# How to align different size lettering flush with the top of a line?

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:

What I would like is this:

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

## 3 Answers

\documentclass{article}
\begin{document}

\raisebox{\dimexpr\fontcharht\fontf-\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.

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

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

\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}
`