Open4
AsciiDocをPDFに変換する
docker-asciidoctorを使う
$ docker run -it -u $(id -u):$(id -g) -v <your directory>:/documents/ asciidoctor/docker-asciidoctor
以下のコマンドでPDFに変換できる
$ asciidoctor-pdf <your adoc file>
日本語が含まれる際は-a pdf-theme=default-with-fallback-font
を指定する必要がある。
$ asciidoctor-pdf -a scripts=cjk -a pdf-theme=default-with-fallback-font <your adoc file>
ページ番号を中心に表示する
デフォルトだと右ページのページ番号は右端に、左ページのページ番号は左端に表示される。
カスタムテーマを作成する。
themes/custom-theme.yml
extends: default-with-fallback-font
footer:
columns: =100%
recto:
center:
content: "{page-number}"
verso:
center:
content: "{page-number}"
テーマのファイルを指定してPDFに変換する。
$ asciidoctor-pdf -a scripts=cjk -a pdf-theme=custom -a pdf-themesdir=themes <your adoc file>
- pdf-themesdir : テーマファイルが存在するディレクトリのパス
- pdf-theme : テーマファイルのファイル名。.ymlで終わっていない場合は
-theme.yml
がsuffixで加えられる
参考
表がページを跨がないようにする
unbreakable
を設定する
table.adoc
[options="unbreakable"]
|===
|ページを跨がない表|This is unbreakable table
|hoge|huga
|===