I want to place two texts in a box with dimensions of 100*\textwidth, one in the center and one at the top or bottom using standard LaTeX without packages. I achieved this using tabular
as follow:
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\begin{center}
\fbox{
\parbox{\textwidth}{
\centering\begin{tabular}{c}
\textbf{\large }\\[2cm]
\textbf{\huge This is a title}\\[2cm]
\textbf{\large This is a small text}
\end{tabular}
}
}
\end{center}
\end{document}
I want to know is there a simpler way for this? e.g. using \parbox
and \raisebox
? I tried to generate it using \parbox
, but after adding the second text, the center text no longer stays centered. same problem using vbox
(I know how to fix it using \phantom
or \setbox
but I am looking for a clean way)
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\fbox{
\centering\vbox{\vskip 2cm
\mbox{\textbf{\huge This is a title}}
\vskip 2cm
\mbox{\textbf{\large This is a subheading}}
}
}
\end{document}
\vbox
and\vskip
nothing in your code is primitive TeX. I guess you mean standard LaTeX without packages.%
at ends of lines or @egreg gets very unhappy