2

I have this code

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2.5cm,showframe]{geometry}
\usepackage{amsmath}

\begin{document}

\begin{equation}
    dy_{t}
        =\frac{\partial g}{\partial t}(x_{t},t)dt
        +\frac{\partial g}{\partial x}(x_{t},t)dx_{t}
        +\frac{1}{2}\frac{\partial^2 g}{\partial x^2}(x_{t},t)(dx_{t})^2
\end{equation}

\end{document}

which produces this output

enter image description here

Is there a way to give the equation a name, f.x. Itô's Lemma, and insert it directly underneath the equation (centered)? The idea is that it is still a part of the \begin{equation}...\end{equation} environment. I have read this, but the solution is not exactly the same. Thanks in advance!

1 Answer 1

2

It doesn't seem like a good idea, but the document is yours. The approach in the linked question is much worse, however.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2.5cm,showframe]{geometry}
\usepackage{amsmath}

\begin{document}

\begin{gather}
    dy_{t}
        =\frac{\partial g}{\partial t}(x_{t},t)dt
        +\frac{\partial g}{\partial x}(x_{t},t)dx_{t}
        +\frac{1}{2}\frac{\partial^2 g}{\partial x^2}(x_{t},t)(dx_{t})^2
\\
\text{Itô's lemma}\notag
\end{gather}

\end{document}

enter image description here

For completeness, I'd rather go with something like below.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2.5cm,showframe]{geometry}
\usepackage{amsmath}

\begin{document}

We obtain the following equation, known as \emph{Itô's lemma},
\begin{equation}
    dy_{t}
        =\frac{\partial g}{\partial t}(x_{t},t)dt
        +\frac{\partial g}{\partial x}(x_{t},t)dx_{t}
        +\frac{1}{2}\frac{\partial^2 g}{\partial x^2}(x_{t},t)(dx_{t})^2
\end{equation}

\end{document}

enter image description here

In the case you seem to be after, I can suggest something like this.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2.5cm,showframe]{geometry}
\usepackage{amsmath}
\usepackage{nccmath}

\begin{document}

\section{Main body}

We recall the fundamental \emph{Pythagoras' theorem}
\begin{equation}\label{pyth}
a^2+b^2=c^2
\end{equation}
From it we easily obtain the following equation, known as \emph{Itô's lemma},
\begin{equation}\label{ito}
    dy_{t}
        =\frac{\partial g}{\partial t}(x_{t},t)dt
        +\frac{\partial g}{\partial x}(x_{t},t)dx_{t}
        +\frac{1}{2}\frac{\partial^2 g}{\partial x^2}(x_{t},t)(dx_{t})^2
\end{equation}

\begin{fleqn}[2em]
\setlength{\parindent}{0pt}

\section{Equations}

Pythagoras' theorem
\begin{equation}\tag{\ref{pyth}}
a^2+b^2=c^2
\end{equation}

Itô's lemma
\begin{equation}\tag{\ref{ito}}
    dy_{t}
        =\frac{\partial g}{\partial t}(x_{t},t)dt
        +\frac{\partial g}{\partial x}(x_{t},t)dx_{t}
        +\frac{1}{2}\frac{\partial^2 g}{\partial x^2}(x_{t},t)(dx_{t})^2
\end{equation}

\end{fleqn}

\end{document}

enter image description here

Alternatively, with the references next to the name:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2.5cm,showframe]{geometry}
\usepackage{amsmath}
\usepackage{nccmath}

\begin{document}

\section{Main body}

We recall the fundamental \emph{Pythagoras' theorem}
\begin{equation}\label{pyth}
a^2+b^2=c^2
\end{equation}
From it we easily obtain the following equation, known as \emph{Itô's lemma},
\begin{equation}\label{ito}
    dy_{t}
        =\frac{\partial g}{\partial t}(x_{t},t)dt
        +\frac{\partial g}{\partial x}(x_{t},t)dx_{t}
        +\frac{1}{2}\frac{\partial^2 g}{\partial x^2}(x_{t},t)(dx_{t})^2
\end{equation}

\begin{fleqn}[2em]
\setlength{\parindent}{0pt}

\section{Equations}

Pythagoras' theorem~\eqref{pyth}
\begin{equation*}
a^2+b^2=c^2
\end{equation*}

Itô's lemma~\eqref{ito}
\begin{equation*}
    dy_{t}
        =\frac{\partial g}{\partial t}(x_{t},t)dt
        +\frac{\partial g}{\partial x}(x_{t},t)dx_{t}
        +\frac{1}{2}\frac{\partial^2 g}{\partial x^2}(x_{t},t)(dx_{t})^2
\end{equation*}

\end{fleqn}

\end{document}

enter image description here

7
  • 1
    I like the second option. If you have to insert a final mark because it's end of paragraph, would you use )^2**\ .**\end{equation}?
    – manooooh
    Sep 14, 2018 at 15:55
  • 2
    @manooooh I usually add punctuation directly, without spaces.
    – egreg
    Sep 14, 2018 at 15:57
  • @egreg Thank you! The reason I asked the question is that I am writing a document, where I at the end of it list/recall all the equations from the document. This means that I have 1-2 pages consisting only of equations. Since some of them are quite similar, it helps if they're named. If we're talking about writing an article, then I completely agree that your second solution is better.
    – Andreas
    Sep 14, 2018 at 15:58
  • 1
    @Andreas In that case I'd go with the name and the equation on the next line, using (almost) flush left equations (you can mix standard centered equations and flush left in the same document with the nccmath package); a quad or two from the margin for the equation would be OK.
    – egreg
    Sep 14, 2018 at 16:01
  • 1
    @Andreas I added a couple of suggestions
    – egreg
    Sep 14, 2018 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .