2
    \begin{array}{rl}
    s &≥ 1/x \\
    1 - s &≥ 1/y
    \end{array}

enter image description here

How can I make the spacing before and after ≥ to be the same? (I am rendering using KaTex https://katex.org/)

1
  • 3
    Don't do that with array: use align*.
    – Bernard
    Jun 23 at 20:22

2 Answers 2

3

You can use both an array and an aligned environment to achieve results that will look very similar. Be aware, though, that the contents of the array environment will be typeset in inline math mode, while those of the aligned environment will be typeset in display math mode -- and will also be spaced more loosely.

enter image description here

\documentclass{article}
\usepackage{array}             % for \newcolumntype macro
\newcolumntype{C}{>{{}}c<{{}}} % for binary and relational operators
\usepackage{amsmath}           % for aligned env.
\begin{document}

\begingroup % limit the scope of the next instruction to the current group
\setlength\arraycolsep{0pt}
$\begin{array}{rCl}
    s     &\ge& 1/x \\
    1 - s &\ge& 1/y
 \end{array}$
\endgroup

\medskip
$\begin{aligned}
    s     &\ge 1/x \\
    1 - s &\ge 1/y
 \end{aligned}$
 
\end{document}
4

Your code would be wrong also in standard LaTeX.

\begin{align*}
s &≥ 1/x \\
1-s &≥ 1/y
\end{align*}

This requires amsmath on the LaTeX side.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.