# Strange behaviour of \textsection in footnote with fixltx2e

This is a follow-up question to How do I enable protrusion for footnotes with \fnsymbol using microtype?, and my answer there.

The MWE that I provided there

\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{etoolbox}
\usepackage{fixltx2e}  %% <- this gives problems

\usepackage{geometry}
\geometry{a5paper,showframe}

\usepackage[protrusion=alltext,factor=2000]{microtype}

\DeclareMicrotypeSet{alltextAndFootnotes}{%
encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2}, %% alltext
font     = {OMS/lmsy/m/n/scriptsize},
}

\microtypesetup{protrusion=alltextAndFootnotes}
\SetProtrusion[context=footnote]{encoding=OMS, family=lmsy,series=m, shape=n, size=scriptsize}{%
"03={,650},%% *
"78={,650},%% \mathsection
"79={,650},%% \dagger
"7A={,650},%% \ddagger
"7B={,650},%% \mathparagraph
"6B={,650},%% \|
}
{encoding=T1, family=lmr, series=m, shape=n, size=scriptsize}
{  }
{encoding=OT1, family=lmr, series=m, shape=n}
{  }

\makeatletter
\newcommand*\new@makefnmark{\hbox{\@textsuperscript{\normalfont
\microtypecontext{protrusion=footnote}\@thefnmark}}}
\patchcmd{\@footnotemark}
{\@makefnmark}
{\new@makefnmark}{}{}
\makeatother

\renewcommand{\thefootnote}{\fnsymbol{footnote}}

%% --------------------------------------------------------------
%% --------------------------------------------------------------
\begin{document}
Here's some text to show the behaviour of footnote marker at%
\footnote{A footnote}
the end of a line, which disappears when the code for setting  microtypecontext is used in fnmark redefinition.

Here's some text to show the behaviour of footnote marker at%
\footnote{B}
the end of a line, which disappears when the code for setting  microtypecontext is used in fnmark redefinition.

Here's some text to show the behaviour of footnote marker at%
\footnote{C}
the end of a line, which disappears when the code for setting  microtypecontext is used in fnmark redefinition.

Here's some text to show the behaviour of footnote marker at%
\footnote{D}
the end of a line, which disappears when the code for setting  microtypecontext is used in fnmark redefinition.

Here's some text to show the behaviour of footnote marker at%
\footnote{E}
the end of a line, which disappears when the code for setting  microtypecontext is used in fnmark redefinition.

Here's some text to show the behaviour of footnote marker at%
\footnote{F}
the end of a line, which disappears when the code for setting  microtypecontext is used in fnmark redefinition.

Here's some text to show the behaviour of footnote marker at%
\footnote{G}
the end of a line, which disappears when the code for setting  microtypecontext is used in fnmark redefinition.

Here's some text to show the behaviour of footnote marker at%
\footnote{H}
the end of a line, which disappears when the code for setting  microtypecontext is used in fnmark redefinition.

Here's some text to show the behaviour of footnote marker at%
\footnote{I}
the end of a line, which disappears when the code for setting  microtypecontext is used in fnmark redefinition.
\end{document}


works fine for me, until I add the fixltx2e package.

I am aware of the fact that this package changes the default defintion of \@fnsymbol from

\def\@fnsymbol#1{\ensuremath {\ifcase #1\or *\or \dagger \or \ddagger \or \mathsection \or \mathparagraph \or \|\or **\or \dagger \dagger \or \ddagger \ddagger \else \@ctrerr \fi }}


to

\def\@fnsymbol#1{\ifcase #1\or \TextOrMath \textasteriskcentered *\or \TextOrMath \textdagger \dagger \or \TextOrMath \textdaggerdbl \ddagger \or \TextOrMath \textsection \mathsection \or \TextOrMath \textparagraph \mathparagraph \or \TextOrMath \textbardbl \|\or \TextOrMath {\textasteriskcentered \textasteriskcentered }{**}\or \TextOrMath {\textdagger \textdagger }{\dagger \dagger }\or \TextOrMath {\textdaggerdbl \textdaggerdbl }{\ddagger \ddagger }\else \@ctrerr \fi }


This means that now \textsection is used as a footnote symbol, and it is the only one that does not protrude:

I don't see what is so special about \textsection, when, e.g., \textparagraph works fine. What is the reason for that bevaviour, and how can I fix that?

-

The command \textsection is special because unlike the others it also exists in T1 encoding (declared in t1enc.def, which is loaded by fontenc). Now, when latex is asked to typeset a text symbol, it will first check whether this symbol is declared in the current encoding, which in this case will be T1. There are two possibilities to solve this:

• either add \textsection to the T1 set:
\SetProtrusion[context=footnote]
{encoding=T1, family=lmr, series=m, shape=n, size=scriptsize}
{ \textsection={,650} }

• or, which seems the cleaner approach, undeclare the \textsection command in T1, so that the symbol from OMS (declared in omsenc.def, loaded by the format) is used instead:
\UndeclareTextCommand{\textsection}{T1}


Another remark: Even though fixltx2e changes the footnote definition to use text symbols instead of math symbols, the glyphs actually still come from the math font (OMS). To really use symbols from a text font, you might want to additionally load the textcomp package, and declare the protrusion settings for TS1/lmr instead of OMS/lmsy. (The issue with \textsection will have to be addressed in the same way as above.)

While this won't make any difference with Latin or Computer Modern, where the symbols are the same in math and text fonts, it will for other fonts that are not accompanied by math fonts (say, Times New Roman). Without textcomp, the footnote symbols would hence be selected from Computer Modern, which is not what you would want.

So, to wrap this up, I would suggest to do the following:

\usepackage{textcomp}
\UndeclareTextCommand{\textsection}{T1}
\SetProtrusion[context=footnote]{font=TS1/*/m/n/scriptsize}{%
\textasteriskcentered={,650},
\textsection={,650},
\textdagger={,650},
\textdaggerdbl={,650},
\textparagraph={,650},
\textbardbl={,650},
}
\SetProtrusion[context=footnote] % dummy declaration
{font=T1/*/m/n/scriptsize}
{  }

-
Oh god, I looked on the T1 table in fontenc.pdf, and did not see it, possibly because it is "hidden" among accented characters. Thanks! –  mafp Apr 21 '13 at 12:05