https://github.com/samuelmarks/pandoc_latex_pygments
Replace `lstlisting` with `minted` blocks in LaTeX
https://github.com/samuelmarks/pandoc_latex_pygments
Last synced: 2 months ago
JSON representation
Replace `lstlisting` with `minted` blocks in LaTeX
- Host: GitHub
- URL: https://github.com/samuelmarks/pandoc_latex_pygments
- Owner: SamuelMarks
- Created: 2015-12-30T14:11:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-30T15:41:41.000Z (over 10 years ago)
- Last Synced: 2024-04-15T01:22:13.473Z (about 2 years ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
pandoc_latex_pygments
=====================
Replace `lstlisting` with `minted` blocks in LaTeX.
## Requirements
Python 2.7. Adding Python 3 support should be trivial.
## Usage
$ python -m pandoc_latex_pygments -h
usage: pandoc_latex_pygments.py [-h] filename
Replace `lstlisting` with `minted` blocks in LaTeX
positional arguments:
filename File to replace `lstlisting` with `minted` in
optional arguments:
-h, --help show this help message and exit
## Example
### Input
random other stuff
\begin{lstlisting}
~~ python
print "hello world"
\end{lstlisting}
more random other stuff
\begin{lstlisting}
~~ java
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
\end{lstlisting}
final random stuff
### Output
random other stuff
\begin{minted}[mathescape, linenos, numbersep=5pt, gobble=2, frame=lines, framesep=2mm]{python}
print "hello world"
\end{minted}
more random other stuff
\begin{minted}[mathescape, linenos, numbersep=5pt, gobble=2, frame=lines, framesep=2mm]{java}
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
\end{minted}
final random stuff