2

I'm writing a LaTeX document in the article class and I recently realized there is no /chapter command for this class. However, when I use sections and subsections, they are written 1.1, 1.1.1, 1.1.2, etc. I don't know how to go on to 2.1, 2.2, etc. Am I doomed to stick with 1.n's forever? Thanks!

Here is my document:

%
% This is the LaTeX template file for lecture notes for CS267,
% Applications of Parallel Computing.  When preparing 
% LaTeX notes for this class, please use this template.
%
% To familiarize yourself with this template, the body contains
% some examples of its use.  Look them over.  Then you can
% run LaTeX on this file.  After you have LaTeXed this file then
% you can look over the result either by printing it out with
% dvips or using xdvi.
%

\documentclass[twoside]{article}
\setlength{\oddsidemargin}{0.25 in}
\setlength{\evensidemargin}{-0.25 in}
\setlength{\topmargin}{-0.6 in}
\setlength{\textwidth}{6.5 in}
\setlength{\textheight}{8.5 in}
\setlength{\headsep}{0.75 in}
\setlength{\parindent}{0 in}
\setlength{\parskip}{0.1 in}

%
% ADD PACKAGES here:
%

\usepackage{amsmath,amsfonts,graphicx}

%
% The following commands set up the lecnum (lecture number)
% counter and make various numbering schemes work relative
% to the lecture number.
%
\newcounter{lecnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\renewcommand{\thesection}{\thelecnum.\arabic{section}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thefigure}{\thelecnum.\arabic{figure}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}

%
% The following macro is used to generate the header.
%
\newcommand{\lecture}[4]{
   \pagestyle{myheadings}
   \thispagestyle{plain}
   \newpage
   \setcounter{lecnum}{#1}
   \setcounter{page}{1}
   \noindent
   \begin{center}
   \framebox{
      \vbox{\vspace{2mm}
    \hbox to 6.28in { {\bf Topics in Topology
        \hfill Fall 2015} }
       \vspace{4mm}
       \hbox to 6.28in { {\Large \hfill Notes on Topological Quantum Field Theories  \hfill} }
       \vspace{2mm}
       \hbox to 6.28in { {\it #3 \hfill} }
      \vspace{2mm}}
   }
   \end{center}
   \markboth{Lecture #1: #2}{Lecture #1: #2}

   \vspace*{4mm}
}
%
% Convention for citations is authors' initials followed by the year.
% For example, to cite a paper by Leighton and Maggs you would type
% \cite{LM89}, and to cite a paper by Strassen you would type \cite{S69}.
% (To avoid bibliography problems, for now we redefine the \cite command.)
% Also commands that create a suitable format for the reference list.
\renewcommand{\cite}[1]{[#1]}
\def\beginrefs{\begin{list}%
        {[\arabic{equation}]}{\usecounter{equation}
         \setlength{\leftmargin}{2.0truecm}\setlength{\labelsep}{0.4truecm}%
         \setlength{\labelwidth}{1.6truecm}}}
\def\endrefs{\end{list}}
\def\bibentry#1{\item[\hbox{[#1]}]}

%Use this command for a figure; it puts a figure in wherever you want it.
%usage: \fig{NUMBER}{SPACE-IN-INCHES}{CAPTION}
\newcommand{\fig}[3]{
            \vspace{#2}
            \begin{center}
            Figure \thelecnum.#1:~#3
            \end{center}
    }
% Use these for theorems, lemmas, proofs, etc.
\newtheorem{theorem}{Theorem}[lecnum]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newenvironment{proof}{{\bf Proof:}}{\hfill\rule{2mm}{2mm}}

% **** IF YOU WANT TO DEFINE ADDITIONAL MACROS FOR YOURSELF, PUT THEM HERE:

\newcommand\E{\mathbb{E}}

\begin{document}
%FILL IN THE RIGHT INFO.
%\lecture{**LECTURE-NUMBER**}{**DATE**}{**LECTURER**}{**SCRIBE**}
\lecture{1}{February 3, 2015}{Alexander Grounds}
%\footnotetext{These notes are partially based on those of Nigel Mansell.}

% **** YOUR NOTES GO HERE:

% Some general latex examples and examples making use of the
% macros follow.  
%**** IN GENERAL, BE BRIEF. LONG SCRIBE NOTES, NO MATTER HOW WELL WRITTEN,
%**** ARE NEVER READ BY ANYBODY.

These notes are based in large part on~\cite{K03}. I assume some differential topology, including the definitions of smooth manifolds, smooth maps, tangent spaces, and orientations. The unfamiliar reader should reference~\cite{L03} or a similar introduction to differential topology.

\part{Defining TQFTs}

\section{Cobordisms} 

\subsection{Oriented Manifolds}

Let $M^n$ be a compact oriented manifold with boundary. Suppose we can write $\partial M = \Sigma_0 \coprod \Sigma_1$ for some connected manifolds $\Sigma_0$, $\Sigma_1$.For each point $x \in \Sigma_0$, we have a natural inclusion $$T_x \Sigma_0 \hookrightarrow T_x M.$$ If $\Sigma_0$ is oriented, we can choose an ordered positive basis $\mathcal{B}$ for $T_x \Sigma_0$. By appending one more vector $v$ to the end of $\mathcal{B}$, we can complete it to a positive basis for $T_x M$. If $v$ points into $M$, we 





%Here is a citation, just for fun~\cite{CW87}.

\section*{References}
\beginrefs
\bibentry{K03}{\sc Kock, Joachim}, 
``Frobenius Algebras and 2D Topological Quantum Field Theories''
{\it London Mathematical Society Student Texts 59},
2003, pp.~1--55.

\bibentry{L03}{\sc Lee, John M.},
``Introduction to Smooth Manifolds"
{\it Springer Graduate Texts in Mathematics 218},
2003, pp.~1--76, 377--399.
\endrefs

% **** THIS ENDS THE EXAMPLES. DON'T DELETE THE FOLLOWING LINE:

\end{document}
  • \section{First section}\subsection{Subsection one one}\subsection{Subsection one two}\section{Second section}\subsection{Subsection two one}\subsection{Subsection two two} should work; otherwise, add a simple complete document illustrating the problem mentioned. – Gonzalo Medina Feb 4 '15 at 2:19
  • Unfortunately that produces 1.1 First section 1.2 Second section etc. – Alex Grounds Feb 4 '15 at 2:20
  • 1
    Then, as I said in my previous comment, add a complete, simple document illustrating this odd behaviour. – Gonzalo Medina Feb 4 '15 at 2:21
  • @GonzaloMedina How does one do that? Can I attach a file to my question or something? – Alex Grounds Feb 4 '15 at 2:22
  • Simply edit your question, copy the code there, select it and press Ctrl+K (or use the code button). – Gonzalo Medina Feb 4 '15 at 2:24
2

Your document has

\renewcommand{\thesection}{\thelecnum.\arabic{section}}

so the section counter will be prepended by the counter lecnum which is stepped with the \lecture command. If you want your sections to increase, you have two options:

  1. Use a new \lecture command (the section counter will increase, but it will still have as prefix the lecture number).

  2. Comment-out the line

    \renewcommand{\thesection}{\thelecnum.\arabic{section}}
    

    Take into account that since some other counters also have the lecture number prefix, you migh also want to comment-out these lines:

    \renewcommand{\thepage}{\thelecnum-\arabic{page}}
    \renewcommand{\thesection}{\thelecnum.\arabic{section}}
    \renewcommand{\theequation}{\thelecnum.\arabic{equation}}
    \renewcommand{\thefigure}{\thelecnum.\arabic{figure}}
    \renewcommand{\thetable}{\thelecnum.\arabic{table}}
    

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.