diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/biblatex-ext/biblatex-ext.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/biblatex-ext/biblatex-ext.tex | 654 |
1 files changed, 554 insertions, 100 deletions
diff --git a/Master/texmf-dist/doc/latex/biblatex-ext/biblatex-ext.tex b/Master/texmf-dist/doc/latex/biblatex-ext/biblatex-ext.tex index 34d2d4eb4c7..7e635f7b4cf 100644 --- a/Master/texmf-dist/doc/latex/biblatex-ext/biblatex-ext.tex +++ b/Master/texmf-dist/doc/latex/biblatex-ext/biblatex-ext.tex @@ -14,7 +14,7 @@ \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \fi -\usepackage[british]{babel} +\usepackage[french,ngerman,british]{babel} \usepackage{csquotes} \usepackage[useregional]{datetime2} \usepackage{lmodern} @@ -37,14 +37,19 @@ \addbibresource{biblatex-examples.bib} \addbibresource{biblatex-ext-examples.bib} -\DeclareBibliographyCategory{sigfridsson} -\DeclareBibliographyCategory{introcite:opts} -\DeclareBibliographyCategory{introcite:lengths} -\addtocategory{sigfridsson}{sigfridsson} -\addtocategory{introcite:opts}{sigfridsson,knuth:ct:a,knuth:ct:b} -\addtocategory{introcite:lengths}{sigfridsson,coleridge,geer} - \makeatletter +\defbibcheck{examplebib}{% + \xifinlist{\thefield{entrykey}}{\extblxdoc@examplebib@list} + {} + {\skipentry}} + +\newcommand*{\exampleprintbib}[1]{% + \nocite{#1}% + \let\extblxdoc@examplebib@list\empty + \def\do##1{\listeadd\extblxdoc@examplebib@list{\detokenize{##1}}}% + \docsvlist{#1}% + \printbibliography[check=examplebib, heading=none]} + \iffontspec \def\textvisiblespace{% \raisebox{-2.2pt}{% @@ -103,6 +108,19 @@ \lstdefinestyle{extblxstylelatex}{% language = {[LaTeX]TeX}, style = {extblxstylegeneral}, + moretexcs = {setlength,bibhang,addcomma,adddot,addperiod,addcolon,addspace, + addnbspace, + mkbibbold,mkbibemph,mkbibbrackets,mkbibparens, + usebibmacro,newbibmacro,renewbibmacro,setunit,newunit,printfield,printlist, + bibopenparen,bibcloseparen,bibopenbracket,bibclosebracket, + iflistundef,iffieldundef,ifnameundef, + ExecuteBibliographyOptions, + DeclareFieldFormat,DeclareDelimFormat,DeclareDelimcontextAlias, + DeclareInnerCiteDelim,UndeclareInnerCiteDelim,DeclareInnerCiteDelimAlias, + DeclareOuterCiteDelim,UndeclareOuterCiteDelim,DeclareOuterCiteDelimAlias, + introcitepunct,volnumdelim,maintitletitledelim,voltitledelim,sernumdelim, + volnumdatedelim,locdatedelim,locpubdelim,publocdelim,pubdatedelim, + extradateonlycompcitedelim,introcitesep,introcitewidth,introcitesep}, } \lstdefinestyle{extblxstylebibtex}{% @@ -239,25 +257,38 @@ \renewcommand*{\ltxsyntaxlabelfont}{\accentcolour\displayverbfont} \renewcommand*{\changelogfont}{\normalfont} \renewcommand*{\changeloglabelfont}{\accentcolour\sffamily\bfseries} -\newcommand*{\stylelistfont}{\accentcolour\sffamily\small} +\newcommand*{\stylelistlabelfont}{\accentcolour\sffamily\small} +\newcommand*{\bibfieldformatfont}{\sffamily} +\newcommand*{\bibfieldformatlabelfont}{\accentcolour\bibfieldformatfont\small} \newenvironment*{stylelist} {\list{}{% \setlength{\labelwidth}{\marglistwidth}% \setlength{\labelsep}{\marglistsep}% \setlength{\leftmargin}{0pt}% - \renewcommand*{\makelabel}[1]{\hss\stylelistfont##1}}% + \renewcommand*{\makelabel}[1]{\hss\stylelistlabelfont##1}}% \def\styleitem##1{% \item[{##1}]% \ltd@pdfbookmark{##1}{##1}}} {\endlist} +\newenvironment*{bibfieldformatlist} + {\list{}{% + \setlength{\labelwidth}{\marglistwidth}% + \setlength{\labelsep}{\marglistsep}% + \setlength{\leftmargin}{0pt}% + \renewcommand*{\makelabel}[1]{\hss\bibfieldformatlabelfont##1}}% + \def\bibfieldformatitem##1{% + \item[{##1}]% + \ltd@pdfbookmark{##1}{##1}}} + {\endlist} + \newenvironment*{keymarglistbook} {\marglist \setlength{\itemsep}{0pt}% \raggedright \let\@@item\item - \def\item[##1]{% + \def\keyitem[##1]{% \@@item[{##1}]% \ltd@pdfbookmark{##1}{##1}}} {\endmarglist} @@ -290,12 +321,58 @@ \par\endgroup \nobreak\vspace{\itemsep}} +\def\ltd@item@ii#1#2{% + \ltd@itemsave + \ifhmode + \itemsep\z@ + \else + \ltd@itembreak + \fi + \item[#1]% + \ifblank{#2} + {} + {\phantomsection\label{exltd@itm@#2}}% + \ltd@itemrest + \ifblank{#2}{}{\ltd@pdfbookmark{#2}{#1}}} + \blx@inputonce{ext-biblatex-aux.def}{auxiliary code for ext-biblatex}{}{}{}{} \newcommand*{\biblatexversion}{\extblx@requiredbiblatexversion} \newcommand*{\biblatexdate}{\extblx@requiredbiblatexdate} \AtEndPreamble{% \deflength{\marglistwidth}{(\oddsidemargin+2cm)*85/100}} + +\newcommand*{\tikztextmark}[2]{% + \tikz[remember picture,baseline,inner sep=0pt]\node [anchor=base] (#1) {#2};} + +% *{<cmd>}{<x-shift>}{<y-shift>} +% unstarred version for commands defined by biblatex-ext +% starred version for standard biblatex commands +\def\punctarrow{% + \@ifstar\punctarrow@ii\punctarrow@i} + +\def\punctarrow@i{% + \def\punctarrow@cmdfont{\bfseries}% + \def\punctarrow@hyperref##1##2{% + \hyperref[exltd@itm@##1]{##2}% + }% + \punctarrow@iii +} + +\def\punctarrow@ii{ + \def\punctarrow@cmdfont{\itshape}% + \let\punctarrow@hyperref\@secondoftwo + \punctarrow@iii +} + +\def\punctarrow@iii#1#2#3{% + \ifdimcomp{#2}{<}{0pt} + {\def\punctarrow@nodeanchor{east}} + {\def\punctarrow@nodeanchor{west}}% + \draw[spot,thick,latex-,rounded corners] (#1) |- ++ (#2,#3) + node[anchor=\punctarrow@nodeanchor,text = black] + {\punctarrow@hyperref{#1}{\punctarrow@cmdfont\cmd{#1}}};% +} \makeatother % By Stefan Kottwitz, see https://tex.stackexchange.com/a/799/35864 @@ -314,14 +391,20 @@ \newrobustcmd*{\bibmacro}[1]{\sty{#1}} \renewrobustcmd*{\bibtype}[1]{\sty{@#1}} \renewrobustcmd*{\cmd}[1]{\sty{\textbackslash #1}} +\newrobustcmd*{\bibfieldformat}[1]{{\bibfieldformatfont #1}} - +\newcommand*{\ctan}{\mkbibacro{CTAN}} \newcommand*{\gitbaseurl}{https://github.com/moewew/biblatex-ext} -\newcommand*{\extblxversion}{0.2} +\newcommand*{\extblxversion}{0.3} \newcommand*{\biber}{Biber} \newcommand*{\gitissuelink}[1]{% \href{\gitbaseurl/issues/#1}{issue \##1 on github}} +\newrobustcmd*{\CSdelim}{% + \textcolor{spot}{\margnotefont context sensitive}} +\newrobustcmd*{\CSdelimMark}{% + \leavevmode\marginpar{\CSdelim}} + \titlepage{% title = {The \sty{biblatex-ext} Bundle}, subtitle = {Extensions for the \sty{biblatex} standard styles}, @@ -329,7 +412,7 @@ author = {Moritz Wemheuer}, link = {mwemheu@gmail.com},% revision = {\extblxversion}, - date = {\DTMDate{2018-03-28}}, + date = {\DTMDate{2018-06-04}}, } \hypersetup{% @@ -349,6 +432,7 @@ bib-open-bracket bib-close-bracket main-title-after-title + jour-vol-delim } \begin{document} @@ -439,14 +523,14 @@ their implementation, but many \sty{biblatex} standard features only work properly with \biber{}. \subsection{Installation}\label{sec:install} -This style bundle is available on \mkbibacro{CTAN}.% +This style bundle is available on \ctan.% \fnurl{https://ctan.org/pkg/biblatex-ext} The current release is also available in \miktex{} and \texlive{} 2018 or newer. If at all possible you should install this bundle via your \tex{} distribution (using \miktex{} Console\fnurl{https://miktex.org/howto/miktex-console} or \sty{tlmgr} for \texlive\fnurl{https://www.tug.org/texlive/pkginstall.html}). -If you must install this package manually, get the files from \mkbibacro{CTAN} +If you must install this package manually, get the files from \ctan{} and install the \sty{.bbx}, \sty{.cbx} and \sty{.def} files preferably to \path{tex/latex/biblatex-ext} of your local or home \TeX{} tree, the other files (\path{CHANGES.md}, \path{README.md}, \path{biblatex-ext.tex}, @@ -477,13 +561,41 @@ of assistance, you might want to consider posting your question on the The \sty{biblatex-ext} bundle is a collection of \sty{biblatex} style files. You can load the styles exactly as you would load the standard styles: \begin{biblatexcode} -\usepackage[style=(*@$\langle$\normalfont\emph{style}$\rangle$@*)]{biblatex} +\usepackage[style=(*@\prm{style}@*)]{biblatex} \end{biblatexcode} The naming of the styles follows the scheme -\mbox{\texttt{ext-}$\langle$\emph{standard style}$\rangle$}, e.g., +\mbox{\texttt{ext-}\prm{standard style}}, e.g., the style corresponding to \sty{authoryear-icomp} is called \sty{ext-authoryear-icomp}. +This manual assumes familiarity with the concepts of \sty{biblatex} and does +not attempt to explain any of the standard \sty{biblatex} features, so you may +want to have the \sty{biblatex} documentation% +\fnurl{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf} +at hand to fully appreciate what is going on. +If you are new to \sty{biblatex} the three hundred odd pages of the manual +can be hard to stomach at first, so you may want to have a look at a more +gentle introduction. +Of the many introductory texts and tutorials available on the internet% +\fnurl{https://tex.stackexchange.com/q/13509/35864} +the author particularly likes +Knut Hegna and Dag Langmyhr's \emph{Local Guide to \sty{biblatex}}% +\fnurl{http://dag.at.ifi.uio.no/public/doc/biblatex-guide.pdf} +and Paul Stanley's \emph{\sty{biblatex} -- An Easier Read}% +\fnurl{https://github.com/PaulStanley/biblatex-tutorial/releases}. +French speakers may want to consider Maïeul Rouquette's +\foreignlanguage{french}{\emph{(Xe)\LaTeX{} Appliqué aux sciences humaines}}% +available on \ctan\fnurl{https://ctan.org/pkg/latex-sciences-humaines}. +If you read German you may be interested in Dominik Waßenhoven's two-part +series \foreignlanguage{ngerman}{\emph{Bibliographien erstellen mit +\sty{biblatex}}}\fnurl{http://biblatex.dominik-wassenhoven.de/dtk.shtml} +in \foreignlanguage{ngerman}{\emph{Die \TeX nische Komödie}} +2/2008\fnurl{http://www.dante.de/DTK/Ausgaben/2008-2.pdf} (pp.~53--75) +and 4/2008\fnurl{http://www.dante.de/DTK/Ausgaben/2008-4.pdf} (pp.~31--51). +Please keep in mind that some of these texts were written a while ago and +that \sty{biblatex} is actively developed: technical details may have changed +and new features make some things easier. + \section{Styles}\label{sec:styles} This bundle provides an extended version of each standard style as well as a few new styles. @@ -712,36 +824,32 @@ Whether or not to display \enquote{in:} before the journal information in \bibtype{article} entries. All other entry types are not affected by this option. -\begin{bibexample}[title={\kvopt{articlein}{true}}] +\begingroup \makeatletter \togglefalse{bbx:doi} +\DeclareFieldFormat{highlighthere}{% + \iffieldequalstr{entrykey}{sigfridsson} + {\textcolor{highlight1}{#1}} + {\iffieldequalstr{entrykey}{westfahl:space} + {\textcolor{highlight2}{#1}} + {#1}}} \renewbibmacro*{in:}{% \blx@begunit\blx@endunit - \printtext[highlight1]{% - \printtext{% - \bibstring{in}\intitlepunct}}} -\toggletrue{bbx:articlein}\fullcite{sigfridsson} -\renewbibmacro*{in:}{% - \blx@begunit\blx@endunit - \printtext[highlight2]{% + \printtext[highlighthere]{% \printtext{% \bibstring{in}\intitlepunct}}} -\smallskip\par\fullcite{brandt} -\makeatother + +\begin{bibexample}[title={\kvopt{articlein}{true}}] +\toggletrue{bbx:articlein} +\exampleprintbib{sigfridsson,westfahl:space} \end{bibexample} \begin{bibexample}[title={\kvopt{articlein}{false}}] -\togglefalse{bbx:doi} -\togglefalse{bbx:articlein}\fullcite{sigfridsson} -\makeatletter -\renewbibmacro*{in:}{% - \blx@begunit\blx@endunit - \textcolor{highlight2}{% - \printtext{% - \bibstring{in}\intitlepunct}}} -\smallskip\par\fullcite{brandt} -\makeatother +\togglefalse{bbx:articlein} +\exampleprintbib{sigfridsson,westfahl:space} \end{bibexample} +\makeatother +\endgroup \boolitem[false]{citeinxref} This option controls if \bibtype{inbook}, \bibtype{incollection} and @@ -770,7 +878,8 @@ bibliography, this needs to happen either explicitly by citing the parent {\printtext{\bbx@cite@inxref{\thefield{crossref}}}}} {\usebibmacro{#1}}}} \makeatother -\toggletrue{bbx:citeinxref}\fullcite{westfahl:space} +\toggletrue{bbx:citeinxref} +\exampleprintbib{westfahl:space} \end{bibexample} \begin{bibexample}[title={\kvopt{citeinxref}{false}}] @@ -785,7 +894,8 @@ bibliography, this needs to happen either explicitly by citing the parent {\printtext{\bbx@cite@inxref{\thefield{crossref}}}}} {\usebibmacro{#1}}}} \makeatother -\togglefalse{bbx:citeinxref}\fullcite{westfahl:space} +\togglefalse{bbx:citeinxref} +\exampleprintbib{westfahl:space} \end{bibexample} \boolitem[false]{innamebeforetitle} @@ -810,7 +920,8 @@ Whether or not the \bibfield{editor} should be moved before the \clearname{editor}} {}} \makeatother -\toggletrue{bbx:innamebeforetitle}\fullcite{pines} +\toggletrue{bbx:innamebeforetitle} +\exampleprintbib{pines} \end{bibexample} \begin{bibexample}[title={\kvopt{innamebeforetitle}{false}}] @@ -825,7 +936,8 @@ Whether or not the \bibfield{editor} should be moved before the \clearname{editor}}% \usebibmacro{byeditorx}% \usebibmacro{bytranslator+others}} -\togglefalse{bbx:innamebeforetitle}\fullcite{pines} +\togglefalse{bbx:innamebeforetitle} +\exampleprintbib{pines} \end{bibexample} \boolitem[false]{innameidem} @@ -854,7 +966,7 @@ This option only has an effect if \opt{innamebeforetitle} is set to \opt{true}. {}} \makeatother \toggletrue{bbx:innamebeforetitle}\toggletrue{bbx:innameidem} -\fullcite{gaonkar:in} +\exampleprintbib{gaonkar:in} \end{bibexample} \begin{bibexample}[title={\kvopt{innameidem}{false}}] @@ -876,7 +988,7 @@ This option only has an effect if \opt{innamebeforetitle} is set to \opt{true}. {}} \makeatother \toggletrue{bbx:innamebeforetitle}\togglefalse{bbx:innameidem} -\fullcite{gaonkar:in} +\exampleprintbib{gaonkar:in} \end{bibexample} @@ -932,13 +1044,13 @@ printed with the \bibfield{volumeof} format. \begin{bibexample}[title={\kvopt{maintitleaftertitle}{true}}] \togglefalse{bbx:isbn} \toggletrue{bbx:maintitleaftertitle} -\fullcite{knuth:ct:a} +\exampleprintbib{knuth:ct:a} \end{bibexample} \begin{bibexample}[title={\kvopt{maintitleaftertitle}{false}}] \togglefalse{bbx:isbn} \togglefalse{bbx:maintitleaftertitle} -\fullcite{knuth:ct:a} +\exampleprintbib{knuth:ct:a} \end{bibexample} \endgroup \end{optionlist} @@ -947,8 +1059,8 @@ printed with the \bibfield{volumeof} format. The \opt{dashed} option of the \sty{authoryear}- and \sty{authortitle}-like bibliography styles allows for finer control over the dashes now. \begin{optionlist} -\optitem[false]{dashed}{\opt{true}, \opt{false}, \opt{fullhash}, - \opt{bibnamehash}} +\optitem[true]{dashed}{\opt{true}, \opt{false}, \opt{fullhash}, + \opt{bibnamehash}} This option controls whether or not recurring lists of authors/editors in the bibliography are replaced with a dash. @@ -980,14 +1092,14 @@ Assuming \kvopt{maxnames}{1} and no name list disambiguation {biblatex-ext-examples.bib} give \renewcommand*{\bibnamedash}{\textbf{\textemdash\addspace}} -\DeclareFieldFormat{dasheshighlight}{% +\DeclareFieldFormat{highlighthere}{% \iffieldequalstr{entrykey}{elk:einio} {\highlight[1]{#1}} {\iffieldequalstr{entrykey}{appleby:abl} {\highlight[2]{#1}} {#1}}} \renewbibmacro*{author}{% - \printtext[dasheshighlight]{% + \printtext[highlighthere]{% \ifboolexpr{ test \ifuseauthor and @@ -1060,19 +1172,19 @@ labels in a \sty{numeric} bibliography. \begin{bibexample}[title={\kvopt{introcite}{false}}] \csuse{extblx@opt@dashed@false} \csletcs{extblx@introcite}{extblx@opt@introcite@false} -\printbibliography[heading=none, category=introcite:opts] +\exampleprintbib{sigfridsson,knuth:ct:a,knuth:ct:b} \end{bibexample} \begin{bibexample}[title={\kvopt{introcite}{plain}}] \csuse{extblx@opt@dashed@false} \csletcs{extblx@introcite}{extblx@opt@introcite@plain} -\printbibliography[heading=none, category=introcite:opts] +\exampleprintbib{sigfridsson,knuth:ct:a,knuth:ct:b} \end{bibexample} \begin{bibexample}[title={\kvopt{introcite}{label}}] \csuse{extblx@opt@dashed@false} \csletcs{extblx@introcite}{extblx@opt@introcite@label} -\printbibliography[heading=none, category=introcite:opts] +\exampleprintbib{sigfridsson,knuth:ct:a,knuth:ct:b} \end{bibexample} \makeatother \endgroup @@ -1087,9 +1199,33 @@ The label produced by the \opt{plain} option can be customised as follows. \renewcommand*{\introcitepunct}{\highlight{\textbf{\addcolon}\textvisiblespace}} \csuse{extblx@opt@dashed@false} \csletcs{extblx@introcite}{extblx@opt@introcite@plain} -\printbibliography[heading=none, category=sigfridsson] +\exampleprintbib{sigfridsson} \end{bibexample} \end{ltxsyntax} +\begin{keymarglistbook} + \keyitem[bbx:introcite:plain:keeprelated] This toggle controls whether or + not the citation label is also repeated for default related entries. + The default value \opt{false} suppresses the label for related entries. +\begin{bibexample}[title={\texttt{\string\togglefalse\{% + bbx:introcite:plain:keeprelated\}} (default)}] +\togglefalse{bbx:doi} +\csletcs{extblx@introcite}{extblx@opt@introcite@plain} +\exampleprintbib{vizedom:related} +\end{bibexample} +\begin{bibexample}[title={\texttt{\string\toggletrue\{% + bbx:introcite:plain:keeprelated\}}}] +\toggletrue{bbx:introcite:plain:keeprelated} +\renewbibmacro*{related:init}{% + \csundef{bbx:relatedloop}% + \iftoggle{bbx:introcite:plain:keeprelated}{% + \DeclareFieldFormat{bbx:introcite}{\highlight{##1}}% + \renewcommand*{\introcitepunct}{\highlight{\addcolon}\space}% + }{\renewbibmacro{introcite:plain}{}}} +\csuse{extblx@opt@dashed@false} +\csletcs{extblx@introcite}{extblx@opt@introcite@plain} +\exampleprintbib{vizedom:related} +\end{bibexample} +\end{keymarglistbook} The \opt{label} option can be configured to not allow the label to run into the remaining bibliography entry thus creating the appearance of a tabular-like @@ -1127,7 +1263,7 @@ overlay={% ] \csuse{extblx@opt@dashed@false} \csletcs{extblx@introcite}{extblx@opt@introcite@label} -\printbibliography[heading=none, category=introcite:lengths] +\exampleprintbib{sigfridsson,coleridge,geer} \end{bibexample} \endgroup @@ -1137,16 +1273,17 @@ overlay={% \setlength{\introcitewidth}{1.8cm} \csuse{extblx@opt@dashed@false} \csletcs{extblx@introcite}{extblx@opt@introcite@label} -\printbibliography[heading=none, category=introcite:lengths, nottype=article] +\exampleprintbib{coleridge,geer} \end{bibexample} \begin{bibexample}[enhanced, title={\kvopt{introcite}{label} with - $\len{introcitewidth}=0$ and $\len{introcitesep}=\len{bibhang}$}] + \len{introcitewidth} set to zero and \len{introcitesep} equal to + \len{bibhang}}] \setlength{\introcitewidth}{0pt} \setlength{\introcitesep}{\bibhang} \csuse{extblx@opt@dashed@false} \csletcs{extblx@introcite}{extblx@opt@introcite@label} -\printbibliography[heading=none, category=introcite:lengths, nottype=book] +\exampleprintbib{sigfridsson,geer} \end{bibexample} \makeatother @@ -1156,55 +1293,230 @@ The delimiter context is \sty{bbx:introcite}, the inner citation delimiters can be accessed as \sty{bbx:introcite} as well. The label does not have outer citation delimiters, you can use the wrapper field format \sty{bbx:introcite} instead. In fact this approach is more -versatile than the outer citation delimiter feature (see the dicsussion in +versatile than the outer citation delimiter feature (see the discussion in \cref{sec:opt:citedelims}). + +\begin{bibexample}[title={Example customisations for \kvopt{introcite}{plain}}] +\begin{lstlisting}[style=extblxstylelatex] +\DeclareFieldFormat{bbx:introcite}{\mkbibbrackets{#1}} +\DeclareDelimFormat[bbx:introcite]{nameyeardelim}{\addcomma\space} +\UndeclareInnerCiteDelim{bbx:introcite} +\renewcommand*{\introcitepunct}{\quad} +\end{lstlisting} +\tcblower +\DeclareFieldFormat{bbx:introcite}{\mkbibbrackets{#1}} +\DeclareDelimFormat[bbx:introcite]{nameyeardelim}{\addcomma\space} +\UndeclareInnerCiteDelim{bbx:introcite} +\renewcommand*{\introcitepunct}{\quad} +\csuse{extblx@opt@dashed@false} +\csletcs{extblx@introcite}{extblx@opt@introcite@plain} +\exampleprintbib{sigfridsson} +\end{bibexample} + +\begin{bibexample}[title={Example customisations for \kvopt{introcite}{label}}] +\begin{lstlisting}[style=extblxstylelatex] +\DeclareFieldFormat{bbx:introcite}{\mkbibbold{#1}} +\DeclareDelimcontextAlias{bbx:introcite}{textcite} +\DeclareInnerCiteDelim{bbx:introcite}{\bibopenparen}{\bibcloseparen} +\setlength{\introcitewidth}{0pt} +\setlength{\introcitesep}{\bibhang} +\end{lstlisting} +\tcblower +\DeclareFieldFormat{bbx:introcite}{\mkbibbold{#1}} +\DeclareDelimcontextAlias{bbx:introcite}{textcite} +\DeclareInnerCiteDelim{bbx:introcite}{\bibopenparen}{\bibcloseparen} +\setlength{\introcitewidth}{0pt} +\setlength{\introcitesep}{\bibhang} +\csuse{extblx@opt@dashed@false} +\csletcs{extblx@introcite}{extblx@opt@introcite@label} +\exampleprintbib{coleridge,geer} +\end{bibexample} +\csgundef{blx@delimcontextalias@bbx:introcite} +% because \DeclareDelimcontextAlias is global ... at the moment, this can go +% with biblatex >= 3.12 + +If you are using an author-year citation style together with +\kvopt{introcite}{label} or \kvopt{introcite}{label}, you may be interested in +combining this with \kvopt{bibstyle}{ext-authortitle} instead to move the year +back to the end of the entry. +\makeatletter +\begin{bibexample}[enhanced, title={\kvopt{introcite}{label} with + \kvopt{style}{ext-authoryear} and \kvopt{bibstyle}{ext-authortitle}}] +\setlength{\introcitewidth}{0pt} +\setlength{\introcitesep}{\bibhang} +\bbx@opt@mergedate@false +\renewbibmacro*{author}{% + \ifboolexpr{ + test \ifuseauthor + and + not test {\ifnameundef{author}} + } + {\usebibmacro{bbx:dashcheck} + {\bibnamedash} + {\printnames{author}% + \setunit{\printdelim{authortypedelim}}% + \usebibmacro{bbx:savehash}}% + \usebibmacro{authorstrg}} + {\global\undef\bbx@lasthash}} +\csuse{extblx@opt@dashed@false} +\csletcs{extblx@introcite}{extblx@opt@introcite@label} +\exampleprintbib{sigfridsson,geer} +\end{bibexample} +\makeatother \end{optionlist} \section{Further Customisations}\label{sec:opt:cust} +Aside from the new options mentioned in the last section the styles of this +bundle also offer additional field formats, punctuation and delimiter commands, +a new citation delimiter interface and a few new bibliography macros. + +The citation delimiter interface is a novel feature of \sty{biblatex-ext}, +but for the other subsections familiarity with the underlying \sty{biblatex} +concepts is assumed. +Some of this is easier understood by looking at the source code directly, +so it might not be a bad idea to have \sty{ext-standard.bbx} open when perusing +this section of the manual. + \subsection{Field formats}\label{sec:opt:field} In a few places where the standard styles employ hard-coded formatting directives the styles of this bundle offer customisable formats instead. Field formats can be modified with \cmd{DeclareFieldFormat}. -\begin{keymarglistbook} -\item[bib(list)labeldate] The format for the labeldate in the bibliography or - a bibliography list for \sty{authoryear}-like styles. The default is to wrap +\begin{bibfieldformatlist} +\bibfieldformatitem{biblabeldate} The format for the labeldate in the + bibliography for \sty{authoryear}-like styles. The default is to wrap the date in round brackets. \begin{bibexample} \togglefalse{bbx:doi} \DeclareFieldFormat{biblabeldate}{\highlight{\bibopenparen}\highlight[2]{#1}% \highlight{\bibcloseparen}} - \fullcite{sigfridsson} + \exampleprintbib{sigfridsson} \end{bibexample} -\item[issuedate] The format of the \bibfield{issue} and \bibfield{date} - information for \bibtype{article}s. By default this block is wrapped in - round brackets. +\bibfieldformatitem{biblistlabeldate} Like \bibfieldformat{biblabeldate}, + but for bibliography lists created by \cmd{printbiblist}. + The default is to use the same format as \bibfieldformat{biblabeldate}. + +\bibfieldformatitem{issuedate} The format of the \bibfield{issue} and + \bibfield{date} information for \bibtype{article}s. By default this block is + wrapped in round brackets. \begin{bibexample} \makeatletter\bbx@opt@mergedate@false\makeatother \togglefalse{bbx:doi} \DeclareFieldFormat{issuedate}{\highlight{\bibopenparen}\highlight[2]{#1}% \highlight{\bibcloseparen}} - \fullcite{sigfridsson} + \exampleprintbib{sigfridsson} \end{bibexample} -\item[volumeof] The format for the \bibfield{volume} of a \bibfield{maintitle} - used when \kvopt{maintitleaftertitle}{true}. +\bibfieldformatitem{volumeof} The format for the \bibfield{volume} of a + \bibfield{maintitle} used when \kvopt{maintitleaftertitle}{true}. \begin{bibexample} \togglefalse{bbx:isbn}\toggletrue{bbx:maintitleaftertitle} \DeclareFieldFormat{volumeof}{\highlight{\bibstring{volume}}~% \highlight[2]{#1}} - \fullcite{knuth:ct:a} + \exampleprintbib{knuth:ct:a} \end{bibexample} -\end{keymarglistbook} -\DeclareFieldFormat{issuedate}{\mkbibparens{#1}} +\bibfieldformatitem{titlecase:title} The standard styles follow an + all-or-nothing approach when it comes to title casing. The field format + \bibfieldformat{titlecase} intended to enable sentence case with + \cmd{MakeSentenceCase*} is applied to all title-like fields alike. Finer + control over the title casing of each field could require involved code.% + \fnurl{https://tex.stackexchange.com/a/22981/} + The field format \bibfieldformat{titlecase:title} is applied to the fields + \bibfield{title} and \bibfield{subtitle}. + By default this field format is an alias for \bibfieldformat{titlecase}. + +\bibfieldformatitem{titlecase:booktitle} Like \bibfieldformat{titlecase:title}, + but controls the title casing of the \bibfield{booktitle} and + \bibfield{booksubtitle} fields. + +\bibfieldformatitem{titlecase:maintitle} Like \bibfieldformat{titlecase:title}, + but controls the title casing of the \bibfield{maintitle} and + \bibfield{mainsubtitle} fields. + +\bibfieldformatitem{titlecase:journaltitle} Like + \bibfieldformat{titlecase:title}, but controls the title casing of the + \bibfield{journaltitle} and \bibfield{journalsubtitle} fields. + +\bibfieldformatitem{titlecase:issuetitle} Like \bibfieldformat{titlecase:title}, + but controls the title casing of the \bibfield{issuetitle} and + \bibfield{issuesubtitle} fields. + +The \bibfieldformat{citetitle} field format can be used to change the title +case in author-title citations, so there is no +\bibfieldformat{citetitle:labeltitle}. + +\begin{bibexample}[title={Default output for \bibfieldformat{titlecase} + field formats}]% +\DeclareFieldFormat{titlecase:title}{\highlight[1]{#1}} +\DeclareFieldFormat{titlecase:journaltitle}{\highlight[2]{#1}} +\togglefalse{bbx:doi} +\exampleprintbib{shore} +\end{bibexample} + +\begin{bibexample}[title={Example changes to \bibfieldformat{titlecase} field + formats}]% +\begin{lstlisting}[style=extblxstylelatex] +\DeclareFieldFormat{titlecase:title}{|1\MakeSentenceCase*{#1}1|} +\DeclareFieldFormat{titlecase:journaltitle}{|2#12|} +\end{lstlisting} +\tcblower +\DeclareFieldFormat{titlecase:title}{\highlight[1]{\MakeSentenceCase*{#1}}} +\DeclareFieldFormat{titlecase:journaltitle}{\highlight[2]{#1}} +\togglefalse{bbx:doi} +\exampleprintbib{shore} +\end{bibexample} +\end{bibfieldformatlist} \subsection{Punctuation}\label{sec:opt:punct} The package provides the following commands to modify the delimiters and punctuation between fields. -The punctuation commands should be redefined with \cmd{renewcommand}. +Normal punctuation commands should be redefined with \cmd{renewcommand}, +while context-sensitive commands marked with \CSdelim{} should be redefined +with \cmd{DeclareDelimFormat}. +A short overview over common punctuation commands defined by \sty{biblatex-ext} +as well as standard \sty{biblatex} in an example bibliography +can be found in \cref{sec:punctinuse}. \begin{ltxsyntax} +\csitem{innametitledelim}\CSdelimMark +Similar to \cmd{nametitledelim}, but for names after the \enquote{in:} if +\opt{innamebeforetitle} is \opt{true}. +The default value is that of \cmd{nametitledelim} for all contexts. +Since the definition of \cmd{nametitledelim} is different for the delimiter +contexts \opt{bib} and \opt{biblist}, you may have to use the optional argument +to redefine the delimiter.\footnote{The author admits that it is somewhat +pointless to make \cmd{innametitledelim} context sensitive. +But the obvious parallels with \cmd{nametitledelim} were too tempting. +It is probably too late now.} +\begin{bibexample} +\toggletrue{bbx:innamebeforetitle} +\togglefalse{bbx:isbn} +\DeclareDelimFormat[bib,biblist]{innametitledelim}{\highlight{\textbf{% + \addperiod}\textvisiblespace}\bibsentence}% <- hacky & hard-coded! +\exampleprintbib{pines} +\end{bibexample} +Since \cmd{nametitledelim} and \cmd{innametitledelim} are independent, +the following output is easily achieved. +Note that the optional argument to \cmd{DeclareDelimFormat} is used +to make sure the definitions apply to the bibliography and bibliography lists +contexts, this is necessary because these contexts have special pre-defined +values that would otherwise not be redefined. +\begin{bibexample}[title={Example customisations for \cs{innametitledelim}}] +\begin{lstlisting}[style=extblxstylelatex] +\ExecuteBibliographyOptions{innamebeforetitle=true} +\DeclareDelimFormat[bib,biblist]{nametitledelim}{|1\addcolon\space1|} +\DeclareDelimFormat[bib,biblist]{innametitledelim}{|2\addcomma\space2|} +\end{lstlisting} +\tcblower +\toggletrue{bbx:innamebeforetitle} +\DeclareDelimFormat[bib,biblist]{nametitledelim}{\highlightbf[1]{\addcolon}% + \space} +\DeclareDelimFormat[bib,biblist]{innametitledelim}{\highlightbf[2]{\addcomma}% + \space} +\exampleprintbib{gaonkar,gaonkar:in} +\end{bibexample} + \csitem{maintitletitledelim} The punctuation between the \bibfield{maintitle} and \bibfield{title} or \bibfield{booktitle} of a work if \opt{maintitleaftertitle} is \opt{false}. @@ -1212,8 +1524,8 @@ The default is \cs{newunitpunct}. \begin{bibexample} \togglefalse{bbx:isbn} \renewcommand*{\maintitletitledelim}{\highlight{\textbf{\addperiod}% - \textvisiblespace}\bibsentence} -\fullcite{knuth:ct:a} + \textvisiblespace}\bibsentence}% <- hacky & hard-coded! +\exampleprintbib{knuth:ct:a} \end{bibexample} \csitem{voltitledelim} @@ -1224,7 +1536,7 @@ The default is a colon followed by a space. \togglefalse{bbx:isbn} \renewcommand*{\voltitledelim}{\highlight{\textbf{\addcolon}% \textvisiblespace}\bibsentence} -\fullcite{knuth:ct:a} +\exampleprintbib{knuth:ct:a} \end{bibexample} \csitem{titlemaintitledelim} @@ -1235,8 +1547,43 @@ The default is \cmd{newunitpunct}. \togglefalse{bbx:isbn} \toggletrue{bbx:maintitleaftertitle} \renewcommand*{\titlemaintitledelim}{\highlight{\textbf{\addperiod}% - \textvisiblespace}\bibsentence} -\fullcite{knuth:ct:a} + \textvisiblespace}\bibsentence}%<- hacky & hard-coded! +\exampleprintbib{knuth:ct:a} +\end{bibexample} + +\csitem{jourvoldelim} +The delimiter between the \bibfield{journaltitle} and \bibfield{volume} fields +for \bibtype{article} if no \bibfield{series} is present. +The default is a space. +\begin{bibexample} +\togglefalse{bbx:doi} +\renewcommand*{\jourvoldelim}{\highlight{\textvisiblespace}} +\makeatletter\bbx@opt@mergedate@false\makeatother +\exampleprintbib{sigfridsson} +\end{bibexample} + +\csitem{jourserdelim} +The delimiter between the \bibfield{journaltitle} and \bibfield{series} fields +for \bibtype{article}. +The default is \cmd{newunitpunct}. +\begin{bibexample} +\togglefalse{bbx:doi} +\renewcommand*{\jourserdelim}{\highlight{\textbf{\addperiod}\textvisiblespace}% + \bibsentence% <- hacky ... + }% <- hard-coded! +\makeatletter\bbx@opt@mergedate@false\makeatother +\exampleprintbib{reese,shore} +\end{bibexample} + +\csitem{servoldelim} +The delimiter between the \bibfield{series} and \bibfield{volume} fields +for \bibtype{article}. +The default is \cmd{jourvoldelim}. +\begin{bibexample} +\togglefalse{bbx:doi} +\renewcommand*{\servoldelim}{\highlight{\textvisiblespace}}% <- hard-coded! +\makeatletter\bbx@opt@mergedate@false\makeatother +\exampleprintbib{reese,shore} \end{bibexample} \csitem{volnumdatedelim} @@ -1247,7 +1594,7 @@ The default is a space. \togglefalse{bbx:doi} \renewcommand*{\volnumdatedelim}{\highlight{\textvisiblespace}} \makeatletter\bbx@opt@mergedate@false\makeatother -\fullcite{sigfridsson} +\exampleprintbib{sigfridsson} \end{bibexample} @@ -1258,15 +1605,16 @@ The default is a dot. \begin{bibexample} \togglefalse{bbx:doi} \renewcommand*{\volnumdelim}{\highlightbf{\adddot}} -\fullcite{sigfridsson} +\exampleprintbib{sigfridsson} \end{bibexample} \csitem{sernumdelim} -The delimiter between \bibfield{series} and \bibfield{number}. +The delimiter between \bibfield{series} and \bibfield{number} for +\bibtype{book}- and \bibtype{inbook}-like entries. The default is a space. \begin{bibexample} \renewcommand*{\sernumdelim}{\highlight{\textvisiblespace}} -\fullcite{coleridge} +\exampleprintbib{coleridge} \end{bibexample} \csitem{locdatedelim} @@ -1275,7 +1623,7 @@ The default is a comma followed by a space. \begin{bibexample} \renewcommand*{\locdatedelim}{\highlight{\textbf{\addcomma}\textvisiblespace}} \makeatletter\bbx@opt@mergedate@false\makeatother -\fullcite{jaffe} +\exampleprintbib{jaffe} \end{bibexample} \csitem{locpubdelim} @@ -1285,7 +1633,7 @@ The default is a colon followed by a space. \begin{bibexample} \makeatletter\bbx@opt@mergedate@false\makeatother \renewcommand*{\locpubdelim}{\highlight{\textbf{\addcolon}\textvisiblespace}} -\fullcite{knuth:ct:a} +\exampleprintbib{knuth:ct:a} \end{bibexample} @@ -1320,7 +1668,7 @@ You could use \cs{publocdelim} if you changed the order of these fields to \usebibmacro{date}% \newunit} \makeatletter\bbx@opt@mergedate@false\makeatother -\fullcite{knuth:ct:a} +\exampleprintbib{knuth:ct:a} \end{bibexample} @@ -1331,20 +1679,19 @@ The default is a comma followed by a space. \begin{bibexample} \renewcommand*{\pubdatedelim}{\highlight{\textbf{\addcomma}\textvisiblespace}} \makeatletter\bbx@opt@mergedate@false\makeatother -\fullcite{knuth:ct:a} +\exampleprintbib{knuth:ct:a} \end{bibexample} -\csitem{extradateonlycompcitedelim} +\csitem{extradateonlycompcitedelim}\CSdelimMark Similar to \cmd{compcitedelim}, but indended for use between compressed citations where the second is an \bibfield{extradate} only. The default is a comma (\emph{not} followed by a space). \end{ltxsyntax} \begin{bibexample} -\renewcommand*{\extradateonlycompcitedelim}{\highlightbf{\addcomma}} +\DeclareDelimFormat{extradateonlycompcitedelim}{\highlightbf{\addcomma}} \cite{knuth:ct:b,knuth:ct:c} \end{bibexample} - \subsection{Delimiters for citation commands}\label{sec:opt:citedelims} The delimiters for citation commands provided by the styles of this bundle offer a simple way to customise the bracketing of citation commands. @@ -1514,7 +1861,7 @@ Many of these macros are replacements for bare \cmd{printfield} or sequence of commands into one central place. \begin{keymarglistbook} -\item[barevolume+volumes] +\keyitem[barevolume+volumes] A bibliography macro to print the \bibfield{volume}, \bibfield{part} and \bibfield{volumes} fields for \bibtype{mvbook}-, \bibtype{book}- and \bibtype{inbook}-like entry types. @@ -1531,30 +1878,28 @@ fields will be printed by \bibmacro{maintitle+title} or {}% \newunit \printfield{volumes}}} -\fullcite{knuth:ct} -\smallskip\par -\fullcite{matuz:doody} +\exampleprintbib{knuth:ct,matuz:doody} \end{bibexample} -\item[edition] +\keyitem[edition] A bibliography macro to print the \bibfield{edition} field, this avoids a direct \lstinline|\printfield{edition}| in the bibliography drivers. -\item[in:editor(+others)] +\keyitem[in:editor(+others)] The bibliography macro to print the \bibfield{editor} before the \bibfield{booktitle} for \bibtype{inbook}, \bibtype{incollection} and \bibtype{inproceedings} when \opt{innamebeforetitle} is set to \opt{true}. The \cmd{printname} uses the name format \bibfield{ineditor}. -\item[language] +\keyitem[language] A bibliography macro to print the \bibfield{language} field, this avoids a direct \lstinline|\printlist{language}| in the bibliography drivers. -\item[note] +\keyitem[note] A bibliography macro to print the \bibfield{note} field, this avoids a direct \lstinline|\printfield{note}| in the bibliography drivers. -\item[pubinstorg+location+date] +\keyitem[pubinstorg+location+date] A general-purpose bibliography macro to catch \bibmacro{publisher+location+date}, \bibmacro{institution+location+date} and \bibmacro{organization+location+date}. @@ -1583,7 +1928,7 @@ sensible values are \bibfield{publisher}, \bibfield{institution} and \usebibmacro{pubinstorg+location+date}{|organization|}} \end{biblatexcode} -\item[type+number] +\keyitem[type+number] A bibliography macro to print the \bibfield{type} and \bibfield{number} fields. \end{keymarglistbook} @@ -1592,6 +1937,15 @@ The GitHub repository of this project uses release tags, so you can compare the changes in source code there.\footnote{\url{\gitbaseurl/compare/}} See also \sty{CHANGES.md}. \begin{changelog} +\begin{release}{0.3}{2018-06-04} +\item Added \bibfieldformat{titlecase:\dots title} field formats% + \see{sec:opt:field} +\item Added \sty{bbx:introcite:plain:keeprelated} toggle% + \see{sec:opt:style} +\item Added \cs{jourvoldelim}, \cs{jourserdelim} and \cs{servoldelim}% + \see{sec:opt:punct} +\item Improve documentation +\end{release} \begin{release}{0.2}{2018-03-28} \item Rework lengths for \kvopt{introcite}{label}\see{sec:opt:style} \item Fixed meaning of \cs{maintitletitledelim}\see{sec:opt:punct} @@ -1608,7 +1962,107 @@ See also \sty{CHANGES.md}. \end{changelog} \begin{bibexample}[breakable] -\printbibliography +\printbibliography[title={Example References}] +\end{bibexample} + +\clearpage +\appendix +\section{Punctuation Commands in Use}\label{sec:punctinuse} +The following example bibliography shows some common punctuation commands +in use. +Commands provided by standard \sty{biblatex} are marked in +\textit{\cmd{italics}}, new commands defined by \sty{biblatex-ext} are in +\textbf{\cmd{bold}}. +\begin{bibexample}[title={Punctuation and delimiters + (defined by \textit{standard \sty{biblatex}} and + \textbf{\sty{biblatex-ext}})}, + top=6mm,bottom=4mm,remember, + overlay={ + % geer + \punctarrow*{nameyeardelim}{-.8mm}{6mm} + \punctarrow*{nametitledelim}{2.5mm}{6mm} + % companion + \punctarrow*{multinamedelim}{-2.5mm}{6mm} + \punctarrow*{finalnamdelim}{2.5mm}{4mm} + \punctarrow{locpubdelim}{-2.5mm}{-5mm} + \punctarrow{pubdatedelim}{2.5mm}{-4mm} + % knuth:ct:a + \punctarrow{maintitletitledelim}{-2.5mm}{-.8cm} + \punctarrow{voltitledelim}{2.5mm}{-4mm} + % moore + \punctarrow*{intitlepunct}{-4mm}{-4mm} + \punctarrow*{bibpagespunct}{-2.5mm}{-4mm} + \punctarrow*{bibrangedash}{.2cm}{-4mm} + % sigfridsson + \punctarrow{jourvoldelim}{-.2cm}{-4mm} + \punctarrow{volnumdelim}{.2cm}{-4mm} + % vizedom:related + \punctarrow*{translatortypedelim}{2.5mm}{6mm} + \punctarrow*{begrelateddelim}{.8cm}{-4mm} + % westfahl:frontier + \punctarrow*{editortypedelim}{2.5mm}{6mm} + \punctarrow*{newunitpunct}{-.2cm}{-4mm} + % westfahl:space + \punctarrow*{bibnamedash}{2.5mm}{5mm} + \punctarrow*{subtitlepunct}{2.5mm}{5mm} + } +] +\frenchspacing +\list{} + {\setlength{\leftmargin}{\bibhang}% + \setlength{\itemindent}{-\leftmargin}% + \setlength{\itemsep}{8mm}% + \setlength{\parsep}{\bibparsep}} +\item\nocite{geer} + Geer, Ingrid de\tikztextmark{nameyeardelim}{\textvisiblespace}(1985)% + \tikztextmark{nametitledelim}{.} \enquote{Earl, Saint, Bishop, Skald -- + and Music. The Orkney Earldom of the Twelfth Century. A Musicological Study}. + PhD thesis. Uppsala: Uppsala Universitet. + +\item\nocite{companion} + Goossens, Michel\tikztextmark{multinamedelim}{,} Frank Mittelbach + \tikztextmark{finalnamdelim}{and} Alexander Samarin (1994). + \emph{The LaTeX Companion}. 1st ed. Reading, Mass.% + \tikztextmark{locpubdelim}{:} Addison-Wesley\tikztextmark{pubdatedelim}{,} + 1994. 528 pp. + +\item\nocite{knuth:ct:a} + Knuth, Donald E. (1984). \emph{Computers \& Typesetting}% + \tikztextmark{maintitletitledelim}{.} Vol. A\tikztextmark{voltitledelim}{:} + \emph{The \TeX{} book}. Reading, Mass.: Addison-Wesley, 1984. + +\item\nocite{moore} + Moore, Gordon E. (1965). \enquote{Cramming more components onto integrated + circuits}. In\tikztextmark{intitlepunct}{:} \emph{Electronics} 38.8% + \tikztextmark{bibpagespunct}{,} pp. 114\tikztextmark{bibrangedash}{--}117. + +\item\nocite{sigfridsson} + Sigfridsson, Emma and Ulf Ryde (1998). \enquote{Comparison of methods for + deriving atomic charges from the electrostatic potential and moments}. + In: \emph{Journal of Computational + Chemistry}\tikztextmark{jourvoldelim}{\textvisiblespace}19% + \tikztextmark{volnumdelim}{.}4 (1998), pp. 377--395. + +\item\nocite{vizedom:related} + Vizedom, Monika B. and Gabrielle L. Cafee% + \tikztextmark{translatortypedelim}{,} trans. (1960). + \emph{The Rites of Passage.} University of Chicago Press% + \tikztextmark{begrelateddelim}{.} Trans. of Arnold van Gennep. + \emph{Les rites de passage.} + Paris: Nourry, 1909. + +\item\nocite{westfahl:frontier} + Westfahl, Gary\tikztextmark{editortypedelim}{,} ed. (2000a). + \emph{Space and Beyond. The Frontier Theme in Science Fiction}% + \tikztextmark{newunitpunct}{.} Westport, Conn. and London: Greenwood, 2000. + +\item\nocite{westfahl:space} + \tikztextmark{bibnamedash}{--} (2000b). \enquote{The True Frontier% + \tikztextmark{subtitlepunct}{.} Confronting and Avoiding the Realities of + Space in American Science Fiction Films}. In: \emph{Space and Beyond. + The Frontier Theme in Science Fiction}. Ed. by Gary Westfahl. Westport, Conn. + and London: Greenwood, 2000, pp. 55--65. +\endlist \end{bibexample} \end{document} |