[Tex/LaTex] Pandoc doesn’t convert markdown headings into sections

conversionmarkdownpandoc

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.''

\begin{itemize}
\tightlist
\item
  Here's a list.
\item
  One more item.
\end{itemize}

\textbf{Bold}

\emph{emph}

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

Best Answer

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