Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using clrscode to typeset my algorithms. This package provides the \proc command in order to typeset the name of a procedure with some nice small-caps.

In a text paragraph I refer to some procedure name and unfortunately it is very long and the \proc command prevents it from breaking.

How can I force it to break the line or emulate the look&feel of \proc?

EDIT: This is an example piece of LaTeX code, where the procedure name does not break for me:

\documentclass{article}

\usepackage{clrscode}

\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Duis nec nisi mollis augue pulvinar condimentum sed quis dolor.
$\proc{Some-Very-Long-Proc-Name-That-Does-Not-Break}(E, P, Q)$.
Nam libero metus, vehicula vitae euismod a, scelerisque eget neque.
Morbi tristique tincidunt urna ut tempor.
Vestibulum sapien justo, pulvinar a porttitor eget, vestibulum a quam.
\end{document}
share|improve this question
    
As far as I can see, \proc doesn't prevent line breaks. Can you give a minimal working example (MWE)? –  egreg Sep 12 '11 at 21:57
    
@egreg: I've added an example that doesn't work for me. –  Jasiu Sep 12 '11 at 22:50
add comment

1 Answer

up vote 1 down vote accepted

TeX breaks inline math only after relation or operation symbols. In that case the argument of \proc is treated as a function name and should not be split across lines, from a mathematician's point of view.

However, in tough cases where no alternative is feasible, you can say

\proc{long\-procedure\-name}$(E,P,Q)$

specifying with \- the preferred points where the name can be split. I'd prefer this "manual" way than relying on the automatic hyphenation.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.