I have the following defined in my tex
Code: Select all
\hyphenation{Java-Script}
%
\newcounter{jscount}
\newcommand{\JS}{\addtocounter{jscount}{1}JavaScript\ifthenelse{\equal{\value{jscount}}{1}}{\textsuperscript{\textregistered}}{}}
Unfortunately the first occurrence is a place where the hyphenation should take place. It seems that with the registered trademark symbol, the hyphenation macro doesn't recognize it and it flows into the margin.
If I increment the counter before the use, then the mark isn't there and the hyphenation works.
I'm guessing there is a better way to define my
\JS{}
macro so that the addition of the registered trademark does not prevent the hyphenation?