If I use fenced code block within pandoc markdown it produces reasonable LaTeX ouptut:
<code>pagebreak
```python
foo = 1
```
</code>
<code>pagebreak
```python
foo = 1
```
</code>
pagebreak
```python
foo = 1
```
<code>pandoc input.md -o output.tex
</code>
<code>pandoc input.md -o output.tex
</code>
pandoc input.md -o output.tex
<code>pagebreak
begin{Shaded}
begin{Highlighting}[]
NormalTok{foo }OperatorTok{=} DecValTok{1}
end{Highlighting}
end{Shaded}
</code>
<code>pagebreak
begin{Shaded}
begin{Highlighting}[]
NormalTok{foo }OperatorTok{=} DecValTok{1}
end{Highlighting}
end{Shaded}
</code>
pagebreak
begin{Shaded}
begin{Highlighting}[]
NormalTok{foo }OperatorTok{=} DecValTok{1}
end{Highlighting}
end{Shaded}
But if I replace pagebreak
LaTeX command with an environment command, fenced code block will not work anymore:
<code>begin{minipage}{textwidth}
```python
foo = 1
```
end{minipage}
</code>
<code>begin{minipage}{textwidth}
```python
foo = 1
```
end{minipage}
</code>
begin{minipage}{textwidth}
```python
foo = 1
```
end{minipage}
<code>pandoc input.md -o output.tex
</code>
<code>pandoc input.md -o output.tex
</code>
pandoc input.md -o output.tex
<code>begin{minipage}{textwidth}
```python
foo = 1
```
end{minipage}
</code>
<code>begin{minipage}{textwidth}
```python
foo = 1
```
end{minipage}
</code>
begin{minipage}{textwidth}
```python
foo = 1
```
end{minipage}
It seems that pandoc has some special handling for LaTeX environments which breaks things. Does anyone know where can I search for a solution? I want environment commands to be inserted into output as-is, like all other LaTeX commands, without any special handling.