0

I'm dealing with a pesky hyphenation problem in my LaTeX document on Overleaf. I tried to fix it by using the \usepackage{hyphenat} package, but it didn't do the trick. Since my document is pretty long, manually tinkering with hyphenation isn't a viable option.

Is there any effective solution or a way to work around this document-wide hyphenation issue in LaTeX on Overleaf? I'd really appreciate any tips or suggestions.

Here an example

my main packages:

\documentclass[dscexam]{coppe}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{amsmath,amssymb}

\usepackage[dvipsnames]{xcolor}

\usepackage{bm} % parenteses do modo equação \usepackage[unicode=true, bookmarks=true, breaklinks=false, pdfborder={0 0 0}, backref=false, colorlinks=true, hyphens]{hyperref}

\hypersetup{ linkcolor=black, % Cor dos links internos (seções, figuras, tabelas, etc.) citecolor=black, % Cor das citações (usada com \cite{}) urlcolor=blue, % Cor dos URLs filecolor=blue % Cor dos links para arquivos } \usepackage{graphicx} \usepackage{booktabs}

\usepackage[flushleft]{threeparttable} \usepackage{subcaption} \usepackage{textcomp} % R com bolinha \usepackage{verbatim} % Inclua o pacote verbatim para comentar trechos inteiros % GRAPHICS \usepackage{tikz} \newenvironment{aasa}{$\displaystyle\aligned}{\endaligned$}

\usepackage{csvsimple} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{float} %holding figures \usepackage{indentfirst} %tira a identação do primeiro paragrafo

\usepackage[figurename=Figure]{caption}

\usepackage{chemfig} % figurinhas químicas \usetikzlibrary{calc}

