Jeremy C. Reed wrote:
I have a 210 page book and a 650 page book with many Emphasis (italics) and /path/to/file/names that extend out into my margin.

I am using microtype package which seems to work well for formatting.

I don't want to manually place a line break before each of these problem words or file names. I want it automated. I don't want anything in my margin (unless maybe in lyxcode block).

Any suggestions?

I googled for this for over 30 minutes but couldn't find what I am looking for. (It seems like I asked about this before but can't find in my saved email.)

Like Richard, I'm bamphoozled by the emphasis part; I've never seen emphasis screw up hyphenation (although I'll confess that I use it sparingly) (and I'm not very observant). In general, there are four parameters that control LaTeX's use of hypenation: \pretolerance, \tolerance, \hyphenpenalty and \exhyphenpenalty. You can google them to try to find details. Futzing with them might cause the emphasized terms to hyphenate, but also might cause excessive hyphenation elsewhere. I'm not sure, but it might be possible to redefine the \emph command to use alternate values of some/all of these parameters just within the emphasized text.

Using something like \url should break up the paths, although it also will dictate a font style (tt?) that you may or may not agree with. If \url doesn't do it for you, there's another trick, but it's rather tedious. You can add \newcommand{\fslash}{\discretionary{}{/}{/}} to your preamble and then change every / to \fslash{} (in ERT). That lets LaTeX split a "word" at a forward slash, including the slash at the start of the next line as in

... /start/of/long
/path/to/nowhere.

HTH,
Paul

Reply via email to