Centralize o texto diretamente abaixo de um título alinhado à direita

Centralize o texto diretamente abaixo de um título alinhado à direita

Com o LaTeX, como centralizo o texto diretamente abaixo de um título alinhado à direita? Talvez seja melhor explicado com minha tentativa até agora:

\documentclass{article}
\usepackage[ hmargin = 1in, vmargin = 1in ]{geometry}
\setlength{\parindent}{0pt}
\usepackage{showframe}
\begin{document}

\begin{minipage}{.6\linewidth}\huge Some Heading\end{minipage}
\hfill
\begin{minipage}{.33\linewidth}
    \raggedleft {\huge Another Heading} \\
    \centering  \today
\end{minipage}

\end{document}

O problema é que isso minipagerequer um argumento de largura, então a única maneira de centralizar perfeitamente a segunda linha é adivinhar (antecipadamente) a largura exata que o título terá após ser renderizado. Existe uma maneira melhor?

Responder1

\documentclass{article}
\usepackage[ hmargin = 1in, vmargin = 1in ]{geometry}
\setlength{\parindent}{0pt}
\usepackage{showframe}
\begin{document}

\begin{minipage}[t]{.6\linewidth}\huge Some Heading\end{minipage}
\hfill
\begin{tabular}[t]{@{}c@{}}
\huge Another Heading \\
\today
\end{tabular}

\end{document}

Responder2

A solução de David tabularfunciona muito bem, mas muitas vezes recorro ao uso \makeboxpara criar uma caixa com a largura desejada e alinhar o texto dentro dessa "caixa". Abaixo, mostro como cinserir, alinhar rà direita e là esquerda o texto dentro de uma caixa que é tão larga quanto \widthof{\huge Another Heading}:

insira a descrição da imagem aqui

Notas:

Código:

\documentclass{article}
\usepackage[ hmargin = 1in, vmargin = 1in ]{geometry}
\setlength{\parindent}{0pt}
\usepackage{showframe}
\usepackage{calc}

\begin{document}

\begin{minipage}{.3\linewidth}\huge Some Heading\end{minipage}
\hfill
\begin{minipage}{.4\linewidth}
    \raggedleft {\huge Another Heading} \\
    \makebox[\widthof{\huge Another Heading}][c]{\today} \\
    \makebox[\widthof{\huge Another Heading}][r]{\today} \\
    \makebox[\widthof{\huge Another Heading}][l]{\today}
\end{minipage}

\end{document}

Responder3

Empilhe-o.

\documentclass{article}
\usepackage[ hmargin = 1in, vmargin = 1in ]{geometry}
\setlength{\parindent}{0pt}
\usepackage{showframe}
\usepackage{stackengine}
\begin{document}
{\huge Some Heading}
\hfill
\stackunder[2pt]{\huge Another Heading}{\today}
\end{document}

insira a descrição da imagem aqui

informação relacionada