mhchem의 Biblatex-apa 문제

mhchem의 Biblatex-apa 문제

BibLaTeX나는 'cite-style'을 사용할 때 apamhchembib 파일에 아래 첨자/위 첨자가 있는 화학 공식이 포함되어 있을 때 문제를 발견했습니다 . MWE는

\documentclass{article}
\usepackage[version=4]{mhchem}
\usepackage[style=apa, backend=biber]{biblatex}
%\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{Bib.bib}

\begin{document}

This is a citation with only simple chemistry: \parencite{Cite1}.

This is a citation with superscript: \parencite{Cite2}.

\printbibliography
\end{document}

Cite1에는 간단한 화학식만 포함되어 있으며 완벽하게 작동합니다.

@Article{Cite1,
  author       = {Author, A.},
  date         = {2020},
  journaltitle = {A Journal},
  title        = {A title with just some \ce{Mg/Ca} chemistry},
  issue        = {2},
  pages        = {1--4},
  volume       = {1},
  timestamp    = {2020-03-27},
}

인용 2에는 위 첨자가 포함되어 있으며 14개의 오류가 발생합니다.

@Article{Cite2,
  author       = {Author, B.},
  date         = {2020},
  journaltitle = {Another Journal},
  title        = {A title with some more complicated \ce{\delta^{18}O} chemistry and a longer title},
  issue        = {1},
  pages        = {2--6},
  volume       = {8},
  timestamp    = {2020-03-27},
}

BibLaTeX문제는 Mathmode로 전환되는 것 같습니다 . 하지만 \ce이를 방지해야 합니다.

여기에 이미지 설명을 입력하세요

\protect에서와 같이 간단한 는 {\protect\ce{\delta^{18}O}}해당 문제를 해결하지만 이제 "O"가 소문자로 만들어지기 때문에 또 다른 문제가 생성됩니다.

여기에 이미지 설명을 입력하세요

{\protect\ce{\delta^{18}\MakeUppercase{O}}}마침내 올바른 결과를 얻으려면 다소 복잡한 버전이 필요합니다 .

여기에 이미지 설명을 입력하세요

실제 bib 파일에는 많은 항목이 포함되어 있으므로 당연히 모든 항목을 수동으로 변경하고 싶지 않습니다. 흥미롭게도 -style과 완벽하게 작동하지만 authoryear문제는 명백히 apa-특정입니다. 이 문제를 해결하는 방법에 대한 제안을 보내 주시면 매우 감사하겠습니다.

답변1

biblatex-apa로 문장 대소문자를 구분합니다 \MakeSentenceCase*. 해당 매크로는 매우 복잡하며 기본적으로 깨지지 않고 일반 텍스트만 처리할 수 있습니다.

제목에 복잡한 매크로가 있는 경우 중괄호 쌍을 사용하여 숨기거나 보호해야 합니다.

버팀대 보호의 복잡한 규칙은 귀하가 필요하다는 것을 의미합니다.중괄호 안의 내용이 매크로로 시작하고 cpaitatalisation을 유지하려는 경우 중괄호 쌍.

\documentclass{article}
\usepackage[version=4]{mhchem}
\usepackage[style=apa, backend=biber]{biblatex}


\begin{filecontents}{\jobname.bib}
@Article{Cite1,
  author       = {Author, A.},
  date         = {2020},
  journaltitle = {A Journal},
  title        = {A Title with Just Some {{\ce{Mg/Ca}}} Chemistry},
  issue        = {2},
  pages        = {1--4},
  volume       = {1},
}
@Article{Cite2,
  author       = {Author, B.},
  date         = {2020},
  journaltitle = {Another Journal},
  title        = {A Title with Some More Complicated {{\ce{\delta^{18}O}}}
                  Chemistry and a Longer Title},
  issue        = {1},
  pages        = {2--6},
  volume       = {8},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
This is a citation with only simple chemistry: \parencite{Cite1}.

This is a citation with superscript: \parencite{Cite2}.

\printbibliography
\end{document}

저자 A. (2020). 약간의 Mg/Ca 화학이 포함된 제목입니다. 저널, 1, 1–4.//저자, B. (2020). δ 18 O 화학이 좀 더 복잡하고 제목이 더 긴 제목입니다. 또 다른 일지, 8, 2–6.

관련 정보