
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
。