Text Formatting ⇒ Equation numbering
Equation numbering
Thanks
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Equation numbering
Isn't that what amsmath'spsw1937 wrote:How do you get equations numbers of the form "page number.equation number”.
\numberwithin
command is for? See `texdoc amsldoc', section `Equation numbering'.KR
Rainer
Re: Equation numbering
Yes it does do what I wanted. I was told this just after having posted my question. But you have to be careful with \numberwithin because it doesn't always number equations that are at the top of a page correctly. Sometimes it carries the numbering over from the previous page and other times it starts to number from zero rather than 1.
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Equation numbering
interesting, do you have examples for this?psw1937 wrote:Sometimes it carries the numbering over from the previous page and other times it starts to number from zero rather than 1.
Stefan
Equation numbering
Code: Select all
\documentclass[UKenglish,11pt,a4paper]{book}\usepackage{babel,pstricks,pst-plot,longtable,url,graphicx,setspace}\usepackage{anyfontsize,fancyhdr,amssymb,amsmath}\pagestyle{fancy}\fancyhead{}\fancyfoot{}\renewcommand{\headrulewidth}{0pt}\renewcommand{\headheight}{13.6pt}%\usepackage{makeidx}\newcounter{pic}[page]\newcounter{fig}[page]\setcounter{secnumdepth}{4}\newtheorem{ption}{Proposition}\newtheorem{assum}{Assumption}\newtheorem{them}{Theorem}\newtheorem{lem}{Lemma}\newcounter{thm}[page]\numberwithin{equation}{page}\begin{document}substituting in the value for $\pi^{\star\star\star}$ gives,\footnote{This follows from the fact that\begin{eqnarray*}\Delta S^{\star\star\star}&=&\pi^{\star\star\star} (v-c)-\frac{(\pi^{\star\star\star})^2}{2}\\&=&\pi^{\star\star\star}\left(v-c-\frac{1}{2}\pi^{\star\star\star}\right)\label{eqn1}\\&=&\pi^{\star\star\star}\left(v-c-\frac{1}{2}v+\frac{1}{4}c\right)\\&=&\pi^{\star\star\star}\left(\frac{1}{2}v-\frac{3}{4}c\right)\\&=&\left(v-\frac{1}{2}c\right)\left(\frac{1}{2}v-\frac{3}{4}c\right)\\&=&\frac{1}{2}v^2-\frac{3}{4}vc-\frac{1}{4}vc+\frac{3}{8}c^2\\&=&\frac{1}{2}v^2-vc+\frac{3}{8}c^2.\end{eqnarray*}$\Delta S^\star$ can be written\begin{eqnarray*}\Delta S^\star&=&\frac{1}{2}(v-c)^2\\&=&\frac{1}{2}(v^2-2vc+c^2)\\&=&\frac{1}{2}v^2-vc+\frac{1}{2}c^2~~~~~~>\Delta S^{\star\star\star}\end{eqnarray*}}\begin{eqnarray*}\Delta S^{\star\star\star}&=&\frac{1}{2}v^2-vc+\frac{3}{8}c^2~~~~~~<\Delta S^\star\end{eqnarray*}Note that if $v^2\geq 2c$ then $\Delta S^{\star\star\star}\geq \Delta S^{\star\star}$.\footnote{To see this note that\begin{eqnarray*}\Delta S^{\star\star\star}&\geq&\Delta S^{\star\star}\\\Rightarrow \frac{1}{2}v^2-vc+\frac{3}{8}c^2&\geq&\frac{3}{8}(v-c)^2\\\Rightarrow \frac{1}{2}v^2-vc+\frac{3}{8}c^2&\geq&\frac{3}{8}(v^2-2vc+c^2)\\\Rightarrow \frac{1}{2}v^2-vc+\frac{3}{8}c^2&\geq&\frac{3}{8}v^2-\frac{6}{8}vc+\frac{3}{8}c^2\\\Rightarrow \frac{1}{2}v^2-vc&\geq&\frac{3}{8}v^2-\frac{6}{8}vc\\\Rightarrow \frac{1}{2}(v^2-2vc)&\geq&\frac{3}{8}(v^2-2vc)\\\mathrm{which~is~true~when~v^2}&\geq&2vc.\end{eqnarray*}}This means that if the gains that result from the improvement in quality are large enough Buyer control is preferred to both Seller control or having separate firms. The advantage of Buyer control is that it encourages investment by the Buyer. But as he doesn't take into account the costs, $c$, the Buyer overinvests relative to the first best outcome.%\newpage\setcounter{equation}{1}In the special case of $v^2\geq 2vc$ the Buyer will be willing, and able, to pay the Seller a fixed amount at time A to obtain the right to make the decision about the improvement. That amounts to the Buyer buying the Seller's firm. The Seller will be able to demand amount equal to the difference in his expected profits, $\Delta S_S^{\star\star}-\Delta S_S^{\star\star\star}$, in return for letting the Buyer make the improvement decision.
Equation numbering
I have found the case where the top equation on the second page is numbered following on from the numbering of the first page. In this case the top equation on page 2 is numbered 1.3 while the second equation on page 2 is numbered 2.1.
Code: Select all
\documentclass[UKenglish,11pt,a4paper]{book}%\usepackage[colorlinks,urlcolor=blue]{hyperref}\usepackage{babel,pstricks,pst-plot,longtable,url,graphicx,setspace}\usepackage{anyfontsize,fancyhdr,amssymb,amsmath}\pagestyle{fancy}\fancyhead{}\fancyfoot{}\renewcommand{\headrulewidth}{0pt}\renewcommand{\headheight}{13.6pt}%\usepackage{makeidx}\newcounter{pic}[page]\newcounter{fig}[page]\setcounter{secnumdepth}{4}\newtheorem{ption}{Proposition}\newtheorem{assum}{Assumption}\newtheorem{them}{Theorem}\newtheorem{lem}{Lemma}%\newcounter{eqnn}[page]\newcounter{thm}[page]\numberwithin{equation}{page}%\makeindex\begin{document}Now let $i$ be an/the member for whom the gain in utility (reduction in disutility) from changing his effort level is the smallest, that is, \[v_i(a_i^\star)-v_i(a_i(\varepsilon))\leq v_j(a^\star_j)-v_j(a_j(\varepsilon))~~~~~~~~~\mathrm{for~all~}j.\]Summing over $j$ gives\begin{eqnarray}n(v_i(a_i^\star)-v_i(a_i(\varepsilon)))&\leq&\sum_{j=1}^n v_j(a^\star_j)-v_j(a_j(\varepsilon))\leq x^\star- (x^\star-\varepsilon)\nonumber\\\Rightarrow \label{eqn8}x^\star -(x^\star -\varepsilon)&\geq &n(v_i(a_i^\star)-v_i(a_i(\varepsilon)))> 0.\end{eqnarray}(Note that $i$ may depend on $\varepsilon$ but the notion used here does not reflect this.)Using Taylor's Theorem\footnote{Young's Form of Taylor’s Theorem: Let $f:(\alpha,\beta) \rightarrow \Re$ be $n-1$ times continuously differentiable on $(\alpha,\beta)$ and assume that $f$ has an $n^{th}$ derivative at the point $x$ in $(\alpha,\beta)$. For any $v$ such that $x + v$ belongs to $(\alpha,\beta)$,\[f(x+v)=f(x)+\sum^n_{i=1}\frac{f^k(x)}{k!}v^k +\frac{r(v)}{n!}v^n\]where the remainder term $r(v)$ satisfies \[\lim_{v\rightarrow 0}r(v)=0.\] Here we have $f(\cdot)=v(\cdot), k=1,x+v=x_i(\varepsilon), v=(a_i(\varepsilon)-a^\star_i)<0$ and $x=a^\star_i$.Substituting in to the formula above we get\begin{eqnarray*}v_i(a_i(\varepsilon))&=&v_i(a^\star_i)+\frac{v^{'}_i(a^\star_i)}{1!}(a_i(\varepsilon)-a^\star_i) +\hat{r_i}(\varepsilon)\\\Rightarrow -v^{'}_i(a^\star_i)(a_i(\varepsilon)-a^\star_i)-\hat{r_i}(\varepsilon)&=&v_i(a^\star_i)-v_i(a_i(\varepsilon))\\\Rightarrow v_i(a^\star_i)-v_i(a_i(\varepsilon))&=&v^{'}_i(a^\star_i)(a^\star_i-a_i(\varepsilon))-\hat{r_i}(\varepsilon)\end{eqnarray*}} (or the definition of a derivative) we get\begin{eqnarray}\label{eqn9}v_i(a^\star_i)-v_i(a_i(\varepsilon))&=&v^{'}_i(a^\star_i)(a^\star_i-a_i(\varepsilon))-\hat{r_i}(\varepsilon)\\&&~~~~~\mathrm{where}~~\frac{\hat{r}_i(\varepsilon)}{(a^\star -a_i(\varepsilon))}\rightarrow 0~\mathrm{as~}\varepsilon \rightarrow 0.\nonumber\end{eqnarray}%\newpage\noindentSimilarly,\footnote{Here we have $f(\cdot)=v(\cdot), k=1,x+v=x(a_{-i}^\star,a_i(\varepsilon)), v=(a_i(\varepsilon)-a^\star_i)<0$ and $x=a^\star$.Substituting in to the formula above we get\begin{eqnarray*}x(a_{-i}^\star,a_i(\varepsilon))&=&x(a^\star_i)+\frac{\frac{\partial x(a^\star)}{\partial a_i}}{1!}(a_i(\varepsilon)-a^\star_i) +\tilde{r_i}(\varepsilon)\\\Rightarrow -\frac{\partial x(a^\star)}{\partial a_i}(a_i(\varepsilon)-a^\star_i)-\tilde{r_i}(\varepsilon)&=&x(a^\star_i)-x(a_{-i}^\star,a_i(\varepsilon))\\
Equation numbering
Sorry if I misled you, I didn't keep in mind that the page content is still under construction whenpsw1937 wrote: I have found the case where the top equation on the second page is numbered following on from the numbering of the first page. In this case the top equation on page 2 is numbered 1.3 while the second equation on page 2 is numbered 2.1.
\thepage
is called...Heiko's zref package might just do the trick:
Code: Select all
\documentclass[UKenglish,11pt,a4paper]{book}\usepackage{babel,amsmath}\usepackage{blindtext}\usepackage{zref-perpage}%\numberwithin{equation}{page}\zmakeperpage{equation}\renewcommand*\theequation{\thezpage.\arabic{equation}}\begin{document}\blindtext[5]\begin{equation}y=f(x)\end{equation}\end{document}
Rainer
Equation numbering
Thanks Rainer. The way I am doing it now is with the "perpage" package and the commandsrais wrote:Sorry if I misled you, I didn't keep in mind that the page content is still under construction whenpsw1937 wrote: I have found the case where the top equation on the second page is numbered following on from the numbering of the first page. In this case the top equation on page 2 is numbered 1.3 while the second equation on page 2 is numbered 2.1.\thepage
is called...
Heiko's zref package might just do the trick:
\MakePerPage{equation}
\renewcommand{\theequation}{\theperpage.\arabic{equation}}
I guess these two packages will be doing the same thing.
Paul.