
나는 얻으려고 노력하고있다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
.
내가 무엇을 놓치고 있나요? pandoc
Ubuntu 16.04에서 2.7.3을 사용하고 있습니다 . 목표는 text.md
와 같은 Markdown 파일로 시작하여 공간이 깨지지 않는 위치를 a;b
보여주는 PDF 파일을 출력으로 얻는 것입니다 .a ;b
답변1
pandoc
LaTeX 출력의 기본 템플릿은 옵션을 강제 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
옵션은 원하는 기능을 종료합니다. 다음 방법으로 이 문제를 해결할 수 있습니다.
다음 파일에서 기본 LaTeX 템플릿을 가져옵니다
mytemplate.latex
.pandoc -D latex >mytemplate.latex
에서는 즐겨 사용하는 텍스트 편집기를 사용하여 에 전달된 옵션을
mytemplate.latex
제거합니다 .shorthands=off
babel
다음으로 컴파일:
pandoc -f markdown -t latex -M lang:fr-FR --template=mytemplate -o test.pdf test.md
mytemplate.latex
이 작업은 현재 디렉토리나 에 있는 경우 작동합니다 ~/.pandoc/templates
.