3

I'm using biblatex to handle my bibliography, and there are certain names in my .bib file that contain unusual characters. Normally, biblatex handles this just fine.

Unfortunately, the journal I'm submitting to has \usepackage[T1]{fontenc} as part of their template, and in the T1 encoding, these characters disappear. Composing the characters out of standard LaTeX diacritics rather than using precomposed Unicode characters seems to make no difference.

Is there any way around this without changing the font encoding (which I'm unsure if I can do)?

MWE:

\documentclass{article}

\usepackage[T1]{fontenc}

\usepackage{biblatex}
\addbibresource{mwe.bib}

\begin{document}

\cite{testentry}

\v{S} \v{s} \v{r}

\printbibliography

\end{document}
@misc{testentry,
    author={\v{S}a\v{s}kov\'{a}, Kate\v{r}ina},
    title={Test Entry},
    year={2021},
}

showing that author name is mangled

The same happens if I give the name in UTF-8 as {Šašková, Kateřina} instead of using \v{S} and \'. Strangely, this doesn't happen if I use \v{S} and such in my document itself.

5
  • Can you tell us which biblatex and Biber version you are using? If I run your MWE on a recently-updated MikTeX system (biblatex v3.19 and Biber 2.19) I get the expected output i.stack.imgur.com/u3OdP.png. It's true that with BibTeX you should have additional curly braces as Mico writes and that with Biber (which your MWE should use by default) it's nicer to just go with the UTF-8 characters directly, but it surprises me a bit that the code shown here does not work when at least one of the other two options does work for you.
    – moewe
    Jun 6 at 6:09
  • @moewe From the logs: Package: biblatex 2022/07/12 v3.18b programmable bibliographies (PK/MW). I can't seem to find the biber version in Overleaf's logs.
    – Draconis
    Jun 6 at 16:14
  • Hrmm, strange. I tested the MWE with Overleaf and their TeX Live 2022, 2021, 2020 and 2019 and the output was always as expected. (See for example overleaf.com/read/ypvrdppxypww.) Do you compile with pdfLaTeX or do you use another engine? fontenc should not be used with XeLaTeX and LuaLaTeX as they handle fonts differently. (With German for example \usepackage[T1]{fontenc} will cause wrong output for ß in XeLaTeX and LuaLaTeX.)
    – moewe
    Jun 6 at 18:41
  • @moewe Aha! That would be my problem! I'm using XeLaTeX because I thought it was better than pdfLaTeX.
    – Draconis
    Jun 6 at 18:52
  • 1
    Well, it can do certain things pdfLaTeX cannot do. But I wouldn't say it's better per se. (If I were to go away from pdfLaTeX I would probably go for LuaLaTeX instead of XeLaTeX: While XeLaTeX is faster than LuaLaTeX, LuaLaTeX's Lua layer lets you do wonderful things that pdfLaTeX and XeLaTeX only dream of.) If your template forces \usepackage[T1]{fontenc} that probably means the authors of that template don't want you to use anything other than pdfLaTeX or they didn't think anyone would use anything else.
    – moewe
    Jun 6 at 19:03

1 Answer 1

5

I'm guessing you've "inherited" somebody else's bib file, and that this person used BibTeX (along with a suitably chosen bibliography style) to create their formatted bibliographies. There's nothing wrong with this, of course. However, it is important to be aware of how to enter "accented" characters properly for use by BibTeX. My additional guess is that the person whose bib file you've inherited didn't do this job entirely correctly. Please see the most-upvoted answer to the query How to write “ä” and other umlauts and accented letters in bibliography? for more information on this subject [shameless self-citation alert!].

To fix the situation at hand, you need to change

author={\v{S}a\v{s}kov\'{a}, Kate\v{r}ina},

to

author={{\v S}a{\v s}kov{\'a}, Kate{\v r}ina},

Aside: The issue you've encountered is not really related to the use or non-use of the T1 font encoding. Rather, it's about the input encoding: e.g., ascii (which doesn't know about accented characters at all!) vs utf8 (which lets you employ the letters Š, š, á, and ř directly). I'd actually strongly recommend the T1 font encoding instead of, say, the OT1 font encoding. Why? Doing so will let you copy and paste words with accented characters from the pdf file into a plain-text file created with the help of a utf8-enabled editing program.

By the way, if you know you'll always be using biblatex and biber to create the bibliography and hence that you'll never be using BibTeX, you might as well just write

author={Šašková, Kateřina},

to begin with. A major advantage would be that the surname Šašková won't be treated, for sorting purposes, as if it were spelled Saskova.


enter image description here

\documentclass{article}
\begin{filecontents*}[overwrite]{mybib.bib}
@misc{testentry,
    author={{\v S}a{\v s}kov{\'a}, Kate{\v r}ina},
    title={Test Entry},
    year={2021},
}
\end{filecontents*}
\usepackage[T1]{fontenc} % or, 

\usepackage{biblatex}
\addbibresource{mybib.bib}

\begin{document}
\v{S} \v{s} \v{r} \cite{testentry}

\printbibliography
\end{document}
2
  • 1
    Thank you! I'm afraid what I inherited is not a .bib file in this case, but bad habits learned from other .bib files of the past; it's good to learn the right way to do this.
    – Draconis
    Jun 6 at 5:23
  • 1
    Just a remark: you can also input {\v{S}}a{\v{s}}kov{\’a}
    – egreg
    Jun 6 at 7:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .