2

I asked this question earlier and it was linked to other questions and considered closed. I've checked the answers to the linked questions and they don't answer my question so I'm trying again. The following text begins a paragraph. When typeset, the word 'the' in the second sentence breaks the right margin:

Graunt decided to pen a scientific paper to show to Petty. In 1662 he produced
a series of tables based on mortality records. His article was called \texttt{Natural and
Political Observations Mentioned in a Following Index, and Made Upon the
Bills of Mortality.}

I can probably solve it by rewording the preceding text but it would be nice to understand why this is happening here and nowhere else in the document.

New contributor
TonyK is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
5
  • 2
    If your question gets closed as a duplicate but you don't think that it's a duplicate, then the normal protocol is to edit our existing question to state how your question is different and why the answers of the other question didn't help you. After you edit a closed question, it gets automatically added to a review queue where are users have the option to reopen the question if they agree with you. Nov 25 at 17:41
  • 1
    Is there a reason for using \texttt for this? I'd use italics.
    – egreg
    Nov 25 at 17:43
  • 2
    Please add the code of a complete document, starting with \documentclass and ending with \end{document}. In particular, it is relevant to know the font, font size, and text width, which should all become clear if you include the relevant parts of your preamble. The issue might be easy to fix by adding some possibilities for breaking long words.
    – gernot
    Nov 25 at 17:46
  • When did you ask this question before and what was the question number? Nov 25 at 18:14
  • Probably this one: tex.stackexchange.com/q/623885/107497
    – Teepeemm
    Nov 25 at 18:18
4

I can somehow reproduce the issue:

\documentclass[12pt]{article}

\begin{document}

Graunt decided to pen a scientific paper to show to Petty. In 1662 he produced
a series of tables based on mortality records. His article was called
\texttt{Natural and Political Observations Mentioned in a Following Index,
and Made Upon the Bills of Mortality.}

\end{document}

enter image description here

There are a few things you should know about typewriter type:

  1. it sets no flexibility in interword spaces;
  2. it is not subject to hyphenation;
  3. the interword space is the same as the width of letters;
  4. it is totally unfit for this job.

Issue number 4 is independent from the other three, which can be fixed.

\documentclass[12pt]{article}

\newcommand{\opus}[1]{%
  \begingroup
    \spaceskip=\fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font
    \xspaceskip=\fontdimen7\font\relax
    \ttfamily
    %\hyphenchar\font=`\-
    #1%
  \endgroup
}

\begin{document}

Graunt decided to pen a scientific paper to show to Petty. In 1662 he produced
a series of tables based on mortality records. His article was called
\opus{Natural and Political Observations Mentioned in a Following Index,
and Made Upon the Bills of Mortality.}

\end{document}

enter image description here

You might decide to uncomment the \hyphenchar line (but be advised that all text in typewriter type might get hyphenated).

However, this doesn't solve issue number 4: the result is ugly as hell.

Substitute the definition of \opus with

\newcommand{\opus}[1]{\textit{#1}}

and the result will look much better:

enter image description here

Now you can choose.

3
  • Thank you all. I've learned that I should amend my question even if it is closed. That I should post the preamble. And I've learned that texttt doesn't allow adjustment of spacing. All good things to know. I'll switch to italics.
    – TonyK
    Nov 25 at 18:17
  • @TonyK You can just remove your closed previous question.
    – egreg
    Nov 25 at 18:27
  • I'm not just a neophyte in LaTeX but on this resource roo. How do I remove a question?
    – TonyK
    Nov 26 at 1:31

Your Answer

TonyK is a new contributor. Be nice, and check out our Code of Conduct.

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.