Is there a way to dynamically size titles as part of a
\titleformat (from the
titlesec package) definition? I'd like to scale titles of different lengths to be the same width (relative to
\textwidth) by only changing fontsize.
The answers to this question describe how to resize text in a similar way, but I'm not sure how this could be used to redefine/extend the section titles. (e.g. as a part of