Skip to content

Instantly share code, notes, and snippets.

@lo48576
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lo48576/385008523a706d1d3a4f to your computer and use it in GitHub Desktop.
Save lo48576/385008523a706d1d3a4f to your computer and use it in GitHub Desktop.
asciidoc to pdf (with fop)
#!/bin/sh
a2x -fpdf -dbook --fop --fop-opts="-c ./fop.xconf" --xsl-file=fop-vl-pgothic.xsl template.adoc
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
encoding="UTF-8" >
<!-- specify fo.xsl path in your asciidoc installation. -->
<xsl:import href="/usr/share/asciidoc/docbook-xsl/fo.xsl"/>
<xsl:param name="paper.type" select="'A4'"/>
<xsl:template>
<fo:inline font-family="VL PGothic">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
<!-- specify fonts you prefer. -->
<xsl:param name="title.font.family">VL PGothic</xsl:param>
<xsl:param name="body.font.family">VL PGothic</xsl:param>
<xsl:param name="monospace.font.family">VL PGothic</xsl:param>
<xsl:param name="symbol.font.family">VL PGothic</xsl:param>
<xsl:param name="sans.font.family">VL PGothic</xsl:param>
</xsl:stylesheet>
<?xml version="1.0"?>
<fop version="1.0">
<base>.</base>
<source-resolution>72</source-resolution>
<target-resolution>72</target-resolution>
<default-page-settings height="240mm" width="120mm"/>
<renderers>
<renderer mime="application/pdf">
<filterList>
<value>flate</value>
</filterList>
<fonts>
<auto-detect/>
</fonts>
</renderer>
</renderers>
</fop>

title (たいとる)

section (せくしょん)

statement (ぶんしょう)

subsection (さぶせくしょん1)

list (りすと)

  • item 1 (あいてむ1)

  • item 2 (あいてむ2)

square (すくえあ)

  • item 1 (あいてむ1)

  • item 2 (あいてむ2)

subsection 2

C++ source

constexpr int c = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment