Text Formatting ⇒ Help me figure this enumerate problem
-
- Posts: 1
- Joined: Tue Dec 21, 2010 10:11 pm
Help me figure this enumerate problem
Need to have the Question 1 in front of a line and then Answer 1 in front of the other, then Question 2 and then Answer 2.
I am sure there is an easier way another than writing it in front of each and every line (then I have the indentation problem).
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Help me figure this enumerate problem
From your brief description, it seems you want something like this:
Code: Select all
\documentclass{article}
\newcounter{question}
\setcounter{question}{0}
\newcommand{\question}{\refstepcounter{question}\item[Question~\thequestion.]}
\newcommand{\answer}{\item[Answer~\thequestion.]}
\begin{document}
\begin{enumerate}
\question What is your name?
\answer My name is Arthur of Camelot.
\question What is your quest?
\answer My quest is to seek the Holy Grail.
\question What is your favorite color?
\answer My favorite color is blue.
\end{enumerate}
\end{document}