Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to create an environment which contains a list to typeset auto-numbered thesis (just like one does with math formulae). I would like the spacing to be something like this:

exhibit1

This is the code I've managed to create:

\newenvironment*{Tesis}
  {\begin{list}
    {\hspace{14pt}(T\arabic{tesisc})}
    {\setlength{\rightmargin}{0cm}%
     \refstepcounter{tesisc}%
     \setlength{\leftmargin}{2\parindent}}
    \item
  }
  {\end{list}}

which unfortunately renders thus:

exhibit2

I've fiddled with every list parameter I know of (\labelwidth etc.), but with no avail.

How can I tweak the list environment to accomplish the desired effect?

share|improve this question

3 Answers 3

up vote 7 down vote accepted

enumitem is king of lists and provides a flexible interface:

enter image description here

\documentclass{article}
\usepackage{enumitem,lipsum}% http://ctan.org/pkg/{enumitem,lipsum}
\begin{document}
\lipsum[1]
\begin{enumerate}[label={(T\arabic*)},leftmargin=4em]
  \item \lipsum[2]
  \item \lipsum[3]
\end{enumerate}
\lipsum[4]
\end{document}

There are numerous examples on this site using , but the go-source would be the enumitem documentation. It also includes some examples.

share|improve this answer
    
It works brilliantly, cheers! –  NVaughan Jan 3 '13 at 18:20

Using Werner's and cmhughes' answer, I came up with this code, which works fine for my purposes:

\newcounter{tesisc)
\newenvironment*{Tesis}
  {\begin{enumerate}%
      [label={(T\arabic{tesisc})},%
      leftmargin=4em]
     \refstepcounter{tesisc}\item
  }
  {\end{enumerate}}
share|improve this answer
    
You can clone the basic lists to create your own - probably very similar to what you're doing. See section 7 Cloning the basic lists in the enumitem documentation. Not sure why you're using \refstepcounter though, since \item should \refstepcounter{tesisc}... –  Werner Jan 3 '13 at 19:04
    
If I don't specify \refstepcounter{tesisc} my count remains in 0. –  NVaughan Jan 3 '13 at 19:12
    
Then your use is probably \begin{Tesis} something \end{Tesis} rather than \begin{Tesis} \item something \end{Tesis}? –  Werner Jan 3 '13 at 19:17
    
Indeed, but I still require the \refstepcounter{tesisc} command. –  NVaughan Jan 3 '13 at 19:46

I would definitely use the enumitem package for this, but just in case you want a working version of your snippet, you can use the following

\documentclass{article}
\usepackage{lipsum}

\newcounter{tesisc}
\newenvironment*{Tesis}
  {\begin{list}
    {(T\arabic{tesisc})}
    {\setlength{\rightmargin}{0cm}%
     \refstepcounter{tesisc}%
     \setlength{\leftmargin}{1cm}}
    \item
  }
  {\end{list}}

% for references
\renewcommand{\thetesisc}{(T\arabic{tesisc})}

\begin{document}

\lipsum[1]
\begin{Tesis}
\lipsum[2]
\end{Tesis}
\begin{Tesis}\label{test}
\lipsum[2]
\end{Tesis}

Reference: \ref{test}

\end{document}

For further reading, have a look at Section 56 of source2e. Some examples are discussed in Definitive guide to trivlists

share|improve this answer
    
Thanks, @cmhughes. I'll have a look at the references you provide. –  NVaughan Jan 3 '13 at 19:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.