# Use localized quotation marks, hyphenation and ponctuation in BibLaTeX using langid for entries title

What I get:

A. Author, « Some article title ? ». Whatever Journal.

B. Buthor, « Un article ? ». Another Journal.

What I would like:

A. Author, “Some article title?”. Whatever Journal.

B. Buthor, « Un article ? ». Another Journal.

And hyphenation should be language-dependent of course. ;)

autolang=other is not an option as it would translate some other parts of the bibliography that I don’t want to be affected.

I’ve stumbled upon BibLaTeX langid with autolang=hyphen makes csquotes use localized quotation marks and the old behaviour is mostly what I want (with the minor point that I don’t know how it behaved w.r.t. punctuation like question marks above).

MNWE:

\documentclass{scrartcl}

\usepackage[british,french]{babel}
\usepackage[autostyle=true]{csquotes}
\usepackage[autolang=hyphen]{biblatex}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@article{eng,
author = {Author, A.},
title = {Some article title?},
journal = {Whatever Journal},
year = {2019},
langid = {british},
}
@article{fra,
author = {Buthor, B.},
title = {Un article ?},
journal = {Another Journal},
year = {2019},
langid = {french},
}
\end{filecontents*}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

• Could you post a minimal compilable code? – Bernard Mar 13 '19 at 22:14
• Sure, added a MNWE. – Archange Mar 13 '19 at 22:48

You can try the following.

A remark about the punctuation marks. There are two types in your example:

• Punctuation marks in fields, like e.g. the question mark in the title: {Some article title?},

• Punctuation marks created by macros from biblatex, e.g. the colon after the In:.

The first type is difficult to adapt to the language with pdflatex as the catcodes are already frozen. With lualatex it works.

\documentclass{scrartcl}
\usepackage{ifluatex}
\ifluatex\else
\usepackage[T1]{fontenc} %with pdflatex
\fi

\usepackage[british,french]{babel}
\usepackage[autostyle=true]{csquotes}
\usepackage[autolang=hyphen]{biblatex}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@article{eng,
author = {Author, A.},
title = {Some article title?},
journal = {Whatever Journal},
year = {2019},
langid = {british},
editor={D. Editor}
}
@article{fra,
author = {Buthor, B.},
title = {Un article?},
journal = {Another Journal},
year = {2019},
langid = {french},
editor={D. Editor}
}

\end{filecontents*}

\makeatletter
\def\blx@hook@initlang{%
\csq@reset=0 \csq@setstyle{\abx@field@langid}%
%optional for the colon after "In":
\ifdefstring{\abx@field@langid}{french}{}
{\def\FDP@colonspace{}%
\def\FDP@thinspace{}}%
}
\makeatletter
\begin{document}

\nocite{*}
\printbibliography
\end{document}


### Output with pdflatex

• Nice! Actually, I use XeLaTeX, but it does not work either with it. Guess I will have to look about fixing this JPEG embedded ICC profile issue I have with LuaLaTeX to finally switch over (especially since it also gives font expansion with microtype). – Archange Mar 14 '19 at 15:15
• Small question though: why are single quotes used instead of “”? – Archange Mar 14 '19 at 15:15
• I don't know, but you get them also without the changes (if the language is british). Ask a new question if you want to change this. – Ulrike Fischer Mar 14 '19 at 15:24
• What profile issue have you with lualatex? Can you add a question about this? – Ulrike Fischer Mar 14 '19 at 15:25
• Actually the quotes work correctly (i.e. I get “”) in my original document with your solution, so it’s perfect for me. I need to do some more research on that profile issue, but basically I have a JPEG with an embedded profile that renders differently depending on the used software to visualize it, and differently between XeLaTeX and LuaLaTeX output. I need to find a good example of image with embedded ICC to check which rendering is wrong, I’ll have a look during the week-end. – Archange Mar 14 '19 at 15:56

Using autolang=other (and loading the T1 font encoding) does the job:

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[british,french]{babel}
\usepackage[autostyle=true]{csquotes}
\usepackage[autolang=other]{biblatex}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@article{eng,
author = {Author, A.},
title = {Some article title?},
journal = {Whatever Journal},
year = {2019},
langid = {british},
}
@article{fra,
author = {Buthor, B.},
title = {Un article ?},
journal = {Another Journal},
year = {2019},
langid = {french},
}
\end{filecontents*}

• No it does not, please read my question above. Using other will also translate some other part, like cited pages. I can update my MNWE to show the issue if you want. – Archange Mar 13 '19 at 23:17
• Just add editor = {Ditor, E.}, keys to both entries for instance. – Archange Mar 13 '19 at 23:35