9

In this document, where I am replicating my original document in order to get the issue I am highlighting here, a comma is stranded on the next line:

\documentclass[a4paper, 14pt]{extarticle}
\usepackage[paper = a4paper, margin = .5in]{geometry}
\usepackage{fontspec}
    \setmainfont{Linux Libertine O}
\usepackage{microtype}
\usepackage{gb4e}
    \exewidth{(23)}

\begin{document}
\begin{exe}
\ex The suffix \textit{-ung-}, on the other hand, clearly undergoes vowel harmony here, cf.\ \textit{áttong-}, \textit{brǿðrongr}, \textit{fjórðong-}, and \textit{konong-} vs.\ \textit{systrungr} and \textit{þriðung-}. These words occur frequently and there are no exceptions.\\
\end{exe}
\end{document}

enter image description here

Why does this occur and what is the best way to fix/prevent it?

There's a similar problem raised in How to avoid a linebreak before a comma?, but the accepted answer refers to the babel package, which I am not using (I use polyglossia), and to its documentation, whose current version doesn't mention the "~ sequence given in the answer.

  • mentioning shorthands, you can activate babel shorthands in polyglossia. I just don't know what it is from the top of my head. Should be something like babelshorthands=on. -> From the package: \DeclareOption{babelshorthands}{\setkeys{polyglossia}{babelshorthands=true}} – Johannes_B Mar 17 '15 at 16:02
  • You could use \mbox{-} where you wanted to avoid mis-hyphenation. – Steven B. Segletes Mar 17 '15 at 16:17
  • there is a \nobreakdash defined in amsmath for this express purpose. if the description of the problem in the user guide (texdoc amsmath, p.9) sounds like it would do what you need, i'll be happy to define an analog that shouldn't step on the toes of the class file and packages shown in your example. (it would not be automatic.) – barbara beeton Mar 17 '15 at 16:17
  • On a completely different matter, you shoud define a sematic command instead of repeating textit all the time. – Johannes_B Mar 17 '15 at 16:18
  • 2
    Having one command for one job, you can later decide to have all occurences of affix to use slshape isntead of itshape. Something else. – Johannes_B Mar 17 '15 at 16:51
7

You don't want to use \textit{...}, because TeX could be willing to hyphenate the affix. Better defining a macro for this:

\documentclass[a4paper, 14pt]{extarticle}
\usepackage[paper = a4paper, margin = .5in]{geometry}
\usepackage{fontspec}
\usepackage{microtype}
\usepackage{gb4e}

\setmainfont{Linux Libertine O}

\exewidth{(23)}

\newcommand{\affix}[1]{\mbox{\textit{#1}}}

\begin{document}
\begin{exe}
\ex The suffix \affix{-ung-}, on the other hand, clearly undergoes vowel harmony here,
cf.\ \affix{áttong-}, \affix{brǿðrongr}, \affix{fjórðong-}, and \affix{konong-} vs.\
\affix{systrungr} and \affix{þriðung-}. These words occur frequently and there are no
exceptions.

\ex The suffix \affix{-ung-}, on the other hand, clearly undergoes vowel harmony here,
cf.~\affix{áttong-}, \affix{brǿðrongr}, \affix{fjórðong-}, and \affix{konong-} vs.\@
\affix{systrungr} and \affix{þriðung-}. These words occur frequently and there are no
exceptions.
\end{exe}
\end{document}

I have presented two ways for inputting the text. Instead of “backslash space” it's better \@; between cf. and the next word probably a tie would be better.

In this case you get an overfull box, but that's life: wait until the document is in final form before fixing these small problems. And don't use 14pt type unless it's a children's book or it is for visually impaired people. Note also that \\ at the end is useless (and wrong).

enter image description here

  • 1
    Actually, \mbox is what I used in my document, I just assumed (or hoped) there was a better way. To your other comments: Why is \@ better than \ (cf. these answers)? I use 14pt in my presentation handouts, where I print two pages on each side of a landscape oriented page. I find 14pt to be the best size for that. – Sverre Mar 17 '15 at 16:40
  • To your last comment: You're right that \\ is useless in this MWE, but I generally use it in my {exe} environments in my presentation handouts when I want extra space between my \ex items - which I don't always want (hence why I don't assign such spacing globally). – Sverre Mar 17 '15 at 16:41
  • @Sverre - is a feasible break point, so either you mask it in a box or add a penalty after it. But considering you could even get a break after the first hyphen in -ung-, the \mbox way seems best. – egreg Mar 17 '15 at 16:42
  • 2
    @Sverre Send an email to Knuth. ;-) – egreg Mar 17 '15 at 16:45
  • 2
    I would, if it weren't for the fact that he only accepts bug reports, not feature requests :) – Sverre Mar 17 '15 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.