2

When editing the following document with Overleaf

\documentclass[a4paper, 12pt,fleqn]{article}
\usepackage{amsmath}
\usepackage{breqn}
\usepackage[utf8]{inputenc}
\usepackage{indentfirst}

\title{Exercice sur les équations}

\begin{document}

\maketitle

\begin{align*}
    12 + x &= 17 \\
    12 \boxed{- 12} + x &= 17 \boxed{- 12} \\
    x &= 5
\end{align*}

\begin{align*}
    3x – 2 &= 17 \\
    3x - 2 \boxed{+ 2} &= 17 \boxed{+ 2} \\
    3x &= 19
\end{align*}

\end{document}

I get the expected output

enter image description here

but there is a warning (at least I think this is a warning due to the yellow triangle)

enter image description here

Is this something serious?

(I apologize if this is obvious, I am back to LaTeX after 20 years trying to help my children with the formatting of their homework after seeing with disgust what they were about to send to the teacher (we are in France, confined at home))

  • 1
    You shouldn't use (U+2013) for the minus sign, but a simple hyphen. – egreg Mar 28 at 18:26
  • 3
    The problem is the first line of the second align. There the minus is actually a endash: 3x – 2 &= 17 change this to 3x - 2 &= 17 – Ulrike Fischer Mar 28 at 18:27
  • @UlrikeFischer: thank you. This is a copy/paste from the horrendous WordPad text my son was working on and I did not realize that hyphens are not hyphens. – WoJ Mar 28 at 18:31
  • @egreg: thank you - please see my comment to Ulrike – WoJ Mar 28 at 18:32
5

The problem is that a character U+2013 (en-dash) is used instead of a minus sign U+2212 is used (or just a hyphen). This happens when people doesn't know the difference.

I also propose some enhancements to your code, adding \: in appropriate places to emulate the spacing that TeX would insert if \boxed were not here.

\documentclass[a4paper, 12pt,fleqn]{article}
\usepackage{amsmath}
%\usepackage{breqn}
%\usepackage[utf8]{inputenc}
\usepackage{indentfirst}

\title{Exercice sur les équations}

\begin{document}

\maketitle

\begin{align*}
    12 + x &= 17 \\
    12\: \boxed{-\:12} + x &= 17\: \boxed{-12} \\
    x &= 5
\end{align*}

\begin{align*}
    3x - 2 &= 17 \\
    3x - 2\: \boxed{+\:2} &= 17\:\boxed{+\:2} \\
    3x &= 19
\end{align*}

\end{document}

enter image description here

| improve this answer | |
  • I should also have noticed that the typesetting of "3x -2 = 17" was off. – WoJ Mar 28 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.