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 few long nonsensical words I'd like to break at the same place as the other words. How do I do it?

Example below.

enter image description here

The text quoted is:

As an example of the two first properties, the percentage of reads with U in the first position, or A in the tenth, consider the cluster: UUGUUUUUGGUGUUUGUAUCUACAGAA, AACAAAACAAAAAGTTGGGTAGTTTGAGAAC and AACAAAAGGACTAGTGTTCTAGAAGA This cluster consists of three reads, and one of them starts with U. Hence the percentage

Ps. I'm using classicthesis if that matters.

share|improve this question
    
what about an minimal working example? –  bene Jul 11 '13 at 8:45
    
They were too involved for such a small task. –  The Unfun Cat Jul 11 '13 at 8:55

3 Answers 3

up vote 4 down vote accepted

Maybe you can use the \hyphenation{<words>} command to tell LaTeX how to break your very long words. I suggest to split your words every two letters like this \hyphenation{UU-GU-UU-UU-GG-UG-UU-UG-UA-UC-UA-CA-GA-A}.

But if you have many of these words and all different from each other I don't think this method is very clean and good.. maybe there is something better you can do but I don't know

share|improve this answer
    
I only had a few, that is why I was looking for a solution like this. –  The Unfun Cat Jul 11 '13 at 8:50

Package seqsplit is your friend:

\documentclass{article}
\usepackage{seqsplit}
\begin{document}
As an example of the two first properties, the percentage of reads
with U in the first position, or A in the tenth, consider the cluster:
\seqsplit{UUGUUUUUGGUGUUUGUAUCUACAGAA},
\seqsplit{AACAAAACAAAAAGTTGGGTAGTTTGAGAAC} and
\seqsplit{AACAAAAGGACTAGTGTTCTAGAAGA}.
This cluster consists of three reads, and one of
them starts with U. Hence the percentage \ldots
\end{document}

Result

If you want to have hyphens, then \seqinsert can be redefined (see the documentation of seqsplit):

\renewcommand*{\seqinsert}{\ifmmode\allowbreak\else\-\fi}

Result

share|improve this answer

TeX has no idea how to hyphenate your long words. The discretionary hyphen command \- will tell TeX where a good place to hyphenate the word is.

share|improve this answer

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.