## LaTeX forum ⇒ General ⇒ 3 Nag warnings with title page. Why ? Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
Cham
Posts: 826
Joined: Sat Apr 02, 2011 4:06 pm

### 3 Nag warnings with title page. Why ?

Here's another MWE code which gives a Nag warning :

Package nag Warning: table with no \caption on input line 28.

I don't want the table to get any caption! So what is wrong with this code?

\RequirePackage[l2tabu,orthodox]{nag}\documentclass[11pt,letterpaper,twoside]{article}\usepackage[T1]{fontenc}\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}\usepackage{tabularx} \begin{document} \subsection{Subsection title} Bla bla \begin{table}	\begin{tabularx}{\textwidth}{|X|X|X|}	\hline	Name 1 & Name 2 & Name 3	\\ \hline	Text & Text & Text	\\ \hline	\end{tabularx}\end{table}  % What is wrong with this table? Bla bla \end{document}
Last edited by Cham on Sat Oct 28, 2017 4:54 pm, edited 1 time in total.

Johannes_B
Site Moderator
Posts: 3600
Joined: Thu Nov 01, 2012 4:08 pm
Nothing. The package assumes that every tabular (defined within table) moves around (it does indeed, as that is the only purpose of a table) and needs a caption to be refernced.

Are you maybe doing \begin{table}[H] in your own document? Do not. Omit the table environment.

A mistake many users make.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Cham
Posts: 826
Joined: Sat Apr 02, 2011 4:06 pm
Johannes_B wrote:Are you maybe doing \begin{table}[H] in your own document? Do not. Omit the table environment.

Yes, I do this. What then to do, and I want all the tables and figures to be fixed on THAT place. I don't want them to move around.

Johannes_B
Site Moderator
Posts: 3600
Joined: Thu Nov 01, 2012 4:08 pm
Omit the table environment.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Cham
Posts: 826
Joined: Sat Apr 02, 2011 4:06 pm
I can't! For example, I need to do this, which works without any Nag warning :

\RequirePackage[l2tabu,orthodox]{nag}\documentclass[11pt,letterpaper,twoside]{article}\usepackage[T1]{fontenc}\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}\usepackage{tabularx}\usepackage{here} \begin{document} \subsection{Subsection title} Bla bla \begin{table}[H]	\centering	\renewcommand{\arraystretch}{1.5}	\begin{tabularx}{\textwidth}{|X|X|X|}	\hline	Name 1 & Name 2 & Name 3	\\ \hline	Text & Text & Text	\\ \hline	\end{tabularx}\end{table}  % WHAT IS WRONG? Bla bla \end{document}

Johannes_B
Site Moderator
Posts: 3600
Joined: Thu Nov 01, 2012 4:08 pm
Well then, where is the problem? Use [H] all the time. It does what you want, prevents the figure or table from moving.

It is just more code to type in.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Cham
Posts: 826
Joined: Sat Apr 02, 2011 4:06 pm
I don't see how to make the previous table, without the table environment and the tabularx inside. How would you modify the previous code ?

Johannes_B
Site Moderator
Posts: 3600
Joined: Thu Nov 01, 2012 4:08 pm
The center environment adds a bit of vertical space. A minipage around would be even better, but again more typing.

Just stick with using H.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Cham
Posts: 826
Joined: Sat Apr 02, 2011 4:06 pm
Ok, thanks a lot. For the moment, I'll stick with the table environment (with [H]).

But I still have a strange Nag warning with that label inside a list. I don't know what to do, to solve this issue, and I'm yet unable to produce a MWE for this. I'll try something else.

Johannes_B
Site Moderator
Posts: 3600
Joined: Thu Nov 01, 2012 4:08 pm
Nag is a script, without any intelligence. It might report false warnings.
The manual even tells you so, it can report false things and it might not pick up all bad things.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.