semprag / biblatex-sp-unified

An opinionated biblatex implementation of the Unified Stylesheet for Linguistics Journals
LaTeX Project Public License v1.3c
39 stars 12 forks source link

A solution for undefined control sequence \abx@macro@name:family-given #52

Open seoyeonjang opened 2 years ago

seoyeonjang commented 2 years ago

Hello,

First of all, thanks for the package! I just wanted to share that I encountered an error log while running the unified-test.tex and somehow I managed to solve it.

Here's the error message:

! Undefined control sequence.
\abx@macro@name:family-given ...tenamefamilygiven
{\ifdefvoid {#3} {} {\ifca...
l.22 \printbibliography[heading=none]
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.`

Based on the answer to a similar issue on StackExchange, I redefined name:family-given in unified.bbx.
At first, I just tried to copy-paste the code in the answer. That code solved the error and I could print the bibliography, but all the first names were in parentheses. So I modified the code as the following, and I could finally get the bibliography that looks exactly the same as unified-test.pdf in this repository.

\renewbibmacro*{name:family-given}[4]{%
  \ifuseprefix
    {\usebibmacro{name:delim}{#3#1}%
     \usebibmacro{name:hook}{#3#1}%
     \ifdefvoid{#3}{}{%
       \ifcapital
         {\mkbibnameprefix{\MakeCapital{#3}}\isdot}
         {\mkbibnameprefix{#3}\isdot}%
       \ifprefchar{}{\bibnamedelimc}}%
     \mkbibnamefamily{#1}\isdot
     \ifboolexpe{%
       test {\ifdefvoid{#2}}
       and
       test {\ifdefvoid{#4}}}
       {}
       {\bibnamedelimd}%
     \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
     \ifdefvoid{#4}{}{\ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd}\mkbibnamesuffix{#4}\isdot}%
     \ifboolexpe{%
       test {\ifdefvoid{#2}}
       and
       test {\ifdefvoid{#4}}}
       {}
       }
    {\usebibmacro{name:delim}{#1}%
     \usebibmacro{name:hook}{#1}%
     \mkbibnamefamily{#1}\isdot
     \ifdefvoid{#4}{}{\revsdnamepunct\bibnamedelimd\mkbibnamesuffix{#4}\isdot}%
     \ifboolexpe{%
       test {\ifdefvoid{#2}}
       and
       test {\ifdefvoid{#3}}}
       {}
       {\revsdnamepunct}%
     \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
     \ifdefvoid{#3}{}{\ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd}\mkbibnameprefix{#3}\isdot}%
     \ifboolexpe{%
       test {\ifdefvoid{#2}}
       and
       test {\ifdefvoid{#3}}}
       {}
       }}

I hope this helps!

fintelkai commented 1 year ago

I cannot reproduce the error on a current version of TeXLive 2022. You are probably running old versions of biber and biblatex.

lingbuzz commented 1 year ago

hi -- fwiw, I see the same issue on Debian buster, texlive package 2018.20190227-2, and the above indeed resolves it. Thanks indeed for making this package public (and thanks to @seoyeonjang for the fix)!