2

I have to use \section*{} in my thesis because I need align the TOC. But when I use \numberwithin{}{} equations are numbered like (0.1), (0.2) and so on. It seems that \numberwithin{}{} does not recognize sections when it is used \section*. The same occurs when I try to number propositions according to sections, that is, they became proposition 0.1,an so on. How can I use both?

\documentclass[a4paper,12pt,oneside]{article}

\usepackage[left=3cm,top=3cm,right=2cm,bottom=2cm]{geometry}

\usepackage{amsmath,amsfonts,amssymb,arial,graphicx,longtable,setspace,color,booktabs,ragged2e}

\usepackage{indentfirst}

\usepackage[portuges]{babel}

\pagestyle{myheadings}

\newtheorem{theorem}{Teorema}[section] 

\newtheorem{definition}[theoremm]{Definition}

\newtheorem{example}[theorem]{Example}

\renewcommand{\figurename}{Figura}

\renewcommand{\contentsname}{\centering \normalsize Sum\'ario}

\usepackage[applemac]{inputenc}

\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}

\let\endchangemargin=\endlist

\onehalfspacing

\newtheorem{theorem}{Teorema}
\newtheorem{acknowledgement}[theorem]{Acknowledgement}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{axiom}[theorem]{Hip\'{o}tese}
\newtheorem{case}[theorem]{Case}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{conclusion}[theorem]{Conclusion}
\newtheorem{condition}[theorem]{Hip—tese}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{corollary}[theorem]{Corol\'{a}rio}
\newtheorem{criterion}[theorem]{Criterion}
\newtheorem{definition}[theorem]{Defini\c{c}\~ao}
\newtheorem{example}[theorem]{Exemplo}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{lemma}[theorem]{Lema}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{proposition}[theorem]{Proposi\c{c}\~ao}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{solution}[theorem]{Solution}
\newtheorem{summary}[theorem]{Summary}
\newenvironment{proof}[1][Prova]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}

\numberwithin{equation}{section}

\begin{document}

\thispagestyle{empty}
\singlespacing
\begin{center}
\textbf{\normalsize UNIVERSIDADE FEDERAL DO RIO GRANDE DO SUL}

\textbf{\normalsize FACULDADE DE CIæNCIAS ECONïMICAS}

\textbf{\normalsize PROGRAMA DE PîS-GRADUA‚ÌO EM ECONOMIA}
\vspace{3cm}

\vspace{3cm}

\large Marcelo de Carvalho Griebeler\\

\vspace{3cm}
\textbf{\large ENSAIOS EM TEORIA ECON\^{O}MICA}\\

\vspace{4cm}

\begin{flushright}
\normalsize
\end{flushright}

\vspace{5cm}

\normalsize \textbf{Porto Alegre}

\normalsize \textbf{2013}
\end{center}

\newpage

\thispagestyle{empty}
\singlespacing
\begin{center}
\textbf{\large Marcelo de Carvalho Griebeler}

\vspace{3cm}

\vspace{3cm}

\textbf{\large ENSAIOS EM TEORIA ECON\^{O}MICA}\\

\vspace{4cm}

\begin{changemargin}{7.4cm}{0.6cm}
Tese submetida ao Programa de P\'{o}s-Gradu\c{c}\~{a}o em Economia da Faculdade de Ci\^{e}ncias Econ\^{o}micas da UFRGS, como quesito parcial para obten\c{c}\~{a}o do t\'{i}tulo de Doutor em Economia, com \^{e}nfase em Economia Aplicada.
\end{changemargin}

\begin{flushright}
\normalsize Orientador: Prof. Dr. Ronald Otto Hillbrecht
\end{flushright}

\vspace{5cm}

\normalsize \textbf{Porto Alegre}

\normalsize \textbf{2013}
\end{center}
\end{document}
ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149

2 Answers2

2

There is no incompatibility. The counter section starts at zero. The command \section increases this counter instead of \section*. So you get the correct number of the section.

You can change the numbering scheme later on. However I don't think it's a good style changing the numbering scheme inside the document.

Marco Daniel
  • 95,681
2

You can define your own section command to increment the section counter manually when you change the section with \section*. This may solve your problem. This example uses both the new command and the original \section* to show the difference.

enter image description here

\documentclass{article}
\usepackage{amsthm}

\newcommand{\mysection}[1]{%
  \stepcounter{section}
  \section*{#1}
}
\newtheorem{theorem}{Teorema}[section] 

\begin{document}

\mysection{First section}
This section starts with \verb!\mysection!. The section counter is
incremented, but does not appear above.
\begin{theorem}\label{thm:first}
First theorem of first section.
\end{theorem}

\section*{Second section}
This section starts with \verb!section*!, so the section counter isn't
incremented. 
\begin{theorem}\label{thm:second}
First theorem of second section.
\end{theorem}

\mysection{Third section}
This section starts with \verb!\mysection!.
\begin{theorem}\label{thm:third}
First theorem of third section.
\end{theorem}

References: Teorema~\ref{thm:first}, Teorema~\ref{thm:second}, 
Teorema~\ref{thm:third}.
\end{document}
Ethan Bolker
  • 9,333
  • 3
  • 42
  • 69