5

I've faced with a situation like below in IEEEconf 2-column template:

enter image description here

\documentclass[letterpaper, 10pt, conference]{IEEEconf}

\usepackage{graphicx}
\usepackage{mathptmx}
\usepackage{amsmath}
\usepackage{amssymb}

\title{My Title*}

\author{Guy$^{1}$
\thanks{*This work was not supported by any organization}% <-this % stops a space
\thanks{$^{1}$Guy is with Hell, {\tt\small guy@hell.edu}}%
}

\begin{document}

\maketitle
\thispagestyle{empty}
\pagestyle{empty}

\begin{abstract}

ABSTRACT

\end{abstract}

\section{INTRODUCTION}

\noindent\begin{minipage}{.5\linewidth}
\begin{equation}
  \begin{cases}
    \theta_{i}^{h^{-}} = \frac{\displaystyle 2(i-1)\pi}{\displaystyle m_{c}^{\hat{x}}}\\
    \theta_{i}^{h^{+}} = \frac{\displaystyle 2i\pi}{\displaystyle m_{c}^{\hat{x}}}\\
\end{cases}
\end{equation}
\end{minipage}%
\begin{minipage}{.5\linewidth}
\begin{equation}
    \begin{cases}
    \theta_{j}^{v^{-}} = \frac{\displaystyle 2(j-1)\pi}{\displaystyle m_{c}^{\hat{v}}}\\
    \theta_{j}^{v^{+}} = \frac{\displaystyle 2j\pi}{\displaystyle m_{c}^{\hat{v}}}\\
\end{cases}
\end{equation}
\end{minipage}

\end{document}

I'm gonna decrease the distance between right equation with its label (i.e. (3)), such that everything will be placed in a straight line.

What is the best approach to do that?

Update 1: result of @Zarko's code:

enter image description here

  • 1
    If you need it for a two-column format, then you should post a document in two-column format. – gernot Jan 15 '17 at 00:26
  • @gernot: The MWE is for two-column scenario, now. –  Jan 15 '17 at 00:30
  • since you're using amsmath, there is a command \raisetag{,dimen>} that can be applied if a tag is moved away from its "normal" position, which this one is. try \raisetag{1.5\baselineskip} just before the second \end{equation}. documented in texdoc amsmath, section 3.8. – barbara beeton Jan 15 '17 at 20:50

4 Answers4

3

The equation number has a minimum distance from the equation, but there's a slick trick in exercise 19.8 of the TeXbook.

\documentclass[letterpaper, 10pt, conference]{IEEEconf}  % Comment this line out if you need a4paper

\usepackage{graphicx} % for pdf, bitmapped graphics files
\usepackage{mathptmx} % assumes new font selection scheme installed
\usepackage{amsmath} % assumes amsmath package installed
\usepackage{amssymb}  % assumes amsmath package installed
\usepackage{amsthm}
\usepackage{lipsum}

\renewcommand{\qedsymbol}{$\blacksquare$}

\newtheorem{thm}{Theorem}[section]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{cor}{Corollary}
\newtheorem{conj}{Conjecture}[section]
\theoremstyle{definition}
\newtheorem{defn}{Definition}[section]
\newtheorem{exmp}{Example}[section]
\newtheorem{rem}{Remark}

\title{My Title*}

\author{Guy$^{1}$
\thanks{*This work was not supported by any organization}% <-this % stops a space
\thanks{$^{1}$Guy is with Hell, {\tt\small guy@hell.edu}}%
}

\begin{document}

\maketitle

\lipsum[2]\nopagebreak
\noindent
\begin{minipage}{.45\linewidth}
\begin{equation}
  \begin{cases}
    \theta_{i}^{h^{-}} = \dfrac{ 2(i-1)\pi}{ m_{c}^{\hat{x}}}\\
    \theta_{i}^{h^{+}} = \dfrac{ 2i\pi}{ m_{c}^{\hat{x}}}\\
\end{cases}
\hspace{10000pt minus 1fil}
\end{equation}
\end{minipage}\hspace{.1\linewidth plus 4pt}%
\begin{minipage}{.45\linewidth}
\begin{equation}
    \begin{cases}
    \theta_{j}^{v^{-}} = \dfrac{ 2(j-1)\pi}{ m_{c}^{\hat{v}}}\\
    \theta_{j}^{v^{+}} = \dfrac{ 2j\pi}{ m_{c}^{\hat{v}}}\\
