0

I want to write some lines in the following format. For example:

This is my request for better writing:
   a. I want to break the first line in a the next few words and
      to continue here for next few more words.
   b. I want to break the first line in a the next few words and
      to continue here for next few more words.
   c. I want to break the first line in a the next few words and
      to continue here for next few more words.

I want that a line number "a" will start after a few spaces. When the corresponding line will break, it should continue under the first word that it started, for example in line a (start with "I" and the word under I is to... The same behaviour is wanted for b and c.

Can someone help to solve it ?

nox
  • 4,160
  • 12
  • 26
  • 1
    Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. – Martin Schröder Dec 25 '16 at 14:14

2 Answers2

4

Sounds to me like you are looking for the enumerate environment. You can customize it with the enumitem package. You can break a line with \\ or start a new paragraph with an empty line or a \par.

Edit: You can customize the horizontal spacing with the keys leftmargin, itemindent, labelindent, labelwidth and labelsep, see page 4--5 of the enumitem package documentation.

\documentclass{article}
\usepackage[showframe]{geometry}% display page margins to make effect of leftmargin better visible
\usepackage{enumitem}% to customize enumerate/itemize/description
\setlist[enumerate,0]{% global customization of enumerate environment, see page 9 of enumitem package documentation.
    label=\alph*.,
    leftmargin=1cm,
}

% a custom command to save some typing, displays the value of a dimension in a table
\newcommand{\displaydimension}[1]{#1 & \the\csname #1\endcsname \\}

\begin{document}
\begin{enumerate}
\item you can \\
    break a line
\item and you can \par
    start a new paragraph
\item current values for horizontal spacing:

    \begin{tabular}[t]{@{}ll@{}}
        \displaydimension{leftmargin}
        \displaydimension{itemindent}
        \displaydimension{labelindent}
        \displaydimension{labelwidth}
        \displaydimension{labelsep}
    \end{tabular}
    \[ \texttt{leftmargin} +  \texttt{itemindent} = \texttt{labelindent} + \texttt{labelwidth} + \texttt{labelsep} \]
    \hfill\scriptsize (according to \texttt{enumitem} package documentation page~4)
\end{enumerate}
\end{document}

enter image description here

Please note that the values on the screenshot are not the default values, but for leftmargin=1cm, as visible in the source code. The default is leftmargin=25.00003pt.

jakun
  • 5,981
  • From where and how I need to usepackage()enuitem)? – user121783 Dec 25 '16 at 14:55
  • or maybe usepackage(enumerate) just enough ? – user121783 Dec 25 '16 at 14:57
  • 2
    have you tried my code? It is working on my system and I would expect it to work on yours as well. – jakun Dec 25 '16 at 15:00
  • if you want to change the enumeration style globally you can use \setlist[enumerate,0]{label=\alph*.}. see documentation section 5 "Global settings" (page 9). – jakun Dec 25 '16 at 15:20
  • yes, it works. can I change or add more spase at the start of the line - let say 2 or 3 gap of tab ? – user121783 Dec 26 '16 at 06:09
  • yes, you can also customize the spacing. For horizontal spacing there are the keys leftmargin, itemindent, labelindent, labelwidth and labelsep. see page 4--5 of the enumitem package documentation (the link in my answer). – jakun Dec 26 '16 at 16:28
  • @user121783 see my edited answer. play around with leftmargin=... or labelindent=..., labelwidth=\widthof{a.}, labelsep=5pt, leftmargin=! (the latter requires \usepackage{calc}). – jakun Dec 26 '16 at 17:47
1

I don't know whether you want this in a monospaced font, or in usual text. For the latter please look at enumerations and lists:

\documentclass{article}

\usepackage{enumitem} % for resizing spaces in enumeration

\setlist{parsep=0pt,
    itemsep=0pt,
    %topsep=0pt
}

\usepackage{blindtext}

\renewcommand{\theenumi}{\alph{enumi}}
\begin{document}

Some Text. \blindtext
\begin{enumerate}
    \item Test 1
    \item Test 2
\end{enumerate}

More text. \blindtext
\end{document}

I used the renewcommand to change the enumeration from 1., 2., .. to a., b., ... if neccessary refer also to How do I change the `enumerate` list format to use letters instead of the default Arabic numerals?

nox
  • 4,160
  • 12
  • 26