1

What I'm looking for is for something similar to CSS's vertical-alignment tag in order to align text of different sizes flush with the top of a line vs the bottom of the line.

With the following:

\documentclass{article}
\begin{document}
{\tiny smaller text should be aligned level with} the following text here
\end{document}

I get: enter image description here

What I would like is this: enter image description here

I haven't been able to find a way to do this for some reason, so any suggestions appreciated!

0

enter image description here

\documentclass{article}
\begin{document}

\raisebox{\dimexpr\fontcharht\font`f-\height\relax}{\tiny
    smaller text should be aligned level with} the following text here
\end{document}

This raises based on the height of f in the larger text, you may want to use the height of a capital such as t or \ht\strutbox, depending.

0

Looks like this question has been asked a few times before, but I wasn't able to find it using google or search, but SE's related search found it for me.

Here's one way it can be done using \raisebox:

    \documentclass{article}
    \begin{document}
    \raisebox{0.5ex}{\tiny smaller text should be aligned level with} the following text here
    \end{document}
  • that raises it but doesn't necessarily align the tops. – David Carlisle Dec 6 '16 at 18:38
0

adjustbox provides a valign=t option, changing the anchor to be at the top:

enter image description here

\documentclass{article}

\usepackage{adjustbox}

\begin{document}

some regular text
\adjustbox{valign=t}{\tiny smaller text should be aligned level with}
\adjustbox{valign=t}{the following text here}

\end{document}

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.