# Equation Number Overwriting

\documentclass[12pt, letterpaper]{Ultheses}
\usepackage{amsmath}
\usepackage{array}
\usepackage{tabu}
\usepackage{graphicx}
\graphicspath{ {/} }
\usepackage{matlab-prettifier}
\usepackage{caption}
\usepackage{subcaption}
%\usepackage[colorinlistoftodos]{todonotes}
\numberwithin{equation}{section}
%\usepackage{cleveref}
\usepackage{amsmath,amssymb,amsfonts}
%\usepackage{breqn}
\usepackage[intoc,refpage]{nomencl}
\makenomenclature
\usepackage{hyperref}
%\renewcommand{\pagedeclaration}[1]{\dotfill\hyperpage{#1}}
\newcommand{\nm}[2]{\nomenclature{#1}{#2}}
\usepackage{lipsum}
\usepackage{epstopdf}
\usepackage{fancyvrb}
%\usepackage[usenames]{color}
\usepackage{layout}
\usepackage{mydef}
\usepackage{url}
\usepackage{titlesec}
%\newcommand{\sectionbreak}{\clearpage}
\usepackage{indentfirst}
\usepackage{ragged2e}


I have use these packages. Its my thesis. I don't know which part of the code should I upload here?

How can I remove the overwriting of equation numbers? I have not labelled all the equations however after properly labeling the equation number the problem remains. How can this problem be fixed?

• how we can reproduce your problem if you not provide equation code? please edit your question and add small but complete document with your equation beginning with \documentclass{...}˙and end with \end{document}. welcome to tex.se! Mar 28 '18 at 18:41
• Welcome to TeX.SX! Mar 28 '18 at 18:43
• Take a look at the following to learn how to create a minimal working example (MWE) In short: Post code that is enough to recreate your issue, but nothing more. So the display environment you used to typeset that formula and all packages necessary to use that code snippet. And make sure that the posted code actually shows your issue. Mar 28 '18 at 19:03
• you upload only preamble. you should add code of equation too. your error is untypical and you doing something very wrong. however until we not see equation code, we cant say anything. Mar 28 '18 at 19:04
• And in the editor for your question you can highlight the code and click on the {} button to mark it as code (as I did in my edit for you). Mar 28 '18 at 19:04

The file ullthesis2017.cls -- which may or may not be functionally the same as Ultheses.cls -- contains the instructions

\@addtoreset {equation}{chapter}
\renewcommand\theequation
{\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}


This code indicates that you should not be providing the instruction

\numberwithin{equation}{section}


in the preamble of your thesis document. For sure, if one comments out this instruction, the unfortunate equation number overprinting issue vanishes.

If I were in your shoes, I would mostly strive to find an alternative to the ullthesis2017 (or Ultheses) document class. Really.

\documentclass[12pt, letterpaper]{ullthesis2017} % same as 'Ultheses.cls'?
%% I've simplified the preamble considerably...
\usepackage{amsmath} % for '\numberwithin' macro
\numberwithin{equation}{section} % see what happens if you comment out this line...

\begin{document}
$$1+1=2$$
\end{document}

• This solved the problem of equation overwriting. thanks a ton!!!! Huge problem solved!!! Mar 28 '18 at 19:41
• I'm very fast. Good answer +1. Mar 28 '18 at 19:41
• @Abhijeet - The real solution would consist mainly in not using such a dreadful mess of a LaTeX document class.
– Mico
Mar 28 '18 at 19:43
• I am new to Latex. The graduate school provided me the template. I am slowly and steadily learning LaTeX. I will definitely code it on my own in the future. Mar 28 '18 at 19:46
• I see no problem in the code using \ifnum. Mar 28 '18 at 20:42
• your document class is unknown to me, so i cant test your code.
• with standard documentclass as is article,reportorbook is not possible reproduce your problem. for example

\documentclass[12pt, letterpaper]{article}%{Ultheses}
\usepackage{mathtools}

\begin{document}
$$\begin{split} \MoveEqLeft xxxx = 1 + yyyyy + zzzzz \\ & - uuuuuu - vvvvvvv \end{split}$$

\end{document}


gives

please test this minimal document example with your document class and see, i you will obtain your error.

• Also for you +1. Mar 28 '18 at 19:42
• It's some bizarre code in the document class used by the OP that's responsible for the overprinting issue. See my answer for more details. The "remedy", such as it is, consists of omitting the otherwise-standard instruction \numberwithin{equation}{section}.
– Mico
Mar 28 '18 at 19:42
• @Mico, +1 for your answer. it is difficult believe, that exist such documentclass`es. i sympathize with everyone they need to use them. Mar 28 '18 at 19:51