Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!

share|improve this question
    
Welcome to TeX.sx! –  Peter Jansson Apr 10 '13 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 '13 at 11:21
    
@AlanMunn Please make that an answer –  Joseph Wright Aug 13 '13 at 6:11

1 Answer 1

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{ver@babel.sty}{2001/03/01}
\@namedef{opt@babel.sty}{\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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.