2

I am currently using the amsbook class to write my thesis. It happens quite regularly that some text lines cross the margin of the document. So far, I have no clue why and in which cases that happens (e.g., it does not only happen in math environments). Does anyone know why this happens and how to fix it?

Here is some minimal example from my thesis, where this happens. I have included the packages that I use, but the same problem occurs if I do not use any of them.

\documentclass{amsbook}

\usepackage[english]{babel}
\usepackage{amsmath, amsthm, amsfonts,amssymb}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}\usepackage{lmodern}
\usepackage[bookmarks,bookmarksopen,bookmarksnumbered,colorlinks,linkcolor=blue,citecolor=red,urlcolor=grey,breaklinks]{hyperref}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{tikz}\usetikzlibrary{positioning}
\usepackage{tikz-cd}
\usepackage{accents}
\usepackage{mathtools}
\usepackage{todonotes}
\usepackage{mathrsfs}

\theoremstyle{definition}
\newtheorem{Def}{Definition}[chapter]

\begin{document}
    \begin{Def}[Polynomial Hubbard Trees]
        Let $p$ be a post-critically finite polynomial. The \emph{Hubbard Tree} of $p$ is the unique finite embedded tree $H\subset\mathbb{C}$ for which the following conditions are satisfied:
        \begin{itemize}
            \item $\Omega^+(C(p))\subset H$ and all endpoints of $H$ are contained in $\Omega^+(C(p))$. (\textbf{Minimality})
            \item The embedded tree $H$ is forward invariant, i.e., $p(H)\subset H$. (\textbf{Invariance})
            \item For every pair of points $z,w\in H$, the in-tree connection $[z,w]_H$ is a regulated arc. (\textbf{Normalization})
        \end{itemize}
    \end{Def}
\end{document}

The compiled file Looks like this. As you can see, the margin is not respected.

  • 1
    welcome to tex.se! with given information is almost impossible to help you ... do you use babel package? maybe adding microtype package can help you. for more you need to show (short as possible) example of your document which show your problem. – Zarko May 10 at 8:02
  • Does the issue arise mainly, or exclusively, with long words? Did you maybe suppres hyphenation? – Mico May 10 at 8:08
  • Thank you for your help, I have just edited my post. Including the microtype package does not change anything... – saveturn May 10 at 8:21
  • try ({\bfseries Minimality}) (instead of (\textbf{Minimality}) ). – Zarko May 10 at 8:27
  • @DavidCarlisle, i wonder, why it make difference (enable hyphenation, meanwhile \textbf{...} in this particular case not). this is over my knowledge of LateX :-( – Zarko May 10 at 8:34
1

it seems that \textbf{...} in combination with left parent before it (see @egreg comment below; thank you very mach Gregorio!) block automatic hyphenation of the text inside it. it is not connected with amsbook document class, but also happen for example at use of article. so, to my opinion, this is bug ...

you have two possibilities to resolve your problem:

  • manually insert hyphenation points as suggested in Red-Cloud answer
  • instead (\textbf{...}) use ({\bfseries ...}) as i suggested in my comment below question

some off-topic remarks:

  • the hyperref package should be loaded last (in rare exception as is cleveref)
  • mathtolls load amsmath (and improve it), so you not need load again
  • amssymb load amsfonts, so you not need to load again
  • utf8 coding is included in recent (standard) document class version, so you can omit it in preamble

    \documentclass{article}
    
    \usepackage[english]{babel}
    \usepackage{mathtools,amssymb, amsthm}
    \usepackage[T1]{fontenc}
    %\usepackage[utf8]{inputenc}
    \usepackage{lmodern}
    \usepackage{mathrsfs}
    \usepackage{accents}
    \usepackage{mathtools, amssymb, amsthm}
    \usepackage{enumitem}
    \usepackage{graphicx}
    \usepackage{tikz}
    \usetikzlibrary{positioning}
    \usepackage{tikz-cd}
    \usepackage{todonotes}
    \usepackage[bookmarks,bookmarksopen,bookmarksnumbered,
                colorlinks,linkcolor=blue,citecolor=red,urlcolor=grey,
                breaklinks]{hyperref}
    
    \theoremstyle{definition}
    \newtheorem{Def}{Definition}[section]
    
    \begin{document}
        \begin{Def}[Polynomial Hubbard Trees]
            Let $p$ be a post-critically finite polynomial. The \emph{Hubbard Tree} of $p$ is the unique finite embedded tree $H\subset\mathbb{C}$ for which the following conditions are satisfied:
            \begin{itemize}
                \item $\Omega^+(C(p))\subset H$ and all endpoints of $H$ are contained in $\Omega^+(C(p))$. ({\bfseries Minimality})
                \item The embedded tree $H$ is forward invariant, i.e., $p(H)\subset H$. (\textbf{Invariance})
                \item For every pair of points $z,w\in H$, the in-tree connection $[z,w]_H$ is a regulated arc. (\textbf{Normalization})
            \end{itemize}
        \end{Def}
    \end{document}
    

result:

enter image description here

  • It's the combination “left parenthesis followed by \textbf” that blocks hyphenation, not just \textbf. – egreg May 10 at 10:49
  • @egreg, it might be. so far i didn't tested. and yeas, you are right. I will correct answer asap. – Zarko May 10 at 10:51
2

Use \textbf{Mini\-mality}.

But it is a bit curious, because there are alread the hyphenation points Min-i-mal-ity

  • oh sorry I missed this, I'll delete mine which is the same, – David Carlisle May 10 at 8:37

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.