centering / aligning arbitrary amsmath objects

by tjt263   Last Updated May 16, 2019 01:23 AM

See how the little ^\frown symbols are aligned (on the last 3 lines) ?
That's what I want.

But see how it's just a concatenation symbol for (C_\alpha) (Cα) and (C_\beta) (Cβ) ?
I want to make that obvious, so I want to push both halves out to the sides (see the second image).

enter image description here

\documentclass[preview,border=2mm]{standalone}
\usepackage{amsmath}
\providecommand{\abs}[1]{\lvert#1\rvert}

\begin{document}

    $$C=E_k(m)$$
    \begin{align*}
        C_\alpha = & (E_k(m) \oplus m) & C_\beta = & (E_k(m) \oplus 1^{\abs{C}}) \\
        C_\alpha = & (C      \oplus m) & C_\beta = & (C      \oplus 1^{\abs{C}}) %%
    \end{align*}

    $$C_\omega = (C_\alpha) ^\frown (C_\beta)\ \ $$
    \begin{align*}
        C_\omega = (E_k(m) \oplus m) & ^\frown (E_k(m) \oplus 1^{|C|}) \\
        C_\omega = (C      \oplus m) & ^\frown (C      \oplus 1^{|C|}) %%
    \end{align*}

\end{document}

Like this, but with the symbol back in it's original spot in the middle. enter image description here

\documentclass[preview,border=2mm]{standalone}
\usepackage{amsmath}
\providecommand{\abs}[1]{\lvert#1\rvert}

\begin{document}

    $$C=E_k(m)$$
    \begin{align*}
        C_\alpha = & (E_k(m) \oplus m) & C_\beta = & (E_k(m) \oplus 1^{\abs{C}}) \\
        C_\alpha = & (C      \oplus m) & C_\beta = & (C      \oplus 1^{\abs{C}}) %%
    \end{align*}

    $$C_\Omega = (C_\alpha) ^\frown (C_\beta)\ \ $$
    \begin{align*}
        C_\Omega = & (E_k(m) \oplus m) & ^\frown & (E_k(m) \oplus 1^{|C|}) \\
        C_\Omega = & (C      \oplus m) & ^\frown & (C      \oplus 1^{|C|}) %%
    \end{align*}

\end{document}

If I could keep it all in the same environment that would also be good, rather than calling \begin{align*} ... \end{align*} and $$ ... $$ twice separately.



Answers 1


Although I would not recommend the desired output, one way to do this is to use alginat:

enter image description here

Notes

Code

\documentclass[preview,border=2mm]{standalone}
\usepackage{amsmath}
\providecommand{\abs}[1]{\lvert#1\rvert}

\begin{document}
\begin{alignat*}{4}
             &       &      C &= E_k(m) \\
    C_\alpha &=  (E_k(m) \oplus m) &\qquad &          &C_\beta &=  (E_k(m) \oplus 1^{\abs{C}}) \\
    C_\alpha &=  (C      \oplus m) &\qquad &          &C_\beta &=  (C      \oplus 1^{\abs{C}}) \\
             &     &C_\Omega = (C_\alpha)  &^\frown (C_\beta) \\
    C_\Omega &=  (E_k(m) \oplus m) &\qquad &^\frown  &&(E_k(m) \oplus 1^{|C|}) \\
    C_\Omega &=  (C      \oplus m) &\qquad &^\frown  &&(C      \oplus 1^{|C|}) %%
\end{alignat*}
\end{document}
Peter Grill
Peter Grill
May 16, 2019 01:13 AM

Related Questions


Updated April 05, 2017 09:23 AM

Updated March 12, 2019 12:23 PM

Updated March 20, 2017 21:23 PM

Updated February 15, 2018 17:23 PM

Updated June 25, 2018 21:23 PM