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}
Archange
  • 1,368

2 Answers2

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

Bernard
  • 271,350
  • 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 Mar 13 '19 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 Mar 13 '19 at 23:21
  • 1
    Just add editor = {Ditor, E.}, keys to both entries for instance. – Archange Mar 13 '19 at 23:35
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

Ulrike Fischer
  • 327,261
  • 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
  • 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. – Ulrike Fischer Mar 14 '19 at 15:24
  • 1
    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
  • Actually that ICC profile issue is https://tex.stackexchange.com/questions/146517/how-to-improve-color-consistency-of-bitmap-pictures-from-native-format-to-target. I’m adding my workarounds to it (found some that work quite well). – Archange Mar 14 '19 at 21:37
  • Done: https://tex.stackexchange.com/a/479548/56823. Do you think it should be reported somewhere for LuaLaTeX devs to know about it? – Archange Mar 14 '19 at 22:06
  • Sorry I do find your posting quite unclear. Do you have a problem or a solution? If you have problem you shouldn't bury it in some old posting. Report it at the right place. – Ulrike Fischer Mar 14 '19 at 22:14
  • I have the same problem as the person that asked the linked question: ICC profiles embedded in JPEG files are lost by LuaLaTeX. I also have solutions, but those are workaround: since it works OOTB with XeLaTeX, I would hope the same could be true for LuaLaTeX. Is that more clear to you? – Archange Mar 14 '19 at 22:21
  • Well I didn't read everything, the answer from michal sounds as if it should work. In any case the comments here are the wrong place. – Ulrike Fischer Mar 14 '19 at 22:24