Math & Sciencealignat environment with no top/bottom margins

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
CaptainProton
Posts: 15
Joined: Fri Dec 18, 2009 10:54 pm

alignat environment with no top/bottom margins

Post by CaptainProton »

I would like to have my alignat environment to have no top and bottom margins. I found the following solution for the standard align environment which does exactly what I want:

Code: Select all

\makeatletter
\newenvironment{myalign*}{%
  \setlength{\mathindent}{0pt}%
  \setlength{\abovedisplayskip}{-\baselineskip}%
  \setlength{\abovedisplayshortskip}{\abovedisplayskip}%
  \start@align\@ne\st@rredtrue\m@ne
}%
{\endalign}
\makeatother
Can someone help me to adjust it for the alignat environment? I can't figure it out myself.

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

alignat environment with no top/bottom margins

Post by Stefan Kottwitz »

Hi,

here's a modification for the alignat environment:

Code: Select all

\newenvironment{myalignat}[1]{%
  \setlength{\mathindent}{0pt}%
  \setlength{\abovedisplayskip}{-\baselineskip}%
  \setlength{\abovedisplayshortskip}{\abovedisplayskip}%
  \start@align\z@\st@rredtrue#1
}%
{\endalign}
Stefan
LaTeX.org admin
CaptainProton
Posts: 15
Joined: Fri Dec 18, 2009 10:54 pm

alignat environment with no top/bottom margins

Post by CaptainProton »

Stefan_K wrote:here's a modification for the alignat environment:
Thank you very much, it works! I would have never figured this out myself.
Post Reply