LukasCBossert / biblatex-archaeologie

This ci­ta­tion-style cov­ers the ci­ta­tion and bib­li­og­ra­phy rules of the Ger­man Ar­chae­ol­ogical In­sti­tute. Var­i­ous op­tions are avail­able to change and ad­just the out­come ac­cord­ing to one’s own pref­er­ences.
http://biblatex-archaeologie.texografie.de
10 stars 3 forks source link

Sorting von shorthands - ignoriere [] #114

Open LukasCBossert opened 7 years ago

LukasCBossert commented 7 years ago

Es gibt die Möglichkeit bei antiken Werken an die shorthands einen individuellen und möglichst eindeutigen Zusatz zu setzen. Dieser wird in eckige Klammern geschrieben. Bei der Sortierung in der Bibliographie wird allerdings nach year aufsteigend sortiert. Da ich nicht manuell sortshorthand für jeden Eintrag definieren möchte, kann ich die Sortierung weiterhin über die shorthands laufen lassen? Sodass zuerst der Eintrag ohne Klammer, dann die mit Klammer alphabetisch angeordnet werden, @moewew ?

%---- Ich stelle gerade fest, dass mit dem Einfügen von \sort{\field{shorthand}} zwar oberflächlich gesehen sehr weit komme, aber im Endeffekt dann die Reihenfolge in der Bibliografie die Sortierung bestimmt, was auch nicht sein sollte. MWE unten.

Es handelt sich um diesen Block, der den Wert in der eckigen Klammer bestimmt:

archaeologie.cbx:

\newbibmacro*{uniqueshorthand}{%
  \printtext[brackets]{%
  \ifnameundef{translator}
        {\ifnameundef{intranslator}%
         {\iffieldundef{series}%
            {\printnames[name:family]{editor}}%
            {\usebibmacro{series}}%
           }%
         {\printnames[name:family]{intranslator}}}%
          {\printnames[name:family]{translator}}}}
\documentclass[ngerman]{scrbook}
\usepackage{filecontents,babel}
\begin{filecontents}{\jobname.bib}

@InBook{Prop,
  pages         = {8--279},
  title         = {Properz},
  publisher     = AWi,
  year          = {1996},
  author        = {Aurelius Propertius, Sextus},
  editor        = {Luck, Georg},
  series        = {Sammlung Tusculum},
  booksubtitle  = {Liebeselegien/Carmina},
  booktitle     = {Properz/Tibull},
  intranslator  = {Luck, Georg},
  keywords      = {ancient},
  language      = {german},
  location      = {Zürich and Düsseldorf},
  options       = {ancient},
  origlanguage  = {latin},
  shortauthor   = {Properz},
  shorthand     = {Prop.},
  subtitle      = {Liebeselegien},
}

@Book{Prop-Flach,
  title        = {Elegien},
  publisher    = WBG,
  year         = {2011},
  author       = {Aurelius Propertius, Sextus},
  editor       = {Flach, Dieter},
  keywords     = {ancient},
  location     = {Darmstadt},
  options      = {ancient,uniqueme},
  origlanguage = {latin},
  shortauthor  = {Properz},
  shorthand    = {Prop.},
}

@Book{Prop-Loeb,
  title        = {Propertius},
  publisher    = HUP,
  year         = {1990},
  author       = {Aurelius Propertius, Sextus},
  number       = {18},
  series       = {Loeb},
  keywords     = {ancient},
  language     = {english},
  location     = {Harvard},
  options      = {ancient,uniqueme},
  origlanguage = {latin},
  shortauthor  = {Properz},
  shorthand    = {Prop.},
  subtitle     = {Elegies},
  translator   = {Goold, P. E.},
}

@Book{Prop-Reclam,
  title        = {Sextus Propertius},
  publisher    = {Reclam},
  year         = {1993},
  author       = {Aurelius Propertius, Sextus},
  editor       = {Mojsisch, Burkhard and Schwarz, Hans-Horst and Tautz, Isabel J.},
  number       = {1728},
  series       = {Universal-Bibliothek},
  afterword    = {Mojsisch, Burkhard},
  commentator  = {Mojsisch, Burkhard and Tautz, Isabel J.},
  keywords     = {ancient},
  location     = Stuttgart,
  options      = {ancient,uniqueme},
  origlanguage = {latin},
  shortauthor  = {Properz},
  shorthand    = {Prop.},
  subtitle     = {Sämtliche Gedichte},
  translator   = {Mojsisch, Burkhard and Schwarz, Hans-Horst and Tautz, Isabel J.},
}

@Book{Prop-Richardson,
  title         = {Propertius},
  publisher     = {University of Oklahoma Press},
  year          = {1977},
  author        = {Aurelius Propertius, Sextus},
  editor        = {Richardson, Jr., Lawrence},
  commentator   = {Richardson, Jr., Lawrence},
  introduction  = {Richardson, Jr., Lawrence},
  keywords      = {ancient},
  location      = {Norman},
  options       = {ancient,uniqueme},
  origlanguage  = {latin},
  shortauthor   = {Properz},
  shorthand     = {Prop.},
}

@Book{VitrX,
  author        = {Vitruvius},
  title         = {Zehn Bücher über Architektur},
  publisher     = WBG,
  location      = {Darmstadt},
  year          = {2008},
  edition       = {6},
  origyear      = {1964},
  origtitle     = {De architectura},
  origlanguage  = {latin},
  translator    = {Fensterbusch, Curt},
  shorthand     = {Vitr.},
  shortauthor   = {Vitruv},
  keywords      = {ancient},
  options       = {ancient},
}

@Book{Vitr_loebX,
  author        = {Vitruvius},
  title         = {On Architecture},
  publisher     = HUP,
  location      = {Cambridge and London},
  year          = {1983},
  volume        = {I--II},
  series        = {Loeb Classical Library},
  number        = {251},
  origyear      = {1931},
  origtitle     = {De architectura},
  origlanguage  = {latin},
  translator    = {Granger, Frank},
  shorthand     = {Vitr.},
  shortauthor   = {Vitruv},
  keywords      = {ancient},
  options       = {ancient,uniqueme},
}

@Book{Vitr_PrestelX,
  author        = {Vitruvius},
  title         = {Zehn Bücher über Architektur des Marcus Vitruvius Pollio},
  publisher     = {Heitz \& Mündel},
  location      = {Strassburg},
  year          = {1912},
  series        = {Zur Kunstgeschichte des Auslandes},
  number        = {100},
  origlanguage  = {latin},
  translator    = {Prestel, J.},
  shorthand     = {Vitr.},
  keywords      = {ancient},
  options       = {ancient,uniqueme},
}

@Book{Vitr_RodeX,
  author        = {Vitruvius},
  title         = {Des Marcus Vitruvius Pollio Baukunst},
  publisher     = {bey Georg Joachim Göschen},
  location      = {Leipzig},
  year          = {1796},
  volume        = {I},
  origtitle     = {De architectura},
  origlanguage  = {latin},
  translator    = {August Rode},
  shorthand     = {Vitr.},
  shortauthor   = {Vitruv},
  keywords      = {ancient},
  options       = {ancient,uniqueme},
}
@Inbook{Vitr:Fischer,
  author       = {Vitruvius},
  booktitle    = {Vitruv NEU oder Was ist Architektur?},
  year         = {2010},
  editor       = {Fischer, Günther},
  publisher    = {Birkhäuser},
  pages        = {70--76. 92--95. 132\psq},
  origlanguage = {latin},
  location     = Berlin,
  intranslator = {Fischer, Günther},
  keywords     = {ancient},
  options      = {ancient,uniqueme},
  origtitle    = {De architectura},
  origyear     = {2009},
  shorthand    = {Vitr.},
}

@Book{Vitr_RowlandX,
  author        = {Vitruvius},
  title         = {Vitruvius},
  subtitle      = {Ten Books on Architecture},
  publisher     = CUP,
  location      = {Cambridge},
  year          = {1999},
  origtitle     = {De architectura},
  origlanguage  = {latin},
  translator    = {Rowland, Ingrid D.},
  shorthand     = {Vitr.},
  shortauthor   = {Vitruv},
  keywords      = {ancient},
  options       = {ancient,uniqueme},
}

