How do you get equations numbers of the form "page number.equation number”. Is there a way to set things up so the equation command numbers this way automatically?
Thanks
Text Formatting ⇒ Equation numbering
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
Hi Rainer
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.
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: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Equation numbering
Hi,
Stefan
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
LaTeX.org admin
Equation numbering
Yes. I have had both occur in the same document. Unfortunately its a 200 page document and finding the bit of code that causes the problem is difficult. I have code that numbers the first equation on the top of the page 0. The equation at the top of page 2 is numbered 2.0, or at least it was when I ran this code. I'll keep looking for the example of other problem.
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.
\[\Delta S_S^{\star\star}-\Delta S_S^{\star\star\star}=\frac{1}{4}(v^2+2c)\footnote{This follows from,\begin{eqnarray*}
\Delta S^{\star\star}_S&=&\frac{1}{4}(v-c)^2\\
&=&\frac{1}{4}(v^2-2vc+c^2)\\
&=&\frac{1}{4}v^2-\frac{1}{2}vc+\frac{1}{4}c^2\\
\Delta S^{\star\star\star}_S&=&-\pi^{\star\star\star}c-(1-\pi^{\star\star\star})\frac{1}{2}c\\
&=&-\pi^{\star\star\star}c-\frac{1}{2}(c-\pi^{\star\star\star}c)\\
&=&-\pi^{\star\star\star}c-\frac{1}{2}(c-(v-\frac{1}{2}c)c)\\
&=&-\pi^{\star\star\star}c-\frac{1}{2}(c-vc+\frac{1}{2}c^2)\\
&=&-c(v-\frac{1}{2}c)-\frac{1}{2}(c-vc+\frac{1}{2}c^2)\\
&=&-vc+\frac{1}{2}c^2-\frac{1}{2}c+\frac{1}{2}vc-\frac{1}{4}c^2\\
&=&-\frac{1}{2}vc+\frac{1}{4}c^2-\frac{1}{2}c\\
\Delta S^{\star\star}_S-\Delta S^{\star\star\star}_S&=&\frac{1}{4}v^2-\frac{1}{2}vc+\frac{1}{4}c^2+\frac{1}{2}vc-\frac{1}{4}c^2+\frac{1}{2}c\\
&=&\frac{1}{4}v^2+\frac{1}{2}c\\
&=&\frac{1}{4}(v^2-2c).
\end{eqnarray*}}\]Here we can think of this outcome as resulting from the Buyer's firm purchasing the Seller's firm for a price of $\frac{1}{4}(v^2-2c)$ in period A. Ownership in the sense of GHM means the Buyer gains residual control rights over the Seller's firm, or more precisely the residual control rights over the non-human assets of the Seller's firm. The residual control right are, however, limited in this case to deciding whether or not to make the quality improvement in period B. The fact that the Buyer can make this decision by fiat means that the Seller's improvement costs, $c$, are not being internalised in {\em Case III} as they were in equation of {\em Case I}. This explains why despite the fact that the two firms are integrated joint profits are less than in the first-best outcome ({\em Case I} ).
\end{document}
Last edited by Stefan Kottwitz on Sat Jan 03, 2015 11:19 pm, edited 1 time in total.
Equation numbering
Hi Stefan
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.
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\noindent
Similarly,\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))\\
\Rightarrow x(a^\star_i)-x(a_{-i}^\star,a_i(\varepsilon))&=&\frac{\partial x(a^\star)}{\partial a_i}(a^\star_i-a_i(\varepsilon))-\tilde{r_i}(\varepsilon)
\end{eqnarray*}}
\begin{eqnarray}\label{eqn10}x(a^\star_i)-x(a_{-i}^\star,a_i(\varepsilon))&=&\frac{\partial x(a^\star)}{\partial a_i}(a^\star_i-a_i(\varepsilon))-\tilde{r_i}(\varepsilon)\\
&&~~~~~\mathrm{where}~~\frac{\tilde{r}_i(\varepsilon)}{(a^\star -a_i(\varepsilon))}\rightarrow 0~\mathrm{as~}\varepsilon \rightarrow 0.\nonumber\end{eqnarray}
Since $a^\star$ maximises total surplus it is the solution to the problem:
\begin{equation}\max_{a} S(a)=x(a)-\sum^n_{i=1} v_i(a_i)\end{equation}which means it satisfies the first order considtions\[\frac{\partial x(a^\star)}{\partial a_i}=v^{'}(a^\star_i)~~~~~i=1, \dots, n\]This means we can rewrite \ref{eqn10}. Remember that $x^\star -\varepsilon=x(a^\star_{-i},a_i(\varepsilon))$ so that\[x^\star-x(a^\star_{-i},a_i(\varepsilon))=x^\star-(x^\star-\varepsilon)=\frac{\partial x(a^\star)}{\partial a_i}(a^\star_i-a_i(\varepsilon))-\tilde{r_i}(\varepsilon)\]which means
\begin{eqnarray*}\frac{\partial x(a^\star)}{\partial a_i}(a^\star_i-a_i(\varepsilon))-\tilde{r_i}(\varepsilon)&=&x^\star-(x^\star-\varepsilon)\\
&\geq& n(v_i(a^\star_i)-v_i(a_i(\varepsilon)))\\
&=&n\left(\frac{\partial x(a^\star)}{\partial a_i}(a^\star_i-a_i(\varepsilon))-\hat{r_i}(\varepsilon)\right)\end{eqnarray*}Dividing by $a^\star_i-a_i(\varepsilon)$ and gathering the remainders gives
\[\frac{\partial x(a^\star)}{\partial a_i}\geq n\frac{\partial x(a^\star)}{\partial a_i}+\frac{\tilde{r}_i(\varepsilon)-n\hat{r}_i(\varepsilon)}{a^\star_i-a_i(\varepsilon)}\]Letting $\varepsilon\rightarrow 0$ gives\footnote{Now there is a caveat here: Remember that $i$ in (\ref{eqn8}) depends on $\varepsilon$, so as $\varepsilon\rightarrow0$, the index $i$ may change. Nevertheless, since there are only $n$ choices for $i$, some index $i$ must occur infinitely often, so for such an index the equation above must hold.}
\[\frac{\partial x(a^\star)}{\partial a_i}=n\left({\frac{\partial x(a^\star)}{\partial a_i}}\right)~~~~~~~~(\mathrm{utilising~equations~\ref{eqn9}~and~\ref{eqn10}).}\]
\end{document}
Last edited by Stefan Kottwitz on Sun Jan 04, 2015 12:11 pm, edited 1 time in total.
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.