\usepackage{textgreek,stackengine} \newcommand\textdot[1]{\stackon[1pt]{\csname text#1\endcsname}{.}} \newcommand\textdots[1]{\stackon[1pt]{\csname text#1\endcsname}{..}} \usepackage[version=3]{mhchem}

%%%%%%%%%%%%%%%%% TIKZ DOTS

\makeatletter % from: https://tex.stackexchange.com/a/101263/134144 \tikzset{ dot diameter/.store in=\dot@diameter, dot diameter=1pt, dot spacing/.store in=\dot@spacing, dot spacing=5.5pt, dots/.style={ line width=\dot@diameter, line cap=round, dash pattern=on 0pt off \dot@spacing } } \makeatother %%%%%%%%% TIKZ RED collor \def\RED{\gdef\printatom##1{\color{red}\ensuremath{\mathrm{##1}}}} \def\BLACK{\gdef\printatom##1{\color{black}\ensuremath{\mathrm{##1}}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{epstopdf} \usepackage[]{natbib}

%\usepackage{breakurl}

\makelosymbols \makeloabbreviations

\usepackage{scalerel,amssymb} \def\mcirc{\mathbin{\scalerel{\bigcirc}{t}}} \def\msquare{\mathord{\scalerel{\Box}{gX}}} %%%%%%%%%%%%%%%%%%%%%%% \usepackage{fancyhdr}

% Define o estilo de página "mainmatterstyle" \fancypagestyle{mainmatterstyle}{ \fancyhf{} % Limpa os cabeçalhos e rodapés anteriores \fancyhead[RO]{\nouppercase{\rightmark}} % Capítulos e seções à direita \fancyfoot[C]{\thepage} % Número da página no rodapé \renewcommand{\headrulewidth}{0.4pt} % Espessura da linha do cabeçalho \renewcommand{\footrulewidth}{0pt} % Sem linha no rodapé } \fancypagestyle{encerrado}{ \fancyhf{} % Limpa os cabeçalhos e rodapés \fancyfoot[C]{\thepage} % Número da página no rodapé \renewcommand{\headrulewidth}{0pt} % Sem linha no cabeçalho \renewcommand{\footrulewidth}{0pt} % Sem linha no rodapé }

  • 3
    what is your problem? you show no input or output and do not say how you want to change the hyphenation. make a small complete example that shows a problem – David Carlisle Aug 22 '23 at 20:44
  • 2
    Please clarify what this so-far mysterious "pesky hyphenation problem" might be. Could it be that you're trying to suppress hyphenation globally? Please be specific. – Mico Aug 22 '23 at 21:02
  • 1
    If you really want to suppress hyphenation entirely, specify \hyphenpenalty=10000. But be prepared for the spacing in your output to look dreadfully uneven. The hyphenated examples you show are correct under normal rules for English. – barbara beeton Aug 22 '23 at 21:33
  • I apologize for any confusion caused. It appears that there is an issue with the hyphenation in my text. The syllable division is incorrect, as illustrated in the provided example. I am uncertain about the accuracy of the hyphenation criteria being employed. To clarify, I am using only the "english babel" package and have not included any additional components. – Caio Henrique Pinheiro Aug 22 '23 at 21:35
  • Let's suppose English isn't my strong suit; nonetheless, I'm hopeful that Barbara is correct. Thank you. – Caio Henrique Pinheiro Aug 22 '23 at 21:41
  • @CaioHenriquePinheiro -- Please let us know what you think the hyphenation of those words should be. I've just checked, and they follow the US rules. – barbara beeton Aug 22 '23 at 21:47
  • For example, wouldn't it be more appropriate to separate them by syllables? It doesn't seem quite correct to split the word "Differences" as "Differ-ences," or "characteristics" as "character-istics." – Caio Henrique Pinheiro Aug 22 '23 at 22:04
  • you have posted a lot of code but unrelated to the problem as it uses local files and does not produce output. Why do you think there is a problem with the hyphenation? – David Carlisle Aug 22 '23 at 22:04
  • 1
    @CaioHenriquePinheiro they look like syllable boundaries to me (I am english, although UK hyphenation does not always follow pronunciation) – David Carlisle Aug 22 '23 at 22:07
  • What's the point of me posting the excerpt of the text where I have hyphenation issues, when hyphenation occurs automatically due to the imported packages? – Caio Henrique Pinheiro Aug 22 '23 at 22:09
  • Indeed, it does seem to be a linguistic matter, doesn't it, David? I'm from Brazil, by the way. – Caio Henrique Pinheiro Aug 22 '23 at 22:10
  • the hyphenation is unrelated to the packages you showed apart from \usepackage[english]{babel} but a test file would allow people to test answers, and clarify your question. Originally all you said was hyphenation was not as you expected, but as we did not know the input how could we say if that was expected or not? – David Carlisle Aug 22 '23 at 22:12
  • But now is it clear, David? – Caio Henrique Pinheiro Aug 22 '23 at 22:14
  • The hyphenation of those two words shouldn't depend on packages, but on a set of patterns preloaded to the engine. I can submit them to tex (not pdftex, pdflatex, etc.) and ask for \showhyphens{differences characteristics} and those hyphenati0on points will be reported, along with others that might be used if the lines in the working text required breakpoints giving different lengths. – barbara beeton Aug 22 '23 at 22:15
  • only via comments, the example code is not usable. As the answer is "there is no problem" do you want an answer saying that or do you want to delete the question? – David Carlisle Aug 22 '23 at 22:16
  • 1
    @barbarabeeton if the option to babel had been portuguese the hyphenation would depend on the package (I know you know that:-) – David Carlisle Aug 22 '23 at 22:18
  • @DavidCarlisle -- Of course, but we're talking about English words here, and they should be hyphenated accordingly (even if it's necessary to specify that they're a \foreignlanguage). (By the way, the UK hyphenation may be different, but we don't have enough information to determine whether it's US or UK.) – barbara beeton Aug 22 '23 at 22:20
  • 1
    @CaioHenriquePinheiro each language has different rules for hyphenation (see e.g, https://english.stackexchange.com/questions/385/what-are-the-rules-for-splitting-words-at-the-end-of-a-line). In your example, characteristics should have char|ac|ter|is|tics as hyphenation points (see @barbara's comment). I'd infer you are looking at these words with the mindset of Portuguese rules, which definitely do not apply here. – Paulo Cereda Aug 22 '23 at 22:31
  • If grammatically the pic of the output I provided is correct, then the question is not relevant, but rather a linguistic misunderstanding on my part. Now, if the exemplified hyphenation is indeed incorrect, the doubt persists. The issue is that I have no intention of doing it manually, word by word. – Caio Henrique Pinheiro Aug 22 '23 at 22:31
  • @barbarabeeton we do as the OP showed his babel call (english=american) – David Carlisle Aug 22 '23 at 22:31
  • 1
    @CaioHenriquePinheiro I show the full set of allowed points in my answer, if the words are hyphenated at all, I'd say the breaks you showed are the best choice, I'm interested to know where you would have expected break – David Carlisle Aug 22 '23 at 22:36
  • Honestly, I think the issue lies in the syllabic separation we have in mind in Portuguese, as was pointed out during our discussion. For instance, from what I researched for 'differences,' it's 'dif-fer-en-ces.' However, using the syllable separation approach seen in Portuguese, it would be something like: 'dif-fe-ren-ces'. – Caio Henrique Pinheiro Aug 22 '23 at 22:42

1 Answers1

3

Using the patterns for UK English

\documentclass{article}

\usepackage[british]{babel}

\showhyphens{differences characteristics} \begin{document}

\end{document}

shows

dif-fer-ences char-ac-ter-ist-ics

With the (default) US english

\documentclass{article}

\usepackage[american]{babel}

\showhyphens{differences characteristics} \begin{document}

\end{document}

you get

dif-fer-ences char-ac-ter-is-tics

so slightly different break points, but the breaks you show are valid in both variants.

David Carlisle
  • 757,742