I've started using new command lately and I think it is great. For example
\newcommand{\QQQ}{~~,\quad\text{and}\qquad }
\newcommand{\WW}{~~,\quad\text{with}\qquad }
\newcommand{\WWW}{~~,\quad\text{where}\qquad }
I also want to have a shortcut for creating equation and align envornments, but newcommand won't let me do it. How can I make a shortcut for
\begin{equation}
\end{equation}?
I'm using TeXStudio if there's a non-latex way to do it in my editor.
For example, if I use
\newcommand{\ZZ }{\begin{align}}
\newcommand{\ZZZ }{\end{align}}
and then type
\ZZ
\pi
\ZZZ
I get the PDF compiler error:
Paragraph ended before \align was complete.
\newcommandwould not work? What did you try that did not work? Can you add an example to show what you tried? – Vincent Dec 28 '20 at 01:47equationit should work, but withalignit doesn't because it scans for the\end{align}text, and with your attempt it fails to find it. I must say, though,\begin{align}tells a lot more than\ZZto me, and with some decent tab completion you can typeba<TAB>and get\begin{align} ... \end{align}typed (even fewer keystrokes than\ZZ ... \ZZZ) – Phelype Oleinik Dec 28 '20 at 02:00\long\def\ZZ#1\ZZZ{\begin{align}#1\end{align}}. This approach has been covered before. – Werner Dec 28 '20 at 03:30