3

I am writing a document.

Problem with equations

After I tried to put two equations into the document, LaTeX started giving me a whole bunch of errors such as:

  • \begin{document} ended by \end{equation} and
  • Extra \endgroup.

Problem with margin and enumerate

As well as this, the second page of my document has the margin further left than it should be (since I should still be inside an enumerate) and when I try to make a new \item inside this enumerate, it doesn't even give me the number (should be 3) in the document) anymore. Has anyone got any tips?

I'm aware that it may be something really simple such as a missing curly bracket, but I cannot find errors in between my last \begin{enumerate} and \end{enumerate}. If anyone could help me out with this it would be greatly appreciated.

Below is my code (I have attempted to make the code a little shorter by saying text instead of displaying my actual text, which is significantly longer):

\documentclass[a4paper,twoside]{IEEEtran}
\usepackage{graphicx}
\usepackage{amsmath}

\begin{document}

\title{title}

\author{my name}

\maketitle

\begin{abstract}
...
\end{abstract}

\section{Introduction}
...

\section{Telecommunications Infrastructure Planning}
text here
\begin{enumerate}
\item text
\item text
\item text
\item text
\end{enumerate}

My solutions to these tasks are given below:
\\*
\newline

\begin{enumerate}
\item text  
    \item text  
    \item Below is the graph I drew:

\begin{figure}[h!]
    \begin{center}
        \includegraphics[height=2.5in,width=3.5in,angle=0]{pic.eps}
    \end{center}
\end{figure}

\item text
    \end{enumerate}

\section{Compound Interest}
For this part of the mixed session, the following tasks were set:
\begin{enumerate}
\item text  
    \item text
\item text  
    \item text  
    \item text
\end{enumerate}

The following was what I did to complete the above tasks:
\begin{enumerate}
\item The following was the model I created in excel:

\begin{figure}[h!]
    \begin{center}
        \includegraphics[height=1.125in,width=2.125in,angle=0]{pic.eps}
    \end{center}
\end{figure}

\item I then modified the model as can be seen below:

\begin{figure}[h!]
    \begin{center}
        \includegraphics[height=2in,width=1.75in,angle=0]{pic.eps}
    \end{center}
\end{figure}

    The above two models were developed using the compound interest equation, which is given below:


    \begin{equation*}
        \begin{center}
            $A = P(1 + \frac{r}{n})^{nt}$
        \end{center}
    \end{equation*}


where
\newline
$A$ is the total amount in the account at any given time; \newline
$P$ is the principal (initial) amount in the account; \newline
$r$ is the annual interest rate; \newline
$n$ is the number of times the interest is compounded per year; \newline
$t$ is the number of years.
\\*
\newline

The difference in these results was that at the intervals 1, 2, 3 and 4 years, which both models had in common, the second model, which compounded quarterly, had accumulated slightly more interest. This was due to it compounding quarterly instead of annually. The 5\% interest annually was 1.25\% interest quarterly.


\item As $n \to \infty$, the compound interest formula becomes:

\begin{equation*}
    \begin{center}
        $A = Pe^{rt}$
    \end{center}
\end{equation*}

\end{enumerate}

\end{document}
4

There are two locations where you use

\begin{equation*}
  \begin{center}
    $ ... $
  \end{center}
\end{equation*}

You don't need to center the contents inside an equation*; it's done by default. Moreover, equation* is already in math mode, so you need only use

\begin{equation*}
  ...
\end{equation*}

You different margins may stem from the fact that you're using twoside mode.


Finally, even though you didn't mention this: Don't use \\ to break a line or start a new paragraph. Rather leave empty (blank) spaces in your code.

  • you don't say so explicitly, but it's the \begin{center}...\end{center} that takes the job out of the equation environment and causes the mismatch of \begin{document} ... \end{equation*} and fouls up grouping. only explicitly math sub-environments should be used within an equation environment unless they're further protected by being put inside as \text. – barbara beeton Apr 1 '15 at 12:37
1

Your code is full of \newline and \\* that are wrong. If you don't like the spacing setup of the IEEEtran class, don't use it; if you have to use it for a submission, then do as they want.

Here's an edited version of your code, with some tricks. The most important fact is however fixing the wrong formula with center inside equation*.

  1. The graphic file should be included with a size depending on \columnwidth rather than absolute dimensions

  2. No \\* or \newline

  3. The explanations of the variables can be given as an itemize environment with zero separation and empty label

Here's the code.

\documentclass[a4paper,twoside]{IEEEtran}
\usepackage{newtxmath} % I can't stand CM math with Times text
\usepackage{graphicx}

% the following two packages are already loaded by IEEEtran
%\usepackage{amsmath}
%\usepackage{enumitem}

\begin{document}

\title{title}

\author{my name}

\maketitle

\begin{abstract}
...
\end{abstract}

\section{Telecommunications Infrastructure Planning}
text here
\begin{enumerate}
\item text
\item text
\item text
\item text
\end{enumerate}

My solutions to these tasks are given below:
\begin{enumerate}
\item text  

\item text  

\item Below is the graph I drew:
  \begin{center}
  \medskip
  \includegraphics[width=.8\columnwidth]{example-image}
  \medskip
  \end{center}

\item text
\end{enumerate}

The above two models were developed using the compound interest equation, which is given below:
\begin{equation*}
A = P\biggl(1 + \frac{r}{n}\biggr)^{nt}
\end{equation*}
where
\begin{itemize}[nosep,label={}]
\item $A$ is the total amount in the account at any given time;
\item $P$ is the principal (initial) amount in the account;
\item $r$ is the annual interest rate;
\item $n$ is the number of times the interest is compounded per year;
\item $t$ is the number of years.
\end{itemize}
The difference in these results was that at the intervals 1, 2, 3 and 4 years, which both models had 
in common, the second model, which compounded quarterly, had accumulated slightly more interest. This 
was due to it compounding quarterly instead of annually. The 5\% interest annually was 1.25\% interest 
quarterly.

\end{document}

enter image description here

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.