GeneralAnother Question about the align environment

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
avp3000
Posts: 49
Joined: Thu Nov 15, 2007 4:22 pm

Another Question about the align environment

Post by avp3000 »

Hello,

Here is an example:

Code: Select all


\documentclass[10pt]{article}
\usepackage[a4paper,pagesize]{typearea}

\usepackage[english,ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}

\usepackage{blindtext}
\usepackage[pdftex]{graphicx}
\usepackage{color}

\begin{document}

\blindtext
\begin{align*}
\pi_{i}(y_{i},y_{-i}) &= (1 - y_{i} - \sum_{j \neq i} y_{j})y_{i}\\
\Longrightarrow \quad \dfrac{\partial\pi_{i}}{\partial y_{i}} & = 1 - 2y_{i} - \sum_{j \neq i} y_{j} = 0 \\
\text{\textcolor{red}{Nash--Gleichgewicht}:}\\
y_{i}^{\ast} &= \dfrac{1}{(n+1)}\\
\Longrightarrow \qquad Y^{\ast} &= \frac{n}{(n+1)}
\end{align*}
\blindtext
\end{document}

I want to do several things:

1. I want that no empty lines appear between the equations and the two blind texts. I know it doesn't look good, but I need to do this in other situations.
2. I want to align "Nash--Gleichgewicht" to the left. Is there a way to starn an align* environment, than end it and have some normal text and than start the align environment again, but in a way that the equal (=) signs are abouve each other?

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Another Question about the align environment

Post by Stefan Kottwitz »

Hi Alexander,

1. like in the other thread and in the modified example below,
2. use \intertext.

I modified the code, here without the preamble that wasn't modified:

Code: Select all

\begin{document}
\setlength{\abovedisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
\setlength{\jot}{0pt}

\blindtext
\begin{align*}
\pi_{i}(y_{i},y_{-i}) &= (1 - y_{i} - \sum_{j \neq i} y_{j})y_{i}\\
\Longrightarrow \quad \dfrac{\partial\pi_{i}}{\partial y_{i}} & = 1 - 2y_{i} - \sum_{j \neq i} y_{j} = 0 \\
\intertext{\textcolor{red}{Nash--Gleichgewicht}:}
y_{i}^{\ast} &= \dfrac{1}{(n+1)}\\
\Longrightarrow \qquad Y^{\ast} &= \frac{n}{(n+1)}
\end{align*}
\blindtext
\end{document}
Stefan
LaTeX.org admin
avp3000
Posts: 49
Joined: Thu Nov 15, 2007 4:22 pm

Re: Another Question about the align environment

Post by avp3000 »

One more question - what is the default value of \abovedisplayskip? Sometimes it's really useful changing this, but the disadvantage is, it screws the equations on the rest of the presentation. I would be very glad to know the default value, because in this case I can change it at the beginning of the slide and then turn it back to it's default value at the end of the slide. Thank you.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Another Question about the align environment

Post by Stefan Kottwitz »

Hi Alexander,

the value of \abovedisplayskip will be shown in a document if you write

Code: Select all

\the\abovedisplayskip
It will be written to the logfile if you use \showthe:

Code: Select all

\showthe\abovedisplayskip
I get 10.0pt plus 2.0pt minus 5.0pt with the article class.

Instead of using this value I would prefer to define a new length command and save the length of \abovedisplayskip to it for later use. If the change is needed just for a small range it's easier to limit the change of \abovedisplayskip by \begingroup ... \endgroup.
Above advice is valid for other lengths too, of course.

Stefan
LaTeX.org admin
Post Reply