0

This question already has an answer here:

I want to have latex automatically add line breaks to long sequences of characters that do not contain spaces. For instance:

...................................................................................................................................................................................

into

................................... ................................... ................................... ................................... ................................... .....

I also need to be able to manipulate the color of some of the periods using \textcolor{red}{.}, for instance. I am aware of the seqsplit package but can't seem to change fonts, sizes, colors of the text within it.

marked as duplicate by Mico, Schweinebacke, gernot, Maarten Dhondt, egreg line-breaking Mar 6 '17 at 9:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Welcome to TeX.SE! Your question is not very clear. Please ilustrate it with small, complete document with \documentclass{...} on the begin and \end{document} on the end, which will demonstrate your problem. In normal circumstance LaTeX break lines to the specified text width. – Zarko Mar 6 '17 at 1:56
  • 1
    With respect to the 'linebreaks', are you looking for things like \parbox or the minipage environment? These are covered in introductory materials. Or, does your reference to the seqsplit package mean those dots are all characters of one long 'word'? I think more information is needed at this point.... – jon Mar 6 '17 at 4:01
3

All you need will be satisfied with seqsplit and minipage or parbox. see the code below.

\documentclass{article}
\usepackage{seqsplit}
\usepackage{color}
\begin{document}

\begin{minipage}{.7\textwidth}
\seqsplit{%
agtcctttggggatctgtccactcctgatgctgttatgggcaaccctaaggtgaaggctc%
atggcaagaaagtgctcggt{\textcolor{red}{\LARGE g}}cctttagtgatggcctggctcacctggacaacctcaagg%
gcacctttgccacactgagtgagctgcactgtgacaagctgcacgtggatcctgagaact%
taataaaaaacatttattttcattgc}
\end{minipage}

\end{document}

enter image description here

0

If you want to automatically add line breaks in a section, you can change the line width by using \parbox{<linewidth>}{<content>}. If you want to change the color of some of the periods you just have to use what you've figured out for that.

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