Pages

24 August, 2015

LaTeX/LyX positioning floating text on top of a page

To publish preprint versions of papers, you often need to add a remark on top of the first page. If you do not want to mess around with the final PDF, there is are several ways to add floating text, with absolute positioning.

Here is my current solution.

% optional box and link packages (LyX adds them automatically)
%\usepackage{framed}
%\usepackage{color}
%\usepackage{hyperref}

% import textpos in LaTeX preamble
\usepackage[absolute]{textpos}

% set default positioning parameters
\setlength{\TPHorizModule}{10mm}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{0mm}{0mm} % start content at the top-left corner
\setlength{\parindent}{0pt}

\definecolor{shadecolor}{rgb}{1, 0.80078125, 0}

\begin{textblock}{2}(0,0)
\begin{minipage}[t]{1\paperwidth}%
\begin{shaded}%
\begin{center}
\textbf{\textcolor{blue}{Preprint version for self-archiving.}}\\
The final publication is available at [Name of Publisher] via
\textbf{\href{http://dx.doi.org}{http://dx.doi.org/[DOI Number]}.} 
\end{center}
\end{shaded}%
\end{minipage}
\end{textblock}

The output looks as follows.

No comments: