2

Just as the title states, how can I get a centered comment 2cm above the bottom of the page?

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Johannes_B Apr 23 '14 at 6:55
  • You could do it using package TikZ or package textpos or ... To give a good answer, a minimal working example (MWE) is something we need. – Johannes_B Apr 23 '14 at 6:56
  • What is the bottom of the page? The end of the body text, just 2cm above the line with the page number (the footer) or under the footer at 27.7cm from the top of the A4? Are you searching a centered \footnote{} or someting different? We need the MWE as \documentclass{article} \usepackage{lipsum} \begin{document} \lipsum[1-4] \end{document} and a clear explanation of what you want obtain exactly in this example. – Fran Apr 23 '14 at 7:14
  • Related/duplicate? tex.stackexchange.com/questions/169808/… – Steven B. Segletes Apr 23 '14 at 12:14
2

You can use Tikz for this stuff.

\documentclass[border=10pt,a4paper]{article}

\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[remember picture,overlay]
\node[yshift=2cm] (text) at (current page.south) {Your text}
\end{tikzpicture}
\end{document}

If you need this on all pages. You should considre using fancyhdr

0

If you are interested in testing a new package which relies on LuaTeX, there's placeat. It is not particularly feature rich at the moment, especially regarding the grid, but it requires less overhead than loading TikZ

Here's an example; compile with lualatex:

% compile with lualatex
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[showframe]{geometry}% 'showframe' lets us see where normal text would go
\usepackage{placeat}
\placeatsetup{
% using A4 paper, make the grid use (approx.) 1cm intervals
  gridnumberx = 28,
  gridnumbery = 21,
  nogrid, % <-- removes the grid
}
% placeat doesn't support centered material (yet?)...
\newcommand*{\cbox}[1]{\makebox[0pt][c]{#1}}

\begin{document}

Normal text up here

\placeat(15,20){\cbox{Special text down here}}

\end{document}
0

I'd say defining a new float with random specifier 'b!' is the most convinient method for solving your problem:

\documentclass{article}
\usepackage{lipsum,microtype}
\usepackage{float}
  \newfloat{comment}{b!}{loc}

\makeatletter
\def\commentname{Comment}
\let\svd@comment=\comment
\let\svd@endcomment=\endcomment
\renewcommand{\comment}[1][b!]{%
  \svd@comment[#1]
  \small
  {\noindent\itshape\commentname.\space}}
\renewcommand{\endcomment}{%
  \vspace{2cm}\null
  \svd@endcomment}
\makeatother

\begin{document}
\lipsum[1-2]

\begin{comment}
  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{comment}

\lipsum[3-5]
\end{document}

An alternative: With the textpos package you can easily place material to an absolute position on the page. A drawback is that it does not detect overlappings. Hence, you have to manage the surrounding text manually:

\documentclass{article}
\usepackage{lipsum,microtype}
\usepackage{fp}
\usepackage[absolute]{textpos}
  \setlength{\TPHorizModule}{1pt}
  \setlength{\TPVertModule}{\TPHorizModule}

\makeatletter
\def\commentname{Comment}
\newcount\oddsidemarginvalue \oddsidemarginvalue62
\newcount\textwidthvalue \textwidthvalue345
\setlength{\oddsidemargin}{\the\oddsidemarginvalue pt}
\setlength{\textwidth}{\the\textwidthvalue pt}
\advance\oddsidemarginvalue by 72
\newcount\y@comment \y@comment630
\newdimen\commentheight
\makeatother

\begin{document}
\makeatletter
\lipsum[1-3]
  \setbox0=\vbox{% measuring the height of the comment
    \small
    {\noindent\itshape\commentname.}
    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.}
  \commentheight=\ht0 \advance\commentheight by \dp0
  \def\commentheightvalue{\strip@pt\commentheight}
  \FPround\commentheightvalue{\commentheightvalue}{0}
  \advance\y@comment by -\commentheightvalue
\begin{textblock}{\the\textwidthvalue}(\the\oddsidemarginvalue,\the\y@comment)
  \small% printing the actual comment body
  {\noindent\itshape\commentname.}
  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{textblock}
\y@comment630
\makeatother
\end{document}

Note that the last example can be easily wrapped into a macro or environment. Now, it is only supposed to be a demo of the facilities of the textblock environment to solve your issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.