2

I want to alight enumerate my Exercises. My old way is

\begin{ex}
Find the volume of the following pyramids $ABCD$

\begin{enumerate}[\quad 1)]
\item $A(1; 2; 3)$, \quad $B(2; 1; -2)$, \quad $C(-1; -4; 3)$, \quad $D(2; 1; -5)$;

\hfill Answer. 4.
\item $A(1;-2;-4)$, \quad $B(-2;-1;0)$, \quad $C(3; 4;-2)$, \quad $D(5; 5; -5)$;

\hfill Answer. 5.
\item $A(3; 2; 1)$, \quad $B(2; 4; 6)$, \quad $C(1; 5; 3)$, \quad $D(5; 4; 3)$.

\hfill Answer. 6.
\end{enumerate}
\end{ex}

enter image description here Now I want to align coordinates of the vertices A, B, C, D. I tried

\begin{ex}
 Find the volume of the following pyramids

\setcounter{eqn}{0}
\begin{alignat*}{6}
\num&& A(1; 2; 3), \qquad& B(2; 1; -2),\qquad& C(-1; -4; 3),\qquad& D(2; 1; -5); \\
\num&& A(-3; -2; -1), \qquad&  B(2; 4; 6),\qquad& C(1; 5; 3), \qquad& D(5; 4; 3).
\end{alignat*}
\end{ex}

enter image description here

How can I align to all vertices A, B, C, D to the left (none right with A and C like the second picture) and how can I add answer to every item like my old way?

My full code

\documentclass{article}
\usepackage{amsmath}
\newcounter{eqn}
\usepackage{enumerate}
\renewcommand*{\theeqn}{\arabic{eqn})}
\newcommand{\num}{\refstepcounter{eqn}\text{\theeqn}\quad}
\usepackage{amsthm}
\theoremstyle{definition} 
\newtheorem{ex}{Exercise}
\begin{document}
\begin{ex}
Find the volume of the following pyramids $ABCD$
\begin{enumerate}[\quad 1)]
\item $A(1; 2; 3)$, \quad $B(2; 1; -2)$, \quad $C(-1; -4; 3)$, \quad $D(2; 1; -5)$;

\hfill Answer. 4.
\item $A(1;-2;-4)$, \quad $B(-2;-1;0)$, \quad $C(3; 4;-2)$, \quad $D(5; 5; -5)$;

\hfill Answer. 5.
\item $A(3; 2; 1)$, \quad $B(2; 4; 6)$, \quad $C(1; 5; 3)$, \quad $D(5; 4; 3)$.

\hfill Answer. 6.

\end{enumerate}
\end{ex}

\begin{ex}
Find the volume of the following pyramids
\setcounter{eqn}{0}
\begin{alignat*}{6}
  \num&& A(1; 2; 3), \qquad& B(2; 1; -2),\qquad& C(-1; -4; 3),\qquad& D(2; 1; -5); \\
\num&& A(-3; -2; -1), \qquad&  B(2; 4; 6),\qquad& C(1; 5; 3), \qquad& D(5; 4; 3).
\end{alignat*}
\end{ex}
\end{document}
2
  • You want to align all A, B etc?
    – user11232
    Nov 28, 2014 at 4:02
  • @HarishKumar Yes. I want to align all A, B Nov 28, 2014 at 7:12

1 Answer 1

2

Is it like this?

\documentclass{article}
\usepackage{amsmath}
\newcounter{eqn}
\usepackage{enumerate}
\renewcommand*{\theeqn}{\arabic{eqn})}
\newcommand{\num}{\refstepcounter{eqn}\text{\theeqn}\quad}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{ex}{Exercise}

\newcommand*{\mybox}[1]{%
    \makebox[1in][l]{$#1$}
    }
\begin{document}
\begin{ex}
Find the volume of the following pyramids $ABCD$
\begin{enumerate}[\quad 1)]
\item \mybox{A(1; 2; 3),} \mybox{B(2; 1; -2),} \mybox{C(-1; -4; 3),} \mybox{D(2; 1; -5);}

\hfill Answer. 4.
\item \mybox{A(1;-2;-4),} \mybox{B(-2;-1;0),} \mybox{C(3; 4;-2),} \mybox{D(5; 5; -5);}

\hfill Answer. 5.
\item \mybox{A(3; 2; 1),} \mybox{B(2; 4; 6),} \mybox{C(1; 5; 3),} \mybox{D(5; 4; 3).}

\hfill Answer. 6.

\end{enumerate}
\end{ex}

\begin{ex}
Find the volume of the following pyramids
\setcounter{eqn}{0}
\begin{alignat*}{6}
  \num& A(1; 2; 3), && \quad B(2; 1; -2),&&\quad C(-1; -4; 3),&&\quad D(2; 1; -5); \\
\num& A(-3; -2; -1), &&\quad  B(2; 4; 6),&&\quad C(1; 5; 3), &&\quad D(5; 4; 3).
\end{alignat*}
\end{ex}
\end{document}

enter image description here

3
  • perhalp distance between two pionts two large. Nov 28, 2014 at 7:14
  • Yes. Change it at \newcommand*{\mybox}[1]{% \makebox[1in][l]{$#1$} Nov 28, 2014 at 7:18
  • @minthao_2011 No problemo :)
    – user11232
    Nov 28, 2014 at 7:20

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.