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 have a problem when I use the command \verb|detectionFinProgramme|. I don't know how to manage LaTex to get a normal alignement at the end of the line.

enter image description here

Does someone have a solution ?

Thanks in advance for your help.

share|improve this question
5  
There can't be a "normal" alignment in such cases. You probably don't want a line break inside the "detectionFinProgramme", and if you move the word to the next line you get large spaces. Make sure that you have given LaTeX every help to find a good solution (e.g. by loading microtype) and in the rest of the cases you will have to decide manually, e.g. by changing the order of the words. tex.ac.uk/cgi-bin/texfaq2html?label=overfull –  Ulrike Fischer Dec 12 '12 at 10:40
    
Note that you don't need (and probably shouldn't use) \verb here \texttt{detectionFinProgramme} would be better. It would not change the linebreak though. What do you want to happen? extra white space (try adding \sloppy before the paragraph) or do you want to break within the word, and if so do you want a - at the end of the line. –  David Carlisle Dec 12 '12 at 11:07
1  
If you do want hyphens see the answer already posted, if you want breaking without hyphens another solution is tex.stackexchange.com/questions/66593/… –  David Carlisle Dec 12 '12 at 11:10
add comment

1 Answer

up vote 3 down vote accepted

You can use egreg's solution to Hyphenation of CamelCaseClassNames: Mix automatic and manual? as follows:

Sample output

\documentclass{article}

\makeatletter
\def\camelhyph#1{\c@melhyph#1\relax}
\def\c@melhyph#1{%
  \ifx#1\relax\else
    \ifx#1\-#1\else
      \ifnum`#1<91 \-\fi
      #1%
      \expandafter\expandafter\expandafter\c@melhyph\expandafter
    \fi
  \fi}
\makeatother

\begin{document}

Filler text filler text filler text filler text filler text filler text
\texttt{\camelhyph{detectionFinProgramme}}
filler text filler text filler text filler text filler text filler
text filler text filler text filler text filler text filler text.

\end{document}
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.