1

In plain text, this is what I want to do:

Explanation: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus volutpat eu orci vitae eleifend.
             Praesent sed orci commodo, venenatis neque vel, pulvinar velit.
             Mauris ullamcorper tellus sed quam pellentesque, vitae sagittis nisl dapibus.

update

If hspace{5cm} fit the length of the word "Explanation: " and if hspace worked in the enumerate environment, the following would be what I want my document to look like:

\documentclass[11pt]{article}

\begin{document}

\begin{enumerate}

\item 1

answer

\item 2

explanation: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus volutpat eu orci vitae eleifend.\\ \hspace {5cm}Praesent sed orci commodo, venenatis neque vel, pulvinar velit.\\ \hspace {5cm}Mauris ullamcorper tellus sed quam pellentesque, vitae sagittis nisl dapibus.

\item 3

answer

\end{enumerate}

\end{document}

Basically, imagine

Explanation: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus volutpat eu orci vitae eleifend.
             Praesent sed orci commodo, venenatis neque vel, pulvinar velit.
             Mauris ullamcorper tellus sed quam pellentesque, vitae sagittis nisl dapibus.

is in an enumerate environment.

This is what I want:

img

  • Plain text or Plain TeX? Are you interested in page breaking capability for the right-hand text? Have you seen the enumitem package for list management? Do you know of tabular environments like tabularx? – Werner Sep 4 '13 at 17:35
  • EDIT: Yes, what @TorbjørnT. said. Much better. Don't abuse tables. – Sam Whited Sep 4 '13 at 17:38
  • 1
    Something like tex.stackexchange.com/questions/33817/…? – Torbjørn T. Sep 4 '13 at 17:38
  • removed the align tag, as that is specifically for math. horizontal-alignment might work, but it's really the indentation (\hangindent would be appropriate if this were plain tex) that's involved here. – barbara beeton Sep 4 '13 at 17:48
  • I was saying "plain text" to refer to my presentation of the formatting on this question. But I mean I want to use that in a LaTeX article. – Frank Epps Sep 4 '13 at 17:50
2

Revised answer based on revised question. There are many ways to skin a cat. Here are two possible ways that might provide some inspiration.

\documentclass{article}
\usepackage{hanging}
\usepackage{longtable}
\newlength{\hangwidth}
\newcommand{\newhang}[1]{\settowidth{\hangwidth}{#1}\par\hangpara{\hangwidth}{1}#1}
\newcounter{myquestion}

\begin{document}
\stepcounter{myquestion} 
\newhang{\arabic{myquestion}. Question: }What is the question?
\newhang{Answer: }Lorem ipsum dolor sit amet, consectetur adipiscing elit.\\Phasellus volutpat eu orci vitae eleifend.\\Praesent sed orci commodo, venenatis neque vel, pulvinar velit.\\Mauris ullamcorper tellus sed quam pellentesque, vitae sagittis nisl dapibus.
\stepcounter{myquestion} 
\newhang{\arabic{myquestion}. Question: }What is the question?
\newhang{Answer: }Lorem ipsum dolor sit amet, consectetur adipiscing elit.\\Phasellus volutpat eu orci vitae eleifend.\\Praesent sed orci commodo, venenatis neque vel, pulvinar velit.\\Mauris ullamcorper tellus sed quam pellentesque, vitae sagittis nisl dapibus.
\stepcounter{myquestion} 
\newhang{\arabic{myquestion}. Question: }What is the question?
\newhang{Answer: }Lorem ipsum dolor sit amet, consectetur adipiscing elit.\\Phasellus volutpat eu orci vitae eleifend.\\Praesent sed orci commodo, venenatis neque vel, pulvinar velit.\\Mauris ullamcorper tellus sed quam pellentesque, vitae sagittis nisl dapibus.

\setcounter{myquestion}{0}
\begin{longtable}{rp{0.7\textwidth}}
\stepcounter{myquestion}\arabic{myquestion}. Question: &What is the question?\\
Answer: &Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus volutpat eu orci vitae eleifend. Praesent sed orci commodo, venenatis neque vel, pulvinar velit. Mauris ullamcorper tellus sed quam pellentesque, vitae sagittis nisl dapibus.\\
\stepcounter{myquestion}\arabic{myquestion}. Question: &What is the question?\\
Answer: &Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus volutpat eu orci vitae eleifend. Praesent sed orci commodo, venenatis neque vel, pulvinar velit. Mauris ullamcorper tellus sed quam pellentesque, vitae sagittis nisl dapibus.\\
\stepcounter{myquestion}\arabic{myquestion}. Question: &What is the question?\\
Answer: &Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus volutpat eu orci vitae eleifend. Praesent sed orci commodo, venenatis neque vel, pulvinar velit. Mauris ullamcorper tellus sed quam pellentesque, vitae sagittis nisl dapibus.\\
\stepcounter{myquestion}\arabic{myquestion}. Question: &What is the question?\\
\end{longtable}

\end{document}

enter image description here

  • Thanks. This works by itself, but within the enumerate environment, it doesn't work. Is there a way to fix that? – Frank Epps Sep 4 '13 at 23:13
  • You said you wanted it in plain text. How do you want it to look in the enumerate environment? – Aubrey Blumsohn Sep 5 '13 at 0:04
  • I was saying "plain text" to refer to my presentation of the formatting on this question. But I mean I want to use that in a LaTeX article. – Frank Epps Sep 5 '13 at 0:46
  • Yes, I understand that. But the output I produced is identical to your required output. Why would you want to put this in an enumerate environment? Do you want a number in front of it? – Aubrey Blumsohn Sep 5 '13 at 7:33
  • I am writing up homework solutions. This is under #2. – Frank Epps Sep 5 '13 at 8:34

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.