I'm trying out pandoc to convert markdown snippets in to tex, but for some reason it never converts headings. Here is the command I run, and the output I get:

$ pandoc -f markdown -t latex src.md
\# Heading

\#\# Subheading

Some \& ampersands.

``Here's a quote.''

  Here's a list.
  One more item.



Instead of converting # into \section, it treats it as a character that needs escaping, similarly to ampersands. What am I doing wrong?


The wrong escape is most likely because you are not starting the line with a #. That is, you input is

 # Heading (note space at beginning)

instead of

# Heading
  • The snippet I pasted is pandoc's output – my input file, of course, doesn't contain the escape characters, but regular heading indicators (#, ##, etc). This is my problem – pandoc seems to add the escape characters during conversion.
    – Elise
    Sep 19 '16 at 16:26
  • 1
    Can you add what your input file is and what version of pandoc you are using.
    – Aditya
    Sep 19 '16 at 19:37
  • @Elise: See updated answer
    – Aditya
    Sep 19 '16 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.