# formula over two columns in IEEE style

I have two questions:

1. why are the big braces \left( only rendered as small regular ones for most of the equations? How can these be rendered as bigger?
2. Using an IEEE two-column layout and some long formulae I want to typeset the long ones over both columns. How can I acheive this?

    \documentclass[conference]{IEEEtran}
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
%\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts,lipsum}
\usepackage{glossaries}
\makeglossaries

\begin{document}

\lipsum[1-2] % filler text

%%%%%%%%%%%%%%%%
% formula here

$$\text{mean} ={\frac {1}{n}}\sum _{i=1}^{n}x_{i} \label{eq:mean}$$

$$\text{weightedMean} = \frac{\sum_{i_1}^{n} w_i * x_i}{\sum_{i_1}^{n} w_i} \label{eq:weightedMean}$$

Where $x_{long}$ and $y_{lat}$.

$$\text{centroid} = \left[ mean(x_{long}), mean(y_{lat}) \right] \label{eq:centroid}$$

$$\text{distanceHaversine} = 2r \arcsin{\sqrt{ \sin^2{\left(\frac{y_{lat_1}-y_{lat_2}}{2} \right)} + \cos(y_{lat_1}) \cos{y_{lat_2}} \sin^2{\left(\frac{x_{long_1}-x_{long_2}}{2} \right)} }} \label{eq:haversine}$$

\lipsum[1-2] % filler text
\lipsum[1-2] % filler text
\lipsum[1-2] % filler text
\end{document}


Currently is generated - but has the two issues

