[Tex/LaTex] “Where” notation in definition

math-mode

I need to define a rather complex operation. Hence I want to use the classical "where" definition style, i.e.

Foo = Bar(x,y) 
WHERE
x = Baz
y = Fob

My attempt so far in latex is:

\begin{align*}
\text{Foo} = \text{Bar}(x,y) && \mathbf{where} \\
x = \text{Baz}
\end{align*}

I am not really satisfied with the result, though:

  • The where keyword does not really stand out from the layout
  • The helper definitions are on the same level as the main definition

So instead of fiddling around with it, is there some kind of (semi-) canonical way to layout such definitions?

Best Answer

I'm guessing you're using the \text macro to typeset stuff in roman font, but that's bad pratice because semantically incorrect: the \text macro should be reserved for typesetting phrases such as "where", "for all", "subject to", etc. within display math environments (e.g. equation, align, etc.), not for variables or function names. You should use the \mathrm macro, instead, here.

Here's how I would write your equations:

enter image description here

\documentclass{article}

\usepackage{amsmath}

\newcommand\Foo{\mathrm{Foo}}
\newcommand\Barfun{\mathrm{Bar}}
\newcommand\Baz{\mathrm{Baz}}
\newcommand\Fob{\mathrm{Fob}}

\begin{document}
%
\begin{align*}
  \Foo &= \Barfun(x,y) \\
  \intertext{where}    
  x    &= \Baz         \\
  y    &= \Fob
\end{align*}
%
\end{document}
Related Question