According to section 6 of microtype
manual (v.2.5 from 2011/02/07, p. 23) the code below should set custom protrusion for footnote numbers. However, when \microtypecontext
command is set, it cancels footnote mark completely. I run lualatex (beta-0.70.1-2011061410), but it isn't important if you're using pdflatex or xelatex, the result is same. Ideas?
Here's a MWE:
\documentclass{article}
\usepackage{geometry}
\geometry{a5paper,showframe}
\usepackage[protrusion=true,factor=2000]{microtype}
\makeatletter
\SetProtrusion[context=footnote]%
{font=*/*/*/*/scriptsize}% adapt if necessary; "footnotesize" corrected to "scriptsize" after Werner's note
{1={,650},%
2={,400},%
3={,400},%
4={,400},%
5={,400},%
6={,400},%
7={,500},%
8={,400},%
9={,400},%
0={,400}}
\newcommand*\new@makefnmark{\hbox{\@textsuperscript{\normalfont
\microtypecontext{protrusion=footnote}\@thefnmark}}}
\renewcommand*\@footnotemark{%
\leavevmode \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
\new@makefnmark \ifhmode\spacefactor\@x@sf\fi \relax}
\makeatother
%\setcounter{footnote}{123}
\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.
\end{document}
Note that the version of microtype package is 2.5 beta 06 which supports xelatex and tracking feature for lualatex.
The same question asked at comp.text.tex. I'll sync them if necessary.
UPDATE: Robert made couple of replies at comp.text.tex and solved most of problems regarding this issue by updating the package (microtype beta is now 2.5 beta 08). The only one that still remains is that numbers throughout a document (not only footnotes) are always lining nums, meaning Lowercase
and Proportional
options to fontspec
get ignored, so text figures cannot be used in normal fashion. With Renderer=Basic
option to fontspec
, Numbers=Lowercase
option gets applied, but Numbers=Proportional
still does not.