1

In a LaTeX document I have a series of equations written inside different equation environments. I would like to replace the equation number with the solution of each equation. How can I do it?

1
  • i cannot see the point of doing it. you can always use math environments like gather in which you can display both the equation and its solution.
    – Yorgos
    Commented Oct 1, 2017 at 9:06

2 Answers 2

3

A solution based on the \tag macro of the amsmath package:

\documentclass{article}
\usepackage{amsmath} % for "\tag" macro
\begin{document}
\[
   x+1=2  \tag{$x=1$} 
\]
\end{document}

Use \tag* instead of \tag if you don't want to surround the solution with parentheses.

1

Maybe, you want something like this:

$$ 
   \matrix {x + 2 = 5 \cr
            y + 3 = 5}       \eqno (x=3,\ y=2) 
$$
10
  • Don't use $$ ... $$ in LaTeX, use \[ ... \] instead. See why-is-preferable-to on this site.
    – Bernard
    Commented Oct 1, 2017 at 9:28
  • @Bernard - Who says Petr is using LaTeX? :-)
    – Mico
    Commented Oct 1, 2017 at 9:30
  • @Mico The OP is using LaTeX, where $$ and \eqno should not be used.
    – egreg
    Commented Oct 1, 2017 at 9:34
  • @Mico: ??? You're rather cryptic today…
    – Bernard
    Commented Oct 1, 2017 at 9:34
  • 2
    @Mico: I didn't even think of this possibility, as the O.P. mentioned equation environments!
    – Bernard
    Commented Oct 1, 2017 at 10:07

You must log in to answer this question.

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