0

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.

  • 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 06 '17 at 01: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 06 '17 at 04:01

2 Answers2

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

javadr
  • 2,404
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.

Artillect
  • 397