4

Currently, I am using the \align method in this way:

\begin{align}
\mathcal{P}(Z \leq z) &= \mathcal{P}t\{f_1(\delta).f_2(\delta)\right\} \\
& = \exp(mt) \star \left\{\frac{l}{2\sqrt{\pi t^3}} \exp(-l^2/{4t})\right\} \\
& = F_1 * F_2
\end{align}

(sample code was found here)

This produces the following results (including an automatic equation line numbering system): enter image description here

Would it be possible to replace those autonumbers with a description added in manually? I already know there is a way to remove the autonumbers, but I also would like to add some text to describe each line. Is this possible or too difficult to achieve?

Daneolog
  • 143

1 Answers1

5

You can use \tag*{<stuff>} to add descriptions without the surrounding (...) common to tags. If you want custom tags surrounded by (...), use \tag{<stuff>}.

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
  \mathcal{P}(Z \leq z) &= \mathcal{P} t \{f_1(\delta).f_2(\delta) \} \tag{description1}                   \\
                        &= \exp(mt) \star \left\{ \frac{\ell}{2\sqrt{\pi t^3}} \exp(-\ell^2/{4t}) \right\} \\
                        &= F_1 \times F_2 \tag{description2}
\end{align*}

\end{document}

It's probably better to use a macro-like approach through something like

\newcommand{\eqdesc}[2][2em]{\tag*{#2}\hspace{#1}}

which inserts a 2em space at the end of the \tag*, effectively indenting it from the right-margin. This could separate it visually from other, regular \tags, if needed.

A more tabular-like display of descriptions is possible if you just add another equation into the mix:

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
  \mathcal{P}(Z \leq z) &= \mathcal{P} t \{f_1(\delta).f_2(\delta) \} &
    \text{description1} \\
                        &= \exp(mt) \star \left\{ \frac{\ell}{2\sqrt{\pi t^3}} \exp(-\ell^2/{4t}) \right\} \\
                        &= F_1 \times F_2 &
    \text{description2}
\end{align*}

\end{document}

There will be a visible space between the equations to separate them.

Werner
  • 603,163
  • 1
    Hmm... is there any way to put it a little closer to the left instead of having it right-aligned to the entire page? It's a little nit-picky but it just looks kinda odd... – Daneolog Jan 26 '19 at 06:42
  • 1
    @Daneolog: Yes. \tag and \tag* are similar to equation numbering. In fact, if you use add a \label, you can \ref it later. If you're not using any \label-\refs with these descriptions, you can manhandle them slightly using something like \newcommand{\eqdesc}[2][2em]{\tag*{#2\hspace{#1}}}. This puts a \tag* with a default space of 2em on the right, effectively pushing it in 2em from the right margin. Use \eqdesc[3em]{stuff} to change the default spacing. Is this more in line with what you're after? – Werner Jan 26 '19 at 06:49
  • 1
    Hmm somewhat. I guess what I was technically going for was a more tabular format, similar to what \begin{tabular} does here – Daneolog Jan 26 '19 at 06:56
  • 1
    This makes it look like the description is still left-oriented while on the right side of the equations. – Daneolog Jan 26 '19 at 06:57
  • 1
    @Daneolog: You can add another equation as your "description", encapsulating it inside \text. I've added that as another option to my answer. – Werner Jan 26 '19 at 07:01
  • 1
    Perfect! Works like a charm :) Thanks so much – Daneolog Jan 26 '19 at 07:10