# How can I use the xfakeboldness package?

I'm interested in reproducing this answer using the xfakebold package.

\documentclass{article}

\usepackage{xfakebold}

\newcommand{\fbseries}{\unskip\setBold\aftergroup\unsetBold\aftergroup\ignorespaces}
\makeatletter
\newcommand{\setBoldness}[1]{\def\fake@bold{#1}}
\makeatother

\begin{document}

This is some regular text.

% Default boldness = 0.3
This is some {\fbseries fake bold} text.

\setBoldness{0.5}%
This is some {\fbseries fake bolder} text.

\setBoldness{1}%
This is some {\fbseries fake boldest} text.

\end{document}


However when I attempt to reproduce in Overleaf or Sublime Text, I get:

Which is not the expected result. How can I get the expected outcome as shown in the question?

• Is there or do exists xfakebold package into Overleaf? I have compiled your MWE with MikTeX and it works correctly. – Sebastiano Nov 12 '19 at 15:56
• works ok for me with pdflatex and lualatex. How are you compiling and is your system up-to-date? – Ulrike Fischer Nov 12 '19 at 16:09
• Do you get any errors or warnings? Something in the log? Do you compile with --interaction nonstopmode by any chance (which allows LaTeX to continue after an error, but with possibly wrong output)? – Marijn Nov 12 '19 at 16:28
• I found that this that this builds correctly only lualatex but not pdflatex. I get no errors or warnings using pdflatex. – John-Henry Nov 13 '19 at 1:07
• The xfakebold package does not work with XeLaTeX. You should get a warning in that case: "No LuaTeX or PDFTeX running! For Xe(La)TeX use the FakeBold option from package fontspec!" This is because the package uses PDF literals, which are not supported in this way by XeLaTeX. – Marijn Nov 13 '19 at 6:47