All Projects → danstoner → pandoc_samples

danstoner / pandoc_samples

Licence: other
sample pandoc-generated PDF font examples

Labels

Projects that are alternatives of or similar to pandoc samples

dissertation-story
My philosophy dissertation + cloud backup + version control. Written in plaintext Markdown with Sublime Text 3.
Stars: ✭ 14 (-51.72%)
Mutual labels:  pandoc
Markdown-Templates
Templates for creating scientific, academic and technical documents using Markdown and Pandoc that support equations, code blocks, citations, Unicode symbols and vector graphics.
Stars: ✭ 130 (+348.28%)
Mutual labels:  pandoc
citeproc-rs
CSL processor in Rust.
Stars: ✭ 56 (+93.1%)
Mutual labels:  pandoc
pandoc-action
github action to run pandoc, soft-deprecated ->
Stars: ✭ 39 (+34.48%)
Mutual labels:  pandoc
PanBook
Pandoc LaTeX,Epub模板,用于生成书籍,幻灯片(beamer),简历,论文等(cv, thesis, ebook,beamer)
Stars: ✭ 190 (+555.17%)
Mutual labels:  pandoc
pandoc-placetable
Pandoc filter to include CSV data (from file or URL)
Stars: ✭ 35 (+20.69%)
Mutual labels:  pandoc
my-writing-workflow
Tutorial for converting markdown files in to APA-formatted docs, based on my workflow.
Stars: ✭ 35 (+20.69%)
Mutual labels:  pandoc
bookends-tools
Alfred Workflow to Integrate with Bookends, an academic reference manager/bibliography tool for macOS
Stars: ✭ 78 (+168.97%)
Mutual labels:  pandoc
tufte-pandoc-jekyll
A Jekyll theme for using Tufte CSS with Jekyll + Pandoc
Stars: ✭ 56 (+93.1%)
Mutual labels:  pandoc
umdoc
A Markdown to LaTeX to PDF converter
Stars: ✭ 15 (-48.28%)
Mutual labels:  pandoc
awesome-academic-writing
MERGED with https://github.com/writing-resources/awesome-scientific-writing
Stars: ✭ 39 (+34.48%)
Mutual labels:  pandoc
docker-alpine-pandoc-ja
Pandoc for Japanese based on Alpine Linux
Stars: ✭ 14 (-51.72%)
Mutual labels:  pandoc
pandoc-doc-ja
Pandocユーザーズガイド日本語版(Pandoc 2.7.2+準拠)のリポジトリ by Sphinx
Stars: ✭ 19 (-34.48%)
Mutual labels:  pandoc
rjsmake
Use Markdown to generate a Reveal.js presentation in minutes.
Stars: ✭ 19 (-34.48%)
Mutual labels:  pandoc
uiucthemes
RMarkdown Templates for UIUC Theme-Oriented Documents
Stars: ✭ 45 (+55.17%)
Mutual labels:  pandoc
marked-man
Read Markdown files like UNIX man pages
Stars: ✭ 16 (-44.83%)
Mutual labels:  pandoc
redmine convert textile to markown
Redmine rake task to convert content from textile to markdown
Stars: ✭ 45 (+55.17%)
Mutual labels:  pandoc
gedit-plugin-markdown preview
A gedit plugin previewing markdown (.md) documents
Stars: ✭ 79 (+172.41%)
Mutual labels:  pandoc
casile
The CaSILE toolkit, a book publishing workflow employing SILE and other wizardry.
Stars: ✭ 36 (+24.14%)
Mutual labels:  pandoc
paru
Control pandoc with Ruby and write pandoc filters in Ruby
Stars: ✭ 30 (+3.45%)
Mutual labels:  pandoc

pandoc_samples

sample PDF files with fonts generated by pandoc

Generating conventional documents (PDF, MS Word, HTML, ...) with pandoc is easy. Use the '-o' option to set the output filename, pandoc will use the file extension to set the output file type.

Example:

$ pandoc -o samplejohndoeresume.pdf samplejohndoeresume.md

Styling is a bit harder.

I suggest the pandoc FAQ and the TeX - LaTeX Stack Exchange

John Doe Resume

While learning pandoc and playing with styling I generated a bunch of PDF samples.

The samples directories contain samples generated from samplejohndoeresume.md.

My testing indicates that the fonts are embedded in generated PDFs so they should be viewable properly across other systems.

The following commands were run on my Ubuntu Linux 14.04 LTS workstation after installing the texlive and texlive-fonts-extra packages.

There are subtle variations between the options, templates, and fonts that are usable by the various latex engines from pandoc. I am recording the following recipes since it took me a while to build up these command lines. For both engines I specify a 1-inch margin.

xelatex engine

xelatex seems to like "system fonts" such as TrueType (.ttf) or OpenType (.otf). The TeX Gyre fonts also worked.

The following commands generate a list of the "friendly names" known by the system font manager. Using the font name rather than an individual font filename seems to work better (a "font" with bold and italic styles is frequently split into multiple separate font files in the filesystem). I could not get fc-list to output only the font name, so the "cut" trims off the comma and everything after:

