# Putting variable constraints on the right of an equation

Suppose I have a formula like y/x, and I want to say that x must be greater than zero.

In well-printed literature, you'd see something like

y/x ; x > 0

with just the correct amount of spacing between the formula, the semicolon, and the constraint.

I'm keen not to hardcode those spacings and am sure LaTeX can do it for me. But how?

(Currently, I use $$\frac{y}{x} \hspace{0.5in}; x \geq 0$$)

• What do you mean by correct amount of spacing?
– user11232
Apr 2, 2015 at 8:52
• Statistically speaking, the most typographically pleasing. LaTeX is much better than me at doing this. Apr 2, 2015 at 8:52
• Is this OK? \documentclass{article} \usepackage{amsmath} \begin{document} \begin{aligned} &y/x; && x>0 \end{aligned} \end{document}
– user11232
Apr 2, 2015 at 8:55
• LaTeX can't guess everything: the most typographically pleasing spacing for LaTeX is perhaps not so pleasing, or not so pleasing to you. Anyway, typical typographical spacings are \quad and \qquad, respectively ‘quadrat’ which lengths depend on the font in use, and ‘double quadrat’. You may use one of them instead of \hspace{0.5in}. Apr 2, 2015 at 10:11
• in the example you show, the space around the semicolon looks like the space for a relation. even if it isn't, this input would produce that spacing: $y/x \mathrel{;} x > 0$ Apr 2, 2015 at 12:15

\dots\ $y/x$, with $x > 0$.