3

I am using the aligned environment in order to have a sequence of left-aligned equations.

In this latex code:

\[
\begin{aligned}
& a = b \\
& -c = d
\end{aligned}
\]

There is some space between the minus sign and the "c" even though I want it to be a unary minus.

How can I make this minus sign that comes after an & be a unary minus?

Ideally I would like to have a way to do this that works with KaTeX, since that is what I'm using to render math (although this issue appears to happen with pdflatex too.)

  • I often help myself with pictures for my inadequacy in English language. In my case, an image could help me solve your problem. – Sebastiano Oct 12 '19 at 19:24
  • 2
    &{-c} should do what you want. – GuM Oct 12 '19 at 19:42
5

Simply encase the - symbol in curly braces. Doing so changes the symbol's math status from bin to ord (ordinary).

\[
\begin{aligned}
& a = b \\
& {-}c = d
\end{aligned}
\]

A full MWE:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{aligned}
& a = b \\
& -c = d\\
& {-}c = d
\end{aligned}
\]
\end{document}
|improve this answer|||||
  • 1
    I have not understood the question :-( my congratulations. – Sebastiano Oct 12 '19 at 19:48

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.