1

I am having a very strange problem. It is a document of hundreds of pages and reviewing the PDF in a specific paragraph the word "proslogion" (in Latin) does not fit the margin, it overflows it.

This does not happen in any other context, only here and I suspect it is because it is in Latin.

Is there any way to avoid this?

Since many Latin words appear in the text, is this problem caused by the language? If so, I would like to avoid it in a global way, so that it does not affect other words in other contexts.

EMV:

% !TeX program = lualatex
\documentclass[ebook,11pt,twoside,openright,showtrims]{memoir}

% -------------------------------------------------------Packages
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{csquotes} 
\usepackage{xcolor}  
\usepackage{lipsum} 
\usepackage[showframe, pass]{geometry}
% -------------------------------------------------------Book layout
\setstocksize{9in}{6in}
\settrimmedsize{9in}{6in}{*}
\setbinding{0.5in}
\setlrmarginsandblock{0.5in}{0.4in}{*}
\setulmarginsandblock{0.5in}{0.5in}{*}
\setheadfoot{12.07pt}{\footskip}
\checkandfixthelayout

% -------------------------------------------------------Global settings
\setdefaultlanguage{spanish}
\setcounter{tocdepth}{4}

% -------------------------------------------------------Fonts definition
\newfontfamily\notoserif{Noto Serif}        
\setmainfont{LinuxLibertineO}
\setsansfont{Ubuntu}

% -------------------------------------------------------Heading formats and styles
\renewcommand{\chapnamefont}{\centering\normalfont} 
\renewcommand\chaptitlefont{\centering\huge\bfseries\sffamily}
\renewcommand\secheadstyle{\scshape\centering\huge\sffamily\noindent}
\renewcommand\subsecheadstyle{\centering\Large\sffamily\bfseries\noindent}
\renewcommand\subsubsecheadstyle{\centering\large\sffamily\noindent\ruleline}
\setsecnumdepth{none}
\nouppercaseheads

\makeevenhead{headings}{\sffamily \scriptsize \thepage {\enspace \textemdash \enspace}\rightmark}{}{}
\makeoddhead{headings}{}{}{\sffamily \scriptsize \leftmark {\enspace \textemdash \enspace} \thepage}
\makeevenfoot{headings}{}{}{}
\makeoddfoot{headings}{}{}{}

% Defined commands
%--------------------------------------------------------------------- Commands

\newcommand{\redtext}[1]{\renewcommand{\redtext}{#1}}
\newcommand{\smalltext}[1]{\renewcommand{\smalltext}{#1}}
\newcommand{\txtred}{\textcolor{red}}
\newcommand{\bfred}{\textcolor{red}}
\newcommand{\rred}{\mbox{}\hfill\txtred}
\newcommand{\h}{\hspace{5mm}}
\newcommand{\hl}{\hspace{10mm}}
\newcommand{\txtsmall}{\small}

%--------------------------------------------------------------------- CCE styles


\newcommand{\cceth}[1]{
    {   
        %\par \addvspace{\onelineskip}% Space above     
        \sffamily
        %\tiny
        \addvspace{25pt}% Space above
        \centering
        \color{red} #1
        \par
    }
}

\newcommand{\cceref}[1]{
    {   
        %\par 
        \sffamily
        %\tiny
        \centering
        \color{red} #1
        \par 
        %\bigskip
    }
}

\newcommand{\ccesec}[1]{%
    {\par\raggedright% Start a new paragraph
        \addvspace{\baselineskip}% Space above
        \textbf{\ignorespaces#1}%
    }%
}

\newenvironment{ccebody}{%
    \noindent\ignorespaces
    \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
    \setlength\parindent{0pt}   
    \footnotesize
    \notoserif
}%
{% 
    \par% Start a new paragraph
    \addvspace{\baselineskip}% Space below
}


\newenvironment{cceprose}
{%
    %\label{#1}%
    %$\langle\textit{#1}\ \rangle\equiv$%
    \begin{alltt}\lldo}
    {\end{alltt}}

\newcommand{\ccecite}[1]{
    {   
        \par 
        %\addvspace{\baselineskip}% Space above     
        %\sffamily
        \lldo
        %\tiny  
        \scriptsize #1
        \ignorespaces
        \leftskip1cm\relax
        \rightskip1cm\relax     
        %\tiny
        %\centering
        %\color{red} #1
        
    }
    %\par
}

\newcommand\n[1]{\txtred{\textbf{#1}}}

\newcommand*\ruleline[1]{\par\noindent\raisebox{.8ex}{\makebox[\linewidth]{\hrulefill\hspace{1ex}\raisebox{-.8ex}{#1}\hspace{1ex}\hrulefill}}}

\raggedbottom

\begin{document}
    \mainmatter
  \begin{ccebody}
    
  \n{158} \textquote{La fe \textit{trata de comprender}} (San Anselmo de Canterbury, \textit{Proslogion}, {proemium}: PL 153, 225A) es inherente a la fe que el creyente desee conocer mejor a aquel en quien ha puesto su fe, y comprender mejor lo que le ha sido revelado; un conocimiento más penetrante suscitará a su vez una fe mayor, cada vez más encendida de amor. La gracia de la fe abre \textquote{los ojos del corazón} (\textit{Ef} 1,18) para una inteligencia viva de los contenidos de la Revelación, es decir, del conjunto del designio de Dios y de los misterios de la fe, de su conexión entre sí y con Cristo, centro del Misterio revelado. Ahora bien, \textquote{para que la inteligencia de la Revelación sea más profunda, el mismo Espíritu Santo perfecciona constantemente la fe por medio de sus dones} (DV 5). Así, según el adagio de san Agustín (\textit{Sermo} 43, 7.9: PL 38, 258), \textquote{creo para comprender y comprendo para creer mejor}.

\n{159} \textit{Fe y ciencia}. \textquote{A pesar de que la fe esté por encima de la razón, jamás puede haber contradicción entre ellas. Puesto que el mismo Dios que revela los misterios e infunde la fe otorga al espíritu humano la luz de la razón, Dios no puede negarse a sí mismo ni lo verdadero contradecir jamás a lo verdadero} (Concilio Vaticano I: DS 3017). \textquote{Por eso, la investigación metódica en todas las disciplinas, si se procede de un modo realmente científico y según las normas morales, nunca estará realmente en oposición con la fe, porque las realidades profanas y las realidades de fe tienen su origen en el mismo Dios. Más aún, quien con espíritu humilde y ánimo constante se esfuerza por escrutar lo escondido de las cosas, aun sin saberlo, está como guiado por la mano de Dios, que, sosteniendo todas las cosas, hace que sean lo que son} (GS 36,2).
  
\end{ccebody}

\end{document}

Output

enter image description here

11
  • 4
    You could try adding an explicit \hyphenation{...} pattern for the word. See also Why does TeX prefer an overfull box to hyphenating here? (which is effectively a duplicate of your question, I think,) – Alan Munn Feb 17 at 23:17
  • @AlanMunn It is a document of hundreds of pages and there are many words in Latin. Isn't there a way to do it from settings or using any package? Will I have to look up all the Latin words to make \hypanation{oneLatinWord}? – A. Cedano Feb 17 at 23:21
  • 1
    But you're only having problems with this one word, so you don't need to do this for every word. Alternatively you can load latin as language for polyglossia and then markup all of the Latin words/sentences. But this would not really be practical I suspect. These kinds of problems are easiest to deal with at the very final stages of the document preparation, given the discussion in the linked question. Also, why is the word in {...} in the text? Does removing the {...} around it change anything? – Alan Munn Feb 17 at 23:27
  • 1
    Probably, your question is a duplicate to this one: Latin text not hyphenated at all with LuaLaTeX and polyglossia? There is also a possible solution, I guess :) – Max16hr Feb 17 at 23:28
  • 2
    The simple answer is no, there's not a completely foolproof solution. For more reading on possible solutions, this question is quite comprehensive: What does "overfull hbox" mean? (Why is there a black mark at the end of a line?) – Alan Munn Feb 17 at 23:37
2

The following minimal example:

\documentclass{article}
\usepackage[spanish]{babel}
\selectlanguage{spanish}
\showhyphens{proemium proemio proemial}
\stop

shows

[] \TU/lmr/m/n/10 proemium proemio proemial

which means the hyphenation patterns don't know how to divide these words. As suggested, you can add exceptions for them. With babel and luatex, an alternative approach is to add a pattern, with for example:

\babelpatterns[spanish]{proe3mi}

Here ‘3’ means a valid point. The rule is ‘divide if we know how to do it; don’t divide otherwise’. These are very infrequent words with a very infrequent combination of letters, but I'll consider adding to the hyphenation patterns (I'm the maintainer).

Note this issue is not directly related to either babel or polyglossia.

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.