I feel this is rather a dumb question, but I could not find an answer. I'm looking for a \parbox without the width parameter, i.e. it should be determinded by its content. And the content is multiple lines. Something like:

I like B , but who cares?

An \mbox or \makebox doesn't allow for line breaks, it seems and a \parbox wants a width parameter. There must be some easy solution for what I want, no?

  • Probably varwidth (from the package with the same name) is what you're looking for. Or just a tabular environment. – egreg Jun 29 '14 at 16:40
  • Thanks! The tabular in a simple macro works just as I want. :) – cxxl Jun 29 '14 at 17:55

How about a simple tabular?

% arara: pdflatex

I like \begin{tabular}{l}A\\B\\C2\end{tabular} but who cares?


  • 1
    Maybe with @{}l!@{} instead of l? – egreg Jun 29 '14 at 18:03
  • @egreg yes, that would probably be best :) – cmhughes Jun 29 '14 at 18:08
  • @egreg Thank you for the comment; @{}l@{} is just what I needed for text to fit snugly around the tabular. – ShreevatsaR Nov 17 '16 at 3:02

Another simple solution with the stackengine package. The line separator is by default a blank space, but may be changed:

\usepackage{fourier, heuristica}



I like \Centerstack[l]{A B C2} but who cares?


enter image description here


What fun would have make a table or use a package for this? A funnier method:

I like \rlap{\raisebox{1em}{A}}\rlap{\raisebox{-1em}{C2}}B, but who cares?


In the above example, the width C2 have no effect on the inline text, so the comma is over the number two. If this is a problem, simply do not use \rlap for the the longest row of stacked text:

I like \rlap{\raisebox{1em}{A}}\rlap{B}\raisebox{-1em}{C2}, but who cares?

If rows are multiline paragraphs, simply enclose it in a \parbox. Example:

I like \vrule{} 
, but who cares?

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.