pandoc을 사용할 때 구두점 앞에 바벨 프랑스어 자동 공백 얻기

pandoc을 사용할 때 구두점 앞에 바벨 프랑스어 자동 공백 얻기

나는 얻으려고 노력하고있다pandoc나는 (LaTeX를 사용하여 Markdown을 PDF로 변환) 프랑스어 조판 규칙을 존중하는 PDF를 생성하려고깨지지 않는 공간.

여기에 제안 사항작동하지 않는 것 같습니다(예: pandoc test.md -V lang:fr-FR -o test.pdf또는 ) pandoc test.md -M lang:fr-FR -o test.pdf.

내가 무엇을 놓치고 있나요? pandocUbuntu 16.04에서 2.7.3을 사용하고 있습니다 . 목표는 text.md와 같은 Markdown 파일로 시작하여 공간이 깨지지 않는 위치를 a;b보여주는 PDF 파일을 출력으로 얻는 것입니다 .a ;b

답변1

pandocLaTeX 출력의 기본 템플릿은 옵션을 강제 shorthands=off로 적용하는 것으로 보입니다 babel. 실제로 를 실행한 후에는 다음 pandoc -D latex >default.latex이 표시됩니다.

\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere

(...)

$if(lang)$
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
$if(babel-newcommands)$
  $babel-newcommands$
$endif$
\else

(...)

\end{document}

shorthands=off옵션은 원하는 기능을 종료합니다. 다음 방법으로 이 문제를 해결할 수 있습니다.

  1. 다음 파일에서 기본 LaTeX 템플릿을 가져옵니다 mytemplate.latex.

    pandoc -D latex >mytemplate.latex
    
  2. 에서는 즐겨 사용하는 텍스트 편집기를 사용하여 에 전달된 옵션을 mytemplate.latex제거합니다 .shorthands=offbabel

  3. 다음으로 컴파일:

    pandoc -f markdown -t latex -M lang:fr-FR --template=mytemplate -o test.pdf test.md
    

mytemplate.latex이 작업은 현재 디렉토리나 에 있는 경우 작동합니다 ~/.pandoc/templates.

관련 정보