BibLaTeX:正确引用包含引号的标题

BibLaTeX:正确引用包含引号的标题

请看一下这个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}

引号的嵌套是错误的。我该如何csquotes(我想?)将标题中原来的双引号改为单引号?我宁愿不触碰原始.bib文件,但如果需要,可以将花哨的引号替换为直引号(“),或者进行一些类似的简单更改。

在此处输入图片描述

答案1

我认为这里最好的解决方案是使用\mkbibquote{...}\enquote{...}在文件中.bib


如果这是不可能的,您可以使用源映射将引号替换为\enquote{...}。通常的注意事项:正则表达式实际上不能很好地嵌套,因此只有在您不嵌套引号时才有效。

\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}

也可以使用csquotes'主动报价特征。

此功能有两种形式。\MakeOuterQuote您只需一个字符,它同时充当开始和结束标记。显然,这种构造不适用于嵌套引号,因为

"Lorem "ipsum" dolor"

对于我们是否引用Loremdolor或是否有嵌套引用,存在歧义。特别是,此类引用不能嵌套在 中\enquote

因此,文件中的简单\MakeOuterQuote{"}and不起作用。".bib

但是,如果我们使用单独的开始和结束标记,事情就会正常进行。在这里可以选择的字符对 TeX 来说不应该有其他含义(因此明显的括号和<...>不适用)。以下方法有效

\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}

相关内容