
Я хочу, чтобы нумерация разделов была numberchapter.numbersection.
такой:
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}.}
Но если я хочу создать теорему, нумерация теорем отображается как . Между и Theorem numberchapter.numbersection..numbertheorem
есть двойная точка . Как сделать так, чтобы отображалась только одна точка?numbersection
numbertheorem
\documentclass[twoside,11pt]{book}
\usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm,papersize={15.5cm,23.5cm}]{geometry}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}.}
\renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}.}
\usepackage{amsthm}
\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\chapter{ABC}
blablabla
\section{ONE}
\begin{theorem}
dddd
\end{theorem}
\end{document}
РЕДАКТИРОВАТЬ:
Исходя из ответа Egreg, если я форматирую раздел и подраздел, точка не появляется. Почему это может происходить и какое решение?
\documentclass{book}
\usepackage{amsthm,titlesec}
\titleformat{\section}
[hang]
{\bfseries}
{\bfseries\thesection}{1ex}{\bfseries}
\titlespacing{\section}{1.5pt}{0.2cm}{0.2cm}
\titleformat{\subsection}
[hang]
{\bfseries}
{\bfseries\thesubsection}{1ex}{\bfseries}
\titlespacing{\subsection}{1.5pt}{0.2cm}{0.2cm}
\renewcommand{\thechapter}{\Roman{chapter}}
\makeatletter
\renewcommand{\@seccntformat}[1]{%
\ifcsname format#1\endcsname
\csname format#1\endcsname
\else
\csname the#1\endcsname
\fi
\quad
}
\makeatother
\newcommand{\formatsection}{\thesection.}
\newcommand{\formatsubsection}{\thesubsection.}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\chapter{ABC}
blablabla with \ref{sec:one} and no period.
\section{ONE}\label{sec:one}
\begin{theorem}
dddd
\end{theorem}
\subsection{TWO}
Just to see what happens.
\end{document}
решение1
Вполне вероятно, что вы не хотите, чтобы перекрестные ссылки на разделы и подразделы имели конечную точку. Поэтому вы не хотите жестко подключать точку в \thesection
и в \thesubsection
.
В следующем коде завершающая точка добавляется с помощью \@seccntformat
.
\documentclass{book}
\usepackage{amsthm}
\renewcommand{\thechapter}{\Roman{chapter}}
\makeatletter
\renewcommand{\@seccntformat}[1]{%
\ifcsname format#1\endcsname
\csname format#1\endcsname
\else
\csname the#1\endcsname
\fi
\quad
}
\makeatother
\newcommand{\formatsection}{\thesection.}
\newcommand{\formatsubsection}{\thesubsection.}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\chapter{ABC}
blablabla with \ref{sec:one} and no period.
\section{ONE}\label{sec:one}
\begin{theorem}
dddd
\end{theorem}
\subsection{TWO}
Just to see what happens.
\end{document}
Если вы используете , titlesec
то это еще проще, потому что вы можете явно добавить точку в нужном месте.
\documentclass{book}
\usepackage{amsthm,titlesec}
\titleformat{\section}[hang]
{\bfseries}
{\thesection.}
{1ex}
{}
\titlespacing{\section}{1.5pt}{0.2cm}{0.2cm}
\titleformat{\subsection}[hang]
{\bfseries}
{\thesubsection.}
{1ex}
{}
\titlespacing{\subsection}{1.5pt}{0.2cm}{0.2cm}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\chapter{ABC}
blablabla with \ref{sec:one} and no period.
\section{ONE}\label{sec:one}
\begin{theorem}
dddd
\end{theorem}
\subsection{TWO}
Just to see what happens.
\end{document}
решение2
Пытаться:
\renewcommand{\thetheorem}{\thesection\arabic{theorem}}