0

I would like to use biblatex. I tried to set the language to hungarian. I've found a .bbx file, but I get strange errors if I try to use it.

The file:

\ProvidesFile{magyar.bbx}

\DeclareLanguageMapping{magyar}{magyar}
\RequireBibliographyStyle{authoryear}

\renewcommand*{\finalnamedelim}{%
  %\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
  \addspace\bibsstring{and}\space}

\newbibmacro{names:separator}{%
  \ifthenelse{\value{listcount}<\value{liststop}}%
  {\addcomma\addspace}%
  {}%
 }

\newbibmacro*{names:andothers}{%
 \ifboolexpr{%
   test {\ifnumequal{\value{listcount}}{\value{liststop}}}%
   and%
   test \ifmorenames%
 }{\bibsstring{andothers}\addcomma}%
 {}%
}

\def\@magyarbbx@hun{HUN}

\DeclareNameFormat{sortname}{%
  \begingroup%
    \edef\juniorpart{#7}%
    \ifx\juniorpart\@magyarbbx@hun%
      % Hungarian name
      \usebibmacro{name:first-last}{#3}{#1}{#5}{\relax}%
    \else%
      % English name
      \ifnum\value{listcount}=1\relax%
        \usebibmacro{name:last-first}{#1}{#3}{#5}{#7}%
      \else%
        \usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%
      \fi%
    \fi%
  \endgroup%
}

%\DeclareNameFormat{sortname}{%
% \nameprint{#1}{#3}
% \usebibmacro{names:separator}%
% \usebibmacro{names:andothers}%
% }

\endinput

The error:

Illegal parameter number in definition of \blx@defformat@d

I am not an advanced latex user, and I have no idea how should I fix this issue. I was not able to find a newer version of this file on the internet

Iter Ator
  • 105
  • 2
    A Hungarian localisation is currently being worked on: https://github.com/plk/biblatex/issues/717. The file you found uses some seriously outdated code, in particular https://tex.stackexchange.com/q/299036/35864. Where did you get it? – moewe Apr 26 '18 at 21:35
  • 1
    I found https://github.com/Botffy/texstuff/tree/master/tex/latex/biblatex is that your source? The files are at least three years old and one of them even has 2011 given as date. If there is no support for these files by the author any more, you should probably not use them. – moewe Apr 26 '18 at 21:38
  • I tried the solution from this answer too: https://tex.stackexchange.com/a/9101/161774 But I still get this error. @moewe I don't want to use them, but I have to – Iter Ator Apr 26 '18 at 21:45
  • That answer is from seven years ago. A few things have changed since then - in its current state the files are absolutely unusable. What exactly do you need? Did someone tell you to use exactly these files? Or do you just need a Hungarian localisation for biblatex. If the latter is the case and you are really pressed for time you can get magyar.lbx from https://github.com/marczellm/biblatex/blob/hungarian/tex/latex/biblatex/lbx/magyar.lbx. That file is currently under development, so there is absolutely no warranty that it gets everything right. But it is much better than what you have now – moewe Apr 26 '18 at 21:51
  • If I try than, questionmarks appear instead of quotation marks: https://i.imgur.com/UJUeiUR.png – Iter Ator Apr 26 '18 at 21:59
  • 2
    That is because csquotes has no Hungarian localisation (https://github.com/josephwright/csquotes/issues/19). See https://tex.stackexchange.com/q/166337/35864. You could try \DeclareQuoteAlias{magyar}{dutch} as a very dirty quick hack. – moewe Apr 26 '18 at 22:02
  • 1
    If you notice anything odd with magyar.lbx or have suggestions for further improvement please comment on https://github.com/plk/biblatex/issues/717. The thing is still work in progress, although most things should be good by now. – moewe Apr 26 '18 at 22:11

2 Answers2

2

The files you are using (https://github.com/Botffy/texstuff/tree/master/tex/latex/biblatex) can be traced back to Biblatex customization: author name format defined by hyphenation (localization) (and http://r.snowl.net/harvard-style-citation-in-hungarian-language-hun/). So most of this dates back to 2011 and 2012.

There were some small and some not so small changes to biblatex in the meantime. The most problematic change here is the change to the name formatting macros in version 3.3, see Biblatex 3.3 name formatting.

Following Hungarian with LuaLaTex and biber there was some effort to get Hungarian support into the official package. The first version of Hungarian support was worked out in https://github.com/plk/biblatex/issues/717 and implemented in https://github.com/plk/biblatex/pull/780. Since version 3.12 biblatex has included Hungarian localisation files. That means that with a current biblatex version Hungarian is supported out of the box, so you probably won't need the .bbx file any more.

If you load csquotes you also need to set up a quotation style. This is also work in progress https://github.com/josephwright/csquotes/issues/19. See also quotation mark (quotation sign) xelatex + polyglossia + csquotes, you probably want (quote style as described on Wikipedia)

\DeclareQuoteStyle{magyar}
  {\quotedblbase}
  {\textquotedblright}
  [.05em]
  {\guillemotright}
  {\guillemotleft}
moewe
  • 175,683
1

The dev branch on https://github.com/plk/biblatex now has support for Hungarian.

fbence
  • 1,585
  • 1
    Just to note that this is not an official release yet and that you will net a dev version of Biber as well if you want to run the dev version of biblatex. I can offer no ETA on the next release version of biblatex, but I can warn you that it will very likely take some time if nothing urgent needs to be fixed. – moewe Aug 16 '18 at 07:12
  • 1
    Version 3.12 with Hungarian support was released in late October 2018. – moewe Apr 28 '19 at 08:11