Skip to main content
30 votes
Accepted

How to center a multiline equation?

Use a gathered environment inside the equation environment: \documentclass{article} \usepackage{amsmath} % for "gathered" env. \begin{document} \begin{equation}\label{eq1} \begin{gathered}...
Mico's user avatar
  • 515k
22 votes
Accepted

align, aligned and R Markdown

So, just to be clear (as it says this is unanswered), just write the align (without $$): \begin{align} a_1 &= \beta_0 \\ b_1 &= \beta_1 \\ c_1 &= \beta_2 \\ d_1 &= \beta_3 \end{align} ...
John M's user avatar
  • 346
18 votes

(error) \tightlist (converting .md file into .pdf using pandoc)

Pandoc doesn't use \tightlist if you leave a blank line between each item, e.g. - one - two versus - one - two The same is true for enumerated lists. This is the LaTeX version of "loose" and "...
Heather Turner's user avatar
15 votes
Accepted

How to underline links with pandoc?

The following document, when converted with pandoc generated underlined links in the resultant PDF. However, as noted in the comments to the linked question here Underlined links with hyperref ...
Alan Munn's user avatar
  • 220k
15 votes

Circled numbers ❶, ❷, etc. as bullets and in paragraphs

Option 1: Use a font with the glyphs as DejaVu Sans. Option 2: Use the pifont package. \documentclass{article} \usepackage{fontspec} \setmainfont{DejaVu Sans} \usepackage{pifont} \begin{document} ❶ ❷...
Fran's user avatar
  • 82.6k
14 votes
Accepted

Pandoc - changing the layout when compiling markdown

As documented in the pandoc manual, you can either specify the margin in the YAML header of your markdown file: --- geometry: margin=30mm ... Or you can pass the value as a variable on the command ...
DG''s user avatar
  • 22k
14 votes

Circled numbers ❶, ❷, etc. as bullets and in paragraphs

You can set up the negative circled numbers to use a font of your choice which contains them. I used Noto Serif CJK SC because it was the first serif font I found on my system that supported all the ...
David Purton's user avatar
  • 26.4k
13 votes
Accepted

How can I reformat a table? Using Markdown > Pandoc > PDF

Pandoc does not support vertical lines in tables, see https://github.com/jgm/pandoc/issues/922 for some discussion. A workaround is to modify the implementation of longtable from the Pandoc preamble ...
Marijn's user avatar
  • 38.9k
12 votes

How to change the background color and border of a Pandoc-generated blockquote?

