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}

\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 '21 at 23:17\hypanation{oneLatinWord}? – A. Cedano Feb 17 '21 at 23:21latinas language forpolyglossiaand 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 '21 at 23:27latinas a language. – Alan Munn Feb 17 '21 at 23:30\emergencystretch=3emand enabling font expansion with\usepackage{microtype}. These give LaTeX more ways to adjust the spacing of a troublesome paragraph, making it need to fall back to this less often. – Davislor Feb 18 '21 at 00:34\usepackage[spanish]{babel}and the problem persists. – A. Cedano Feb 18 '21 at 10:07