# Putting an equal sign both at the end and at the beginning of the line (dmath)

I'm using dmath for my equations, because it breaks lines automatically. I've been taught that if I have two formulae separated by an equal sign and they are on different lines then the equal sign should be present both at the end of the first line and at the beginning of the second one. (And it looks prettier, too, in my opinion.) dmath puts the equal sign only at the beginning of the second line. When I put two equal signs between the equaltions it breaks the line twice and the first equal sign ends up as a separate line. I suppose I could solve this problem by using equation instead of dmath and forcing line breaks but I like automatic line breaks. Is there any way to tell dmath to put the equal sign on both lines? (I also have the same problem with +, it appears only at the beginning of the second line.)

• Welcome to TeX.SX! I don't think adding the equals sign at the end is prettier; to be honest, I consider it wrong. You can use \hiderel{=} for the trailing equals. – egreg Jul 6 '14 at 10:14
• This seems to be a standard in Estonian and Russian mathematical texts I've seen. Could you explain please how do I use hiderel? Where do I put it? Around every equals sign? – Liisi Jul 6 '14 at 12:04
• It's better if you show an example of code for a display. – egreg Jul 6 '14 at 12:09
• \documentclass[12pt,a4paper]{report} \usepackage{breqn} \begin{document} \begin{dmath} x+x+x+x+x+x+x+x+x+x+x+x+x+x+x=x+x+x+x+x+x+x+x+x+x+x+x+x+x+x \end{dmath} \end{document} – Liisi Jul 6 '14 at 12:23
• I tried it. hiderel doesn't solve the issue. When I put it only around the equals sign it makes dmath break the line at the place where one of the plus signs is. The plus sign is still present only on the second line, so the problem I mentioned still persists. When I put hiderel around all of the signs it prevents dmath from breaking the line at all. – Liisi Jul 6 '14 at 12:51

One possible solution which gives both automatic line breaking, and equals signs and line numbers precisely where you want them, and also allows pagebreaks (which dmath does not), is here: