Created
August 25, 2014 14:56
-
-
Save snim2/99937f8377968ff1439a to your computer and use it in GitHub Desktop.
Example LaTeX listings with mixed alphanumeric keywords
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[12pt]{article} | |
\usepackage{xcolor} | |
\usepackage{listings} | |
\renewcommand{\ttdefault}{pcr} | |
\definecolor{Black}{gray}{0.0} | |
\definecolor{Blue}{rgb}{0.12,0.29,0.53} | |
\lstset{ | |
basicstyle=\color{Black}\ttfamily, % | |
keywordstyle=[1]\color{Blue}\ttfamily\bfseries, % | |
} | |
\lstdefinelanguage{mylang}{ % | |
% keywords={FOO,BAR,BAZ,ARG}, % | |
% otherkeywords={1234,XYZ1234,XYZ1234HelloWorld}, % | |
alsoletter=0123456789, | |
keywords={FOO,BAR,BAZ,ARG,1234,XYZ1234,XYZ1234HelloWorld}, % | |
} | |
\begin{document} | |
\begin{lstlisting}[numbers=none,breaklines=true,caption={},language=mylang] | |
FOO | |
BAR | |
BAZ | |
ARG | |
1234 | |
XYZ1234 | |
XYZ1234HelloWorld | |
\end{lstlisting} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment