Hot answers tagged

142 votes

How to convert a scientific manuscript from LaTeX to Word using Pandoc?

I tried nearly all methods mentioned in other answers. Eventually, and surprisingly, I found the most satisfactory way to convert is to just open the PDF file in MS Word (2013 or newer), which ...
Yebo Liu's user avatar
  • 1,537
80 votes
Accepted

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

The writer.latex file in Pandoc's source code currently defines \tightlist as: \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} This is also currently the case in ...
Andrew Pinkham's user avatar
29 votes

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

I hit the same problem. It seems that pandoc started using \tightlist in \begin{itemize} sections. My workaround was simply to add an empty macro for \tightlist to my template file (I run pandoc with ...
Jan Rychter's user avatar
28 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
  • 490k
24 votes

How to convert a scientific manuscript from LaTeX to Word using Pandoc?

LaTeX2rtf is the easiest and fastest way to convert .tex files to .rtf that can be read by Microsoft Word. Using it is as simple as downloading the program, choosing your .tex file, and pressing run. ...
TPArrow's user avatar
  • 411
23 votes

Bibtex to HTML/Markdown/etc., using Pandoc

As of pandoc-citeproc-0.4 pandoc-citeproc has support for a \nocite{*}-equivalent. mybib.bib file: @article{behbahani2014aircraft, title={Aircraft Integration Challenges and Opportunities for ...
Alexander Von Moll's user avatar
23 votes
Accepted

How to convert LaTex to word using PanDoc and keep citations as numeral

The solution is to use a CSL file to format the citations. I used ieee.csl from https://github.com/citation-style-language/styles pandoc -s foo.tex --bibliography=foo.bib --csl=ieee.csl -o foo.docx
Ahmad's user avatar
  • 1,003
22 votes

Latex Figures appear before text in pandoc markdown

A simple solution is to add a line with a backslash and space immediately after the figure, followed by a blank line: ![Alt text](image.png) \ Some text after the figure... Do not forget the space ...
nedim's user avatar
  • 435
21 votes
Accepted

LaTeX and pandoc templates

Still off-topic but you can print the default template with pandoc -D latex, edit it and put it in your personal data directory ($HOME/.pandoc on linux): pandoc -D latex > ~/.pandoc/default.latex &...
DG''s user avatar
  • 21.4k
19 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
  • 306
17 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
14 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
  • 213k
13 votes

LaTeX and pandoc templates

If you do pandoc -D latex the template is printed. This works for any format. You could save that template as e.g. 'template.latex' and edit it. You can then point Pandoc to the edited template by ...
twsh's user avatar
  • 2,718
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.2k
12 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
  • 21.4k
12 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
  • 35.7k
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 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
  • 21.4k
11 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
  • 675
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
  • 49.4k
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
  • 78.8k
10 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
  • 21.4k
10 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
  • 301
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

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
  • 305
8 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,213
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
  • 78.8k

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