Skip to content

Commit

Permalink
Allow spaces between args of \DeclareFieldFormat (#586)
Browse files Browse the repository at this point in the history
Make one more argument of \blx@defformat@i explicit to avoid
spaces hanging around.

In theory this makes things a bit less general, but we can probably live
with that. Currently, the macro is only ever used with one arg, so
this is safe (and I don't expect that this will change).
  • Loading branch information
moewew committed Jul 18, 2020
1 parent 48b6ef2 commit 089ce33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions doc/latex/biblatex/biblatex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7725,12 +7725,12 @@ \subsubsection{Formatting Directives}
\cmditem{DeclareFieldFormat}[entrytype, \dots]{format}{code}
\cmditem*{DeclareFieldFormat}*{format}{code}

Defines the field format \prm{format}. This formatting directive is arbitrary \prm{code} to be executed by \cmd{printfield}. The value of the field will be passed to the \prm{code} as its first and only argument. The name of the field currently being processed is available to the \prm{code} as \cmd{currentfield}. If an \prm{entrytype} is specified, the format is specific to that type. The \prm{entrytype} argument may be a comma"=separated list of values. The starred variant of this command is similar to the regular version, except that all type-specific formats are cleared. \emph{Do not put any whitespace between the arguments to this macro as the definitions are quite complex and you will get unexpected results}.
Defines the field format \prm{format}. This formatting directive is arbitrary \prm{code} to be executed by \cmd{printfield}. The value of the field will be passed to the \prm{code} as its first and only argument. The name of the field currently being processed is available to the \prm{code} as \cmd{currentfield}. If an \prm{entrytype} is specified, the format is specific to that type. The \prm{entrytype} argument may be a comma"=separated list of values. The starred variant of this command is similar to the regular version, except that all type-specific formats are cleared.

\cmditem{DeclareListFormat}[entrytype, \dots]{format}{code}
\cmditem*{DeclareListFormat}*{format}{code}

Defines the literal list format \prm{format}. This formatting directive is arbitrary \prm{code} to be executed for every item in a list processed by \cmd{printlist}. The current item will be passed to the \prm{code} as its first and only argument. The name of the literal list currently being processed is available to the \prm{code} as \cmd{currentlist}. If an \prm{entrytype} is specified, the format is specific to that type. The \prm{entrytype} argument may be a comma"=separated list of values. Note that the formatting directive also handles the punctuation to be inserted between the individual items in the list. You need to check whether you are in the middle of or at the end of the list, \ie whether \cnt{listcount} is smaller than or equal to \cnt{liststop}. The starred variant of this command is similar to the regular version, except that all type-specific formats are cleared. \emph{Do not put any whitespace between the arguments to this macro as the definitions are quite complex and you will get unexpected results}.
Defines the literal list format \prm{format}. This formatting directive is arbitrary \prm{code} to be executed for every item in a list processed by \cmd{printlist}. The current item will be passed to the \prm{code} as its first and only argument. The name of the literal list currently being processed is available to the \prm{code} as \cmd{currentlist}. If an \prm{entrytype} is specified, the format is specific to that type. The \prm{entrytype} argument may be a comma"=separated list of values. Note that the formatting directive also handles the punctuation to be inserted between the individual items in the list. You need to check whether you are in the middle of or at the end of the list, \ie whether \cnt{listcount} is smaller than or equal to \cnt{liststop}. The starred variant of this command is similar to the regular version, except that all type-specific formats are cleared.


\cmditem{DeclareNameFormat}[entrytype, \dots]{format}{code}
Expand Down Expand Up @@ -7758,7 +7758,7 @@ \subsubsection{Formatting Directives}
\namepartgiveni
\end{ltxexample}
%
If a certain part of a name is not available, the corresponding macro will be empty, hence you may use, for example, the \sty{etoolbox} tests like \cmd{ifdefvoid} to check for the individual parts of a name. The name of the name list currently being processed is available to the \prm{code} as \cmd{currentname}. Note that the formatting directive also handles the punctuation to be inserted between separate names and between the individual parts of a name. You need to check whether you are in the middle of or at the end of the list, \ie whether \cnt{listcount} is smaller than or equal to \cnt{liststop}. See also \secref{use:cav:nam}. The starred variant of this command is similar to the regular version, except that all type-specific formats are cleared. \emph{Do not put any whitespace between the arguments to this macro as the definitions are quite complex and you will get unexpected results}.
If a certain part of a name is not available, the corresponding macro will be empty, hence you may use, for example, the \sty{etoolbox} tests like \cmd{ifdefvoid} to check for the individual parts of a name. The name of the name list currently being processed is available to the \prm{code} as \cmd{currentname}. Note that the formatting directive also handles the punctuation to be inserted between separate names and between the individual parts of a name. You need to check whether you are in the middle of or at the end of the list, \ie whether \cnt{listcount} is smaller than or equal to \cnt{liststop}. See also \secref{use:cav:nam}. The starred variant of this command is similar to the regular version, except that all type-specific formats are cleared.

\cmditem{DeclareListWrapperFormat}[entrytype, \dots]{format}{code}
\cmditem*{DeclareListWrapperFormat}*{format}{code}
Expand Down
6 changes: 3 additions & 3 deletions tex/latex/biblatex/biblatex.sty
Original file line number Diff line number Diff line change
Expand Up @@ -4183,16 +4183,16 @@
{\blx@defformat@i{#1}{#2}{#3}}
{\blx@defformat@i{#1}{#2}{#3}[*]}}
% {<macro>}{<class>}{<*>}[<entrytype>]{<name>}
\def\blx@defformat@i#1#2#3[#4]#5{%
% {<macro>}{<class>}{<*>}[<entrytype>]{<name>}{<code>}
\def\blx@defformat@i#1#2#3[#4]#5#6{%
\notblank{#3}
{\blx@resetformat{#2}{#5}}
{}%
\def\blx@defformat@a{#2}%
\def\blx@defformat@b{#4}%
\blx@xsanitizeafter{\def\blx@defformat@c}{#5}%
\afterassignment\blx@defformat@ii
#1}
#1{#6}}
\def\blx@defformat@ii{%
\expandafter\forcsvlist
Expand Down

0 comments on commit 089ce33

Please sign in to comment.