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> 
l.3 \begin{document}

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

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

Runaway argument?
./m_2019.tex:3: Paragraph ended before \calc@post@scan was complete.
<to be read again> 
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
% this all has to be done after .aux is read
  % make sure these two cross-referencing commands are defined, at least to \relax
  % \X@rtonum gets the page number from an \r@... command
  % start with zero
  % define \X@FirstPage to store the first page number
    % we store 0 if nothing better is availible
    % we store the real value of \pageref{FirstPage}, just the problem is that \pageref itself is unexpandable
    % the larger FirstPage, the smaller number of pages
    % correction by 1
  % the same again for LastPage
    % the larger LastPage, the larger number of pages
  % \AP@page stores the correct first page number
% \AP@{<article>}{<key>}{<value>} is stored in the file <issue>.ap and is loaded at the end of the class-file
    % store the <article> key
    % define \AP@<key> = <value> but only if <article> is correct
      \expandafter\xdef\csname AP@#2\endcsname{#3}%

This is m_paper.tex



\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} 

This is abstract

\keywords{keyword_1, keyword_2, keyword_3, keyword_4}


First section

\mbox{The research was supported by ...}


  • 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 '19 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 '19 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 '19 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 '19 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 '19 at 13:22

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:

| improve this answer | |
  • 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 '19 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 '19 at 20:52

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.

| improve this answer | |
  • 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 '19 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 '19 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.