Banner

Donate

You find LaTeX Community useful? Please donate! Learn why!

Amount:

Partner Sites

goLaTeX
TeXblog
TeXnicCenter

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 108 on Tue Jun 08, 2010 3:33 pm

Users browsing this forum: No registered users and 1 guest

word wrapping of continuous text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)

word wrapping of continuous text

Postby Mima on Sat Jan 24, 2009 12:26 am

I have a continuous sequence of letters (no special characters or breaks) and TeX writes it over the right border of the page. How can I wrap this sequence such that line breaks are introduced where the page ends?

Thanks a lot for your help!!
Mima
 
Posts: 2
Joined: Sat Jan 24, 2009 12:20 am

Re: word wrapping of continuous text

Postby phi on Tue Feb 03, 2009 11:46 pm

A crude but simple hack (that destroys ligatures and hyphenation) would be to split up the letters and allow breaking everywhere:
Code: Select all
\documentclass{article}
\makeatletter
\newcommand*\wrapletters[1]{\wr@pletters#1\@nil}
\def\wr@pletters#1#2\@nil{#1\allowbreak\if&#2&\else\wr@pletters#2\@nil\fi}
\makeatother
\begin{document}
\wrapletters{akjhghjerbhkjgxhdrjgkbhyxksrfihcgbwaemklcjtnhwabketrbmshrkncgaervbetjkewhbgrkjavkjdkvbkjsjkbtkgvnsetbjsrhtservjbtbjkhtvy}
\end{document}
phi
 
Posts: 578
Joined: Tue Oct 21, 2008 7:10 pm

Re: word wrapping of continuous text

Postby Mima on Thu Feb 05, 2009 10:37 pm

Dear phi

Thanks a lot, that works very well! You helped me a lot.
Mima
 
Posts: 2
Joined: Sat Jan 24, 2009 12:20 am


Return to Text Formatting

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group