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.)

2
  • 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, 2019 at 19:24
  • 2
    &{-c} should do what you want.
    – GuM
    Oct 12, 2019 at 19:42

1 Answer 1

6

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}
1
  • 1
    I have not understood the question :-( my congratulations.
    – Sebastiano
    Oct 12, 2019 at 19:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .