Text Formattingtext in margin

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
howard
Posts: 8
Joined: Fri Oct 23, 2009 8:55 am

text in margin

Post by howard »

Hello all,

Trying to format a paper in report mode and I manually set the margins using the geometry package. I didn't like how latex was hyphenating so many words so I used the hyphenat package with the "none" option so that there was no automatic hyphenation. But now, some words are overlapping the predefined margins (on the right side of the pages). Does anyone know how to maintain uniform margins without hyphenating at line breaks? Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

text in margin

Post by meho_r »

Yes, but that's not such a good idea. Try with command:

Code: Select all

\sloppy
But expect large space between words. You may put it before \begin{document} to apply to whole text or in front of some paragraphs to apply from that place on ("disabling" is done with command: \fussy)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

text in margin

Post by localghost »

howard wrote:[…] I didn't like how latex was hyphenating so many words so I used the hyphenat package with the "none" option so that there was no automatic hyphenation. […]
Please explain that by means of an example (MWE).


Best regards
Thorsten
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

text in margin

Post by frabjous »

If you're typesetting a narrow text column, you might see if microtype helps at all.
howard
Posts: 8
Joined: Fri Oct 23, 2009 8:55 am

text in margin

Post by howard »

The body of the output text looked something like:

text text text text text text text text text text text te-
xt text text text text text text text text text text text
text text text text text text text text text text text te-
xt text text text text text text text text text text text
text text text text text text text text text text text te-
xt text text text ...

It just seemed that latex was hyphenating at nearly every line break. I did find a solution (not sure of how robust it is) using the

Code: Select all

\hyphenpenalty=5000 \tolerance=1000
commands. Of course any better advice would be greatly appreciated. Thanks.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: text in margin

Post by frabjous »

It was hyphenating in the middle of a syllable?

Like te-
xt?

Or just, a lot of the time?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

text in margin

Post by localghost »

howard wrote:[…] Of course any better advice would be greatly appreciated. […]
Provide a small, complete and compilable minimal working example (MWE). This example has to reproduce the undesired behaviour clearly. In your case a MWE would at least consist of your preamble and the critical part of your text.
howard
Posts: 8
Joined: Fri Oct 23, 2009 8:55 am

text in margin

Post by howard »

Sorry localghost, I wasn't sure what MWE stood for. Anyway, below is a sample portion of my document that is giving me hyphens where I do not want them. When I use the hyphenat package with the none option (commented out), it stops the hypenation but causes the words to continue into the right hand margin. The text is actually a chapter introduction, so I put the \noindent command in to simulate a beginning paragraph of a chapter. [Edit- Look at next post - this one did not print the code properly and for some reason and is refusing to be fixed]

Code: Select all

\documentclass[12pt,letterpaper]{report}
\usepackage[T1]{fontenc}
%\usepackage[none]{hyphenat} 
\usepackage{ae,aecompl,amsmath,amsfonts}  
\usepackage{pslatex} 
\usepackage[left=1.5in,top=0.8in,right=1in,bottom=1in,nohead,nofoot]{geometry} 

\begin{document}
\noindent Presented in this chapter are some fundamental theoretical considerations relevant to crystal structures and x-ray diffraction studies. These include crystal systems, symmetry operations, Miller indices, the Bragg and Laue conditions, and basics of x-ray scattering theory.
\end{document} 
As I mentioned in a previous reply, I did have success using the

Code: Select all

\hypenpenalty=5000
\tolerance=1000
commands, but a more robust solution would be desired.
Last edited by howard on Fri Nov 06, 2009 12:15 am, edited 2 times in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

text in margin

Post by localghost »

You are using some obsolete packages. In particular
If you want to use another font, try the Latin Modern font package.

Code: Select all

\documentclass[12pt,letterpaper]{report}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsfonts} 
\usepackage[left=1.5in,top=0.8in,right=1in,bottom=1in,nohead,nofoot]{geometry}
\usepackage{lmodern}

\begin{document}
\noindent Presented in this chapter are some fundamental theoretical considerations relevant to crystal structures and x-ray diffraction studies. These include crystal systems, symmetry operations, Miller indices, the Bragg and Laue conditions, and basics of x-ray scattering theory.
\end{document}
howard
Posts: 8
Joined: Fri Oct 23, 2009 8:55 am

Re: text in margin

Post by howard »

Thanks I'll give it a try.
Post Reply