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
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
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: 10335
- 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