17
You can use eso-pic to place content in the ForeGround in the centre of every page:
\documentclass{article}
\usepackage{eso-pic,xcolor,lipsum}
\AddToShipoutPictureFG{%
\AtPageCenter{%
\color{red}%
\makebox[0pt]{\rule{250pt}{2pt}}%
\makebox[0pt]{\rule[-250pt]{2pt}{500pt}}%
}%
}
\begin{document}
\lipsum[1-50]
\end{document}
answered Jul 11 '17 at 5:13
Werner
530k107107 gold badges12381238 silver badges20382038 bronze badges
12
You could use the standalone class in combination with a minipage of the same width as the text in your main document:
\documentclass{standalone}
\usepackage{lipsum}
\begin{document}
\begin{minipage}{345pt}
\lipsum[2]
\end{minipage}
\end{document}
To find out what the width of the text in your main document is, the showdim package offers the \tenthpt ...
answered Nov 11 '18 at 13:03
samcarter_is_at_topanswers.xyz
107k1111 gold badges152152 silver badges405405 bronze badges
11
For example, there is a paragraph with four lines, two lines are at the bottom of the column A and two lines are at the top of the next column B.
Then, one or more words are removed with the result that TeX breaks the paragraph in three lines instead of four.
The document has set \clubpenalty and \widowpenalty to 10000 to prevent widows and orphans (page ...
answered Jan 27 '18 at 20:14
Heiko Oberdiek
252k2020 gold badges640640 silver badges10021002 bronze badges
10
Use pdfcrop:
\documentclass{article}
\usepackage{lipsum} % for mock text
\pagestyle{empty} % no page ornaments
\begin{document}
\lipsum[1]
\end{document}
Save this as shortdoc.tex and run
pdflatex shortdoc
pdfcrop shortdoc
This will produce shortdoc-crop.pdf, that you can include with \includegraphics.
answered Nov 11 '18 at 15:33
egreg
901k113113 gold badges23022302 silver badges37643764 bronze badges
10
I prefer an implementation with expl3, which is a bit complicated by the mixture with TikZ.
\documentclass{article}
\usepackage{tikz}
%\usepackage{xparse} % not needed for LaTeX 2020-10-01 or later
%Define macros for drawing every 0-9 numbers at unit place
\NewDocumentCommand{\cistercianzero}{}{\draw[black, thick] (0,-0.5)--(0, 0.5)}
\NewDocumentCommand{\...
answered Nov 25 '20 at 21:06
egreg
901k113113 gold badges23022302 silver badges37643764 bronze badges
9
default fraction of text on a page require more space than it is available on page with your big picture. this ratio you can change with \renewcommand{\textfraction}{0.07}. so try the following:
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{graphicx}
\renewcommand{\textfraction}{0.07} % allow minimal text w. figs
\usepackage{lipsum}
...
9
Define a suitable counter representation that expands to three digits: add a 0 if the number is less than 100 and a further one if the number is less than 10.
\documentclass{article}
\usepackage[a6paper,bottom=2cm]{geometry} % for small pictures
\makeatletter
\newcommand{\arabicthree}[1]{\expandafter\@arabicthree\csname c@#1\endcsname}
\newcommand{\@...
answered Apr 13 '20 at 15:16
egreg
901k113113 gold badges23022302 silver badges37643764 bronze badges
8
You can almost never accurately reference the page counter from within the main document, only during the output routine where the page being shipped out is accurately known. Luatex does not change the basic model of the way TeX pages are output so the same applies in luatex.
In your lua loop you can use
mcount=mycount+1
tex.print('\\includegraphics{...
answered Feb 21 '18 at 19:25
David Carlisle
603k5252 gold badges13621362 silver badges21532153 bronze badges
7
Page numbers are typically inserted as part of the page style. An empty page style removes both header and footer from your document, which is probably what happened here.
Remove \pagestyle{empty} from your code in order to restore the page numbering.
answered Dec 27 '17 at 20:29
Werner
530k107107 gold badges12381238 silver badges20382038 bronze badges
7
Welcome to TeX.SE.! As far as I know, a .pdf or .dvi file can not have such a functionality (for whole pages). But it can have it for comments... something that I suppose is not enough for you. If you open any pdf (or dvi) by using any viewer of your system, you will see that all the pages are visible. So, the I don't think you can do it with just a pdf or ...
7
One solution could be xr-hyper:
curriculum.tex:
\documentclass[twocolumn]{article}
\usepackage{xr-hyper}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\externaldocument{001}
\externaldocument{002}
\usepackage{nameref}
\parindent0pt
\begin{document}
\section*{\em\centering Curriculum vitae}
\ref{pub}. \nameref{pub} \dotfill \pageref{pub}\par
\ref{books}...
7
Overview
As noted elsewhere, columnsets cannot be mixed with regular text. As such, the given approach will not work as expected. Also, mixedcolumns do not provide the ability for unequal columns. The following changes resolve the issues:
Use the newcolumnsets module, also known as page grids
Ensure that the layout is using grids
Remove the illustration ...
7
There are differences between how the width of a tcolorbox environment and a \draw grid are determined.
In a tcolorbox environment, its total natural width is exactly \linewidth. Here the entire left and right rules are drawn within that width.
In a \draw (0, 0) grid (1, 1);, its total width is "1cm + line width", because tikz draws a line with ...
7
The whole thing using TikZ
After one commenter asked why I didn't do the whole titlepage in TikZ, I couldn't find rest until I've tried. Here is the result. I'm sure, the left aligned positioning in the center can be optimized. If anyone knows how, just drop me a line and I'll edit.
The code is a lot shorter and cleaner now:
\documentclass{article}
\...
5
I suppose your MWE is something like
\documentclass[10pt,b5paper,dvipdfmx]{jreport}
\begin{document}
foo
\end{document}
and typeset this using pLaTeX and dvipdfmx, which indeed produces an A4-sized PDF. The reason for this is that the b5paper option just tells jreport to lay out the content in a B5-sized domain but is not related to the actual page size of ...
5
\xpatchcmd (from xpatch) has the same format/interface than its counterpart \patchcmd (from etoolbox):
\xpatchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\xpatchcmd searches for <search> in <cmd> and replaces it with <replace>. If this search-and-replace is successful, it executes <success>, ...
answered Feb 2 '18 at 5:41
Werner
530k107107 gold badges12381238 silver badges20382038 bronze badges
5
You can rotate and displace the shipout box. But you can't rotate the "pdf background", the pdf reference allows only multiples of 90.
\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}
\usepackage{graphicx,atbegshi}
\begin{document}
\lipsum
\AtBeginShipoutNext{%
\setbox\AtBeginShipoutBox=\hbox{%
\rotatebox{35}{\hspace{-4cm}\box\AtBeginShipoutBox}% ...
answered Jun 20 '18 at 7:46
Ulrike Fischer
269k1616 gold badges401401 silver badges845845 bronze badges
5
Regarding the \put(0,0){\line(3,-0.35){4}} inside the picture environment of your example, it is a failed attempt to draw a line of length 4 (expressed in terms of \unitlength) starting from point (0,0) and going in direction (3,-0.35). This can't work well, because:
you haven't specified the value of \unitlength, thus you get the default of 1pt (combined ...
5
Basing on the answer of muzimuzhi Z, I suggest a variant with a single box which integrates drawing the grid:
\documentclass[a4paper]{article} % DINA4 (210 × 297 [mm])
\usepackage[%showframe=true,
width=16cm,
height=26cm,
]{geometry}
\pagestyle{empty}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\begin{document}
\newlength{\gridlinewidth}
\setlength{\...
5
You can use the shipout hooks. But you will have to adjust the values to your needs - the starting point is the left upper corner (so I had to use -10pt to get the text on the page).
\documentclass{book}
\usepackage{lipsum}
\begin{document}
\AddToHook{shipout/background}[mypic]
{
\put(0,-\textheight){0, -textheight}
\put(\textwidth,-\textheight){...
answered Oct 29 '20 at 19:43
Ulrike Fischer
269k1616 gold badges401401 silver badges845845 bronze badges
4
Note the use of the undocumented feature of \includegraphics.
\documentclass{article}
\usepackage{pdfpages}
\newlength{\tempwidth}
\begin{document}
\settowidth{\tempwidth}{\includegraphics[page=1]{lipsum.pdf}}
\includepdf[fitpaper,pages=1,trim={0 0 {.5\tempwidth} 0},clip]{lipsum.pdf} % ***
\end{document}
4
This works for me:
\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\begin{document}
\centering % just to avoid overfull box
\includegraphics[page=2,max size={\textwidth}{0.9\textheight}]{l3fp}
\end{document}
answered Apr 23 '14 at 14:17
egreg
901k113113 gold badges23022302 silver badges37643764 bronze badges
4
Use \vspace*{\fill} instead of \vspace*{18cm} at the beginning of the titlepage environment. The 18cm are to high and so the (unneeded?) \\ results in a page break.
\documentclass
[paper=a4, % A4
twoside=off, % nicht doppelseitig setzen
DIV=13, % Vordefinierte Seitenränder (15=min, 0=max)
fontsize=12pt, % default font size
BCOR=15.0mm, % ...
4
If I understand you rightly, then you can use the standard memoir commands to change the document page layout.
The only catch is that the size of the type set text block isn't automatically changed by memoir. Changing this mid-document can be a bit tricky, but you can copy what the geometry package does to do this provided you also surround things with a ...
4
There are two complications here.
Firstly, every call to \directlua runs immediately, so if you want TeX's usual processing to happen, you need to relinquish control to TeX (and use coroutines or something). So when you have
\directlua{for i = 1, 60 do tex.print(tex.count['c@page'])
tex.print([[\par]]) end}
}
as in the question, this simply puts 60 ...
4
This is a very basic solution which just reads the value of the LaTeX counter page in Lua (printing is for testing, but the tex.count statement can be used at other places as well).
\documentclass{article}
\newcommand\printluapage{%
\directlua{tex.print(tex.count['c@page'])}
}
\begin{document}
\printluapage\clearpage\printluapage\clearpage\...
4
The problem of interleaving is partly solved in ConTeXt. You can access the page number from within Lua and it is updated at some point but the problem David described in his comment persists.
\starttext
\startluacode
for i = 1, 60 do
context(context.currentpage)
context.par()
end
\stopluacode
\stoptext
answered Feb 21 '18 at 20:01
Henri Menke
100k1414 gold badges214214 silver badges353353 bronze badges
4
Here it goes :)
I created two macros: \startpreview and \endpreview.
Their behavior:
Everything after a \startpreview will be written to the output pdf.
Everything starting from the page after an \endpreview will be discarded, unless a \startpreview overrides this.
How they work:
I defined two counters (I couldn't make it work with a \newif, for some ...
answered Mar 2 '18 at 22:53
Phelype Oleinik
58k1919 gold badges113113 silver badges188188 bronze badges
4
I'm adding another answer because the previous one almost works and because it is a completely different approach.
I defined the same two commands; \startpreview and \endpreview.
Their behavior:
The \startpreview macro defines a \prevpage macro that holds the current page number. The \endpreview macro will complete this page range crating a macro with ...
answered Mar 5 '18 at 13:41
Phelype Oleinik
58k1919 gold badges113113 silver badges188188 bronze badges
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
page × 209page-numbering × 19
tables × 17
numbering × 16
page-breaking × 16
pdf × 12
margins × 11
header-footer × 9
titles × 9
layout × 9
floats × 8
geometry × 8
graphics × 7
two-column × 7
number × 7
spacing × 6
table-of-contents × 6
longtable × 6
memoir × 6
pdftex × 5
formatting × 5
text × 5
multicolumn × 4
double-sided × 4
tikz-pgf × 3