# How to disable the Overfull \hbox too wide warning for my table?

It just seems impossible to disable it. I tried putting:

1. On the question Overfull \hbox warning when using tabular says adding \hfuzz=0.64pt, I tried \hfuzz=50000pt and no success.

\hfuzz=5000pt
...

2. With the question Is there really no better solution to "Overfull \hbox" than adding a line break?, I tried adding \sloppy, and no results.

\sloppy
..

3. I also tried putting this below from the question How to disable / suppress bad box warnings within a longtable?, but also had no effect.

\hbadness=\maxdimen
...

4. On the question What is a "Overfull \hbox (9.89561pt too wide)"?, I did not understood how to use the \the\fontdimen2\font and \the\fontdimen3\font to extend the limits.

This is the table:

\documentclass[12pt]{article}
\usepackage[a4paper, margin=2cm, showframe]{geometry}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}

\usepackage{newtxtext,newtxmath}
\usepackage{microtype,booktabs}

\usepackage{ragged2e}
\usepackage{array, multirow, tabularx}
\usepackage[strict]{changepage}

\usepackage{hyperref}

\begin{document}

\section{Riscos}

% https://tex.stackexchange.com/questions/366155/how-to-write-a-table-a-little-larger-than-the-paragraphs-with-centered-columns
%
\small
\begin{tabularx}{\linewidth}
{|
*1{                 >{\RaggedRight\arraybackslash\hsize=1.1\hsize }X       |} % Riscos
*2{                 >{\RaggedRight\arraybackslash\hsize=0.95\hsize}X       |} % Resposta, Prevenção
}

\hline Riscos  & Pro\-ba\-bi\-li\-da\-de & Im\-pac\-to & Prio\-ri\-da\-de & Es\-tra\-té\-gia de res\-pos\-ta & Ações de pre\-ven\-ção \\ \hline

% Row 1
% Riscos
\hline Problemas com perda de dados &
Baixa &
% Impacto
Alto &
Alta &
% Estratégia de resposta
Uso do backup &
% Ações de prevenção
Backup periódicos \\ \hline

% Row 2
% Riscos
\hline Alteração do cronograma ou descontinuidade do projeto onde recebo uma bolsa &
Média &
% Impacto
Alto &
Alta &
% Estratégia de resposta
Redefinição da data de entrega do trabalho &
% Ações de prevenção
Monitoramento contínuo das informações obtidas com superiores imediatos \\ \hline

\hline \end{tabularx}

\end{document}


And this is the warning:

D:\main2.tex:63: Overfull \hbox (1.8104pt too wide) in paragraph at lines 63--63

Overfull \hbox (1.8104pt too wide) in paragraph at lines 63--63
[]|\T1/ntxtlf/m/n/10.95 (-20) M▒dia|


This is how the table looks like:

Which is look good for me, therefore how would I to extend the warning limits to allow this table only, not trigger them accordingly to how it is looking now?

• I get no warning using LaTeX, but do get one using XeLaTeX. – John Kormylo Apr 23 '17 at 19:39
• Stranger tough, but nice to know. Thanks for the time. – user Apr 23 '17 at 19:49

The warning is

Overfull \hbox (1.8104pt too wide) in paragraph at lines 63--63
[]|\T1/ntxtlf/m/n/10.95 (-20) M▒dia|


This shows you that the problem is not that the table is too wide, but that the text does not fit in the p column. This is why your settings outside the table had little effect as the paragraph settings are "normalized" in parboxes and p column entries.

So you could reset \hfuzz inside the table but really it is pretty odd to specify a column width and then give it an unbreakable one-word entry that is wider than the column.

If you make the p column 2pt wider then the warning goes.

\begin{tabularx}{\linewidth}
{|
*1{     >{\RaggedRight\arraybackslash\hsize=1.1\hsize }X       |} % Riscos
*2{     >{\RaggedRight\arraybackslash\hsize=0.95\hsize}X       |} % Resposta, Prevenção
}

• Nice perspective, but I think the table is looking fine, then I would prefer keep the column width, but reduce the right padding for that column specifically. So, it should stop the warning and keep the current sizes. – user Apr 23 '17 at 21:50
• @user p{\dimexpr ... +2pt}@{\hskip\dimexpr\tabcolsep=2pt} would increase the cell width and remove the same amount from the inter-column space – David Carlisle Apr 23 '17 at 21:54
• Thanks, this do the job! Also, do you think is possible just disable overlapping warnings for a hole table? – user Apr 23 '17 at 21:58
• yes you can do \hfuzz=\maxdimen\newdimen\hfuzz before the table (but I wouldn't:-) – David Carlisle Apr 23 '17 at 22:02

You get the overfull warning from the word "Média" which is a bit to long for the columnwidth. Either enlarge the width, or hide the content of the column with \rlap{Média}.

• Ow, thanks! It is magic. I put \rlap{Média} and the warning is gone. Now, I do not want to enlarge the width because visually the word Média is fitting nice. I prefer to enlarge the latex invisible overfull limit, instead of enlarge the visual table width. Do you now how to make the visual and invisible overfull limit equals? That is, only get the overfull limits when the text Média actually/visually touches the line. I will update the question within this information. – user Apr 23 '17 at 19:42
• Ops, I just noticed/remembered about the right side padding of the tables' column, therefore the warning should be because the word Média is touching the inner padding of the column. Therefore either I should enlarge the table width or reduce the left padding for that column or cell with the word Média. – user Apr 23 '17 at 19:46

I propose some improvements to the general look of the table, playing with \hsize for X columns, the value of tabcolsep and the font size:

\documentclass[12pt]{article}
\usepackage[a4paper, margin=2cm, showframe]{geometry}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}

\usepackage{newtxtext, newtxmath}
\usepackage{microtype, booktabs}

\usepackage{ragged2e}
\usepackage{array, multirow, tabularx, makecell}
\usepackage[strict]{changepage}

\usepackage{hyperref}

\begin{document}

\section{Riscos}

% https://tex.stackexchange.com/questions/366155/how-to-write-a-table-a-little-larger-than-the-paragraphs-with-centered-columns
%
\footnotesize\renewcommand\tabcolsep{4pt}\setcellgapes{4pt}\makegapedcells
\begin{tabularx}{\linewidth}
{|
*1{ >{\RaggedRight\arraybackslash\hsize=1.15\hsize }X |} % Riscos
*2{ >{\RaggedRight\arraybackslash\hsize=0.925\hsize}X |} % Resposta, Prevenção
}

\hline Riscos & Probabilidade & Impacto & Prioridade & Estratégia de resposta & Ações de prevenção \\ \hline

% Row 1
% Riscos
\hline Problemas com perda de dados &
Baixa &
% Impacto
Alto &
Alta &
% Estratégia de resposta
Uso do backup &
% Ações de prevenção
Backup periódicos \\ \hline

% Row 2
% Riscos
\hline Alteração do cronograma ou descontinuidade do projeto onde recebo uma bolsa &
Média &
% Impacto
Alto &
`