newcommand에 키릴 값 사용

newcommand에 키릴 값 사용

내 목표는 다음과 같이 쓸 수 있는 것입니다.

\newcommand{\сlient_name}{Имя}

\client_name내 문서 전체에 사용하세요 . 지금은 다음과 같은 오류가 발생합니다.

Underfull \hbox (badness 10000) in paragraph at lines 670--670
[][]|\l_fontspec_font –ü—Ä–æ-–≥—Ä–∞–º-–º–∏-—Ä–æ-–≤–∞-

전체 오류 스크린샷은 여기에 있습니다.http://take.ms/opd30

나는 노력했다이 SE 답변그리고 사용해 보았습니다

\newcommand{\сlient_name}{\foreignlanguage{russian}{Имя}}

하지만 그것은 도움이 되지 않았습니다.

/newcommand 변수에 키릴 문자 값을 사용하려면 어떻게 해야 합니까?

답변1

다음과 같은 최소한의 문서를 고려하십시오.

\documentclass{article}
\usepackage{fontspec}

\newcommand{\сlient_name}{Имя}


\begin{document}

\client_name

\end{document}

XeLaTeX를 실행하면 알 수 있습니다.

! Missing $ inserted.
<inserted text> 
                $
l.4 \newcommand{\сlient_name}{Имя}

? 

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.4 \newcommand{\сlient_name}{Имя}

? 
! Missing number, treated as zero.
<to be read again> 
                   n
l.4 \newcommand{\сlient_name}{Имя}

? 
! You already have nine parameters.
\reserved@a ...xpandafter \сlient \reserved@b #10
                                                  n{
l.4 \newcommand{\сlient_name}{Имя}

? 
! Missing $ inserted.
<inserted text> 
                $
l.5 

? 
No file mohnstrudel.aux.
! Undefined control sequence.
l.9 \client
           _name
? 
! Missing $ inserted.
<inserted text> 
                $
l.9 \client_
            name
? 
! Missing $ inserted.
<inserted text> 
                $
l.10 

? 

첫 번째 오류는 정확히 \newcommand시도 중일 때 발생합니다. 나중에 일어날 일은 완전히 예측할 수 없습니다.

_명령 이름에 있는 오류를 수정합니다 . 이는 허용되지 않습니다. 참조명령/매크로 이름에는 숫자와 기호를 포함할 수 없습니다.

관련 정보