General ⇒ Shortning commands such as \begin{gathered}
-
- Posts: 3
- Joined: Mon Apr 07, 2008 1:02 am
Shortning commands such as \begin{gathered}
Is there any way of doing this short of creating a package?
Thanks!
JT
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Shortning commands such as \begin{gathered}
You can define a synonym for those environments using something like
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\newenvironment{gatd}{\gathered}{\endgathered}
\begin{document}
\begin{equation}
\begin{gatd}
(a+b)(a-b)=a^2-b^2\\
(a+b)(a+b)=a^2+2ab+b^2
\end{gatd}
\begin{gatd}
(a-b)(a-b)=a^2-2ab+b^2\\
(a-b)(a+b)=(a+b)(a-b)
\end{gatd}
\end{equation}
\end{document}
Shortning commands such as \begin{gathered}
Code: Select all
\let\bg\gathered
\let\eg\endgathered
Code: Select all
\[
\bg
a+b+c=d+e \\
f+g+h=i
\eg
\]
Re: Shortning commands such as \begin{gathered}
B.A.
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Shortning commands such as \begin{gathered}
short workaround:
Code: Select all
\def\bg#1\eg{\gathered#1\endgathered}
Code: Select all
\newcommand\gath[1]{\gathered#1\endgathered}
Stefan