1

This is over a single line. I honestly thought it would be very simple but so far I have tried:

  • \hfill
  • \hspace*{\fill}
  • \null\hfill
  • \hspace*{0pt}\hfill
  • \mbox{}\hfill

In the following line:

$$g(x) = \underset{c \in \mathcal{Y}}{\operatorname{arg max}} \mathcal{P}(f(x + \epsilon)=c), \hfill \epsilon \sim \mathcal{N}(0, \sigma^2I)$$

All of them result in:

enter image description here

If I just use inline math-mode with a new line, it results in the main equation being left-aligned. I want the main equation to be centrally aligned, with the noise right-aligned.

Stephen
  • 3,826

1 Answers1

0

enter image description here

I'd use the last realization, as there is no reason for shoving the side condition to the right margin.

In any case, $$ should never be used in a LaTeX document environment. Also note \operatorname* instead of \underset.

\documentclass{article}
\usepackage{amsmath}

% these two packages just for the example \usepackage{lipsum} \usepackage{showframe}

\begin{document}

\lipsum[1][1-4] [ \hspace{1000pt minus 1fill} g(x) = \operatorname{arg,max}_{c \in \mathcal{Y}}\mathcal{P}(f(x + \epsilon)=c), \hspace{1000pt minus 1fill} \epsilon \sim \mathcal{N}(0, \sigma^2I) ] \lipsum[2][1-4] [ \hspace{1000pt minus 1fill} g(x) = \operatorname{arg,max}{c \in \mathcal{Y}}\mathcal{P}(f(x + \epsilon)=c), \hspace{1000pt minus 1fill} \makebox[0pt][r]{$\displaystyle \epsilon \sim \mathcal{N}(0, \sigma^2I)$} ] \lipsum[3][1-4] [ g(x) = \operatorname*{arg,max}{c \in \mathcal{Y}}\mathcal{P}(f(x + \epsilon)=c), \qquad \epsilon \sim \mathcal{N}(0, \sigma^2I) ] \lipsum[4][1-4]

\end{document}

egreg
  • 1,121,712