1

I've seen this answer, but it didn't solve the errors. My LaTeX document compiled fine on a Springer Nature template and even on another IEEE template. Oddly, this conference template is where these odd errors show up. I've tried copying lines 545 to 567 into GEdit to get rid of any unwanted invisible characters, and copied it back to TexMaker, but the errors still show up. Tried using the same template on OverLeaf, and errors show up there too.

Is this a problem with the conference template itself?

Screenshot:
enter image description here

Algorithm generated:
Despite the errors, the PDF is generated, and the algorithm appears like this:
enter image description here
There is an unwanted =0 at endfunction and plenty of zeroes at the side.

The packages used:

\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
%---user defined packages start
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{subfig}
\usepackage[latin9]{inputenc}
\usepackage{float}
\usepackage{mathtools}
\usepackage{algpseudocode}
\usepackage{csquotes}
\usepackage{balance}
\usepackage{verbatim}
\usepackage{multirow}
\usepackage[none]{hyphenat}
%---user defined packages end

The code:

%----------------------------------------------------
\begin{algorithm}[tbp]
\caption{Fitness Landscape Generation\label{alg:fitnessLandscapeGeneration}}
\begin{algorithmic}
\Function{Calculate-Point-XYZ}{$S$}
\State $z=\sum_{i=1}^{i=n}f_{i}$, $x=0$, $y=0$, $p=9\times9$
\State $\theta=0$, $d=360/p$
\For{each {$I$}}
    \For{each number $n$ in cells of $I$}
        \State $\theta=\theta\times\pi/180$
        \State $t_{x}=x+n$, $t_{y}=y$
        \State $a_1=\sin(\theta)$, $a_2=\cos(\theta)$
        \State $x=a_2\times(t_{x}-x)-a_1\times(t_{y}-y)+x$
        \State $y=a_1\times(t_{x}-x)+a_2\times(t_{y}-y)+y$
        \State $\theta=\theta+d$
    \EndFor
\EndFor

\Return $x$, $y$, $z$ \EndFunction \end{algorithmic} \end{algorithm} %----------------------------------------------------

Other anomalies:
Even other parts of the paper are appearing odd, when it compiles and appears fine in other templates.
enter image description here Whether I use \begin{description} or \begin{itemize} the contents of

\item [\textbf{Cardinality}:] The number of elements in a set is the cardinality
of the set. For example, the phrase ``the number of $F_{i}$ cells
is two'' is denoted mathematically as: $\left|F_{i}\right|=2$.

end up with overlaps. So I assume this is a problem with the template, and I'd be better off using some other template?

JamesT
  • 3,169
Nav
  • 227
  • 3
    please post example code as a document which shows the problem not as an image.Note you should delete \usepackage[latin9]{inputenc} (I do not think it is possible to use latin 9 on overleaf) – David Carlisle May 31 '23 at 13:40
  • @Nav are you sure that all the algorithm packages you use are compatible with each other? – samcarter_is_at_topanswers.xyz May 31 '23 at 14:13
  • 1
    @DavidCarlisle: OP has shown us the code too. There's an obvious conflict with algorithmic, but perhaps OP knows that, and posted it here as he does not know how to solve it. He seems new to LaTeX, judging from his other questions. – Julia May 31 '23 at 14:39
  • 1
    @Julia fragments of code not an example that makes the error – David Carlisle May 31 '23 at 14:41

1 Answers1

2

You have a package conflict between algorithmic and algorithmicx, deleting the line :

\usepackage{algorithmic}

Would solve the issue.

Waysuw
  • 58
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Community May 31 '23 at 16:35