Math & ScienceEquation numbering with letters

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
peaches2165
Posts: 25
Joined: Wed Oct 22, 2008 5:03 pm

Equation numbering with letters

Post by peaches2165 »

Hi,

I have been using this format

Code: Select all

\documentclass[12pt,leqno]{article}
\usepackage{amsmath, amsfonts, amsthm, amssymb, epsfig}
%\usepackage{txfonts}
\usepackage{amsmath}
\topmargin -.7in
%\parskip .15in
\textheight 9in
\textwidth 6in
\oddsidemargin .25in
\evensidemargin .25in
\begin{document}

\everymath{\displaystyle}

\makeatletter\@addtoreset{equation}{section}
\def\theequation{\thesection.\arabic{equation}}


\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{result}{Result}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{assumption}{Assumption}[section]
\newtheorem{corollary}{Corollary}[section]
\numberwithin{equation}{section}
and now need to number equations with a A.1 etc for the appendix. What command do I need to change just the appendix to A.1 etc.

Thanks,

Peaches

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Equation numbering with letters

Post by Johannes_B »

Please always ensure, that the problem is reproducable for others. Right now, i don't know what's troubeling you. Adding a document body gives the expected result.

Code: Select all

\documentclass[12pt,leqno]{article}
\usepackage{amsmath, amsfonts, amsthm, amssymb, epsfig}
    %\usepackage{txfonts}
\usepackage{amsmath}
\topmargin -.7in
    %\parskip .15in
\textheight 9in
\textwidth 6in
\oddsidemargin .25in
\evensidemargin .25in

\everymath{\displaystyle}

\makeatletter\@addtoreset{equation}{section}
\def\theequation{\thesection.\arabic{equation}}


\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{result}{Result}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{assumption}{Assumption}[section]
\newtheorem{corollary}{Corollary}[section]
\numberwithin{equation}{section}
\begin{document}
\section{daisy}
\begin{equation}
\end{equation}
\begin{equation}
\end{equation}
\begin{equation}
\end{equation}
	\section{donald}
\begin{equation}
\end{equation}
\begin{equation}
\end{equation}
\appendix
	\section{ducks}
\begin{equation}
\end{equation}
\begin{equation}
\end{equation}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply