I successfully get a nice formatted text I could paste anywhere using:
cat myFile.md | pandoc -s -f markdown -t html | xclip -selection clipboard -t text/html
xclip is a command line interface to X selections (clipboard). With ... -t html -o myFile.html works fine too.
I'm trying to change the font family, from the default Serif to some other Sans-serif font family. I found a lot of examples with LaTex, PDF and DOC, but no one that works in this scenario. Tried a lot of fonts (listed from fc-list : family, even after installing texlive-xetex package). The Closest answer I could find was this one.
I'm trying to just use certain parameters on CLI, trying to avoid things like --css source/styles.css.
Using pandoc 1.19.2.4 over Ubuntu 18.04.
Some --variable I tried:
-V fontfamily:arev
-V fontfamily:Ubuntu
-V fontfamilyoptions:sfdefault
-V "mainfont:DejaVuSans"
-V mainfont="DejaVu Sans Serif"
-V "sansfont:DejaVuSans"
Edit 1:
Based on mb21's answer, since Pandoc 1.12.x (source) is possible to provide more metadata to Pandoc adding a YAML block code.
On newer Pandoc versions, I also added a title key to avoid the "[WARNING] This document format requires a nonempty element.".
---
title: My File
header-includes: |
<style>
body {
font-family: "Liberation Sans";
}
</style>
---
I still don't see the fundamental difference in this aspect between coming from Markdown instead of LaTeX, and going to HTML instead of PDF.