• About the questions: 1) use \big[ or \bigg[ or a similar thing; 2) it's not easy (see here and you should check if the journal will accept the extra packages. – Rmano Apr 23 at 10:31
• This post might be interesting for point 2: tex.stackexchange.com/a/255115/109339 – luki Apr 23 at 10:36
• Strangely big is not working. But the main problem is 2. – Georg Heiler Apr 23 at 10:38
• Indeed, I have read the two already, but so far have not managed to get it to work. – Georg Heiler Apr 23 at 10:40

For the first point, you can use one of the pairs \bigl... \bigr, \Bigl... \Bbigr, which often produce a better result than \left ... \right

As to your second question, I propose to use the strip environment from the cuted package (sttools bundle). Of course, as it is not a float, it is up to you to determine where to insert it in the code so that the resulting text remains consistent.

Unrelated: needless to load amsfonts when you load amssymb. Also mean should be declared as math operator, so that it be typeset in upshape, with a correct letterspacing, and a proper spacing w.r.t. possible indices or exponents. Last idices which are actually text or text abbreviations should be typed as such.

    \documentclass[conference]{IEEEtran}
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
%\usepackage{cite}
\usepackage{amsmath,amssymb,lipsum}
\DeclareMathOperator{\mean}{mean}
\usepackage{cuted}
\usepackage{glossaries}
\makeglossaries
\newacronym{isp}{ISP}{internet service provider}
\newacronym{poi}{POI}{point of interest}
\newacronym{od}{OD}{origin destination}

\begin{document}

\lipsum[1-2] % filler text

%%%%%%%%%%%%%%%%
% formula here

$$\mean ={\frac {1}{n}}\sum _{i=1}^{n}x_{i} \label{eq:mean}$$

$$\text{weightedMean} = \frac{\sum_{i_1}^{n} w_i * x_i}{\sum_{i_1}^{n} w_i} \label{eq:weightedMean}$$

Where $x_\text{long}$ and $y_\text{lat}$.

$$\text{centroid} = \bigl[ \mean(x_\text{long}),\mean(y_\text{lat}) \bigr] \label{eq:centroid}$$
\begin{strip}
$$\text{distanceHaversine} = 2r \arcsin{\sqrt{ \sin^2{\left(\frac{y_{lat_1}-y_{lat_2}}{2} \right)} + \cos(y_{\text{lat}_1}) \cos{y_{\text{lat}_2}} \sin^2{\left(\frac{x_{\text{long}_1}-x_{\text{long}_2}}{2} \right)} }} \label{eq:haversine}$$
\end{strip}

\lipsum[1-2] % filler text
\lipsum[1-2] % filler text
\lipsum[1-2] % filler text

\end{document}


• Why is it rendering mean for you but I only get = ... – Georg Heiler Apr 23 at 11:04
• @GeorgHeiler - Did you copy over Bernard's definition, viz., \DeclareMathOperator{\mean}{mean}? – Mico Apr 23 at 11:28
• Good point. Thanks. I missed that one. – Georg Heiler Apr 23 at 11:33

1. why are the big braces \left( only rendered as small regular ones for most of the equations? How can these be rendered as bigger?

The belief that \left( and \right) always create "large" parentheses, irrespective of the material they enclose, is widely held but, alas, wrong. As you've (re-)discovered, if the material enclosed by \left( ... \right) is not tall, then the surrounding "fence symbols" aren't either.

See the posting Is it ever bad to use \left and \right? for in-depth discussions of why \left( ... \right) is not a panacea. In fact, it can be quite wrong at times to use \left( ... \right).

1. Using an IEEE two-column layout and some long formulae I want to typeset the long ones over both columns. How can I achieve this?

There are methods to display selected material, including displayed equations, across both columns. For the equation at hand, though, I can't see a good reason for not typesetting it across two lines. This may be achieved by switching from \sqrt{...} notation to [...]^{1/2} notation, switching from an equation environment to a multline environment, and indicating a line break right before the + symbol. Three possible solutions are shown in the following screenshot:

• use \Bigl and \Bigr throughout;

• use \mleft and \mright to size the round parentheses -- the square brackets are sized via \biggl and \biggr as they span a line break;

• use \left and \right to size the round parentheses. Note what many would perceive an excessive amount of whitespace between \sin^2 and (.

Speaking for myself, I'd say that the first solution is the best one.

Note that I've omitted several pairs of curly braces in the equations, e.g., in \cos{y_{lat_2}}.

\documentclass[conference]{IEEEtran}
\usepackage{amsmath} % for "multline" env.
\usepackage{mleftright} % for "\mleft" and "\mright" macros
% utility macro to typeset variable names:
\newcommand{\vn}[1]{\mathit{#1}} % or "\mathrm", or whatever

\begin{document}

\noindent
With \verb+\Bigl+ and \verb+\Bigr+:
\begin{multline} \label{eq:haversine1}
\textnormal{distanceHaversine} = 2r \arcsin \Bigl[
\sin^2 \Bigl(\frac{y_{\vn{lat}_1}-y_{\vn{lat}_2}}{2} \Bigr) \\
+ \cos y_{\vn{lat}_1} \cos y_{\vn{lat}_2} \sin^2
\Bigl(\frac{x_{\vn{long}_1}-x_{\vn{long}_2}}{2} \Bigr) \Bigr]^{1/2}
\end{multline}

\bigskip\noindent
With \verb+\mleft+ and \verb+\mright+:
\begin{multline} \label{eq:haversine2}
\textnormal{distanceHaversine} = 2r \arcsin \biggl[
\sin^2 \mleft(\frac{y_{\vn{lat}_1}-y_{\vn{lat}_2}}{2} \mright) \\
+ \cos y_{\vn{lat}_1} \cos y_{\vn{lat}_2} \sin^2
\mleft(\frac{x_{\vn{long}_1}-x_{\vn{long}_2}}{2} \mright) \biggr]^{1/2}
\end{multline}

\bigskip\noindent
With \verb+\left+ and \verb+\right+:
\begin{multline} \label{eq:haversine3}
\textnormal{distanceHaversine} = 2r \arcsin \biggl[
\sin^2 \left(\frac{y_{\vn{lat}_1}-y_{\vn{lat}_2}}{2} \right) \\
+ \cos y_{\vn{lat}_1} \cos y_{\vn{lat}_2} \sin^2
\left(\frac{x_{\vn{long}_1}-x_{\vn{long}_2}}{2} \right) \biggr]^{1/2}
\end{multline}
\end{document}


Addendum to address the OP's question about allowing a line break in the vinculum of a square-root expression. I initially seemed to remember that this topic had come up before on TeX.SE, but then I couldn't find a prior posting. Anyway, it's not too difficult to introduce a line break by replacing

\sqrt{AAAA BBBB}


with

\sqrt{AAAA} \\ \overline{BBBB}


but the result -- see below -- looks just awful. (I inserted \cdots instructions to help indicate that the square root continued to the next line, but it didn't help much.) I suspect that readers will try to read the full expression as some kind weird fraction and get utterly and hopelessly lost. In short, I wouldn't do it. Use \Bigl[ ... \\ ... \Bigr]^{1/2} notation instead.

\documentclass[conference]{IEEEtran}
\usepackage{amsmath}
\newcommand{\vn}[1]{\mathit{#1}}
\begin{document}
\noindent
With \verb+\Bigl(+ , \verb+\Bigr)+ , and a line break in the vinculum:
\begin{multline} \label{eq:haversine4}
\textnormal{distanceHaversine} = 2r \arcsin \sqrt{\sin^2
\Bigl(\frac{y_{\vn{lat}_1}-y_{\vn{lat}_2}}{2} \Bigr) \cdots} \\[1ex]
\overline{\cdots+\cos y_{\vn{lat}_1} \cos y_{\vn{lat}_2} \sin^2
\Bigl(\frac{x_{\vn{long}_1}-x_{\vn{long}_2}}{2} \Bigr) }
\end{multline}
\end{document}

• Really interesting. I have one more equation with a long \sqrt is it possible to break the sqrt as well? – Georg Heiler Apr 23 at 11:35
• @GeorgHeiler - Let me make sure I understand your follow-up question: Are you asking how to line-break the long horizontal bar that spans the argument of \sqrt? – Mico Apr 23 at 11:46
• Exactly. This is my question. – Georg Heiler Apr 23 at 11:48
• @GeorgHeiler - I seem to recall that there was once a query on just that topic, i.e., how to line-break the vinculum. Let me see if I can find that posting. – Mico Apr 23 at 12:02
• @GeorgHeiler - I wasn't able to locate a prior posting on TeX.SE on your question. I went ahead and posted an addendum to show how one might line-break the vinculum. Speaking for myself, I find the result *just awful" and hence wouldn't do it. – Mico Apr 23 at 13:08