Go to page:

Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

FAQ /

TextAppearance

Categories: FAQ, Text Appearance
<< | Page list | >>

Frequently Asked Questions about tweaking the general appearance of the text

§ How can I make the whole document ragged right?

  • Quick and dirty solution: Insert \raggedright in TeX mode at the beginning of the document.
    If you want it for a limited area, go to Edit→Paragraph Settings ... and set Alignment to "Left".
  • More elegant solution (better quality and also hyphenation): \usepackage{ragged2e} in preamble and \RaggedRight (with capitals) in TeX mode at the beginning of the document.
    For limited areas, insert {\RaggedRight at the beginning and }, both in TeX mode, at the end of the respective area.

§ How do I avoid hyphenation globally?

There are several possible solutions:

  1. Set the language to something like Welsh for the relevant text. This prevents hyphenation as long as you don't have Welsh hyphenation installed (but note that this is fragile; if you compile the document on a different computer that has Welsh hyphenation, the result will be different).
  2. Insert \exhyphenpenalty=10000\hyphenpenalty=10000 in Document→Settings→Preamble.

§ How do I avoid hyphenation for a specific region of my document?

There are several possible solutions:

  1. Insert \hyphenpenalty=10000 before the paragraph, and \hyphenpenalty=50 in TeX mode after it.
  2. Insert \begin{sloppy} before the paragraph, and \end{sloppy} in TeX mode after it.

§ How do I avoid hyphenation for specific words?

There are several possible solutions:

  1. \hyphenation{foo} in Document→Settings→Preamble will disable hyphenation for the word foo in the whole document.
  2. \usepackage{hyphenat}\nohyphens{foo} in Document→Settings→Preamble will also disable hyphenation for the word foo in the whole document.
  3. \mbox{foo} in TeX mode in the document will disable hyphenation for the word foo only at the given occurrence

§ How do I kill widows and orphans?

Okay, we are not playing Duke Nukem here! To eliminate widows and orphans (first line from a paragraph at the bottom of the page and the last line from a paragraph at the top of the page), add the following to the LaTeX preamble (Document→Settings→Preamble):

\widowpenalty=10000
\clubpenalty=10000

and perhaps

\raggedbottom

FAQ Text Appearance

<< | FAQ.PageList | >>

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2010-08-08 10:58 CEST