I try to use biblatex (to be customized) with Hungarian babel language definition files. The babel language for Hungarian is called magyar
(means: Hungarian).
I am writing a text in which I cite English and Hungarian articles also. I managed to create magyar.lbx based on english.lbx to be able to use Hungarian text in the bibliography with the help of specifying hyphenation = {magyar}
in bib files, and it works like a charm.
The problem is that I would like to modify the format of bibliography further, as in Hungarian the last and first name are in reversed order, e.g. in Hungarian Jules, Verne is written like: Verne Jules.
This is implemented in huplain.bst for using with BibTeX (with the option specifying huname =1
), but unfortunatelly it does not work with author-year format citation (e.g. natbib or babelbib), that is why I had to look for other solutions. It looks like for me, that modifying biblatex's code is the easiest way.
Does anyone have idea about how could I put some conditional statements maybe to \DeclareNameFormat{labelname}
to be able to list Hungarian names in reverse order without a comma between last and first name? I hope it can be done. Thanks for reading!
Editing on the bases of @michal.h21's answer:
I have made a summary in Hungarian language about the results of this topic based on @michal.h21's answer and comments. You can find it here.
Most important features do work, some lesser parts are not so sexy, but will work it out somehow. Any extra comments are welcome!
Best Answer
you can try to define formatting command in \DeclareBibliographyExtras section in lbx file.
so in magyar.lbx
and in english.lbx
and in bbx define name format:
Edit: I was in hurry yesterday, so didn't post complete example.
DeclareNameFormat is command, which accepts 8 parameters. they are:
This command is called on every name in list, if number of authors is smaller than \value{maxnames}. If you have 8 authors and maxnames is set to 5, it will print only authors up to \value{minnames}, I have this value set to 3.
We call command \nameprint with full last and first name. If you need other parts of name use some parameter from list above.
Then we have to print punctuation after every author. I do that with folowning macro:
This macro prints semicolon and space after every author except last one. If you want other punctuation than semicolon, you can replace it with some other punctuation command. Their list is on the page 155 of biblatex manual. Or you can directly print char with \printtext command.
My andothers macro look like this:
We don't have to add punctuation after andothers, because it is printed automatically with next \newunit command in your \DeclareBibliographyDriver.
So my \DeclareNameFormat now looks this way:
Now I see, that my first version of \nameprint was incorrect. Magyar version should probably be:
And English:
You have to define this macro for every language you use in your bibliography, otherwise you will get error message about undefined command.
Another edit based on comments below this post:
you must create bbx and cbx file. For example:
huglain.bbx
notice line
this is loading of your magyar.lbx file. In your current version, this file is not used at all, so in your citation there is "and" before last name instead of "és"
hugplain.cbx is rather simple
In your tex file delete all biblatex macros and call babel with \usepackage[english,magyar]{babel}. Last language is the main language of document.
at top of file magyar.lbx, right below line \PorvidesFile... add lines
and you have error in bibliography strings, replace
with
and finally, you should add hyphenation fields even to english publications in your bib files, unless you want to have citation like Berk, Kriegler, és Ylvisaker