# Align text centered around (custom) symbol with linebreak

I want to align two text columns centered around one symbol. The following code is close to the solution, but still has a linebreak problem:

\newcommand{\correspondsto}{\overset{\scriptscriptstyle\wedge}{=}}
\begin{document}

\begin{equation*}
\begin{array}{@{} @{\qquad} r @{} >{{}}l @{}}
\text{this is the first part and could be longer than one line}     &\correspondsto \text{the same holds for the second cell} \\
\text{Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, }         &\correspondsto \text{ Lorem Ipsum has been the industry} \\
\end{array}
\end{equation*}

\end{document}


which yields:

While this attempt works with short texts, it doesn't work with longer ones. I need a line break (possibly manually) but the centered symbol should still be centered between the lines forming a block, i.e.: isn't o.k. as the correspondsto symbol should be centered between the second and third line, as those form a "block". Is there a way to do this in latex?

• Should the correspondsto sign be exactly in the horizontal center of the page? – leandriis Mar 29 at 10:01
• Not necessarily, one side could be shorter if there is less next. – black Mar 29 at 10:03

Here is my suggestion using tabularx:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tabularx}
\usepackage{booktabs}

\newcommand{\correspondsto}{$\overset{\scriptscriptstyle\wedge}{=}$}

\renewcommand\tabularxcolumn[1]{m{#1}}
\begin{document}

this is the first part and could be longer than one line     & the same holds for the second cell \\ \addlinespace
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,          &  Lorem Ipsum has been the industry \\
\end{tabularx}

\bigskip

this is the first part and could be longer than one line     & the same holds for the second cell \\ \addlinespace
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,          &  Lorem Ipsum has been the industry \\
\end{tabularx}

\end{document}


Something like this? I also changed the wedge to a \widehat. Replace the definition if you prefer.

\documentclass{article}
\usepackage{amsmath}

%\newcommand{\correspondsto}{\overset{\scriptscriptstyle\wedge}{=}}
\newcommand{\correspondsto}{\mathrel{\widehat{=}}}

\newcommand{\correspondence}[2]{%
\parbox{0.4\displaywidth}{\raggedleft\strut\ignorespaces#1\unskip\strut}%
&\correspondsto
\parbox{0.4\displaywidth}{\raggedright\strut\ignorespaces#2\unskip\strut}%
}

\begin{document}

\begin{align*}
\correspondence{Short text}{Short text} \\
\correspondence{
this is the first part and could be longer than one line
}{
the same holds for the second cell
} \\
\correspondence{
Lorem Ipsum has been the industry's standard
dummy text ever since the 1500s,
}{
Lorem Ipsum has been the industry
} \\
\correspondence{
Lorem Ipsum has been the industry's standard
dummy text ever since the 1500s,
}{
Lorem Ipsum
}
\end{align*}

\end{document}


• You need a strut after "cell". If the number of lines is the same on both sides, or differs by two, the heights of the first lines and the depths of the last lines need to be the same or the baselines won't match. – barbara beeton Mar 29 at 16:48
• @barbarabeeton Thanks, added struts both at the beginning and end. – egreg Mar 29 at 17:07