Intereting Posts

Unable to use external PostScript pictures generated by TikZ
Include Page Number in Abstract
highlighting some areas in a picture by making the rest of the picture transparent
Can the PostScript language be used to fully replace TeX?
How to make a newcommand producing a matrix
Creating a custom math symbol from scratch
CritTeXt — any sign of life?
How to change the order in new commands
How can I set a margin equal to “five spaces”?
Towards a \ucshape and \textuc command for uppercase text (XeTeX, LuaTeX)
How do I make every CheckBox the same size?
Small text in table does not recalculate line spacing
Math mode and beamer
Why do I have overfull \hbox when I use inline math without line breaks
How to add extra spaces between rows in tabular environment?

I have a few aligned lists of coefficients. One set of coefficients has three columns and the other has four. At the moment I display them with two `align`

environments:

```
\begin{align}
\gamma_1 &= 8/15 & \gamma_2 &= 5/12 & \gamma_3 &= 3/4 \\
\zeta_1 &= 0 & \zeta_2 &= -17/60 & \zeta_3 &= -5/12 \\
\beta_1 &= 4/15 & \beta_2 &= 1/15 & \beta_3 &= 1/6
\end{align}
\begin{align}
a_0 &= 0 & a_1 &= 8/15 & a_2 &= 2/3 & a_3 &= 1
\end{align}
```

The alignment and spacing between elements in each row is exactly as I want but there is too much space between the three column coefficients and the four column coefficients. Essentially, I want the alignment to reset at a certain point so that the next line of the `align`

environment has four columns and is centered.

- Table rowspan and colspan
- Writing a table with equally spaced columns, based on the widest column
- Title page oddly centered
- Beamer table of contents custom bullets: Long section titles do not align
- Flush what's following \hfill to the next line if it doesn't fit
- Table of contents: section titles ragged right

I learned about the `aligned`

environment as I searched for an answer. The question asked there is essentially what I am asking, but the code provided there does not do what I want. I have not successfully been able to produce code to do exactly what I want.

This is the closest I can get:

```
\begin{align}
\begin{aligned}
\gamma_1 &= 8/15 & \gamma_2 &= 5/12 & \gamma_3 &= 3/4 \\
\zeta_1 &= 0 & \zeta_2 &= -17/60 & \zeta_3 &= -5/12 \\
\beta_1 &= 4/15 & \beta_2 &= 1/15 & \beta_3 &= 1/6 \\
\end{aligned} \\
\begin{aligned}
a_0 &= 0 & a_1 &= 8/15 & a_2 &= 2/3 & a_3 &= 1
\end{aligned}
\end{align}
```

This has two problems:

- The coefficients are compressed rather than expanded as they are with two
`align`

s. - Each
`aligned`

environment has one equation number. I’d prefer to refer to each set of coefficients (gamma, zeta, beta, and a) directly.

Likely I could manipulate the spacing at the bottom and/or top of the align environment and use my original code, but that’s sloppy and I’m confident a simple way to do what I want exists but I’m not aware of it.

Also, the a0 and a3 coefficients are required to be 0 and 1 respectively by definition, so I can leave one out, but I want to include both of them for clarity.

- Tikz matrix arrows alignment
- Centering a gnuplot figure properly
- How to center a lstlisting
- Horizontal alignment of margin notes in nested enumitem list
- How can I align two nodes to the left in TikZ?
- Displaying equation with a line break and all subsequent lines indented
- Conditional centering if single line
- Clean-Looking Piecewise-Defined Functions

You can play around with columns to fool the alignment mechanism as:

```
\begin{align}
\gamma_1 &= 8/15 &&& \gamma_2&= 5/12 &&& \gamma_3 &= 3/4 &\\
\zeta_1 &= 0 &&& \zeta_2&= -17/60 &&& \zeta_3 &= -5/12& \\
\beta_1 &= 4/15 &&& \beta_2&= 1/15 &&& \beta_3 &= 1/6&\\
a_0 ={}&0 &&& a_1 = 8/15 && a_2 = 2/3 &&&\qquad a_3 = 1
\end{align}
```

but with all due respect, what you want to do, does not read well. I would have done something like the following

```
\begin{align}
\gamma_1 &= 8/15 & \gamma_2&= 5/12 & \gamma_3 &= 3/4 \\
\zeta_1 &= 0 & \zeta_2&= -17/60 & \zeta_3 &= -5/12 \\
\beta_1 &= 4/15 & \beta_2&= 1/15 & \beta_3 &= 1/6\\
a_0 &= 0 & a_1 &= 8/15 & a_2 &= 2/3 \\ \notag
& & a_3 &= 1 & &
\end{align}
```

You can deliberately put some vertical space between the first three and the last to highlight the grouping effect which is, in my opinion, more important in order to convey the message rather than to be able to command a LaTeX array.

For full control of the alignment you can use the `alignat`

environment.

```
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools} % loads »amsmath«
\begin{document}
\begin{alignat}{4}
& & \gamma_1 &= 8/15\qquad & \gamma_2 &= 5/12 & \gamma_3 &= 3/4 \\
& & \zeta_1 &= 0 & \zeta_2 &= -17/60\qquad & \zeta_3 &= -5/12 \\
& & \beta_1 &= 4/15 & \beta_2 &= 1/15 & \beta_3 &= 1/6 \\
a_0 &= 0\qquad & a_1 &= 8/15 & a_2 &= 2/3 & a_3 &= 1
\end{alignat}
\end{document}
```

Here is one viable alternative to your alignment issue:

```
\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{align}
\smash{\begin{array}[t]{*{2}{r@{\;}l@{\qquad}}r@{\;}l}
\gamma_1 &= 8/15 & \gamma_2 &= 5/12 & \gamma_3 &= 3/4 \\[\jot]
\zeta_1 &= 0 & \zeta_2 &= -17/60 & \zeta_3 &= -5/12 \\[\jot]
\beta_1 &= 4/15 & \beta_2 &= 1/15 & \beta_3 &= 1/6
\end{array}} \label{gammas} \\ \label{zetas} \\ \label{betas} \\
\begin{array}[t]{*{3}{r@{\;}l@{\qquad}}r@{\;}l}
a_0 &= 0 & a_1 &= 8/15 & a_2 &= 2/3 & a_3 &= 1
\end{array} \label{as}
\end{align}
$\gamma$ is~\eqref{gammas}, $\zeta$ is~\eqref{zetas}, $\beta$ is~\eqref{betas} and $a$ is~\eqref{as}.
\end{document}
```

The equation elements are placed inside an `array`

. Proper vertical alignment is assured using `\\[\jot]`

, while horizontal adjustment is obtained via `\qquad`

for the column spacing. Modify this to suit your need (to say `\quad`

, or `\hspace{<len>}`

where `<len>`

is any known TeX length unit).

A very crude solution is to simply subtract some vertical space.

```
\begin{align}
\gamma_1 &= 8/15 & \gamma_2 &= 5/12 & \gamma_3 &= 3/4 \\
\zeta_1 &= 0 & \zeta_2 &= -17/60 & \zeta_3 &= -5/12 \\
\beta_1 &= 4/15 & \beta_2 &= 1/15 & \beta_3 &= 1/6
\end{align}
\vspace{-\belowdisplayskip}
\vspace{-\abovedisplayskip}
\vspace{-3\jot}
\begin{align}
a_0 &= 0 & a_1 &= 8/15 & a_2 &= 2/3 & a_3 &= 1
\end{align}
```

It’s not perfect though. Does anyone know what the separation between lines in `align`

is?

- Hyperref problems in Beamer when using notes
- moderncv – how to adjust the personal info
- How to edit the linear programming in LaTeX?
- Poisson disc sampling implemented in luatex
- Handwriting drill sheets
- Misaligned month label in TikZ calendar
- Make two versions of one document in LaTeX?
- TeX Live 2013 updates after the release on June 18 (have the pretest version)
- Problem of newenvironment usage with several parameters
- global relabeling of all figures
- Geometric constructions with tikz
- How to break long words after n chars (long genomic sequences)
- How you can put an image in a footnote on page?
- How to set a letter to the margin of the page and position it vertically according to alphabetical order?
- Creating random patterns in TikZ