Skip to content

Commit

Permalink
LaTeX template: Set default listings language for lua, assembler.
Browse files Browse the repository at this point in the history
Otherwise we get an error when trying to compile code
with lua or assembler code.

To change the default dialect (currenty 5.3 for lua
and x86masm for assembler), you can use `--include-in-header`
to inject something like

    \lstset{defaultdialect=[5.2]Lua}

Closes #5227.
  • Loading branch information
jgm committed Jan 26, 2019
1 parent 7012782 commit 7ccaa77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/templates/default.latex
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ $endif$
$if(listings)$
\usepackage{listings}
\newcommand{\passthrough}[1]{#1}
\lstset{defaultdialect=[5.3]Lua}
\lstset{defaultdialect=[x86masm]Assembler}
$endif$
$if(lhs)$
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
Expand Down
2 changes: 2 additions & 0 deletions test/lhs-test.latex+lhs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
\urlstyle{same} % don't use monospace font for urls
\usepackage{listings}
\newcommand{\passthrough}[1]{#1}
\lstset{defaultdialect=[5.3]Lua}
\lstset{defaultdialect=[x86masm]Assembler}
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
Expand Down

0 comments on commit 7ccaa77

Please sign in to comment.