2

I am using the scrreprt document class for writing a report for a study course at my university. While writing the appendix I recognized that there seems to be an error caused by the microtype package in combination with roman pagenumbering (independent of using the upper or lower case roman numbering). After changing from arabic to roman numbering it is no longer possible to use the \label{} command without causing the compiler to crash. Specifically, if I add labels after section or chapter commands there are different errors that occur in relation to the .tex and .aux files. Related to the .tex file, where I am using the label commands, the follwing errors are procuced:

Argument of \MT@res@a has an extra }. \label{chapter:MyChapterName}

Paragraph ended before \MT@res@a was complete. \label{chapter:MyChapterName}

Related to the .aux-File the subsequent errors are reported:

Paragraph ended before \@newl@bel was complete. ...T1/LinuxBiolinumT-TLF/b/n/17.28 \def \par

Extra }, or forgotten \endgroup. .../LinuxBiolinumT-TLF/b/n/17.28 \def \par }

Extra }, or forgotten \endgroup. ...1{\fontencoding {T1}\selectfont

Extra }, or forgotten \endgroup. ...1][]\fontencoding {T1}\selectfont i}}}

Since the \MT@res@a error seems to be connected with the usage of microtype (which I load use without any options) I tried out compiling without loading microtype. It worked fine. The problem is also "resolved" by not changing the numbering style from arabic to roman or not using label commands. Neither of the above routes is a nice workaround in my opinion. The problem i have seems to be also reported by the user cfr, who commented on the follwing question and mentioned the same issue. It would be nice to get in contact with this user, but it seems there is no direct message function here (forgive me if I am wrong, I joined the community a few hours ago).

In relation to the problem I also have to state, that I am using utf-8 inputencryption and T1 fontencryption.

I did not build a minimum working example, but since it is highly recommend to discuss the question, I will try to create one and reproduce the error.

Also I can provide the complete log and the sections from the .aux and .tex Files that are reported by TeXstudio to produce the named errors if it is helpful to understand the problem.

I am looking forward to your comments / suggestions / solutions. You may forgive me, if I did not rely in every kind of way on the rules of this board / community and made some formal mistakes while writing the above question.

Sincerely, P. Schweitzer

UPDATE: minimum working example

I am sorry for not posting the minium working example at the beginning. Anyway here it is:

\documentclass{scrreprt}
\usepackage{scrlayer-scrpage}           % I left the scrlayer-scrpage package in place to show pagenumbering, deleting does not affect the error

\usepackage[greek,ngerman]{babel}       % by deleting the greek option, the error is solved

\usepackage{microtype}                  % by commenting this command out, the error is solved

\usepackage{cleveref}                   % by commenting this command out, the error is solved

\cfoot{\pagemark}                       % I left the pagemark command in place to show pagenumbering, deleting does not effect the error

\begin{document}
\clearpage
\pagenumbering{Roman}

\chapter{Abstract} 
\label{chapter:abstract}                % by commenting all labels in Roman or roman numbered sections/chapters out, the error is solved

\clearpage
\pagenumbering{arabic}

\chapter{Mainpart}
\label{chapter:mainpart}

\section{Test2}
\label{sec:test2}

\appendix
    \clearpage
    \pagenumbering{roman}

    \chapter{Appendix}
    \label{chapter:appendix}

    \section{Test3}
    \label{sec:test3}                   % by commenting all labels in Roman or roman numbered sections/chapters out, the error is solved
\end{document}

Please note: I commented on the changes which, if applied, resolve the problem. Especially I noticed, that if I disable the cleveref package the error also disappears, which I did not realize before. Furthermore disabling the greek option of babel resolved the error, too. Nevertheless I need, especially, the greek option, as I am writing a scientific report which uses greek letter a lot. Furthermore, to make the code working after a "failed" run of the compiler, you always have to delete the .aux files. Otherwise the error persists, even if you technically solved it in the code.

If you have a clue, where this error comes from and how to resolve it "correctly", I would be pleased to read your suggestions!

Thank you for your support. Sincerely, P. Schweitzer

  • 2
    start by deleting the .aux file which appears to be corrupt, see if that fixes things – David Carlisle Apr 1 '18 at 16:14
  • 3
    (1) welcome, (2) as always on this site please post a minimal example others can copy and test – daleif Apr 1 '18 at 16:15
  • I already deleted the files. The error persists. – Pascal Schweitzer Apr 1 '18 at 16:16
  • 1
    @PascalSchweitzer: Then post your minimal example that has this issue, as daleif asked you already – user31729 Apr 1 '18 at 16:18
  • I am currently working on it – Pascal Schweitzer Apr 1 '18 at 16:23
2

Unfortunately, babel-greek redefines the internal macros \@Roman and \@roman in a way that makes them essentially unusable.

Their idea is that page numbers in Roman numerals will appear correct also when Greek is in force, and it sometimes works, but not when microtype has to do its business.

A way out is to ensure that the page number is printed with the default output encoding and restore the standard definitions. You should be careful if you do \pageref in a Greek context, though.

\documentclass{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek,ngerman]{babel}

\usepackage{scrlayer-scrpage}
\usepackage{microtype}
\usepackage{cleveref}

% restore the kernel definitions
\makeatletter
\def\@Roman#1{\expandafter\@slowromancap\romannumeral#1@}
\def\@roman#1{\romannumeral#1}
\makeatother

\edef\documentencodingdefault{\encodingdefault}
\cfoot{\fontencoding{\documentencodingdefault}\selectfont\pagemark}

\begin{document}
\pagenumbering{Roman}

\chapter{Abstract}
\label{chapter:abstract}

\clearpage
\pagenumbering{arabic}

\chapter{Mainpart}
\label{chapter:mainpart}

\section{Test2}
\label{sec:test2}

\clearpage
\appendix
\pagenumbering{roman}

\chapter{Appendix}
\label{chapter:appendix}

\section{Test3}
\label{sec:test3}

\end{document}
  • Thank you for your quick response. I am "new" to LaTeX and currently using it only on a users base. Up to now there was no need to modify package macros. Funny fact: the template I am using was working fine during the last 6 months. I was using microtype, babel-greek and roman pagenumbering. Since I performed an update of my TeXlive distribution a few days ago the described error occures. Prior to this update I already wrote a working appendix with roman numbering, labels and all the stuff, without any issues. The update seems to have changed some internal macros. Funny. ^^ – Pascal Schweitzer Apr 1 '18 at 22:21
  • @PascalSchweitzer babel-greek is not really stable. – egreg Apr 1 '18 at 22:30
  • I was encountering some issues with my Citavi exported bibliography which had some greek letters in the papers titles (mostly discriptions of phase modifications like e.g. alpha-Fe). The only way I found to solve the problem was to include the greek option to bable and to add the textalpha-package. Maybe there is a more elagant way to do so, but I did not bother about it since it did seem to work fine (until a few days ago...). – Pascal Schweitzer Apr 1 '18 at 23:03
  • @PascalSchweitzer Loading babel-greek is a bit like a sledgehammer. Probably chemgreek is better. Or maybe upgreek. – egreg Apr 1 '18 at 23:08
  • thank you for this advice. I removed the greek babel option and added chemgreek and upgreek for upright chars instead. It works quite nicely. And it solved the roman numbering error without redefining the @roman macros. I am happy with the solution. Thank you very much for your kind assistance. – Pascal Schweitzer Apr 1 '18 at 23:32

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.