Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is it possible to stretch text vertically?

Like this:

enter image description here

share|improve this question
add comment

3 Answers

up vote 15 down vote accepted
\usepackage{graphicx}
...
\scalebox{1}[3]{hello}
share|improve this answer
    
Thanks David!!! –  niels Aug 15 '12 at 13:01
add comment

In ConTeXt

\scale[sx=1,sy=2]{Some Text}
share|improve this answer
add comment

As David already stated in his answer the standard package graphicx provides the macro \scalebox{<h-factor>}[<v-factor>]{<content>} for this. The grfguide manual explains this and similar macros in detail. One thing to remember is that the content is boxes as horizontal box, so it can't include line breaks etc. except if you include a minipage, \parbox or similar construct.

There is also the \resizebox{<width>}{<height>}{<content>} which allows to scale text to a specific width and/or height. Use ! for the dimension you don't want to specify but to scale according to the other dimension. The starred version \resizebox* will scale the totalheight instead (height+depth).

There is also the adjustbox package which extends graphicx by providing a general key=value interface. Using this package you can scale even complicated content easily.

\documentclass{article}
\usepackage{adjustbox}
\begin{document}
\adjustbox{scale={2}{3}}{Text}

\adjustbox{width=\linewidth}{Text}

\adjustbox{minipage=10cm,scale={2}{3}}{Text\\with\\multiple\\lines}

\begin{adjustbox}{minipage=10cm,scale={2}{3}}
    Text\\
    with\\
    multiple\\
    lines
\end{adjustbox}

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.