TransWikia.com

BibLaTeX: Properly quoting titles containing quotes

TeX - LaTeX Asked on July 14, 2021

Please take a look at this MWE:

documentclass{scrreprt}

usepackage[shorthands=off,main=ngerman,english]{babel}
usepackage[german=quotes]{csquotes} 

begin{filecontents}{jobname.bib}

@article{Asperger.1944,
  title = {Die „Autistischen Psychopathen“ im Kindesalter},
  author = {Asperger, Hans},
  date = {1944},
  journaltitle = {Archiv für Psychiatrie und Nervenekrankheiten},
  volume = {117},
  pages = {76--136},
  doi = {10.1007/BF01837709},
  langid = {german},
  number = {1}
}

@article{Brundson.2014,
  title = {Exploring the “fractionation” of autism at the cognitive level},
  author = {Brundson, Victoria and Happé, Francesca},
  date = {2014},
  journaltitle = {Autism},
  volume = {18},
  pages = {17--30},
  doi = {10.1177/1362361313499456},
  langid = {english},
  number = {1}
}

end{filecontents}

usepackage[language=auto,autolang=other,style=verbose-ibid]{biblatex}
addbibresource{jobname.bib}

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

The nesting of the quotation marks is wrong. How can I have csquotes(I suppose?) change the original double marks in the titles to single ones? I’d rather not touch the original .bib file, but could replace the fancy quotation marks with straight ones (") if needed, or some similar simple changes.

enter image description here

One Answer

I think the best solution™ here would be to use mkbibquote{...} or enquote{...} in the .bib file.


If this is out of the question, you can use a sourcemap to replace the quotation marks with enquote{...}. The usual caveats applies: Regular expressions don't really do nesting very well, so this only works if you don't nest the quotation marks.

documentclass{scrreprt}

usepackage[shorthands=off,main=ngerman,english]{babel}
usepackage[german=quotes]{csquotes}
usepackage[language=auto,autolang=other,style=verbose-ibid]{biblatex}

DeclareSourcemap{
  maps{
    map{
      step[fieldsource=title,
        match=regexp{„(.*?)“},
        replace=regexp{enquote{$1}}]
      step[fieldsource=title,
        match=regexp{“(.*?)”},
        replace=regexp{enquote{$1}}]
    }
  }
}

begin{filecontents}{jobname.bib}
@article{Asperger.1944,
  title        = {Die „Autistischen Psychopathen“ im Kindesalter},
  author       = {Asperger, Hans},
  date         = {1944},
  journaltitle = {Archiv für Psychiatrie und Nervenkrankheiten},
  volume       = {117},
  pages        = {76--136},
  doi          = {10.1007/BF01837709},
  langid       = {german},
  number       = {1}
}
@article{Brundson.2014,
  title        = {Exploring the “fractionation” of autism at the cognitive level},
  author       = {Brundson, Victoria and Happé, Francesca},
  date         = {2014},
  journaltitle = {Autism},
  volume       = {18},
  pages        = {17--30},
  doi          = {10.1177/1362361313499456},
  langid       = {english},
  number       = {1}
}
end{filecontents}
addbibresource{jobname.bib}

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

It is also possible to use csquotes' active quote feature.

This feature comes in two flavours. With MakeOuterQuote you only need one character, which serves as opening and closing mark at the same time. Obviously, this construction does not work for nested quotation marks, since

"Lorem "ipsum" dolor"

is ambiguous as to if we quote Lorem and dolor or if we have a nested quotation. In particular such quotes cannot be nested inside an enquote.

Hence, the simple MakeOuterQuote{"} and " in the .bib file does not work.

Things do work, however, if we use separate opening and closing marks. The characters you can choose here should not have another meaning for TeX (so the obvious brackets and <...> are out). The following works

documentclass{scrreprt}

usepackage[shorthands=off,main=ngerman,english]{babel}
usepackage[german=quotes]{csquotes}
usepackage[language=auto,autolang=other,style=verbose-ibid]{biblatex}

MakeAutoQuote{«}{»}

begin{filecontents}{jobname.bib}
@article{Asperger.1944,
  title        = {Die «Autistischen Psychopathen» im Kindesalter},
  author       = {Asperger, Hans},
  date         = {1944},
  journaltitle = {Archiv für Psychiatrie und Nervenkrankheiten},
  volume       = {117},
  pages        = {76--136},
  doi          = {10.1007/BF01837709},
  langid       = {german},
  number       = {1}
}
@article{Brundson.2014,
  title        = {Exploring the «fractionation» of autism at the cognitive level},
  author       = {Brundson, Victoria and Happé, Francesca},
  date         = {2014},
  journaltitle = {Autism},
  volume       = {18},
  pages        = {17--30},
  doi          = {10.1177/1362361313499456},
  langid       = {english},
  number       = {1}
}
end{filecontents}
addbibresource{jobname.bib}

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

Correct answer by moewe on July 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP