This is a little LaTeX hack that I would like to document. For something that I am writing right now I have a big table, where one column contains a certain abelian group. All these groups are direct sums of two other abelian groups. Wouldn't it be nice if the column was aligned on the $\oplus$? At the end of this post there is a comparison to see what I mean in practice.

These abelian groups are the Picard group of certain singular curves, and they are direct sums of $\mathrm{Pic}_0$ and a number of copies of $\mathbb{Z}$ depending on the number of irreducible components. But this is not very important for the remainder of the post.

Using the dcolumn package it is possible to align columns on a decimal point. Luckily, this decimal point can be chosen in a rather broad sense. The column specifier

tells you that we wish to align on the + symbol in the LaTeX code, and that we wish to display \oplus as our decimal point. The -1 is not important for us, because we don't have actual decimals.

A few things to keep in mind:

• the dcolumn package automatically turns everything into math mode, hence you don't need to use 's in this particular column; • so if you need to align actual text using this method, you can always wrap things in \text{}; • if you have a column header, you do not with to apply the dcolumn column specifier to it, which is possible by using \multicol{1}{c}{...}. Compare:  \begin{tabular}{c} \toprule \multicolumn{1}{c}{\quad\Pic_0C$} \\ \midrule$C\oplus\mathbb{Z}$\\$\Ga\oplus\mathbb{Z}$\\$\Gm\oplus\mathbb{Z}$\\$\Gm\oplus\mathbb{Z}^{\oplus2}$\\$\Ga\oplus\mathbb{Z}^{\oplus2}$\\ \bottomrule \end{tabular} \begin{tabular}{D{+}{\,\oplus\,}{-1}} \toprule \multicolumn{1}{c}{$\quad\Pic_0C\$} \\ \midrule C+\mathbb{Z} \\ \Ga+\mathbb{Z} \\ \Gm+\mathbb{Z} \\ \Gm+\mathbb{Z}^{\oplus2} \\ \Ga+\mathbb{Z}^{\oplus2} \\ \bottomrule \end{tabular}

Notice that I had to move the column header to the right a little. I should figure out a better solution, especially because this creates a little extra margin on the left. But this nitpickery has gone on long enough now.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9991191029548645, "perplexity": 478.4139785091064}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-34/segments/1596439737178.6/warc/CC-MAIN-20200807113613-20200807143613-00519.warc.gz"}