\end{cases}
\hspace{10000pt minus 1fil}
\end{equation}
\end{minipage}\nopagebreak\vspace{\belowdisplayskip}%
\lipsum[3]

\end{document}

I have used lipsum to emulate some text before and after the equations. Note how to get the same spacing as for a normal equation environment, with no breaks before and after.

The trick is inserting a large glob of horizontal glue, which can be shrinked as much as possible:

\hspace{10000pt minus 1fil}

I have also reduced the width of the minipages, to avoid the left equation number to be too near to the part on the right.

Note also \dfrac, rather than all those \displaystyle tokens.

enter image description here

egreg
  • 1,121,712
  • Still simpler than \dfrac: dcases. – Bernard Jan 15 '17 at 00:49
  • It looks like the OP wants to typeset the numerators and denominators in display style. \dfrac doesn't quite achieve this: its numerators and denominators will be typeset in text style, not display style. – Mico Jan 15 '17 at 06:43
  • @egreg I like your font. – minhthien_2016 Jan 15 '17 at 07:27
  • @Mico I disagree. There is no reason for using display style in the numerator and denominator here. – egreg Jan 15 '17 at 09:41
  • @toandhsp I don't. I just used the same as the OP. – egreg Jan 15 '17 at 09:42
  • I take it your disagreement is with the OP's typesetting objective and not with what I wrote. :-) – Mico Jan 15 '17 at 09:50
  • @Mico Compare the results. In my opinion, your's (and the OP's) is wrong: the exponents in the denominators are way too high. – egreg Jan 15 '17 at 09:51
  • Thanks for pointing out the issue with the improperly placed exponents in the denominators. Turns out it was caused by inappropriately sized math struts; I've updated the answer to correct this issue. After applying this correction, the difference between \dfrac and \ddfrac (the latter with typographic struts) is pretty much minimal... – Mico Jan 15 '17 at 10:09
  • @egreg You said there is a minimum distance between the equation and its number. Do you maybe know how much this distance is (in points per say)? Or if there is a command which gives this number? – Jim Apr 14 '21 at 23:36
  • 1
    @Jim It's basically 1em (in the symbol font, but usually this is the same as 1em in the text font). – egreg Apr 15 '21 at 07:36
  • @egreg Got it, thanks! – Jim Apr 17 '21 at 02:44
2

Edit: Since the question was misleading, the first answer version was accommodate to one column document. Of course meanwhile, after editing of question, appears other answers ...

Reduce width of minipages and push them apart with \hfill and reduce space between equation and equation number by \hspace{-1em}:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

  \noindent$|$\hrulefill\ column width\ \hrulefill$|$

\noindent\begin{minipage}{.48\linewidth} % <-- reduced minipage width
\begin{equation}
  \begin{cases}
\theta_{i}^{h^{-}} = \frac{\displaystyle 2(i-1)\pi}{\displaystyle m_{c}^{\hat{x}}}\\
\theta_{i}^{h^{+}} = \frac{\displaystyle 2i\pi}{\displaystyle m_{c}^{\hat{x}}}
    \end{cases}\hspace{-1em}% <-- added to reduce distance to eq. numbering apart
\end{equation}
\end{minipage}\hfill % <-- added to push minipages appart
\begin{minipage}{.48\linewidth} % <-- reduced minipage width
\begin{equation}
    \begin{cases}
\theta_{j}^{v^{-}} = \frac{\displaystyle 2(j-1)\pi}{\displaystyle m_{c}^{\hat{v}}}\\
\theta_{j}^{v^{+}} = \frac{\displaystyle 2j\pi}{\displaystyle m_{c}^{\hat{v}}}
\end{cases}\hspace{-1em}% <-- added to reduce distance to eq. numbering
\end{equation}
\end{minipage}
\end{document}

enter image description here

Zarko
  • 296,517
  • Thanks, but I should have said that I am using this code in a 2-column environment in IEEEconf template. Your solution actually sent both labels to inappropriate position. Please find the update. –  Jan 15 '17 at 00:20
  • How do I know this? Please, in future be so kind and provide complete small document (MWE) not only code snippet ... – Zarko Jan 15 '17 at 00:42
  • You are right. I do apologize due to wasting your time by that. –  Jan 15 '17 at 00:45
2

Add some negative space

\begin{equation}
  \hspace{-2em}
  \begin{cases}
    ...
  \end{cases}
  \hspace{-2em}
\end{equation}

enter image description here

\documentclass[letterpaper, 10pt, conference]{IEEEconf}

\usepackage{graphicx}
\usepackage{mathptmx}
\usepackage{amsmath}
\usepackage{amssymb}

\title{My Title*}

\author{Guy$^{1}$
\thanks{*This work was not supported by any organization}% <-this % stops a space
\thanks{$^{1}$Guy is with Hell, {\tt\small guy@hell.edu}}%
}

\begin{document}

\maketitle
\thispagestyle{empty}
\pagestyle{empty}

\begin{abstract}

ABSTRACT

\end{abstract}

\section{INTRODUCTION}

\noindent\begin{minipage}{.5\linewidth}
\begin{equation}
  \hspace{-2em}
  \begin{cases}
    \theta_{i}^{h^{-}} = \frac{\displaystyle 2(i-1)\pi}{\displaystyle m_{c}^{\hat{x}}}\\
    \theta_{i}^{h^{+}} = \frac{\displaystyle 2i\pi}{\displaystyle m_{c}^{\hat{x}}}
  \end{cases}
  \hspace{-2em}
\end{equation}
\end{minipage}%
\begin{minipage}{.5\linewidth}
\begin{equation}
  \hspace{-2em}
  \begin{cases}
    \theta_{j}^{v^{-}} = \frac{\displaystyle 2(j-1)\pi}{\displaystyle m_{c}^{\hat{v}}}\\
    \theta_{j}^{v^{+}} = \frac{\displaystyle 2j\pi}{\displaystyle m_{c}^{\hat{v}}}
  \end{cases}
  \hspace{-2em}
\end{equation}
\end{minipage}

\end{document}
gernot
  • 49,614
1

(Updated the answer to employ the Times Roman newtxtext and newtxmath font packages instead of the somewhat obsolescent mathptmx package.)

By using the fairly recent newtxtext and newtxmath Times Roman font package instead of mathptmx, enough space is saved to let you use significantly narrower minipage environments -- providing more separation between the minipage environments

To simplify the code in the equations, the answer sets up a custom macro, called \ddfrac, which automatically typesets the numerator and denominator material in display style.

For extra legibility, you may also want to use (a) dcases environments instead of cases environments and (b) a few \mathstrut directives to increase the space between the fraction lines and the material in the respective denominators.

enter image description here

\documentclass[letterpaper,conference,twocolumn]{IEEEconf}
\usepackage{newtxtext,newtxmath}% not "mathptmx"
\usepackage{mathtools,amssymb}
\newcommand\ddfrac[2]{\dfrac{\displaystyle #1}{\displaystyle #2}} % handy shortcut macro
\newcommand\Tstrut{\smash[b]{\mathstrut}} % "top strut"
\begin{document}
\hrule %  just to illustrate width of text block
\section{INTRODUCTION}

\noindent
\begin{minipage}{.45\columnwidth}
\begin{equation}
  \begin{dcases}
    \theta_{i}^{h^{-}} = \ddfrac{2(i-1)\pi}{m_{c}^{\Tstrut\hat{x}}}\\
    \theta_{i}^{h^{+}} = \ddfrac{2i\pi}{m_{c}^{\Tstrut\hat{x}}}\\
\end{dcases}
\end{equation}
\end{minipage}\hfill
\begin{minipage}{.45\columnwidth}
\begin{equation}
    \begin{dcases}
    \theta_{j}^{v^{-}} = \ddfrac{2(j-1)\pi}{m_{c}^{\Tstrut\hat{v}}}\\
    \theta_{j}^{v^{+}} = \ddfrac{2j\pi}{m_{c}^{\Tstrut\hat{v}}}\\
\end{dcases}
\end{equation}
\end{minipage}

\end{document}
Mico
  • 506,678