4

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*}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}
2
  • Could you post a minimal compilable code?
    – Bernard
    Commented Mar 13, 2019 at 22:14
  • Sure, added a MNWE.
    – Archange
    Commented Mar 13, 2019 at 22:48

2 Answers 2

1

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*}
\addbibresource{\jobname.bib}

\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 lualatex:

enter image description here

Output with pdflatex

enter image description here

10
  • 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
    Commented Mar 14, 2019 at 15:15
  • Small question though: why are single quotes used instead of “”?
    – Archange
    Commented Mar 14, 2019 at 15:15
  • 1
    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. Commented Mar 14, 2019 at 15:24
  • 1
    What profile issue have you with lualatex? Can you add a question about this? Commented Mar 14, 2019 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
    Commented Mar 14, 2019 at 15:56
1

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*}
\addbibresource{\jobname.bib}

\begin{document}

\nocite{*}
\printbibliography

\end{document} 

enter image description here

3
  • 1
    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
    Commented Mar 13, 2019 at 23:17
  • Strange… I used it a few years ago for the book of a friend of mine, and I didn't notice problems. However the data were not the same. Yes, I'd like to see the issue, I'l try to look at ait tomorrow.
    – Bernard
    Commented Mar 13, 2019 at 23:21
  • 1
    Just add editor = {Ditor, E.}, keys to both entries for instance.
    – Archange
    Commented Mar 13, 2019 at 23:35

You must log in to answer this question.

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