Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please don't use LaTeX package/document commands without including them (\tightlist) #4

Open
oscarcarlsson opened this issue May 9, 2015 · 5 comments

Comments

@oscarcarlsson
Copy link

When converting from markdown to LaTeX I noticed that an unsupported command was used in the itemize environment.

Given the following input (in Markdown):

Test:

 - One
 - Two
 - Three

The following LaTeX was produced:

Test:

\begin{itemize}
\tightlist
\item
  One
\item
  Two
\item
  Three
\end{itemize}

The \tightlist command is most likely from the memoir class which is not included or indicated in any way.

If possible, remove this command or indicate which document class or package is required to compile the output succesfully.

@maxheld83
Copy link

similar issue in this other pandoc wrapper, rmarkdown: rstudio/rmarkdown#439

@ozanmakes
Copy link
Owner

This is related to a recent change in pandoc. I don't know much about latex but I think pandoc assumes inclusion of it's latex template. Any suggestions on how to approach this?

therealmarv added a commit to therealmarv/phd_thesis_markdown that referenced this issue May 31, 2015
lukasmartinelli pushed a commit to manuelroth/osm2vectortiles-thesis that referenced this issue Sep 15, 2015
davideparisi added a commit to davideparisi/beamer-template that referenced this issue Nov 18, 2015
fix \thighlist problem with newer version of pandoc (ozanmakes/markup.rocks#4)
olehermanse added a commit to fui/fui-kk that referenced this issue Apr 8, 2018
See: ozanmakes/markup.rocks#4

Signed-off-by: Ole Herman Schumacher Elgesem <oleherman93@gmail.com>
davejm pushed a commit to davejm/dissertation-report that referenced this issue Jul 23, 2018
@jtpereyda
Copy link

jtpereyda commented Jul 31, 2018

You can use the pandoc --standalone option to make a LaTeX file that includes everything necessary.

If you want to build snippets with pandoc, the only way I know of is to use --standalone and then copy everything out before the content and put it into my main LaTeX file.

There's also a LaTeX template provided by pandoc I'm not clear on how to use.

@nodingneu
Copy link

Pandoc also adds images using \includegraphics{} without import \usepackage{graphicx}, so the generated .tex is unusable out-the-box.

@JohnLukeBentley
Copy link

This is still an issue when using pandoc custom templates, as of pandoc 2.13.

A workaround is to copy the \tightlist command as defined in pandoc's default.latex template file. E.g. to produce a (minimal) custom pandoc template like

\documentclass{article}
$if(title)$
\title{$title$}
$endif$

% Must use to prevent a pandoc bug, where all headers are unconditionally
% inserted with a \hypertarget command See:
% https://github.com/jgm/pandoc/issues/7264
\usepackage{hyperref}

% Avoid pandoc bug when there are lists in the body. 
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

\begin{document}
\maketitle
$body$
\end{document}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants