\cdots 명령을 인식하기 위해 listofsymbols 패키지를 얻는 것이 가능합니까?

\cdots 명령을 인식하기 위해 listofsymbols 패키지를 얻는 것이 가능합니까?

listofsymbols책의 기호 목록에 포함될 기호를 정의하기 위해 패키지를 사용하려고 합니다 . \newsym명령과 관련된 기호를 정의하기 위해 명령을 사용하는 데 문제가 있습니다 \cdots.

다음은 문제를 설명하는 간단한 기호 정의입니다.

\opensymdef
\newsym[A family of sets]{sFam}{A_{1},\cdots,A_{n}}
\closesymdef

기호 파일이 포함된 문서를 컴파일하면 pdflatex다음 오류 메시지가 표시됩니다.

Undefined control sequence.
Undefined control sequence.
Undefined control sequence.
Undefined control sequence.
Undefined control sequence.

오류에 대한 설명은 다음과 같습니다.

... family of sets]{sFam}{A_{1},\cdots,A_{n}}

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.

위의 기호 정의에서 \cdots가 같은 문자열 xxxx이나 같은 명령 으로 바뀌면 문서를 컴파일합니다.\alphapdflatex

누군가 이 문제를 해결하도록 도와줄 수 있나요? 어떤 도움이라도 주시면 감사하겠습니다.

답변1

listofsymbols를 사용하는 패키지 에 오류가 있는데 \immediate\write, 이는 잘못된 것이며 문제의 원인입니다.

amsmath새 기호 목록 다음에 로드하는 것은 실제로 해결책이 아닙니다. 왜냐하면 다른 명령이 영향을 받을 수 있기 때문입니다. 예를 들어, \sqrt어떤 순서를 사용하더라도 작동하지 않습니다.

Better는 다음에 정의된 대로 변화하고 \immediate\write있습니다 \protected@iwrite.내 대답 중 하나.

\documentclass{article} 
\usepackage{listofsymbols} 
\usepackage{amsmath}
\usepackage{xpatch}

\makeatletter
% get a copy of \protected@write
\let\protected@iwrite\protected@write
% patch the copy to add \immediate
\xpatchcmd{\protected@iwrite}{\write}{\immediate\write}{}{}
% patch \addsymline to use \protected@iwrite instead of \immediate\write
\xpatchcmd{\addsymline}
  {\immediate\write#5}
  {\protected@iwrite{#5}{}}
  {}{}
\makeatother

\opensymdef 
\newsym[A family of sets]{sFam}{A_{1},\cdots,A_{n}} 
\closesymdef

\begin{document} 

\listofsymbols

test The symbol \sFam means \sFamdoc 
\end{document}

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

이러한 재정의로 인해 일부 기호는 여전히 문제를 일으킬 수 있습니다. 이 경우에는 \protect문제가 있는 항목 앞에 추가하세요.

그런데 \cdots이 문맥에서는 사용하면 안 됩니다 \dots. 간단히 말해서 쉼표 사이의 줄임표는 항상 낮은 점으로 표시되어야 합니다.

답변2

업데이트

egreg가 언급했듯이his comment이것은 단지 부분적인 해결책일 뿐입니다.

질문에 대한 의견에서 문제는 패키지 amsmathlistofsymbols; 이 간단한 문서

\documentclass{article} 
\usepackage[draft]{listofsymbols} 
\usepackage{amsmath}

\opensymdef 
\newsym[A family of sets]{sFam}{A_{1},\cdots,A_{n}} 
\closesymdef 

\begin{document} 
test The symbol \sFam means \sFamdoc 
\end{document}

오류 메시지를 트리거합니다

! Undefined control sequence.
\DN@ ->\def \next@ 
                   
l.6 ...A family of sets]{sFam}{A_{1},\cdots,A_{n}}
                                                  
? 

문제는 로딩으로 해결될 수 있습니다amsmath ~ 후에다음과 같이 기호의 모든 정의:

\documentclass{article} 
\usepackage[draft]{listofsymbols} 

\opensymdef 
\newsym[A family of sets]{sFam}{A_{1},\cdots,A_{n}} 
\closesymdef 

\usepackage{amsmath}

\begin{document} 
test The symbol \sFam means \sFamdoc 
\end{document}

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

관련 정보