I have some text (like a title), that needs to be centered, and some notes to it (multiline – note 1 \\ note 2),
which should be directly underneath it and on the left side of it:
Some centered text
note1
note2
How can I do it?
Best Answer
Use the
varwidth
package:A width of
\textwidth
for thevarwidth
environment makes sure that the text will fit within the text block, but also shrink to the natural width of the box (in case it's not as wide).For keeping the title centred (if the notes extend beyond the width of the title), you can use
However, you are required to use
\par
to the title here then. There are other ways to do this as well.The
showframe
package merely highlights the "centred-ness".