# Auto-indent the second line of a paragraph

When working with numbered lists with long content, I get outputs like this:

However, I would like to produce an output like

where "z" and "planes" are aligned with the word "Giving". Using repeated \\, \hskip commands is hassle and time-consuming. Is there a way to auto-indent the "cut paragraph". Thanks.

Code:

\documentclass[12pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
\noindent (2) Giving the volume of the solid bounded by the surface \\ \hspace{13mm} $z = 10 - 4x - 2y$ below the xy-plane, and on the sides by the \\ \hspace{13mm} planes $y = 0$, $y=3x$ and $x=1$.\\ \vspace{1mm}
\end{document}

-
How are you producing these outputs, the output you would like is the default, could you provide a Minimal Working Example – Au101 Feb 29 at 5:44
I'm sorry, I would reconstruct my question :) – Enthusiast Feb 29 at 5:57
Why don't you use an environment like enumerate? – Gustavo Mezzetti Feb 29 at 6:14
@Enthusiast Please see the answer which I have posted with multiple solutions. You can decide which one is suitable for you. But I will say a big NO to the way you tried to format texts using hard coded spaces. LaTeX is far far better than that. – Masroor Feb 29 at 6:28
@Masroor, thank you for the advice and tips. I am still learning the basics of Latex and trying to modify the means in which I code. I'm glad that several people here responded, which I am grateful for. – Enthusiast Feb 29 at 6:37

Use any of the list-like structures. Below I've used enumerate with the optional argument for \item[<label>]:

\documentclass{article}

\begin{document}

\begin{enumerate}
\item[(2)]
Giving the volume of the solid bounded by the surface \\
$z = 10 - 4x - 2y$ below the xy-plane, and on the sides by the \\
planes $y = 0$, $y = 3x$ and $x = 1$.
\end{enumerate}

\end{document}

-

Ah, you are using LaTeX as though it were Word. LaTeX is not word. In Word you type out what you want to see on the page and perhaps decorate it as you go along by clicking buttons or using keyboard short cuts (Ctrl+i, Ctrl+b, etc.).

In LaTeX we use logical structures. You must unlearn the heathen ways of Gates and his Microsoft Office. Don't write your document like you would a Word document and then try to LaTeX-ify it, or find the LaTeX equivalent of x, y, z.

What you have here is an enumerated list. So we need the enumerate environment. This automatically takes care of the numbering for us, and all the indentation and formatting.

\documentclass[12pt]{article}
\pagestyle{plain}
\usepackage[margin=1.8cm]{geometry}
\geometry{a4paper}
\usepackage[parfill]{parskip}
\usepackage{amsmath}

\begin{document}

\begin{enumerate}
\item Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis
natoque penatibus et magnis dis parturient montes, nascetur
ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu,
pretium quis, sem. Nulla consequat massa quis enim.
\item Donec pede justo, fringilla vel, aliquet nec, vulputate eget,
arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae,
justo. Nullam dictum felis eu pede mollis pretium. Integer
tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean
vulputate eleifend tellus. Aenean leo ligula, porttitor eu,
consequat vitae, eleifend ac, enim.
\item Aliquam lorem ante, dapibus in, viverra quis, feugiat a,
tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque
rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur
ullamcorper ultricies nisi. Nam eget dui.
\end{enumerate}

\end{document}


Them's the basics.

Now, to get your list to start at 2, you're gonna wanna do:

\setcounter{enumi}{1}


This sets the counter to 1. Then when LaTeX encounters the \item it increments the counter and prints the value. So you start at 1. Then you get \item and that moves the counter to 2, which is printed. Another \item moves you up to 3 and so on and so forth. To reproduce your specific style, use the enumitem package:

\documentclass[12pt]{article}
\pagestyle{plain}
\usepackage[margin=1.8cm]{geometry}
\geometry{a4paper}
\usepackage[parfill]{parskip}
\usepackage{amsmath}
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label=(\arabic*)]
\setcounter{enumi}{1}
\item Giving the volume of the solid bounded by the surface $z = 10 - 4x - 2y$ below the $xy$-plane, and on the sides by the planes $y = 0$, $y = 3x$ and $x = 1$.
\end{enumerate}

\end{document}


Beware the forced line breaks \\, these do not end paragraphs and will destroy justification. Beware the explicit indentation and white space. Both of these have specific niche uses and they are also quite able to be used for final tweaks to the exact output, to get exactly the right visual effect. This is especially true as a last resort. They should very rarely be commonplace in your text.

-
+1 for "heathen ways of Gates". – Guho Feb 29 at 6:25
[start=2] <=> \setcounter{enumi}{1} – touhami Feb 29 at 6:32

A list structure is you best bet (see the other answers). For the sake of completeness, this can be achieved in a paragraph with \hangafter and \hangindent:

\documentclass[12pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
\hangafter=1
\settowidth{\hangindent}{(2) }
\noindent (2) Giving the volume of the solid bounded by the surface \\ \hspace{13mm} $z = 10 - 4x - 2y$ below the xy-plane, and on the sides by the \\ \hspace{13mm} planes $y = 0$, $y=3x$ and $x=1$.\\ \vspace{1mm}
\end{document}


-

If you are thinking of doing this in lists like your example image, you can try something like this.

\documentclass{article}

\usepackage{lipsum}

\parindent 0.0mm

\begin{document}

\begin{itemize}
\item [(1)] \lipsum[1]
\item [(2)] Giving the volume of the solid bounded by the surface
$z = 10 - 4x - 2y$ below the $xy$-plane, and on the sides by the
planes $y = 0$, $y=3x$ and $x=1$.
\end{itemize}
\end{document}


You may be looking for auto-numbering of lists.

\documentclass{article}

\usepackage{lipsum}

\parindent 0.0mm

\begin{document}

\begin{enumerate}
\item \lipsum[1]
\item Two Giving the volume of the solid bounded by the surface
$z = 10 - 4x - 2y$ below the $xy$-plane, and on the sides by the
planes $y = 0$, $y=3x$ and $x=1$.
\end{enumerate}
\end{document}


Or even the description environment would be suitable for you.

\documentclass{article}

\usepackage{lipsum}

\parindent 0.0mm

\begin{document}

\begin{description}
\item [(1) One] \lipsum[1]
\item [(2) Two] Giving the volume of the solid bounded by the surface
$z = 10 - 4x - 2y$ below the $xy$-plane, and on the sides by the
planes $y = 0$, $y=3x$ and $x=1$.
\end{description}
\end{document}


For general texts, things are very easy if you use the hanging package.

\documentclass{article}

\usepackage{hanging}

\usepackage{lipsum}

\parindent 0.0mm

\begin{document}

Text without hanging. \lipsum[1]

\hangpara{15.0mm}{1}Single paragraph with hanging. \lipsum[2]

More text without hanging. \lipsum[1]

\begin{hangparas}{15.0mm}{1}
Multiple paragraphs with hanging. \lipsum[3-10]
\end{hangparas}

\end{document}

-