You simply need to use LaTeX code if you are going to produce a LaTeX document. A very simple example: % mystylefile.pandoc \usepackage{tcolorbox} \newtcolorbox{myquote}{colback=red!5!white, colframe=...
jon's user avatar
  • 22.4k
12 votes

How to use PanDoc to derive output from LaTeX and TikZ to a DOCX file?

Pandoc doesn't know how to handle TikZ environments. However, you can use a Lua filter to teach pandoc. Specifically, one can use the method outlined in the building images with TikZ example. The ...
tarleb's user avatar
  • 735
12 votes

How to generate a bibliography with pandoc?

I was able to generate the bibliography by adding --citeproc: pandoc --bibliography=test.bib --citeproc -o test.pdf test.md
Jimmy2027's user avatar
  • 341
11 votes
Accepted

Convert pandoc-style citations to the LaTeX cite format

There is no built-in feature in pandoc that compiles pandoc-style citations to the cite package format. A quick workaround would be to first use the --natbib flag in pandoc to convert to natbib: ...
sebpardo's user avatar
  • 226
11 votes

Pandoc: Markdown to PDF, without cutting off code block lines that are too long

There is a really simple solution, using fvextra, recently suggested by jannick0. Modify your YAML header options to include \usepackage{fvextra} \DefineVerbatimEnvironment{Highlighting}{Verbatim}{...
Clément's user avatar
  • 5,651
11 votes

Pandoc LaTeX to .docx, change font size

Pandoc supports only a small subset of LaTeX commands and \scriptsize is not one of them. Why does it work anyway? Because unrecognized LaTeX (or ConTeXt or HTML) commands are passed unchanged to the ...
DG''s user avatar
  • 22k
11 votes
Accepted

How do I adapt a standard LaTeX template for Pandoc (in a Docker container, not using RStudio/knitr )

1. A pandoc latex template is just a regular latex file with some placeholder variables in it. You can print the default template with pandoc -D latex > default.latex. This means, that you can use ...
DG''s user avatar
  • 22k
10 votes

How to change the background color and border of a Pandoc-generated blockquote?

Using jon's answer and the latest version of pandoc, I was able to put the commands in the front matter of the markdown itself using header-includes: as follows: metadata.yml: header-includes: - \...
Fuhrmanator's user avatar
10 votes
Accepted

Sections not being numbered after converting with pandoc

According to the docs, you can control whether or not to number sections with the --number-sections (or -N) command line flag. So, if you want numbered sections, your build command might look like the ...
Alexander Von Moll's user avatar
10 votes
Accepted

Convert LaTeX to HTML with MathJax

Update: It is possible to use the direct colors now. Try this version of colortbl.4ht: % colortbl.4ht (2019-11-21-17:51), generated from tex4ht-4ht.tex % Copyright 1997-2009 Eitan M. Gurari % ...
michal.h21's user avatar
  • 51.3k
10 votes
Accepted

Pandoc cannot parse equation with a fraction

Beside that $$...$$ syntax is not recommended in LaTeX, it is unclear what are you doing really. There are not an input latex file in the command line, but guessing that is $$ \frac{1}{2} $$ Saving ...
Fran's user avatar
  • 82.6k
9 votes

Pandoc: Markdown to PDF, without cutting off code block lines that are too long

One does not need a listings-setup.tex in order for this to work. Just add this to your YAML-Header include: header-includes: - \usepackage{xcolor} - \lstset{breaklines=true} - \lstset{...
hda's user avatar
  • 315
9 votes
Accepted

With Pandoc, how to apply a style to a "fenced div" block?

You need a lua filter to process the fenced div: function Div(el) if el.classes[1] == "special" then -- insert element in front table.insert( el.content, 1, pandoc.RawBlock("...
DG''s user avatar
  • 22k
8 votes

LaTeX + Biblatex bibliography to other formats via Pandoc

I never got this example generating any citations on my Windows 10 machine. Only after adding --citeproc did the citations appear. For future reference one can try pandoc --bibliography=foo.bib -o ...
mikki's user avatar
  • 81
8 votes
Accepted

spacing in cases

Use aligned: \documentclass{article} \usepackage{amsmath} \usepackage[math-style=TeX]{unicode-math} \setmathfont{STIX Two Math} \newcommand{\dd}{\mathop{}\!\mathrm{d}} \begin{document} \[ \begin{...
egreg's user avatar
  • 1.1m
8 votes
Accepted

ConTeXt: Circumventing pandoc's deprecated starttable usage

My Pull Request ConTeXt writer: Use xtables instead of Tables #4223 has been merged into the master branch and will thus be part of the next release of pandoc. Extreme Tables The Markdown input ...
Henri Menke's user avatar
8 votes
Accepted

Concat multiple md files in a tex file using XeLatex

Remove the -s (standalone) option. By default the LaTeX output is not a complete document but only the contents of the document environment, ready to be included. Alternatively, you can also ...
Fran's user avatar
  • 82.6k
8 votes

Algorithm pseudocode in markdown

Thanks to TeXnician for pointing in the right direction: I was including the preamble inside the markdown. After searching I figured out the solution. It seems that the only thing that needs to be in ...
monti's user avatar
  • 151
8 votes

Andika fractions

TL;DR: You need to tell pandoc, which font to use in the YAML header: --- mainfont: Andika mainfontoptions: - CharacterVariant=1 - CharacterVariant=4 - CharacterVariant=6 - CharacterVariant=7 ...
DG''s user avatar
  • 22k
8 votes
Accepted

Multi line titles with pandoc

Alternatively (to retain the title in PDF properties), use the following format: title: | Data Cleaning and Featurization to Support \ Data Mining in the SomethingSomething Dataset
priiduonu's user avatar
  • 341
8 votes
Accepted

R Markdown/pandoc: Change how code blocks are converted to LaTeX

Thanks to @AlanMunn, I found at least 2 solutions that work for code chunks with undefined language. Both are pandoc-specific, and don't actually require rmarkdown (examples for both can be found here)...
Thunderbeef's user avatar
8 votes

Package amsmath Error: Erroneous nesting of equation structures

The {align} or {align*} environment is like the {equation} or {equation*} environments and are used for arranging equations of multiple lines. (Use the asterisk to avoid automatic numbering of ...
Sean Hare's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible