편집하다

편집하다

나는 영어와 다른 언어로 된 작품을 자주 인용하는 독일어 문서를 작성하고 있습니다. 복합어나 이름의 하이픈 기호를 쉽게 수정하기 위해 의 babel속기 (예를 들어 항상 인쇄해야 하는 추가 하이픈 및 하이픈 없이 줄 바꿈이 가능한 경우)에 사용된 속기를 명령 사용을 위해 활성화했습니다 .ngerman"=""english\addto\extrasenglish

otherlanguage기본 문서 텍스트의 내부 환경에서는 모든 것이 예상대로 작동합니다.

biblatex참고문헌 관리에 사용하는 은 각 참고문헌 항목에 대한 하이픈 넣기 규칙을 전환하는 autolang옵션과 필드를 제공합니다. 로 langid설정하면 인용 및 참고문헌 항목 주위에 환경이 배치되므로 속기를 사용합니다. 그러나 영어와 같은 용어도 인쇄하는데 , 이는 전체 독일어 문서에서는 바람직하지 않습니다. 따라서 다음과 같은 옵션을 제공합니다.autolangotherotherlanguageandbiblatexautolang=hyphen하이픈 넣기 규칙만 활성화하세요필드 에 지정된 언어의 경우 langid다른 모든 용어의 경우 기본 문서 언어로 대체됩니다.

그러나 그러면 속기는 더 이상 작동하지 않습니다. 어떻게 작동하게 합니까?

MWE는 다음과 같습니다.

\documentclass{scrartcl}

\usepackage{fontspec}
\usepackage[english,ngerman]{babel}
\addto\extrasenglish{\useshorthands{"}\languageshorthands{ngerman}}
\usepackage{csquotes}
\usepackage[backend=biber,autolang=hyphen,style=verbose]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{bibliography.bib}
@collection{NMR,
  editor = {Wardrip"=Fruin, Noah and Montfort, Nick},
  title = {The New Media Reader},
  location = {Cambridge/""MA and London},
  publisher = {MIT Press},
  year = 2003,
  langid = {english}
}
\end{filecontents}

\addbibresource{bibliography.bib}

\begin{document}

\begin{otherlanguage}{english}
  Manually using babel shorthands inside an \texttt{otherlanguage}
  environment, everything works as expected: Wardrip"=Fruin.
  Cambridge/""MA.
\end{otherlanguage}

Yet, citing the work from the bibliography, where it was given a
\texttt{langid} field, the shorthands do not work.\autocite{NMR}

Neither do they work in the bibliography:
\printbibliography
\end{document}

답변1

하이픈 규칙 환경은 모든 언어 속기를 적극적으로 비활성화합니다. 그러나 babel은 항상 작동하는 일반 명령을 제공합니다.

\documentclass{scrartcl}

\usepackage{fontspec}
\usepackage[english,ngerman]{babel}
\addto\extrasenglish{\useshorthands{"}\languageshorthands{ngerman}}


\begin{document}

\begin{hyphenrules}{ngerman}
  Manually using babel shorthands inside an \texttt{hyphenrules}
  environment, doesn't: Wardrip"=Fruin.
  Cambridge/""MA.

  Use the babel commands: Wardrip\babelhyphen{hard}Fruin.
  Cambridge/\babelhyphen{empty}MA.
\end{hyphenrules}
\end{document}

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

\hyphenbiblatex에는 and 명령도 있습니다 \hyphenate(그러나 에 대해서는 아무것도 없습니다 "").

편집하다

실제로 모든 언어에서 작동하도록 바로가기를 정의할 수 있습니다.

\documentclass{scrartcl}

\usepackage{fontspec}
\usepackage[english,ngerman]{babel}

\usepackage{csquotes}

\useshorthands*{"}
\defineshorthand{""}{\babelhyphen{empty}}
\defineshorthand{"=}{\babelhyphen{hard}}

\begin{document}
\begin{hyphenrules}{ngerman}
  Wardrip"=Fruin.
  Cambridge/""MA.

  \end{hyphenrules}

\selectlanguage{english}
  Wardrip"=Fruin.
  Cambridge/""MA.

\selectlanguage{ngerman}
  Wardrip"=Fruin.
  Cambridge/""MA.

\end{document}

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

관련 정보