Text FormattingProblem in vertical alignment : enumerate

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ANANTHA
Posts: 5
Joined: Tue Nov 17, 2009 5:48 pm

Problem in vertical alignment : enumerate

Post by ANANTHA »

Hi,
I am new to Latex. I am using it to prepare a report in a particular format. When I use the enumerate environment, the second line begins vertically under the first alphabet of the first line. I have a requirement to make the second line to begin vertically underneath the opening bracket of the fist line.
Like example:
(a) This is a story........
and the mishap.......
This is what the enumerate command gives while what I want is ,
(a) This is a story.......
and the mishap......
Will someone be able to help me . Thanks in advance.
Ananth

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

magicmoose
Posts: 90
Joined: Fri Nov 06, 2009 7:29 am

Problem in vertical alignment : enumerate

Post by magicmoose »

I don't understand your problem - both your examples look identical to me...
ANANTHA wrote:Hi,
(a) This is a story........
and the mishap.......
...
(a) This is a story.......
and the mishap......
Please explain what you are trying to achieve as well as a complete compilable example of where you are up to.
ANANTHA
Posts: 5
Joined: Tue Nov 17, 2009 5:48 pm

Problem in vertical alignment : enumerate

Post by ANANTHA »

Dear Magicmoose,
Sorry for that incomplete querry. I am enclosing the tex file.

\title{\textbf{PERIODIC REPORT DEC 09: } }
\documentclass[12pt]{article}
\begin{document}
\maketitle
\newpage
\noindent \textbf{\underline{\begin{large}Task \end{large}}}\\
\vspace{5mm}
\noindent 1.\hspace{9mm}{\textbf{\underline{Training in .... School}}}:\\
He completed the ..................and he undertook classes on Aerodynamics.
\vspace{5mm}
\noindent 2.\hspace{9mm}{\textbf{\underline{Training in ...:}} }\\
The training at ceased due to.....

\vspace{5mm}
\noindent 3.\hspace{9mm}{\textbf{\underline{XYZ section:}} }The following activities were undertaken in the said period:-
\\
\begin{enumerate}
\item [(a)]The Engg section performed the repair of ......... spares and recovered the ..... and helped the organisation in saving
\end{enumerate}

\end{document}


Note: If you look at the para 3(a) the second line " the ... and helped the organisation in saving" begins vertically under the " The Engg section...". The format that is required is that I want the second line to begin under the opening bracket of (a).
Thank you for your quick reply.
Ananth
magicmoose
Posts: 90
Joined: Fri Nov 06, 2009 7:29 am

Problem in vertical alignment : enumerate

Post by magicmoose »

Hi there,

Try out the following code, I think it should work as you want. Instead of enumerate for the list, I used inparaenum as provided by the paralist package as it is for inline lists (see example) so that fixes the alignment of subsequent lines issue. Then the whole thing needed to be indented, so I used gmedina's code to define the new environment myindentpar.

Hope that helps :)

Code: Select all

\documentclass[12pt]{article}
\usepackage{paralist}
\newenvironment{myindentpar}[1]%
{\begin{list}{}%
         {\setlength{\leftmargin}{#1}}%
         \item[]%
}
{\end{list}}
\begin{document}

\noindent 3.\hspace{9mm}{\textbf{\underline{XYZ section:}} }The following activities were undertaken in the said period:-
\\
\begin{myindentpar}{1em}
\begin{inparaenum}
\item [(a)]The Engg section performed the repair of ......... spares and recovered the ..... and helped the organisation in saving
\end{inparaenum}
\end{myindentpar}
\end{document}
ANANTHA
Posts: 5
Joined: Tue Nov 17, 2009 5:48 pm

Re: Problem in vertical alignment : enumerate

Post by ANANTHA »

Dear Magicmoose,
Thank you very much for your reply. It worked and my job is done. Thanks a ton once again
Ananth
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problem in vertical alignment : enumerate

Post by localghost »

ANANTHA wrote:[...] I am enclosing the tex file. [...]
Looking at the code you provided I feel a shiver running down my spine and I wonder where you got it from. Let LaTeX do the formatting with the help of the enumitem package.

Code: Select all

\documentclass[12pt,titlepage]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{enumitem}

\title{\textbf{PERIODIC REPORT DEC 09:}}
\author{ANANTHA}

\begin{document}
  \maketitle

  \section*{Task}
    \begin{enumerate}[leftmargin=*]
      \item \textbf{\underline{Training in .... School:}}\\ He completed the \ldots\ and he undertook classes on Aerodynamics.
      \item \textbf{\underline{Training in \ldots :}}\\ The training at ceased due to \ldots
      \item \textbf{\underline{XYZ section:}}\\ The following activities were undertaken in the said period
      \begin{enumerate}[label={(\alph*)},fullwidth]
        \item The Engg section performed the repair of \ldots\ spares and recovered the \ldots\ and helped the organisation in saving \ldots
      \end{enumerate}
    \end{enumerate}
\end{document}

Best regards
Thorsten
Post Reply