How can I change equation numbering so that the chapter number is outside the parenthesis like this:
1(1)
instead of
(1.1)
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityHow can I change equation numbering so that the chapter number is outside the parenthesis like this:
1(1)
instead of
(1.1)
You need to redefine \tagform@
from amsmath
(to remove the outer parentheses) and \theequation
(to add them in the desired location):
\documentclass{book}
\usepackage{amsmath}
\renewcommand\theequation{\thechapter(\arabic{equation})}
\makeatletter
\def\tagform@#1{\maketag@@@{\ignorespaces#1\unskip\@@italiccorr}}
\makeatother
\begin{document}
\chapter{Test Chapter}
\eqref{eq:test}
\begin{equation}\label{eq:test}
a=b.
\end{equation}
\end{document}
\documentclass{book} \usepackage{amsmath} \usepackage{amsthm} \renewcommand\theequation{\thechapter(\arabic{equation})} \makeatletter \def\tagform@#1{\maketag@@@{\ignorespaces#1\unskip\@@italiccorr}} \makeatother \newtheorem{theo}{Theorem} \begin{document} \chapter{Test Chapter} \ref{eq:test} \begin{theo} \begin{equation}\label{eq:test} a=b. \end{equation} \end{theo} \end{document}
– Gonzalo Medina
Jul 3 '13 at 0:48
\ref{...}
as part of the theorem text, say a reference in the theorem to a numbered equation that's outside the theorem statement. when that happens, the reference is italic, not upright.
– barbara beeton
Jul 3 '13 at 18:03
\ref
behaves like that; on the other hand, \eqref
(which should be used here instead of \ref
, anyway) will still produce the reference in upright font. I updated my answer to change \ref
for \eqref
.
– Gonzalo Medina
Jul 4 '13 at 21:34
\renewcommand\theequation{\thechapter(\arabic{equation})}
\def\@eqnnum{{\normalfont \normalcolor \theequation}}
is the standard definition with ()
removed
– David Carlisle
Jul 2 '13 at 21:49