@Book{Vitr_SaliouX,
  author        = {Vitruvius},
  title         = {De L’Architecture},
  publisher     = {Les belles lettres},
  location      = {Paris},
  volume        = {I--X},
  series        = {Collection des Universités de France},
  origtitle     = {De architectura},
  origlanguage  = {latin},
  translator    = {Saliou, Catherine},
  shorthand     = {Vitr.},
  shortauthor   = {Vitruv},
  keywords      = {ancient},
  options       = {ancient,uniqueme},
  date          = {1986/2009},
}

@Book{Vitr_SmithX,
  author        = {Vitruvius},
  title         = {Vitruvius on Architecture},
  publisher     = {The Monacelli Press},
  location      = {New York},
  year          = {2003},
  origtitle     = {De architectura},
  origlanguage  = {latin},
  translator    = {Smith, Thomas Gordon},
  shorthand     = {Vitr.},
  shortauthor   = {Vitruv},
  keywords      = {ancient},
  options       = {ancient,uniqueme},
}

@Book{Vitr,
  author       = {Vitruvius},
  title        = {Zehn Bücher über Architektur},
  publisher    = WBG,
  location     = {Darmstadt},
  year         = {2008},
  edition      = {6},
  origyear     = {1964},
  origtitle    = {De architectura},
  origlanguage = {latin},
  translator   = {Fensterbusch, Curt},
  shorthand    = {Vitr.},
  shortauthor  = {Vitruv},
  keywords     = {ancient},
  options      = {ancient},
}

@Book{Vitr:Loeb,
  author       = {Vitruvius},
  title        = {On Architecture},
  publisher    = HUP,
  location     = {Cambridge and London},
  year         = {1983},
  series       = {Loeb Classical Library},
  number       = {251},
  origyear     = {1931},
  origtitle    = {De architectura},
  origlanguage = {latin},
  shorthand    = {Vitr.},
  shortauthor  = {Vitruv},
  keywords     = {ancient},
  options      = {ancient,uniqueme},
  shortseries  = {Loeb},
}

@Book{Vitr:Saliou,
  author       = {Vitruvius},
  title        = {De L'Architecture},
  publisher    = {Les belles lettres},
  location     = Paris,
  volume       = {I--X},
  series       = {Collection des Universités de France},
  origtitle    = {De architectura},
  origlanguage = {latin},
  translator   = {Saliou, Catherine},
  shorthand    = {Vitr.},
  shortauthor  = {Vitruv},
  keywords     = {ancient},
  options      = {ancient,uniqueme},
  date         = {1986/2009},
}

@Book{Vitr:Krohn,
  author       = {Vitruvius},
  editor       = {Krohn, Franz},
  publisher    = {Teubner},
  location     = Leipzig,
  origtitle    = {Vitruvii De architectura libri decem},
  origlanguage = {latin},
  shorthand    = {Vitr.},
  shortauthor  = {Vitruv},
  keywords     = {ancient},
  options      = {ancient,uniqueme},
  date         = {1912},
}
\end{filecontents}
\usepackage[           
  backend=biber,
%style=../biblatex-archaeologie/archaeologie,
style=archaeologie,
inreferences,
    lstabbrv,
    lstlocations,
    lstpublishers,
]{biblatex} 
\addbibresource{\jobname.bib}

\DeclareSortingScheme{nyt}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort{
    \field{shorthand}%<---------
    \field{sortname}
    \field{author}
    \field{editor}
    \field{translator}
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{shorthand}%<----------- hilft nicht wirklich
    \field{sortyear}
    \field{year}
  }
  \sort{
    \field{shorthand}%<----------- hilft nicht wirklich
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{shorthand}%<----------- hilft nicht wirklich
  \field{volume}
  \literal{0}
  }
  \sort{
    \field{shorthand}}%<----------- hilft nicht wirklich
}

\begin{document}
\nocite{*}
\printbibliography[%
    keyword=ancient,%
  heading=subbibintoc,%
    title={Antike Quellen}] 

\printbibliography[%
    notkeyword=ancient,%
    notkeyword=corpus,%
    notkeyword=www,%
  notkeyword=fullcite,%
  heading=subbibintoc,
    title={Forschungsliteratur}]
