I have classes for all the kinds of documents I usually write in Latex. I just migrated to a Mac in my new job, and find that none of my scripts work with MacTex 2018 (first time working with MacTex...).

The only error I get is:

Undefined control sequence. \end{document}

Which means that there is something wrong with my .cls file, but that error makes it impossible to debug it.

The funny thing is all my files work perfectly in my Ubuntu machine under TexLive 2018. Why don't they work on a Mac?

Please have a look at this MWE of a simple letter.

This would be my .cls file:

\ProvidesClass{DC_cover}[2018/08/31 cover class]



% Colors %


\definecolor{gray60}{HTML}{666666}% 60%
\definecolor{gray40}{HTML}{999999}% 40%


%hyperref options, no border and url colors
    pdfborder = {0 0 0},

% Fonts %

\setmainfont[Mapping=tex-text, Color=textcolor]{Arial}

\newfontfamily\bodyfont[]{Arial Black}
\newfontfamily\thinfont[]{Lato Hairline}

\usepackage{unicode-math} %https://tex.stackexchange.com/questions/353136/compilation-error-option-unknown-unicode-math
\setmathfont{XITS Math}

% Awesome %

%- If you want to use the latest, download fontawesome latest Desktop version from https://fontawesome.com/
%- Uncompress and change the names to the otf files so that they do not contain spaces
%- Copy the otf files to the following location, replacing current files
%sudo cp Font* /usr/share/texlive/texmf-dist/fonts/opentype/public/fontawesome5
%sudo texhash

% From Details %

        \today \\[\normalbaselineskip]
        {\Large \textcolor{gray40}{\faPhoneSquare}} #3\\
        \href{mailto:#4}{{\large \textcolor{gray40}{\faEnvelope}} {\small #4}}\\
        \href{skype:#5?call}{{\Large \textcolor{skype}{\faSkype}} {\small #5}}

% To Details %


% Signature %

%   \begin{tabular}{@{}l@{}}
%       Yours sincerely,\\[2\normalbaselineskip]
%       \includegraphics[width=5cm]{#2}\\[\normalbaselineskip]
%       #1
%   \end{tabular}

%Geometry etc%


\setlength{\parindent}{0pt}% No paragraph indentation
\setlength{\parskip}{.5\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip}

%%Page geometry

% Footer %

\usepackage{fancyhdr, lastpage}
\fancyhf{} % sets both header and footer to nothing



    \fancyfoot[L]{{\small \textcolor{gray60}{\faFingerprint}\ \textbf{ #1}}\hspace{0.375cm}-\hspace{0.375cm}cover letter}

        \href{mailto:#2}{\textcolor{gray40}{{\small \faEnvelopeOpen}}\ {\footnotesize #2}}\hspace{3cm}
        {\small \textcolor{gray40}{\faFileSignature}\ \thepage\ of \pageref{LastPage}}}

And this would be my .tex file:

\documentclass[a4paper]{DC_cover}%[print] for print option
%letterpaper: US letter (215.9mm x 279.4mm) - default in this distribution
%a4paper: A4 paper (210.0mm x 297.0mm)




    {John Doe}


    {John Doe}
    {Some address\\
        1 Abc St\\\\
        Singapore 000000}
    {+65 1234 5678}



    {Jane Doe}
    {Doe Agency\\
        10 Abc St\\
        Singapore 000000}


Dear Mrs. Doe,



in response to the e-mail bla bla bla



%{John Doe}


Is there any obvious thing in the .cls file that does not work with MacTex? Sorry for its length but I am really at loss trying to debug it. Many thanks!

  • Are you compiling with xelatex? To do so, you can add this line as the first line in your tex file % !TeX TS-program = xelatex. (above \documentclass) I do not have XITS math and Lato Hairline on my system, but commenting out the lines in your cls referring to these two files, MacTex compiles for me. – egwene sedai Dec 10 '18 at 2:10
  • I compile with LuaLatex... – DaniCee Dec 10 '18 at 2:17
  • Which log file? – DaniCee Dec 10 '18 at 3:29
  • @egwenesedai trying compiling with xelatex, commenting the Lato and XITS line, and adding % !TeX TS-program = xelatex at the beginning, I still get ERROR Undefined control sequence. \end{document} – DaniCee Dec 10 '18 at 3:31
  • I installed MacTex from here (tug.org/mactex/mactex-download.html) and TexStudio from here (texstudio.org). That is all I have done... Does Mac need anything else for Latex to work properly? Simple documents do compile ok – DaniCee Dec 10 '18 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.