csquotes, hyperref 및 scrartcl은 \makeautoquote 및 \makeautoquote*를 사용할 때 여러 오류를 생성합니다.

csquotes, hyperref 및 scrartcl은 \makeautoquote 및 \makeautoquote*를 사용할 때 여러 오류를 생성합니다.

문서를 컴파일할 때 이상한 오류가 발생했습니다. 나는 이 문서를 한동안 작업하고 있으며 tlgmr을 통해 texlive 2018 설치를 업데이트한 후 얼마 후에 이러한 문제에 직면했습니다.

이 MWE는 오류를 재현합니다.

\documentclass[]{scrartcl}

\usepackage[ngerman]{babel}
\usepackage[]{csquotes}
\MakeAutoQuote{»}{«}
\MakeAutoQuote*{>}{<}

\usepackage{hyperref}

\begin{document}

\section{Introduction}
test test test

\section{Conclusion}

\end{document}

오류:

(c:/texlive/2018/texmf-dist/tex/latex/oberdiek/bkm-pdftex.def File: bkm-pdftex.def 2016/05/17 v1.26 bookmark driver for pdfTeX (HO) Package auxhook Info: \AddLineBeginMainAux comes a little late, (auxhook)             because the main .aux file is already opened on input lin e 164. \BKM@id=\count107 )) ! Missing = inserted for \ifnum. <to be read again> 
                   \begingroup  l.14 \section{Introduction}
                            I was expecting to see `<', `=', or `>'. Didn't.

! Missing number, treated as zero. <to be read again> 
                   \begingroup  l.14 \section{Introduction}
                            A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.)

! Missing = inserted for \ifnum. <to be read again> 
                   \begingroup  l.14 \section{Introduction}
                            I was expecting to see `<', `=', or `>'. Didn't.

! Missing number, treated as zero. <to be read again> 
                   \begingroup  l.14 \section{Introduction}
                            A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.)


Package bookmark Warning: Unknown document division name (1) (bookmark)                for option `level' on input line 14.

! Missing = inserted for \ifnum. <to be read again> 
                   \begingroup  l.14 \section{Introduction}
                            I was expecting to see `<', `=', or `>'. Didn't.

! Missing number, treated as zero. <to be read again> 
                   \begingroup  l.14 \section{Introduction}
                            A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.)

! Undefined control sequence. \GenericError  ...                      

                                                    #4  \errhelp \@err@     ... l.14 \section{Introduction}
                            The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

! Undefined control sequence. \GenericError  ...                      

                                                  \let \@err@               ... l.14 \section{Introduction}

(계속됩니다)

hyperref줄 중 하나를 주석 처리하거나 makeautoquote문서 클래스를 변경하면 article모든 것이 잘 컴파일됩니다.

답변1

문제는 그것이 그것들을 \MakeAutoQuote*{<}{>}만들고 활성화 <하고 >재정의한다는 것입니다. 따라서 이 변경 후에는 <or >와 같은 비교 의 모든 사용이 \ifnum … < … \else … \fi실패합니다. 따라서 항상 위험합니다. 즉, 언어 선택이 완료된 후 해당 코드를 읽는다면 다음과 같습니다.

\begin{filecontents*}{\jobname1.tex}
  \ifnum \value{page}>0 \relax\fi
\end{filecontents*}
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[]{csquotes}
\MakeAutoQuote{»}{«}
\MakeAutoQuote*{>}{<}
\AtBeginDocument{\input{\jobname1.tex}}
\begin{document}

\section{Introduction}
test test test

\section{Conclusion}

\end{document}

그럼에도 불구하고 따옴표 문자 <와 를 사용하는 경우 >패키지나 구성, 드라이버 파일 등을 늦게 로드하는 것을 피해야 합니다. 이는 어떤 경우에도 쉽거나 불가능합니다.

귀하의 경우 문제는 bookmarkvia 의 암시적 로딩입니다 \AtBeginDocument. 따라서 다음 중 하나를 시도해 볼 수 있습니다.

\documentclass[]{scrartcl}

\usepackage[ngerman]{babel}
\usepackage[]{csquotes}
\usepackage{hyperref}
\usepackage{bookmark}
\MakeAutoQuote{»}{«}
\MakeAutoQuote*{>}{<}

\begin{document}

\section{Introduction}
test test test

\section{Conclusion}

\end{document}

또는

\documentclass[bookmarkpackage=false]{scrartcl}

\usepackage[ngerman]{babel}
\usepackage[]{csquotes}
\usepackage{hyperref}

\MakeAutoQuote{»}{«}
\MakeAutoQuote*{>}{<}

\begin{document}

\section{Introduction}
test test test

\section{Conclusion}

\end{document}

그러나 \MakeAutoQuote*{<}{>}여전히 위험하고 문제를 일으킬 수 있습니다. 따라서 사용하지 않는 것이 좋습니다.

관련 정보