Given the following custom commands:
\newcommand{\topic}[1]{#1\index{#1}}
\newcommand{\class}[1]{\textsf{\topic{#1}}}
which is used for Java classes with full package name, like:
\class{org.openscience.cdk.layout.StructureDiagramGenerator}
With the current command definition, the class name will not be hyphenated at the periods. How can I change my \newcommand{} to have LaTeX hyphenate the class at periods?
I am using the \class{} inside \caption{} methods which seems to invalidate some solutions.
\topiccommand comes from? (It would be even better if you could provide a minimal working expample.) – Hendrik Vogt Oct 28 '10 at 8:52