1

Using two different computers at work and at home, I sometimes compile my thesis with one computer and sometimes with the other. Most of the time the two versions are consistent, but for algorithms I noticed that the same code gives a different output on the two machines. In particular, if I compile the following code:

\begin{algorithm}[!t]
\caption{The GaussSieve algorithm}
\begin{algorithmic}[1]
\State Initialize an empty list $L$ and an empty stack $S$
\Repeat
    \State Get a vector $\vec{v}$ from the stack (or sample a new one) 
    \For{\textbf{each} $\vec{w} \in L$}
        \State Reduce $\vec{v}$ with $\vec{w}$
        \State Reduce $\vec{w}$ with $\vec{v}$
        ...

then on one computer I get:

and if I compile on the other I get:

In other words: on one machine the output has a horizontal line (as I think it should) and on the other it doesn't. On both machines I use the algorithmicx and the algpseudocode packages, along with a dozen other packages.

So my question is: how do I make the output consistent? And in particular, how do I get both computers to add the horizontal line? Is there a simple command that I could use that forces both machines to output a horizontal line there? Or could I force both computers to use the same version of the package, by e.g. putting the same .sty file in some folder?

Additionally: the spacing between the caption and the first line is larger in the second example than in the first, which causes the page numbers on both machines to be different (as in the first case one section just fits within the page, and in the second it doesn't).

Thanks in advance!

  • Try updating the packages on both machines. – John Kormylo Aug 3 '15 at 23:40
  • @JohnKormylo Am I right that one with the line is correct, and the other one should be outdated? On that machine I've tried updating the packages (algorithmicx and algorithm), but it still compiles without showing a line. – TMM Aug 4 '15 at 0:38
0

Updating the packages algorithmicx and algorithms did not help, but indeed the problem was that on one machine one of the packages was outdated.

After a thorough search/comparison of the package dates in the MiKTeX Package Manager on both machines, I found that on one system the package caption had a different date than the other. Uninstalling the older version, synchronizing the repository, and installing the newest version or this package (dated 2013-05-21) solved the problem.

  • @TMM Thanks for solving it! I don't know what I would have done without you! – TMM Aug 4 '15 at 1:13

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.