mirror of
https://github.com/Wandmalfarbe/pandoc-latex-template.git
synced 2025-02-21 17:57:07 +00:00
Merge pull request #67 from wollanup/master
Add option to avoid page break in listings
This commit is contained in:
commit
bec1b56658
@ -74,6 +74,9 @@ This template defines some new variables to control the appearance of the title
|
||||
- `listings-disable-line-numbers` (defaults to `false`)
|
||||
|
||||
disables line numbers for all listings
|
||||
- `listings-no-page-break` (defaults to `false`)
|
||||
|
||||
avoid page break inside listings
|
||||
- `disable-header-and-footer` (default to `false`)
|
||||
|
||||
disables the header and footer completely on all pages
|
||||
|
@ -262,6 +262,11 @@ $if(listings)$
|
||||
\usepackage{listings}
|
||||
\newcommand{\passthrough}[1]{#1}
|
||||
$endif$
|
||||
$if(listings-no-page-break)$
|
||||
\usepackage{etoolbox}
|
||||
\BeforeBeginEnvironment{lstlisting}{\par\noindent\begin{minipage}{\linewidth}}
|
||||
\AfterEndEnvironment{lstlisting}{\end{minipage}\par\addvspace{\topskip}}
|
||||
$endif$
|
||||
$if(lhs)$
|
||||
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
|
||||
$endif$
|
||||
|
Loading…
x
Reference in New Issue
Block a user