With the thmtools
package, combining \begin{foo}[name=bar,label=x]
with the line \newtheorem{foo}{Foo}
in the preamble typesets to Foo xxx (bar), where xxx is a number. After the (bar) there is an extra space which is about 6pt. To remove it completely, as I have seen at Extra space before labeled theorem body with thmbox or thmtools+thmbox, it is sufficient to add % after the label=x]
part. The point is, if I add any number of \,
s after it, they get completely ignored, whereas \hspaces
, \quad
s and \qquad
s don't. Try typesetting:
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[a4paper]{report}
\usepackage[italian]{babel}
\usepackage{thmtools}
\newtheorem{foo}{Foo}
\begin{document}
\begin{foo}[name=bar,label=x]\hspace{5cm}
With the space.
\end{foo}
\begin{foo}[name=bar2,label=x2]
Without the space.
\end{foo}
\begin{foo}[name=bar3,label=x3]\,\,\,\,\,\,\,\,
With 8 \verb"\,"s.
\end{foo}
\end{document}
On my computer, the \,
s don't produce any space, whereas the \hspace
does. Why does that happen?
Adding % after the label seems not to eliminate the space. Since this has generated a couple of overful \hboxes, I'd like to know how I can remove it.
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[a4paper]{report}
\usepackage[italian]{babel}
\usepackage{thmtools}
\newtheorem{foo}{Foo}
\begin{document}
\begin{foo}[name=bar,label=x]%
With the \verb"%".
\end{foo}
\begin{foo}[name=bar2,label=x2]
Without the \verb"%".
\end{foo}
\end{document}
\,
is a bit dangerous. On the other hand a string of\,
is surely wrong.%
there to have an effect. White space never affects the start of a paragraph or list item.(bar)
andWith
is\labelsep
so adding\setlength{\labelsep}{0pt}
before\begin{foo}
suppresses it.\label{}%
, as stated in the link I put in the question, by extension, it should do the same if placed there. Obviously that was wrong thinking :).