Text beginning with “plus” after ragged2e's commands prevents compilation

Interesting bug. The \Centering macro ends with \@raggedtwoe@everyselectfont whose definition is

% ragged2e.sty, line 191:
\newcommand{\@raggedtwoe@everyselectfont}{%
  \if@raggedtwoe@spaceskip
    \ifdim\fontdimen\thr@@\font=\z@\relax
      \spaceskip\z@
    \else
      \spaceskip\fontdimen\tw@\font
    \fi
  \else
    \spaceskip\z@
  \fi
  }

Since \spaceskip is a glue parameter, it will look forward for possible plus or minus specifications.

Fix:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ragged2e}
\usepackage{etoolbox}

\makeatletter
\appto\@raggedtwoe@everyselectfont{\relax}
\makeatother

\begin{document}

\Centering
Plus some random words.

\end{document}

The appended \relax will stop the search for glue specifications.


It seems that these commands interpret the “plus” as the beginning of a “plus ⟨length⟩ minus ⟨length⟩” structure to give stretch values to a length. Adding a \relax appears to solve the problem, here.

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ragged2e}

\begin{document}

\Centering \relax%
Plus some random words.

\end{document}

Leaving an empty line between the command and the text might also work, but it's less compact in my opinion.