5

I use this code below to get the form name: Chapter I., II., III., section 1., subsection 1.1. in both text and table of contents.:

\renewcommand\thechapter{\Roman{chapter}.}
\renewcommand\thesection{\arabic{section}.}
\renewcommand\thesubsection{\thesection \arabic{subsection}.}
\renewcommand\thesubsubsection{\alph{subsubsection}.}

But when I use the theorem environment:

\usepackage[all]{xy}
\usepackage[thmmarks]{ntheorem}
\newtheorem{Lemma}{Lemma}[section]
\newtheorem{dl}[Lemma]{Định lý}

the result I get is:

enter image description here

I want to change the double dot to one dot only like 1.1., 1.2. ,...

3
  • 2
    which document class you use?
    – Tom
    Jun 21 at 4:16
  • 4
    Welcome to TeX.SE! Please extend your code fragment to complete small document, which reproduce your problem,
    – Zarko
    Jun 21 at 4:18
  • 1
    @Tom i used report document class
    – Hoàng
    Jun 21 at 4:55

3 Answers 3

5

Define

\def\theLemma {\thesection \arabic {Lemma}}

after \newtheorem{Lemma} is used. The command \newtheorem{Lemma} generates \theLemma macro as \thesection.\arabic {Lemma} but you don't want the dot here.

0
6

If you execute instructions such as

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

not only will the headers of Lemma and dl environments look wrong because of the spurious extra period (aka "full stop"), but cross-references to section, subsection, and subsubsection level headers will also feature a spurious period.

I therefore suggest you employ a different solution method, which is shown in the code below.

enter image description here

With this approach, you also needn't redefine \theLemma, \thedl, etc.

\documentclass{report}
\usepackage[vietnamese]{babel}

% Method proposed in "The LaTeX Companion", 2nd ed.:
\makeatletter
\def\@seccntformat#1{\@ifundefined{#1@cntformat}%
   {\csname the#1\endcsname\space}%    default
   {\csname #1@cntformat\endcsname}}%  enable individual control  
\newcommand\section@cntformat{\thesection.\space}       % section
\newcommand\subsection@cntformat{\thesubsection.\space} % subsection
\newcommand\subsubsection@cntformat{\thesubsubsection.\space} % subsection
\makeatother

\usepackage[thmmarks]{ntheorem}
\newtheorem{Lemma}{Lemma}[section]
\newtheorem{dl}[Lemma]{Định lý}

\begin{document}
\chapter{Hello}
\section{World}

\begin{Lemma} Bla bla bla \end{Lemma}
\begin{dl} Bla bla bla \end{dl}

\end{document}
2
  • The default should be \quad instead \space?
    – Tom
    Jun 21 at 5:31
  • @Tom — I guess the default amount of white space is set at the document class level. It could well be \quad for the report class.
    – Mico
    Jun 21 at 6:05
2

It depends on what you want when doing cross-references.

Anyway, since every generated number has a trailing period, also lemmas should share the style.

\documentclass[a4paper]{report}
\usepackage[vietnamese]{babel}

\usepackage[thmmarks]{ntheorem}

\renewcommand\thechapter{\Roman{chapter}.}
\renewcommand\thesection{\arabic{section}.}
\renewcommand\thesubsection{\thesection \arabic{subsection}.}
\renewcommand\thesubsubsection{\alph{subsubsection}.}

\newtheorem{Lemma}{Lemma}[section]
\renewcommand{\theLemma}{\thesection\arabic{Lemma}.}

\newtheorem{dl}[Lemma]{Định lý}

\begin{document}

\tableofcontents

\chapter{Test}\label{ch:test}

\section{Test}\label{sec:test}

\begin{dl}\label{dl:test}
Test
\end{dl}

\ref{ch:test}
\ref{sec:test}
\ref{dl:test}

\end{document}

enter image description here

enter image description here

As you see, all cross-references will have the trailing period. If you don't want it, you need some more work.

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.