Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verbatim blocks should not span page boundaries when possible #37

Open
istathar opened this issue Jun 20, 2019 · 2 comments
Open

Verbatim blocks should not span page boundaries when possible #37

istathar opened this issue Jun 20, 2019 · 2 comments
Labels
discussion Items for discussion

Comments

@istathar
Copy link
Member

Ideally verbatim environments would not have page breaks in them.

According to this answer on TeX StackExchange, the following has the desired effect:

\begin{Verbatim}[samepage=true]
Some looooong text...
\end{Verbatim}

casual testing shows this to be workable.

At present Pandoc is emitting \begin{verbatim} around fenced code blocks, so we would need to intercept these and instead insert \begin{Verbatim}[samepage=true].

Far better would be if this was simply a package level setting we could recommend and put in the default preamble.

@istathar istathar added the improvement New feature or request label Jun 20, 2019
@istathar
Copy link
Member Author

Ah. Pandoc already expected (and in its default template included, which we then ported to the beginning function in LatexPreamble, which is then emitted as 99_Beginning.latex file in the temporary directory) a \DefineVerbatimEnvironment{Highlighting}{Verbatim}. We can use that to change the initial (aka default) option values for the custom verbatim environment.

@istathar istathar self-assigned this Jun 25, 2019
@istathar
Copy link
Member Author

So the line needs to have the samepage=true option added. But now I'm doubting the wisdom of this. This is typesetting; if someone wants a pagebreak in a different place they can use \clearpage. Hm.

@istathar istathar removed their assignment Jun 28, 2019
@istathar istathar added discussion Items for discussion and removed improvement New feature or request labels Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Items for discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant