[Tex/LaTex] Centered text, aligned left

horizontal alignment

This is probably a rather trivial question, but I don't see an obvious way on how to solve it. I want to center a piece of text, but i want to have the centered text be aligned left.

So I would like:

\begin{center}
line1
line2
line3
\end{center}

but where line1, line2 and line3 are aligned left, but still are centered.

Best Answer

You could use a tabular which aligns the text to the left and is itself centered in the text. This could look like this:

\documentclass{scrreprt}
\usepackage{lipsum}
\begin{document}
 \lipsum[1]
 \begin{center}
  \begin{tabular}{l}
    This is line 1 with some text. \\
    This is line 2 with a slightly different text \\
    Line 3 is completely different and also a bit longer. \\
  \end{tabular}
 \end{center}
\end{document}

The output looks like this:

enter image description here

Related Question