2

Today I discovered a problem with the polyglossia package and the g-brief2 class. I hope someone can help me to fix it. :)

Here is my polyglossia MWE (polyg.tex):

\documentclass[a4paper,11pt]{g-brief2}
\usepackage
{%%
    fontspec,
    polyglossia,
    lmodern,
    relsize
}
\setmainlanguage[spelling=new,babelshorthands=true]{german}

\Name               {My Name}
\Unterschrift       {My Name}
\Betreff            {Subject}
\Datum              {\today}
\Anrede             {Dear,}
\Gruss              {Regards,}{0.5cm}

\begin{document}
    \begin{g-brief}
        bla bla bla
    \end{g-brief}
\end{document}

The log for compiling (xelatex polyg.tex) contains the following message:

! Missing control sequence inserted.
<inserted text> 
                \inaccessible 
l.18 ^^I\begin{document}

So, where is the problem? – Best regards and thanks for your assistance!

3
  • Welcome to TeX.sx! Apr 10, 2013 at 10:03
  • The g-brief2 class forces the loading of the inputenc package, and since this package cannot be used with either XeLaTeX or LuaLaTeX, you can't use the class with these engines. The class also forces loading of babel which isn't a good idea if you are also loading polyglossia.
    – Alan Munn
    Apr 10, 2013 at 11:21
  • @AlanMunn Please make that an answer
    – Joseph Wright
    Aug 13, 2013 at 6:11

1 Answer 1

3

With TeX Live 2013 I get no error, but, of course, loading both babel and polyglossia can raise some conflicts.

If you avoid loading babel, you get around the error also with older TeX distributions:

%%% Fool LaTeX to have already loaded babel
\makeatletter
\@namedef{[email protected]}{2001/03/01}
\@namedef{[email protected]}{\sprache}
\makeatother
%%% End of trick

\documentclass[a4paper,11pt]{g-brief2}
\usepackage
{%%
    fontspec,
    polyglossia,
    relsize
}
\setmainlanguage[spelling=new,babelshorthands=true]{german}

\Name               {My Name}
\Unterschrift       {My Name}
\Betreff            {Subject}
\Datum              {\today}
\Anrede             {Dear,}
\Gruss              {Regards,}{0.5cm}

\begin{document}
    \begin{g-brief}
        bla bla bla
    \end{g-brief}
\end{document}

Ask the maintainer of g-brief2 an option for avoiding babel.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .