Weave.jl icon indicating copy to clipboard operation
Weave.jl copied to clipboard

Insert pagebreak and inserting other html

Open jessebett opened this issue 6 years ago • 3 comments

I would like to insert a pagebreak when weaving to pdf.

From https://stackoverflow.com/questions/22601053/pagebreak-in-markdown-while-creating-pdf#29642392 it appears that standard markdown has a way to insert raw html/css which would allow: <div style="page-break-after: always;"></div>

However, it doesn't appear that this is escaped by Weave Markdown. Is there a way to break to html like standard markdown? Or otherwise insert a pagebreak?

jessebett avatar Oct 01 '19 20:10 jessebett

Hey,

a friend of mine had the same problem and I came up with a hacky workaround.

``\hskip0pt$\clearpage$\hskip0pt``

This compiles to:

$\hskip0pt$\clearpage$\hskip0pt$

The \hskip0pt is required because a double dollar $$ isn't valid TeX.

Alternatively you can use the following:

$\]\clearpage\[$

This compiles to:

\[\]\clearpage\[\]

But I think it might insert some unwanted spaces.

I couldn't find a way to do it less hacky, since

\clearpage just doesn't do anything ``\clearpage`` compiles to $\clearpage$ which isn't valid

Kind regards, ambiso

ambiso avatar Apr 11 '20 12:04 ambiso

it would be useful to have a raw tex or similar code block

Moelf avatar Jan 03 '22 20:01 Moelf

@Moelf just had the same issue as you today!

Thanks to @ambiso for the hack, hoping we can add the possibility to do it directly one day :)

AhmedSalih3d avatar Oct 21 '23 14:10 AhmedSalih3d