5

I am currently writing a book in Italian using LyX and I use

\usepackage[italian]{babel}

in the preamble. However, I need to write a chapter of this book in a different language. How can I change the hyphenation only for this chapter to English?

2 Answers 2

4

Insert an ERT using \selectlanguage{english} and revert back using the inverse. From the babel documentation (section 1 The user interface, p 4):

When a user wants to switch from one language to another he can do so using the macro \selectlanguage. This macro takes the language, defined previously by a language definition file, as its argument. It calls several macros that should be defined in the language definition files to activate the special definitions for the language chosen.

3
  • What is an ERT? Feb 17, 2013 at 4:14
  • @MarianoSuárez-Alvarez: In LyX this is referred to as "Evil Red Text" that inserted in the Wysiwyg LyX editor to include any LaTeX code.
    – Werner
    Feb 17, 2013 at 4:25
  • Nowadays with LyX 2.0.x, ERT is called "TeX code" and the button on the toolbar looks like the "TEX" logo of this site. (A little inconsistent that hovering over such a "TeX code" field displays "ERT".)
    – e-birk
    Feb 17, 2013 at 13:19
4

babel supports changing the hyphenrules

\documentclass[openany]{book}
\usepackage[english,italian]{babel}

\begin{document}
\chapter{Chiao}
foo

\begin{hyphenrules}{english}
\chapter{Hello}
bar
\end{hyphenrules}

\chapter{Italiano}
baz
\end{document}

you can insert the two command lines into LyX with Ctrl-L also called ERT (Evil Red Text)

1
  • If the language es english, hyphenrules is ok, but in general the right environment is otherlanguage*. Feb 17, 2013 at 18:47

You must log in to answer this question.

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