4

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.

2
  • what about an minimal working example?
    – bene
    Jul 11, 2013 at 8:45
  • They were too involved for such a small task. Jul 11, 2013 at 8:55

3 Answers 3

5

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

1
  • I only had a few, that is why I was looking for a solution like this. Jul 11, 2013 at 8:50
11

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

4

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .