The correct answer may be to put the two word in an \mbox{keep together}
. Then you avoid hyphenation, but not overfull lines.
You may define a macro to help you save some time when writing:
\newcommand{\MSaccess}{\textsc{ms~access}}
The flip side is that macros eat spaces. Therefore, in you text, you have to write \MSaccess{}
to avoid that a space following the macros disappears. You may try to load the package xspace, and define the command as:
\newcommand{\MSaccessx}{\textsc{ms~access}\xspace}
Unfortunately, there are situations where xspace
does not work, and it may be better to define the command using the TeX
-command def
:
\def\MSA/{\mbox{\textsc{ms~access}}}
Then, you can write \MSA/
(notice the slash), and LaTeX
will not eat a following space. Unfortunately, such commands may be awkward to type keyboards other than US-English.
If you use small caps in your macro, be sure that the font you use has real small caps, and of course, small caps has to be letterspaced (see Bringhurst, The Elements of Typographic Style). Actually, also the MS
should be letterspaced according to Bringhurst.
I agree with Anon in his answer: Typographically a line break between MS
and Access
looks better than a sloppy paragraph or an overfull line (a line sticking out in the right margin). Even worse
will be that `Ac-
cess` is hyphenated.
I suggest that you write your article, and when your are finished, as the last touch up when proof reading, you check the line breaks to see if you have places where there is a line break between MS
and Access
(or Access is hyphenated) and then put the words in an \mbox{MS Access}
.
This MWE demonstrates some of the differences:
\documentclass[onepage]{article}
\usepackage{lmodern,xspace}
\usepackage[utf8]{inputenx}
\usepackage[T1]{fontenc}
\newcommand{\MSaccess}{\textsc{MS}~Access} % NB! \textsc has no effect
\newcommand{\MSaccessx}{\textsc{MS}~Access\xspace}
\def\MSA/{\mbox{\textsc{ms~access}}}
\begin{document}
\thispagestyle{empty}
Here is a text which only purpose is to demonstrate that
\MSaccess without \emph{xspace} eats spaces.
Here is the text which only purpose is to demonstrate the wonders
\emph{xspace} does for \MSaccessx and that \emph{xspace} does not eat spaces. But look here
«\MSaccessx», and how we get a space before the nice, French citation mark (NB!
\emph{xspace} may be configured to avoid this).
And here is the eminent `def`-macro that does not eat any spaces, as I state,
\MSA/ is OK, and does not fail because of strange punctuation, «\MSA/».
\end{document}
Best Answer
The issue seems to be that LaTeX doesn't hyphenate the first word in a paragraph. I don't know if there's a way to enable that globally, but in your case, adding
\hspace{0pt}
without a space afterwards solves the issue:To automate this process and apply
\hspace{0pt}
to every cell (in a column) to simplify automated table generation, you can use the>{...}
syntax from thearray
package, which adds...
to the beginning of every cell in the respective column. Here are the lines I had to change/add in comparison to the MWE above.(The output looks the same.)