4

I'm writing a text using document class gsm-l but the number of the sections overlap with the section symbol §, like this:

enter image description here

Here's an MWE:

\documentclass[a4paper,12pt]{gsm-l}

\usepackage{amsthm, amssymb, amsmath, amsfonts}
\usepackage[utf8]{inputenc}       
\usepackage[T1]{fontenc}           
\usepackage[brazil]{babel} 
\usepackage{gfsartemisia-euler}
\usepackage{dsfont}

\begin{document}

\chapter*{foo}

\tableofcontents

\chapter{foo}

\section{foo}

\section{foo}

\chapter{foo}

\section{foo}

\section{foo}

\end{document}

I think the problem is either with \usepackage{gfsartemisia-euler} or \usepackage[T1]{fontenc}. I tried commenting each one of these packages with % separately, and when I commented the two above (again, one at a time!), the problem was fixed. I don't know why this is happening. What do I do?

6
  • Where can we find this gsm-l.cls?
    – user31729
    Oct 18, 2015 at 19:54
  • Here, in "Graduate Studies in Mathematics", then in "AMS-LaTeX" option.
    – Ivo Terek
    Oct 18, 2015 at 19:57
  • I tried another fontenc: \usepackage[OT1]{fontenc}
    – user31729
    Oct 18, 2015 at 20:04
  • @IvoTerek Note that gsm-l has nothing to do with the issue, except for the fact that it make the table of contents use the § glyph.
    – egreg
    Oct 18, 2015 at 21:18
  • 1
    @IvoTerek Yes, I added an example to my answer with the article class.
    – egreg
    Oct 18, 2015 at 21:26

2 Answers 2

6

There is a bug in the Artemisia-Euler font in the T1 encoding: the § character is assigned zero width. When the OT1 encoding is used, the glyph has the correct width.

A fix for using the T1 encoding which is necessary when typesetting in Portuguese, otherwise hyphenation will be hindered up to being almost impossible, is as follows, instructing LaTeX to fetch the glyph from the OT1 encoded font:

\documentclass[a4paper,12pt]{gsm-l}

\usepackage[T1]{fontenc}           
\usepackage[utf8]{inputenc}       
\usepackage[brazil]{babel} 
\usepackage{amsthm, amssymb, amsmath, amsfonts}

\usepackage{gfsartemisia-euler}
\usepackage{dsfont}

% fix the width of the § glyph
\UndeclareTextCommand{\textsection}{T1}
\DeclareTextSymbolDefault{\textsection}{OT1}

\begin{document}

\tableofcontents

\chapter{foo}

\S1

\section{foo}

\section{foo}

\chapter{foo}

\section{foo}

\section{foo}

\end{document}

enter image description here

Note

The gsm-l class has nothing to do with the issue, except for the fact it shows it, since it uses the § glyph in the table of contents.

Here's a really minimal example:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{gfsartemisia-euler}

\begin{document}

{\fontencoding{OT1}\selectfont\S1}

{\fontencoding{T1}\selectfont\S1}

\end{document}

enter image description here

From the output it's clear that § has zero width in the T1 encoded font. The proposed workaround has no consequences on hyphenation, because § doesn't participate to it anyway.

I checked all Artemisia-Euler fonts in the T1 encoding and all have § with zero width. This is bad and good news together: it's bad because it's a bug; it's good because the proposed hack will work independently of the current font.

3

Apparently there's a fontencoding clash between T1 and OT1 occuring. The wrong spacings etc. vanish if OT1 is used instead of T1:

\documentclass[a4paper,12pt]{gsm-l}

\usepackage{amsthm, amssymb, amsmath, amsfonts}
\usepackage[utf8]{inputenc}       
\usepackage[OT1]{fontenc}           
\usepackage[brazil]{babel} 
\usepackage{gfsartemisia-euler}
\usepackage{dsfont}

\begin{document}

\chapter*{foo}

\tableofcontents

\chapter{foo}

\section{foo}

\section{foo}

\chapter{foo}

\section{foo}

\section{foo}

\end{document}

enter image description here

5
  • 1
    @IvoTerek: Happy TeXing then!
    – user31729
    Oct 18, 2015 at 20:14
  • @ChristianHupfer Using OT1 when the language is Portuguese means that hyphenation will not succeed whenever a word has an accent, which is normal for the language.
    – egreg
    Oct 18, 2015 at 21:06
  • @egreg thanks for the tip! Yes, this would be a problem later.. +1 on your answer too.
    – Ivo Terek
    Oct 18, 2015 at 21:12
  • @IvoTerek: Transfer the accept to egreg then!
    – user31729
    Oct 18, 2015 at 21:14
  • @egreg: Sorry, but I lack this knowledge about hyphenation of particular encodings
    – user31729
    Oct 18, 2015 at 21:15

You must log in to answer this question.

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