I consider posting some materials as .jpg
file on my blog which produced from a .tex
document.
This document includes lots of sections which is about 1500-2300 words. I need neither header nor page number. I can also accept the endnotes.
I want each .jpg
file corresponded with just a whole section, as shown by follow images. (The images were transformed from a .pdf
file.)
page i (also section 1)
page ii (also section 2)
page iii (also section 3)
But, I failed on trying to change the page's height on each page. It is seem that the entire document could set only a fixed page size. I think maybe the requirement can be implemented by
On the beginning of every section, put a
\newpage
command.Set a sufficient page height value (as we known, the page size of a
.tex
file can be several meter long).Typeset the file, record (using some technique) the total length of
vbox
at the end of current page.Use the record value to set a new page height.
typeset again, but just typeset the section I needed.
Does above said describe a right way? Could someone tell me how to implement it automatically?
Or is there a more convenient way to achieve the result?
EDIT:
Hi Chris H, the preview
package suppressed the setting of\lineskiplimit
or/and \lineskip
. Try the code below
documentclass{book}
\usepackage[
active, %if annotate the line obtain fig 1
tightpage]{preview}\setlength{\PreviewBorder}{9pt}
\begin{document}
\setlength{\lineskiplimit}{9pt}\setlength{\lineskip}{9pt}
\begin{preview}
\begin{flushleft}
\fbox{It attempt to compare nil with number}
\fbox{It attempt to compare nil with number}
\end{flushleft}
\end{preview}
\end{document}
obtain fig 2.
fig 1
fig 2
So, the substances in each section would be inappropriate.
pdfcrop
(or imagemagick, which you may well be using anyway for the pdf-jpg conversion, to crop the resulting pdf). Unfortunately thestandalone
documentclass ignores\newpage
, otherwise it would be your friend here.standalone
? One only needs to remove the footline with the page numbers with\pagestyle{empty}
and\thispagestyle{empty}
on the first page (article class). Then one can usepdfcrop
and finallygs
with itsjpeg
device (or ratherpng16m
or variants for.png
images). [only trouble will be with footnotes...]preview
. I hadn't considered footnotes, I must admit - I don't know if they're an issue here. One advantage ofpreview
is that it's a simpler workflow than going thorughpdfcrop
as well (generating the "right" pdf then converting it seems more elegant than having to optically crop it.preview
requires more manual mark-up than\clearpage
. (and I don't know if it acts as an environment, in that case it would create a group, which could be annoying. But I should check the doc first).