\end{document}
moewew commented 7 years ago
\DeclareSortingScheme{nyt}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort{
    \field{shorthand}%<---------
    \field{sortname}
    \field{author}
    \field{editor}
    \field{translator}
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{sortyear}
    \field{year}
  }
  \sort{
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{volume}
    \literal{0}
  }
}

Tut schon, was es behauptet zu tun. Es ist jetzt aber so, dass für biblatex und Biber der in den eckigen Klammern hinzugefügte Kram nicht Teil des shorthands ist. Zum sortieren wird er also nicht herangezogen.

Die einfachste Lösung, die mir einfällt, ist das shorthand-Feld mit Biber direkt zu manipulieren. Also mit einer sourcemap dafür zu sorgen, dass die Klammern und der Übersetzter dazu kommen. Stattdessen kannst Du natürlich auch shorthand lassen wie es ist und nur sortkey passend setzten.

LukasCBossert commented 7 years ago

Ok, das ist natürlich einleuchtend, dass der Zusatz in den eckigen Klammern nicht Teil der shorthand ist. Meine Versuche mit einer sourcemap scheitern:

\ifbool{cbx:uniqueme}{%
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite, foreach={editor, series,translator}]{
          \step[fieldsource=\regexp{$MAPLOOP},%<--- wie spricht man hier das Makro 'uniqueshorthand' an? `editor` etc haben ja zunächst keine eckige Klammer
            match={[}, 
            replace={}] 
            \step[fieldsource=\regexp{$MAPLOOP},%<--- wie spricht man hier das Makro 'uniqueshorthand' an? 
            match={]}, 
            replace={}] 
            \step[fieldsource=shorthand,%<---- hier müsste ich den Inhalt aus 'shorthand' und dem Makro 'uniqueshorthand' ansprechen          
                  fieldtarget=sortshorthand]
            }
} }
}{}

Die Sourcemap ist nur dann notwendig, wenn ein Eintrag auch die Option uniqueme hat (daher die Abfrage am Anfang, die man ggf. auch in die Sourcemap packen kann?)

moewew commented 7 years ago

Die Vorschrift, mit der Du den Zusatz in Klammern bestimmst ist recht kompliztiert. Ich kann mir vorstellen, dass die Sourcemap recht schnell explodiert. Du kannst immer nur eine pro Dokument haben. Außerdem werden sie nicht pro Eintrag abgearbeitet, sodass Du \ifbool{cbx:uniqueme} außen nicht anwenden kannst. In einer sourcemap kannst Du auf die die Befehle von biblatex aber nicht zugreifen. Schon \iffieldundef muss anders geregelt werden.

Ich sehe auf die Schnelle keine schöne Lösung. Ich fände es aber akzeptabel, wenn der Nutzer das Shorthand vollständig (also inklusive Klammmerzusatz) selbst angeben müsste.

LukasCBossert commented 7 years ago

Ok, dann wäre es einfacher (wenn man nicht händisch eine shorthand oder sortshorthanddefinieren möchte) eine bessere Lösung für das Makro uniqueshorthand zu finden!? Danke dir für die Einschätzung.

moewew commented 7 years ago

Mhhh, das uniqueshorthand ist ja für die automatische Ausgabe in den Zitaten gut. Wenn Du das automatisch halten möchtest, dann musst Du Dir überlegen, ob Du auch mit einer einfacheren Ausgabe leben kannst.

Dein Problem ist, dass Du eigentlich ein Sortierschema benötigst, das die Bibliographie exakt nach der Zitatausgabe sortiert. Wenn Du dann spezielle Dinge in den Zitaten machst, dann muss die Sortierung das Nachbilden können. Im von Biber durchgeführten Sortierprozess ist an viele Dinge, auf die im Dokument (mit biblatex) leicht zuzugreifen ist, nicht oder nur schwierig heranzukommen.

LukasCBossert commented 7 years ago

Dann werde ich lieber die sortshorthands händisch bestücken, denn uniqueshorthand funktioniert soweit ganz gut und ich habe lieber das automatisch.

Ich lasse das issue mal offen, vielleicht ergibt sich irgendwann mal eine Lösung.