Skip to content

Commit c05b994

Browse files
committed
ENH: Used minted for code syntax highlighting
1 parent f1f7eaa commit c05b994

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
*.pdf
99
*.ps
1010
*.toc
11+
_minted-*/

Document/LaTeX/ArticleExample.tex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
\documentclass{InsightArticle}
1010

1111
\usepackage[dvips]{graphicx}
12+
\usepackage{color}
13+
\usepackage{minted}
14+
\definecolor{ltgray}{rgb}{0.93,0.93,0.93}
15+
\usemintedstyle{emacs}
1216

1317
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1418
%
@@ -152,13 +156,11 @@ \section{Pointing to other material}
152156
The format of this LaTeX file, allows authors to include code snippets, like
153157
the following
154158

155-
\small
156-
\begin{verbatim}
159+
\begin{minted}[baselinestretch=1,fontsize=\footnotesize,linenos=false,bgcolor=ltgray]{cpp}
157160
typedef itk::Image< unsigned char, 3 > ImageType;
158161

159162
ImageType::Pointer image = ImageType::New();
160-
\end{verbatim}
161-
\normalsize
163+
\end{minted}
162164

163165
and to cite the online documentation of the Insitght Toolkit, for example, the
164166
link to the doxygen documentation of the ImageToImageFilter

Document/LaTeX/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ ${NAME}.bbl: ${BIBTEXDATABSENAME}.bib ${NAME}.aux
3434

3535

3636
${NAME}.dvi: ${NAME}.tex ${BIBTEXDATABSENAME}.bib
37-
latex ${NAME}.tex
37+
latex -shell-escape ${NAME}.tex
3838
bibtex ${NAME}
39-
latex ${NAME}.tex
40-
latex ${NAME}.tex
39+
latex -shell-escape ${NAME}.tex
40+
latex -shell-escape ${NAME}.tex
4141

4242

4343
${NAME}.aux: ${NAME}.tex ${BIBTEXDATABSENAME}.bib
44-
latex ${NAME}.tex
44+
latex -shell-escape ${NAME}.tex
4545

4646

4747
clean:

0 commit comments

Comments
 (0)