2

I'm having an issue compiling document on macOS using Texpad + mactex. The document was originally written on Windows while author used miktex distribution.

Is this a common issue that these are not compatible? The error is probably with the templates that are a part of the document, but I'm not hundred percent sure.

Thank You.

This is my error (I posted here before, but I was asked to provide definition / example of the class that is causing the issue), here is the error with \X@artonum class.


I'm getting this error while building a project I received from colleague. The document structure is defined in templates. Is it possible to read something from this errors:

    \@begindocumenthook ...ter \X@rtonum \r@FirstPage 
                                                  } \setcounter {numpages}{-...
l.3 \begin{document}

./m_2019.tex:3: Argument of \X@rtonum has an extra }.
<inserted text> 
                \par 
l.3 \begin{document}

Runaway argument?
./m_2019.tex:3: Paragraph ended before \X@rtonum was complete.
<to be read again> 
                   \par 
l.3 \begin{document}

./m_2019.tex:3: Missing number, treated as zero.
<to be read again> 
                   \par 
l.3 \begin{document}

Runaway argument?
./m_2019.tex:3: Paragraph ended before \calc@post@scan was complete.
<to be read again> 
                   \par 
l.3 \begin{document}

This is the definition of \X@rtonum and \r@FirstPage in case it might help resolving this problem (I still can't compile the .tex document):

% counter that will store the total number of pages
\newcounter{numpages}
% this all has to be done after .aux is read
\AtBeginDocument{
  % make sure these two cross-referencing commands are defined, at least to \relax
  \@ifundefined{r@FirstPage}{\relax}{\relax}
  \@ifundefined{r@LastPage}{\relax}{\relax}
  % \X@rtonum gets the page number from an \r@... command
  \@ifpackageloaded{hyperref}{\def\X@rtonum#1#2#3#4#5{#2}}{\def\X@rtonum#1#2{#2}}
  % start with zero
  \setcounter{numpages}{0}
  % define \X@FirstPage to store the first page number
  \ifx\r@FirstPage\relax
    % we store 0 if nothing better is availible
    \gdef\X@FirstPage{0}
  \else
    % we store the real value of \pageref{FirstPage}, just the problem is that \pageref itself is unexpandable
    \xdef\X@FirstPage{\expandafter\X@rtonum\r@FirstPage}
    % the larger FirstPage, the smaller number of pages
    \setcounter{numpages}{-\X@FirstPage}
    % correction by 1
    \stepcounter{numpages}
  \fi
  % the same again for LastPage
  \ifx\r@LastPage\relax
    \gdef\X@LastPage{0}
  \else
    \xdef\X@LastPage{\expandafter\X@rtonum\r@LastPage}
    % the larger LastPage, the larger number of pages
    \addtocounter{numpages}{\X@LastPage}
  \fi
  % \AP@page stores the correct first page number
  \ifdefined\AP@page
    \setcounter{page}{\AP@page}
  \fi
}
% \AP@{<article>}{<key>}{<value>} is stored in the file <issue>.ap and is loaded at the end of the class-file
\def\AP@#1#2#3{
  \begingroup
    % store the <article> key
    \edef\reserved@a{#1}%
    % define \AP@<key> = <value> but only if <article> is correct
    \ifx\reserved@a\X@articlename\relax
      \expandafter\xdef\csname AP@#2\endcsname{#3}%
    \fi
  \endgroup
}

This is m_paper.tex

\documentclass[eprint]{publisher}

\begin{document}

\title[Evaluation of Hopkinson Bar Experiments using multiple DIC tools]{Evaluation of Hopkinson Bar Experiments using multiple Digital
Image Correlation Software Tools}
\correspondingauthor[Joe Doe]{Joe Doe}{my}{john@doe.com}
\author[J. Doe]{John Doe}{their}
\author[J. Doe_2]{Joh Doe_2}{my}
\author[J. D\'{a}mal]{John D\'{a}mal }{my}
\author[J. D\'{a}mal]{J. D\'{a}mal}{my}
\institution{my}{University Czech}
\institution{their}{University Germany} 

\begin{abstract}
This is abstract
\end{abstract}

\keywords{keyword_1, keyword_2, keyword_3, keyword_4}

\maketitle
\section{Introduction}

First section


\begin{acknowledgements}
\mbox{The research was supported by ...}
\end{acknowledgements}


\bibliographystyle{publisher}
\bibliography{biblio}

\end{document}
  • you need to post the full m_paper class or a link to it otherwise no one can run this code and debug it. – David Carlisle Oct 31 at 21:19
  • I have extended the topic by m_paper (I cut the text (I have to respect authors) while the main structure remains - the error is the same)... – Josh E. Nov 1 at 11:11
  • you have provided no link to publisher.cls so we can not run your test file or trace the error that you get. – David Carlisle Nov 1 at 11:21
  • Sorry, github.com/JKhay/LaTeX/blob/master/publisher.cls . Please, check, whether the link works (it should, I have checked twice). Than You very much for you help. – Josh E. Nov 1 at 12:40
  • thansk a link to the publishers copy would have been better (your question is archived here forever and github link will probably break) but it's OK for now. – David Carlisle Nov 1 at 13:22
4

The class won't work in a current texsystem, may it be miktex or texlive, it contains code (\@ifundefined{r@FirstPage}{\relax}{\relax}) that relies on a side effect which isn't there anymore.

As a work around you can try to add the following to the preamble:

\makeatletter
\let\r@FirstPage\relax
\let\r@LastPage\relax
\makeatother
  • YES!!! Thank you very much! It finally works! I don't know how you guy manage to know the ropes in the log files, but I was struggling with this over 2 weeks. – Josh E. Nov 1 at 14:53
  • Can I ask you one more favor... :) Are you able to tell me where is the header and footer defined - its content and mostly format - whether the .tex produce capital/small letters, name shortcuts/full names in header? – Josh E. Nov 7 at 20:52
5

There are essentially no differences between miktex and texlive/mactex at the document level unless the document uses shell-escape (\write18) and runs a windows command.

Far more likely is that the two systems have different versions of latex and packages installed, this can happen even if both systems are running miktex, or both texlive.

Add \listfiles and compare your log files.

  • I have uploaded the particular issue (I have posted here before but still can't solve it). I have extended the error with the \X@rtonum definition. I hope it helps. I have also just tried Windows + miktex and I've dealt with a similar error. I really don't know what's the issue. I'd highly appreciate if you can look at that. Thank You. – Josh E. Oct 31 at 17:28
  • @JoshE. please don't post disconnected fragments, construct a small test file that people can run and debug. – David Carlisle Oct 31 at 19:50

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.