$ fc-list : family | cut -f1 -d"," | sort
Accanthis ADF Std
Accanthis ADF Std No2
Accanthis ADF Std No3
Andale Mono
Arial
Arial Black
Asana Math
Bitstream Charter
Cabin
Century Schoolbook L
<snip>

Alternative fc-list commands are in fc-list-examples.md.

The full list of fonts available (from my system) is in samples_xelatex/list_of_xelatex_usable_fonts.txt

The following command generates a PDF with the specified font using the xelatex engine:

$ # single incantation
$ pandoc --latex-engine=xelatex -V geometry=margin=1in -V mainfont="DejaVu Sans" -o samplejohndoeresume.pdf samplejohndoeresume.md

The following command generates PDF samples with pandoc from a list of fonts and using the xelatex engine:

$ # run on a list of fonts.
$ cd samples_xelatex
$ xargs -t -a list_of_xelatex_usable_fonts.txt -I myfont pandoc --latex-engine=xelatex -V geometry=margin=1in -V mainfont="myfont" -o myfont\ samplejohndoeresume.pdf ../samplejohndoeresume.md
pandoc --latex-engine=xelatex -V geometry=margin=1in -V mainfont=Accanthis ADF Std -o Accanthis ADF Std samplejohndoeresume.pdf ../samplejohndoeresume.md 
pandoc --latex-engine=xelatex -V geometry=margin=1in -V mainfont=Accanthis ADF Std No2 -o Accanthis ADF Std No2 samplejohndoeresume.pdf ../samplejohndoeresume.md 
pandoc --latex-engine=xelatex -V geometry=margin=1in -V mainfont=Accanthis ADF Std No3 -o Accanthis ADF Std No3 samplejohndoeresume.pdf ../samplejohndoeresume.md 
pandoc --latex-engine=xelatex -V geometry=margin=1in -V mainfont=Andale Mono -o Andale Mono samplejohndoeresume.pdf ../samplejohndoeresume.md 
pandoc --latex-engine=xelatex -V geometry=margin=1in -V mainfont=Arial  -o Arial  samplejohndoeresume.pdf ../samplejohndoeresume.md
<snip>

xelatex fontspec error (Solution: Use system fonts, not latex fonts.):

$ pandoc --latex-engine=xelatex -V geometry=margin=1in -V mainfont=electrum -o electrumsample_johndoeresume.pdf samplejohndoeresume.md
pandoc: Error producing PDF from TeX source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "electrum" cannot be found.

pdflatex engine

pdflatex seems to like latex fonts rather than system fonts. Some latex fonts include bookman, libertine, and lmodern. The font files are expected to have an .sty extension and are specified by using the filename without the .sty on the end. The problem is that .sty files do not seem to be exclusively font files, so searching for all .sty files on your system will find a lot of non-fonts.

The full list (from my system) is in samples_pdflatex/list_of_pdflatex_usable_fonts.txt which I generated by finding all .sty files and removing out the ones that did not work when supplied as a fontfamily.

Note that I could not get the font (fontfamily) to be applied unless I specified a template file also. The default.latex template installed on my system (with Ubuntu-packaged pandoc) did not seem to work so I used the latest default.latex from https://github.com/jgm/pandoc-templates and put it in the same directory as the source markdown file.

$ wget https://github.com/jgm/pandoc-templates/raw/master/default.latex

The following command generates a PDF with the specified font using the pdflatex engine:

$ # single incantation
$ pandoc --latex-engine=pdflatex --template=default.latex -V geometry=margin=1in -V fontfamily=electrum -o samplejohndoeresume.pdf samplejohndoeresume.md

The following command generates PDF samples with pandoc from a list of fonts that I found to work and using the pdflatex engine:

$ # run on a list of fonts.
$ cd samples_pdflatex
$ xargs -t -a list_of_pdflatex_usable_fonts.txt -I myfont pandoc --latex-engine=pdflatex --template=../default.latex -V geometry=margin=1in -V fontfamily=myfont -o myfont_samplejohndoeresume.pdf ../samplejohndoeresume.md
pandoc --latex-engine=pdflatex --template=../default.latex -V geometry=margin=1in -V fontfamily=allauncl -o allauncl_samplejohndoeresume.pdf ../samplejohndoeresume.md 
pandoc --latex-engine=pdflatex --template=../default.latex -V geometry=margin=1in -V fontfamily=allcmin -o allcmin_samplejohndoeresume.pdf ../samplejohndoeresume.md 
pandoc --latex-engine=pdflatex --template=../default.latex -V geometry=margin=1in -V fontfamily=allsqrc -o allsqrc_samplejohndoeresume.pdf ../samplejohndoeresume.md 
<snip>

pdflatex scalable fonts error (Solution: I used a different font. I did find hints online that this is solvable though.)

pandoc: Error producing PDF from TeX source.
! pdfTeX error (font expansion): auto expansion is only possible with scalable 
fonts.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].