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 have this kind of homeworks here and I want to get things aligned nicely like "1.2.6 EX. ... a) ... b) ..", "` -- how? I don't like that LaTex inserts immediately the point 8 and points 8.1/8.2 etc.

enter image description here

enter image description here

Minimal working example

\documentclass{article}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{float}

\begin{document}
\tableofcontents
\newpage

\section{Exercise 1.1.1} 
\section{Exercise 1.3.4}
\subsection{a) The equation for the affine variety}
\end{document}
share|improve this question
1  
Could you provide a minimal working example starting with \documentclass and ending with \end{document}? This would help a lot in answering you. :) –  Claudio Fiandrino Sep 20 '12 at 7:02
    
Without an MWE it is hard to tell. Are you using \section for the exercise? If so you can use \section*{1.2.6 Exercise} instead and \subsection*{a) Drawing} –  Guido Sep 20 '12 at 7:06
    
@Guido I tried with "*" but it removes the subsection -name from the Table of Contents, I would like to have it there. –  hhh Sep 20 '12 at 7:08
add comment

2 Answers 2

up vote 6 down vote accepted

You can use

\newcommand{\exercise}[1]{\section*{#1 Exercise}\addcontentsline{toc}{section}{#1 Exercise}}
\newcommand{\working}[1]{\subsection*{#1}\addcontentsline{toc}{subsection}{#1}}

and then use

\exercise{1.1.1}
\working{a) Drawing}
...

\exercise{1.1.2}
\working{a) Drawing}
...

EDIT Modified to avoid to type Exercise in the argument.

Example what it becomes

enter image description here

share|improve this answer
    
Without retyping the word Exercise each time, is it possible to just have \exercise{1.3.4}? Instead of \exercise{1.3.4 Exercise}? –  hhh Sep 20 '12 at 7:26
add comment

You may have a look on the following code and its output:

\documentclass{report}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{float}

\renewcommand\thesection{\arabic{chapter}.\arabic{section}}
\renewcommand\thesubsection{\alph{subsection})}


\begin{document}
\tableofcontents
\newpage
\chapter{Theorem XX}
\section{Exercise A}
\section{Exercise B}
    \subsection{Exercise B.1}
    \subsection{Exercise B.2}
\section{Exercise C}
\section{Exercise D}
\section{Exercise E}

\chapter{Theorem YY}
\section{Exercise F}
    \subsection{The equation for the affine variety}
    \subsection{The equation for the affine variety}
\section{Exercise G}
\section{Exercise H}
\end{document}

Output after running the code: enter image description here

If you still want to try with 1.1.1 Exercise then you need to include \part command in the preamble like "\renewcommand\thesection{\arabic{part}.\arabic{chapter}.\arabic{section}}" and use part command in document body!

share|improve this answer
add comment

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.