I am using the soul package to produce "distributed" text. That is, text that is automatically spaced such that it fills the entire line. This works great, but now what I want to do is use a \newcommand within this context, so I can remove redundancy from my source files.
\documentclass{article}
\usepackage{soul}
\sodef\distribute{}{0pt plus 1fil}{0pt plus 2fil}{0pt}
\newcommand{\greeting}{Hello, World!}
\begin{document}
\distribute{\greeting}
\end{document}
If you replace \greeting in \distribute with literal text, then it works fine. However, with \greeting it results in a "Reconstruction failed" error. The soul documentation says this is due to "grouping hyphenable material" or "leaking font switches". The former can be resolved with an \mbox, but then that prevents the letter-spacing from happening; the latter doesn't mean much to me, but I don't think it applies here.
Is there a way of getting line-width distributed letter-spacing containing variables?
A similar question is answered with, "Use microtype." This package, however, looks pretty low-level and I'm not sure where to begin to achieve my goal.
