I'm trying to switch to the ntheorem
package (instead of amsthm
) but I realized that headers of the theorems aren't protruded:
\documentclass{article}
\usepackage[activate={true, nocompatibility}, factor=2000]{microtype}
\usepackage{ntheorem}
\usepackage[showframe]{geometry}
\makeatletter
\newtheoremstyle{mystyle}
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ (##3)\theorem@separator]}
\makeatother
\theoremstyle{mystyle}
\theorembodyfont{\upshape}
\theoremseparator{.}
\newtheorem{what}{Whatever}
\begin{document}
\noindent\bfseries Whatever.\normalfont
\begin{what}
Something here.\newline
Whatever.
\end{what}
\end{document}
I've tried this and \theorem@headerfont\protrudeleft{##1}
makes protrusion correct - but also it generates a few errors and affects formatting of the theorem. So how should I fix it? Thank you in advance for help.
ntheorem
package has implemented the headers of theorem-like structures as "list items" -- in the LaTeX jargon sense of the word. Short of using the\protrudeleft
hack,microtype
has no way of "knowing" that some left-kerning should be applied to the characterW
inWhatever
. This is true even if\labelsep
were set to 0pt and the directive\hskip\labelsep
were omitted entirely from the setup code. If you feel strongly enough about this issue, you may want to contact the maintainer(s) of thentheorem
package and ask for a re-write of major parts of the package's code... – Mico Dec 28 '17 at 20:04\protrusionAmount
, which returns a protrusion value of a given character. Then I think it's possible to fix this issue: define new length, let's say\modLabelsep
, which equals to\labelsep
minus\protrusionAmount{W}
and use\hskip\modLabelsep
instead of\hskip\labelsep
. But I don't know how to define\protrusionAmount
. Moreover, I'm not sure if\protrusionAmount{W}
is equal to\protrusionAmount{\itshape W}
or\protrusionAmount{\bfseries W}
. – Jakbog Dec 29 '17 at 13:08