Numeración de elementos en un capítulo.

Numeración de elementos en un capítulo.

Estoy escribiendo mi tesis con clase de libro. Todos los capítulos menos uno tienen subsección. Para el capítulo particular sin una subsección, el primer número de definición es 2.0.1. El 0 es para la subsección. ¿Cómo hago para que sea sólo 2.1 en lugar de 2.0.1? Esto es lo que tengo:

\documentclass[oneside, openany,12pt]{book}

\usepackage{amsthm,amsmath,latexsym,amsfonts,mathrsfs,graphics,graphicx,amssymb}

\usepackage[mathcal]{eucal}

\usepackage{setspace,titlesec,float,indentfirst,tocloft}

\usepackage[top=1in, left=1in, bottom=1in, right=1in]{geometry}

\usepackage{etoolbox}

\titleformat{\chapter}[display] {\normalfont\LARGE\bfseries\centering}{\chaptertitlename\ \thechapter}{20pt}{\LARGE}

\renewcommand\contentsname{Table of Contents}

\renewcommand{\cftchapleader}{\cftdotfill{\cftsecdotsep}}

\renewcommand{\cftchappresnum}{\MakeUppercase{\chaptername}~}

\renewcommand{\cftchapaftersnumb}{\qquad}

\renewcommand{\cftchapfont}{\bfseries}

\renewcommand{\cftchappagefont}{\bfseries}

\renewcommand{\cftchapaftersnum}{:}

\setlength{\cftchapnumwidth}{5.8em}

\renewcommand{\cftsecindent}{6.1em}

\setlength{\cftsecnumwidth}{2.1em}

\renewcommand{\cftsubsecindent}{6.1em}

\setlength{\cftsubsecnumwidth}{2.1em}

\theoremstyle{plain}

\newtheorem{thm}{Theorem}[section]

\newtheorem{mthm}[thm]{Main Theorem}

\newtheorem{clm}[thm]{Claim}

\newtheorem{lem}[thm]{Lemma}

\newtheorem{cor}[thm]{Corollary}

\newtheorem{rmk}[thm]{Remark}\theoremstyle{remark}

\newtheorem{exm}[thm]{Example}\theoremstyle{definition}

\newtheorem{case}[thm]{Case}\theoremstyle{definition}

\newtheorem{defn}[thm]{Definition}

\begin{document}

\chapter{CHAPTER WITH NO SUBSECTION}

\defn blah blah blah

Gracias.

Respuesta1

Redefina \thethmpara no agregar el número de sección si es 0.

\documentclass[oneside, openany,12pt]{book}

\usepackage{amsthm}

\theoremstyle{plain}
\newtheorem{thm}{Theorem}[section]

\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}

\renewcommand{\thethm}{%
  \ifnum\value{section}=0
    \thechapter.%
  \else
    \thesection.%
  \fi
  \arabic{thm}%
}

\begin{document}

\chapter{Title}

\begin{defn}
blah blah blah
\end{defn}


\chapter{Another}
\section{Title}

\begin{thm}
Blah blah
\end{thm}

\end{document}

Tenga en cuenta que debe utilizar \begin{defn}y \end{defn}, no \defn.

Dejé solo el código relevante, agrega nuevamente el resto que necesitas.

ingrese la descripción de la imagen aquí

Respuesta2

He tenido problemas similares con la numeración de los títulos de las imágenes. Quizás el paquete chngcntrpueda ayudarte.

\usepackage{chngcntr}
...
\chapter{CHAPTER WITH NO SUBSECTION}
\counterwithout{defn}{section}
\defn blah blah blah

información relacionada