I already know about \par\vspace*{\fill}
to align a piece of text at the bottom of page (image below, left); but how do I do this with tikz
?
Only thing close I can find is aligning to current page.base
with anchor=south
– but that aligns to bottom of page, as shown on image below right (code below; click on image for full resolution):
Here is the code used for this image (both compiled with pdflatex test.tex
):
left side test.tex
:
\documentclass[letterpaper,12pt]{article}
% \typeout{ == \the\paperwidth / \the\paperheight ==}
% \typeout{ == \the\pdfpagewidth / \the\pdfpageheight ==}
\pdfpagewidth=\paperwidth \pdfpageheight=\paperheight
% to extract numbers from lengths: % tex.se:15001
% NOTE: \getlength gets numeric portion as pt always;
\makeatletter
\newcommand*{\getlength}[1]{\strip@pt#1}
\makeatother
\usepackage{lipsum}
\begin{document}
% display page margins based on \textwidth/height
\edef\mw{\getlength{\textwidth}}
\edef\mh{\getlength{\textheight}}
\edef\mp{\getlength{\parindent}}
\newlength{\tmv}
\setlength{\tmv}{\textwidth}
\addtolength{\tmv}{-\parindent}
\edef\mv{\getlength{\tmv}}
\begin{picture}(0,0)
\put(-\mp,0) {\line(1,0){\mw}}
\put(-\mp,0) {\line(0,-1){\mh}}
\put(\mv,0) {\line(0,-1){\mh}}
\put(-\mp,-\mh) {\line(1,0){\mw}}
\end{picture}
\lipsum[1]
\par\vspace*{\fill} % \vfill no dice here
\frame{\begin{minipage}{\textwidth}%
\centering%
Please consider
this information
very carefully.
\end{minipage}}
\end{document}
right side test.tex
:
\documentclass[letterpaper,12pt]{article}
% \typeout{ == \the\paperwidth / \the\paperheight ==}
% \typeout{ == \the\pdfpagewidth / \the\pdfpageheight ==}
\pdfpagewidth=\paperwidth \pdfpageheight=\paperheight
% to extract numbers from lengths: % tex.se:15001
% NOTE: \getlength gets numeric portion as pt always;
\makeatletter
\newcommand*{\getlength}[1]{\strip@pt#1}
\makeatother
\usepackage{lipsum}
\usepackage{tikz}
\begin{document}
% display page margins based on \textwidth/height
\edef\mw{\getlength{\textwidth}}
\edef\mh{\getlength{\textheight}}
\edef\mp{\getlength{\parindent}}
\newlength{\tmv}
\setlength{\tmv}{\textwidth}
\addtolength{\tmv}{-\parindent}
\edef\mv{\getlength{\tmv}}
\begin{picture}(0,0)
\put(-\mp,0) {\line(1,0){\mw}}
\put(-\mp,0) {\line(0,-1){\mh}}
\put(\mv,0) {\line(0,-1){\mh}}
\put(-\mp,-\mh) {\line(1,0){\mw}}
\end{picture}
\lipsum[1]
\begin{tikzpicture}[overlay,remember picture,inner sep=0pt, outer sep=0pt]
\path[anchor=south] (current page.base) node[above] (textInfo) {% (286.45807,94.70213)
\frame{\begin{minipage}{\textwidth}%
\centering%
Please consider
this information
very carefully.
\end{minipage}}
};
\end{tikzpicture}
\end{document}
To generate image:
convert -density 150 -bordercolor LimeGreen -border 2 test.pdf test1.png #left
convert -density 150 -bordercolor LimeGreen -border 2 test.pdf test2.png #right
montage test1.png test2.png -geometry +2+2 -tile 2x1 test.png
Many thanks in advance for any answers,
Cheers!
Best Answer
This is relatively easy with the
tikzpagenodes
package by Martin Scharrer:Output: