# How to remove the indentation after the optimization problem

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts

\usepackage{optidef}

\begin{document}

\title{Title}

\author{
\IEEEauthorblockN{Author}
}

\maketitle

\section{Test}
The optimization problem is formulated as
\begin{mini!}|l|[3]
{w}{f(w)+ R(w+6x) \protect\label{eq:ObjectiveExample1}}
{\label{eq:Example1}}
{y=}
\end{mini!}
where $a$ is abc, $a$ is abc, $a$ is abc, $a$ is abc, $a$ is abc,
$a$ is abc, $a$ is abc, $a$ is abc, $a$ is abc, and $a$ is abc.

\end{document}


As seen in the figure, there is an indentation before 'where'. I actually do not know why the indentation appears. Is there any method to remove the indentation?

The optidef package suffers from many unprotected end-of-lines, creating unwanted spaces.

For the present problem a fix would be to define more efficiently an internal environment.

\documentclass[conference]{IEEEtran}
\usepackage{newtxtext,newtxmath}

\IEEEoverridecommandlockouts

\usepackage{optidef}

\RenewEnviron{BaseMiniExclam}[7]{%
\selectConstraintMult{#1}%
\renewcommand{\localOptimalVariable}{#2}%
\begin{subequations}
\ifthenelse{\equal{#7}{b}}{\allowdisplaybreaks}%
#4
\begin{alignat}{5}
\bodyobj{#2}{#3}{#6}{#5}
\BODY
\end{alignat}
\end{subequations}%
\setStandardMini
}

\begin{document}

\title{Title}

\author{
\IEEEauthorblockN{Author}
}

\maketitle

\section{Test}
The optimization problem is formulated as
\begin{mini!}|l|[3]
{w}{f(w)+ R(w+6x) \protect\label{eq:ObjectiveExample1}}
{\label{eq:Example1}}
{y=}
\end{mini!}
where $a$ is abc, $a$ is abc, $a$ is abc, $a$ is abc, $a$ is abc,
$a$ is abc, $a$ is abc, $a$ is abc, $a$ is abc, and $a$ is abc.

\end{document}


I used newtx because I can't stand Computer Modern math and Times text.

• I will solve the problem using the same way as your suggestion, without changingoptidef. Thank you. – Danny_Kim Jul 23 '18 at 8:14
• In my original optimization problem, some constraints have 3 terms, e.g. $\lVert x_i-x_j\rVert\le d_{th};\quad x_i,x_j\in\mathcal{X};\quad \mathcal{X}\in f(t)$. In this case, is there any method to vertically align the third terms? – Danny_Kim Jul 23 '18 at 8:21
• @Danny_Kim This is a whole new question. – egreg Jul 23 '18 at 9:07
• Dear @egreg, do you know any good resource where I can learn more about unprotected end-of-lines and unwanted spaces? I am the main developer of the optidef package and I would like to correct this issue. I think that the issue should be corrected using the % character at the end of lines, however I am not able to successfully achieve that within the optidef package. For example, in the original BaseMiniExclam environment, if you want to keep the double if structure with the begingroup and endgroup commands, how can you protect the end of lines? – jesus Aug 7 '18 at 12:33
• @egreg If it helps, perhaps we could continue the discussion in github.com/jeslago/optidef/issues/19, or I could open a new question in tex.stackexchange – jesus Aug 7 '18 at 12:36

It's really hard to tell why it happens. I suspect it's something related to the definition of mini!, and that it has some unwanted spaces in its \end definition. Anyways, telling LaTeX that we want a new paragraph without indentation seems to solve the problem: \par\noindent:

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts

\usepackage{optidef}

\begin{document}

\title{Title}

\author{
\IEEEauthorblockN{Author}
}

\maketitle

\section{Test}
The optimization problem is formulated as
\begin{mini!}|l|[3]
{w}{f(w)+ R(w+6x) \protect\label{eq:ObjectiveExample1}}
{\label{eq:Example1}}
{y=}
\par\noindent where $a$ is abc, $a$ is abc, $a$ is abc, $a$ is abc, $a$ is abc,
$a$ is abc, $a$ is abc, $a$ is abc, $a$ is abc, and $a$ is abc.

• you should never need \noindent in latex so this is really a workaround for the broken package definition also note it suppresses indentation but not other features of the start of a paragraph such as vertical space if \parskip is non zero. – David Carlisle Jul 23 '18 at 8:04
• Wow, \par\noindent readily works well in my case, but one line is spaced. Anyhow, thank you for me to know the command \par\noindent. – Danny_Kim Jul 23 '18 at 8:13