전체 문서에 대해 스마트(문맥상) 인용을 비활성화하시겠습니까?

전체 문서에 대해 스마트(문맥상) 인용을 비활성화하시겠습니까?

~하는 것이 가능하니장애를 입히다전체 문서에 대한 스마트(문맥상) 인용문? 그렇다면 어떻게?

특히 작은 따옴표 ', 큰 따옴표 " 및 역따옴표 `를 일부 옵션이나 방법으로 그대로 두어 이러한 대체를 직접 비활성화할 수 있습니까?

\documentclass{article}
% minimal document which illustrates the issue.
\begin{document}

Can "double quotes", 'single quotes' and `backticks`
substitutions to any curly, smart, quote, contextual 
be switched off for the whole document?

\end{document}

패키지upquote유형 섹션 으로 제한되는 것으로 보입니다 \ver­ba­tim. 패키지csquotes사용자 정의 가능한 '스마트 따옴표'에 대한 명령과 환경이 있습니다.... 그러나 스마트 따옴표를 완전히 비활성화하는 일부 스위치는 찾기 어렵습니다.

질문"단순한 텍스트가 아닌 본문에 대한 패키지와 같은 인용문이 있습니까?"은(는) 찾고 있습니다.패키지 플러스 매크로그리고 오히려스위치 꺼짐.

시스템적 영향패키지 추가스위치를 켜다(옵션?)본질적인 차이가 있습니다.

한편으로는,"패키지 추가"하류접근하다. 다운스트림 파일로 인해 작성자 파일에 클러스터와 복잡성이 추가되었습니다. 와 같은x, 매크로용으로 이 패키지를 추가한 y다음 해당 패키지를 추가하고 z재정의한 다음 자체적으로 재정의될 수 있도록 a정의합니다 . 각각의 추가된 패키지, 정의 및 재정의는 동적 런타임 실행에도 계산상의 복잡성을 추가할 가능성이 높습니다.bb

반면에,"스위치를 전환해 줘"상류접근하다. 나는 이러한 인용 대체가 다양한 TeX/LaTeX 엔진에서 비롯된 것이라고 추측합니다. 가설적으로든 이상적으로든 스마트 인용 옵션 스위치는 다음과 같은 의사 논리를 사용하여 소스에서 효율적으로 실행되도록 컴파일하고 링크할 수 있습니다.

// over simplified pseudo code
if smartQuotesOption == true {
  // make quote substitutions happen
}
else {
  // just skip the substitutions.
  // so, maybe nothing or little to do.
}

개념적으로 사용자는 명령줄 옵션을 사용합니다.

pdflatex --no-smart-quotes document.tex

또는 LaTeX/TeX 파일에서 다음과 같은 직접 스위치를 사용하십시오.

\smartquotesdisable
\smartquotesenable % default for backward compatibility

pandoc이러한 스마트 대체 활성화/비활성화 토글은 다양한 마크다운 도구 및 주류 워드 프로세서 와 같은 문서 생성 환경에 존재합니다 .

따라서 "스마트 인용 대체가 가능할까요?꺼짐?" …

그렇다면 좋습니다.

그렇지 않다면 스마트 대체 토글에 대한 기능 요청을 어디에 제출해야 합니까? 아니면 그러한 기능이 이미 로드맵에 있는지 알아보세요. :-)

답변1

이 문자는 다른 문자의 고양이코드를 변경하는 데 자주 사용되기 때문에 asciigrave및 의 고양이코드를 변경하는 것에 대해 약간의 의구심이 있습니다 . quotedbl하지만 어쩌면 괜찮을 수도 있습니다.

pdflatex, xelatex및 와 함께 작동하도록 업데이트되었습니다 lualatex.

\documentclass{article}

\usepackage{ifxetex}
\usepackage{ifluatex}
\newif\ifxetexorluatex
\ifxetex
  \xetexorluatextrue
\else
  \ifluatex
    \xetexorluatextrue
  \else
    \xetexorluatexfalse
  \fi
\fi

\ifxetexorluatex
  \usepackage{fontspec}
  \begingroup
    \catcode 34=13
    \catcode 39=13
    \catcode 96=13
    \gdef"{\textquotedbl}
    \gdef'{\textquotesingle}
    \gdef`{\textasciigrave}
  \endgroup
\else
  \usepackage[TS1,T1]{fontenc}
  \begingroup
    \catcode 39=13
    \catcode 96=13
    \gdef'{{\fontencoding{TS1}\selectfont\textquotesingle}}
    \gdef`{{\fontencoding{TS1}\selectfont\textasciigrave}}
  \endgroup
\fi

\def\smartquotedisable{%
  \ifxetexorluatex
    \catcode 34=13
  \fi
  \catcode 39=13
  \catcode 96=13
}
\def\smartquoteenable{%
  \ifxetexorluatex
    \catcode 34=12
  \fi
  \catcode 39=12
  \catcode 96=12
}

\begin{document}

`Hello'

"Hello"

``Hello''

\smartquotedisable

`Hello'

"Hello"

``Hello''

\smartquoteenable

`Hello'

"Hello"

``Hello''

\end{document}

산출

관련 정보