¿Puedes decirme otra solución para poner una línea de texto al final de una página?

¿Puedes decirme otra solución para poner una línea de texto al final de una página?

Estoy escribiendo una clase de documento en la que quiero poner una línea de texto en la parte inferior del área de texto, después de las notas al pie para que su lugar siempre quede completamente fijo. Una solución para esto es la siguiente:

\documentclass{article}
\usepackage{lipsum,graphicx}
\title{A sample title}
\author{John Doe}

\makeatletter
\def\@maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1em%
{\large \@date}%
\end{center}%
\begin{figure}[!b]
\copyright\ 2022 John Doe \hfill Department of Mathematics
\end{figure}
\par
\vskip 1.5em
}
\makeatother

\begin{document}
\maketitle
Text goes here\footnote{A footnote} and\footnote{Another footnote}
\lipsum[2]
\end{document}

Pero por algunas razones, no quiero utilizar un entorno flotante. ¿Puede sugerirme otra solución (preferiblemente sin cargar paquetes adicionales)?

Respuesta1

Existen posibilidades para realizar un posicionamiento absoluto del texto en una página. Por ejemplo, tikz proporciona medios para hacer esto.


Si se está utilizando una versión reciente de LaTeX donde hay ganchos de envío disponibles, puede agregar código al gancho shipout/foreground.

El gancho shipout/foregroundse refiere a un entorno de imagen con la esquina superior izquierda (0,0) en la esquina superior izquierda de la página y una longitud unitaria de 1 punto.
(Para que sucedan cosas en la página, los componentes y-/segundo de las coordenadas deben ser negativos. Con una versión reciente de LaTeX dentro de un pictureentorno, no es necesario preocuparse por la normalización \dimexpry los registros de longitud \unitlength, ya que se realiza automáticamente).

\documentclass[twoside]{article}

\csname @ifundefined\endcsname{pagewidth}{}{\pagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pdfpagewidth}{}{\pdfpagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pageheight}{}{\pageheight=\paperheight}%
\csname @ifundefined\endcsname{pdfpageheight}{}{\pdfpageheight=\paperheight}%

\usepackage{lipsum}
\title{A sample title}
\author{John Doe}

\makeatletter
\newcommand\foo[1]{#1}
\def\@maketitle{%
\newpage
% If you want this on the titlepage only, use \AddToHookNext instead of \AddToHook
\AddToHook{shipout/foreground}{%
  \put(\dimexpr 1in+\ifodd\thepage\oddsidemargin\else\evensidemargin\fi\relax,
       \foo{\dimexpr-\paperheight+.5\dimexpr\paperheight-(1in+\topmargin+\headheight+\headsep+\textheight+\footskip)+\ht\strutbox\relax\relax})%
  {%
    \hbox to\textwidth{\copyright\ 2022 John Doe \hfill Department of Mathematics}%
  }%
}
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1em%
{\large \@date}%
\end{center}%
\par
\vskip 1.5em
}
\makeatother

\begin{document}
\maketitle
Text goes here\footnote{A footnote} and\footnote{Another footnote}
\lipsum[2]

\newpage

Text goes here\footnote{A footnote} and\footnote{Another footnote}
\lipsum[2]

\end{document}

ingrese la descripción de la imagen aquí


Si se está utilizando una versión de LaTeX no tan reciente, considere cargar el paqueteeso-pic:

El siguiente código proporciona un ejemplo donde el comando\AddToShipOutPicture del paqueteeso-picse combina con un entorno de imagen en el que el comando \putse puede utilizar para posicionar el texto.

\documentclass[twoside]{article}
\usepackage{lipsum,eso-pic}
\title{A sample title}
\author{John Doe}

\makeatletter
\newcommand\ConvertToUnitlength[1]{%
  \strip@pt\dimexpr#1*65536/\number\dimexpr\unitlength\relax\relax
}%
\def\@maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1em%
{\large \@date}%
\end{center}%
% If you want this on every page, use \AddToShipoutPicture.
% If you want this on the title-page only, use \AddToShipoutPicture*.
\AddToShipoutPicture{%
  \vbox to \paperheight{%
    \hsize=\paperwidth
    %----------------------------------------------------
    %       Within the \vbox do whatever you like:
    %       e.g., use a picture-environment:
    %----------------------------------------------------
    \setlength{\unitlength}{1cm}%
    \begin{picture}(\ConvertToUnitlength{\paperwidth},
                    \ConvertToUnitlength{\paperheight})(0,0)%
      % Inside this picture 0,0 is the bottom left corner.
      % Unit is cm.
      % If you wish to use length-parameter or \dimexppr, you can use \ConvertToUnitlength.
      % With recent LaTeX \ConvertToUnitlength is not really needed, but
      % you can use it for hiding ( and ) belonging to a \dimexpr
      % from the scanning for a )-delimiter of a \put-command.
      % You can also use eso-pic's \LenToUnit for this purpose.
      % If you need to learn about length-parameters of page-layout, see the documentation of the package "layout".
      \put(\ConvertToUnitlength{\dimexpr 1in+\ifodd\thepage\oddsidemargin\else\evensidemargin\fi\relax},
           \ConvertToUnitlength{.5\dimexpr\paperheight-(1in+\topmargin+\headheight+\headsep+\textheight+\footskip)+\ht\strutbox\relax})%
      {%
        \hbox to\textwidth{\copyright\ 2022 John Doe \hfill Department of Mathematics}%
      }%
    \end{picture}%
    %----------------------------------------------------
  }%
}%
\par
\vskip 1.5em
}
\makeatother

\begin{document}
\maketitle
Text goes here\footnote{A footnote} and\footnote{Another footnote}
\lipsum[2]

\newpage

Text goes here\footnote{A footnote} and\footnote{Another footnote}
\lipsum[2]

\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

Alternativamente, si le gustan los trucos toscos y si el texto debe aparecer solo en la página de título, y la página de título en cualquier caso contiene notas a pie de página, de modo que se dibuje la regla que separa el texto principal de las notas a pie de página y usted termine la página de título. A través de \newpage, puede utilizar \footnotetextjusto antes \newpagepara colocar una última "nota a pie de página" que contenga su aviso de derechos de autor. Si se utiliza hyperref, las cosas deben envolverse en un NoHyperentorno. No sé cómo interactúa esto con \raggedbottom/ \flushbottom.

\documentclass[twoside]{article}
\usepackage{lipsum,hyperref}
\title{A sample title}
\author{John Doe}

\makeatletter
\def\@maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1em%
{\large \@date}%
\end{center}%
% If you want this on every page, use \AddToShipoutPicture.
% If you want this on the title-page only, use \AddToShipoutPicture*.
\par
\vskip 1.5em
}
\makeatother

\begin{document}
\maketitle
Text goes here\footnote{A footnote} and\footnote{Another footnote}
\lipsum[2]

\begingroup
\makeatletter
\long\def\@makefntext#1{\noindent#1}%
\begin{NoHyper}%
\footnotetext{\par\vspace*{\dimexpr\footskip-2\baselineskip\relax}{\normalsize\copyright\ 2022 John Doe \hfill Department of Mathematics}}%
\end{NoHyper}%
\endgroup
\newpage

Text goes here\footnote{A footnote} and\footnote{Another footnote}
\lipsum[2]

\end{document}

ingrese la descripción de la imagen aquí

información relacionada