# Writing Lines and Lines of Math Without Continuation Characters

I've recently converted to using  instead of  as my begin/end math command since I read that is the "correct" method. However, the backslash character is near my pinky on my keyboard and typing that every single line is getting my pinky fatigued.

Is there some sort of multiline equation command/environment in LaTeX similar to how many programming languages have multiline comments?

That is, I currently have:

$r \approx R_{\odot}/2$
$T \approx 10^{7} K$
$M \approx \frac{1}{2} M_{\odot}$
$l \approx R_{\odot}/20$
$H = \frac{L_{\odot}}{4 \pi r^{2}}$
$\Delta \nabla T \approx 2 \times 10^{-10}$
$\frac{dT}{dr} \approx \frac{\bar{T}}{R_{\odot}} \approx 6 \times 10^{-5}$


whereas I would like something of the form

\begin{math}
r \approx R_{\odot}/2
T \approx 10^{7} K
M \approx \frac{1}{2} M_{\odot}
l \approx R_{\odot}/20
H = \frac{L_{\odot}}{4 \pi r^{2}}
\Delta \nabla T \approx 2 \times 10^{-10}
\frac{dT}{dr} \approx \frac{\bar{T}}{R_{\odot}} \approx 6 \times 10^{-5}
\end{math}


Please note that amsmath's align and gather don't fit the bill for me since they require two backslashes at the end of each line.

I'm open to source modification solutions.

Also, I'm using the article documentclass (if it matters).

• you should never have two display math environments in succession so your first example with multiple ..\]... is wrong. It would in theory be possible (but fragile) to make end of line mean \\  in an align but why??? it is only one character less, and you are already entering dozens of \  so \\  is possibly the easiest command to enter. Commented Mar 6, 2016 at 17:50 • Well, you have to use your pinky for basically any TeX command -- ;-) – user31729 Commented Mar 6, 2016 at 17:50 • @DavidCarlisle I don't understand what you mean by the first sentence of your comment; it compiles fine for me. It's true you need \ for all the commands but I still think a reduction in the number I have to enter would be nice (and it would remove 4 characters per line, not one). Your mention of modifying align to make end of line mean \\ is essentially what I was thinking of by "open to source modification solutions;" I just wanted to see if people suggested anything different. Commented Mar 6, 2016 at 19:17 • multiple \[ does not generate a tex error but the vertical space and page break control around the math will be very poor. using a newline instead of \\  to force a new row in the math does save exactly one character, not four:-) Commented Mar 6, 2016 at 19:25
• Okay, I think I understand what you mean about the multiple  issue (though I don't think I've had trouble with it yet). Also, I had meant a "return" will save me four characters in terms of getting rid of the  on each line. Also, since that newline is there no matter what I still think it would save me two characters rather than one in terms of replacing \\ Commented Mar 6, 2016 at 21:00

I think gathered can help you

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$$\begin{gathered} r \approx R_{\odot}/2 \\ T \approx 10^{7} K \\ M \approx \frac{1}{2} M_{\odot} \\ l \approx R_{\odot}/20 \\ H = \frac{L_{\odot}}{4 \pi r^{2}} \\ \Delta \nabla T \approx 2 \times 10^{-10} \\ \frac{dT}{dr} \approx \frac{\bar{T}}{R_{\odot}} \approx 6 \times 10^{-5} \end{gathered}$$

\end{document}


I do agree with comments because \\ are necessary in LaTeX. You will take the habits :)

This solves two problems at once: first, not typing $...$ over and over, and second, having a neat alignment. Try using the align env:

    \begin{align}
r \approx R_{\odot}/2 \\
T \approx 10^{7} K \\
M \approx \frac{1}{2} M_{\odot} \\
l \approx R_{\odot}/20 \\
H = \frac{L_{\odot}}{4 \pi r^{2}} \\
\Delta \nabla T \approx 2 \times 10^{-10} \\
\frac{dT}{dr} \approx \frac{\bar{T}}{R_{\odot}} \approx 6 \times 10^{-5} \\
\end{align}


Now, insert the & symbol where you want it to align. This creates a very nice arrangement! For example, why not try this:

    \begin{align}
&r \approx R_{\odot}/2 \\
&T \approx 10^{7} K \\
&M \approx \frac{1}{2} M_{\odot} \\
&l \approx R_{\odot}/20 \\
&H = \frac{L_{\odot}}{4 \pi r^{2}} \\
&\Delta \nabla T \approx 2 \times 10^{-10} \\
&\frac{dT}{dr} \approx \frac{\bar{T}}{R_{\odot}} \approx 6 \times 10^{-5} \\
\end{align}


This will align everything on the left. Put all the &s to the right for a right align, or mix things up by adding &s in the middle. In general, all equations will shift until the &s line up, then hide the &s.

• The original question states that the double backslash isn't wanted either, hence align isn't acceptable. Commented Mar 19, 2020 at 19:41
• In LaTeX, you normally have to use either \newline or \\. It's very hard to find cases where you don't need those. Commented Mar 21, 2020 at 19:08
• Anyway, simply typing \\  at the end of each line is far better than typing $...$ each time. Commented Apr 3, 2020 at 15:40