General3 Nag warnings with title page. Why ?

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

3 Nag warnings with title page. Why ?

Post by Cham »

Using the usefull Nag package, I'm getting three warnings and I don't understand why. I suppose I'm doing something wrong with the \flushleft and \center commands in the code below. How to fix these ?

Code: Select all

\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{mdframed}
\usepackage[unicode,colorlinks,plainpages=false,hyperindex=true,pdfpagelabels]{hyperref}
\usepackage{graphicx}

\begin{document}

  \begin{titlepage}

	\href{http://www.site/}{\flushleft{\vspace{-0.3in}\includegraphics[height=0.6in]{example-image-a}}}  % WHAT IS WRONG HERE?

	\begin{mdframed}
		\center{\textsf{\Large Title 1}} \\[18pt]  % WHAT IS WRONG HERE?
		\center{\textbf{\textsf{\huge Title 2}}} \\[12pt]  % WHAT IS WRONG HERE?
	\end{mdframed}

  \end{titlepage}

\end{document}
Any suggestion about the \flushleft and \center in this title page ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

3 Nag warnings with title page. Why ?

Post by Johannes_B »

Both are not commands! They are environments.

Code: Select all

\begin{center} 
\end{center}
Maybe you are looking for \centering?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

3 Nag warnings with title page. Why ?

Post by Cham »

What about the flushleft ? It's an environment too ?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

3 Nag warnings with title page. Why ?

Post by Johannes_B »

Yes, that is why i said both.

You might be looking for the following.

Code: Select all

\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{mdframed}
\usepackage[unicode,colorlinks,plainpages=false,hyperindex=true,pdfpagelabels]{hyperref}
\usepackage{graphicx}

\begin{document}

\begin{titlepage}

\noindent\href{http://www.site/}{\vspace{-0.3in}\includegraphics[height=0.6in]{example-image-a}}  

\vspace{2cm}
\begin{mdframed}
\centering\textsf{\Large Title 1}\par \bigbreak
\textbf{\huge Title 2} 
\end{mdframed}

\end{titlepage}

\end{document}
You might find https://en.wikibooks.org/wiki/LaTeX/Title_Creation and/or https://github.com/johannesbottcher/titlepageExamples/ helpful.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

3 Nag warnings with title page. Why ?

Post by Cham »

Ah ! Thanks a lot ! It's now more logical for the logo, since I now can remove the useless \vspace{-0.3in}.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

3 Nag warnings with title page. Why ?

Post by Stefan Kottwitz »

Hi Cham,

the command making the same as flushleft environment is \raggedright.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

3 Nag warnings with title page. Why ?

Post by Cham »

I also have another Nag glitch with a label inside a list, but I'm yet unable to reproduce the warning with this MWE :

Code: Select all

\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{mdframed}
\usepackage[unicode,colorlinks,plainpages=false,hyperindex=true,pdfpagelabels]{hyperref}
\usepackage{graphicx}
\usepackage{multicol}

\begin{document}

\begin{multicols}{2}

\begin{enumerate}
	\item Blabla.
	\item \label{name} Item with a reference label.
	\item Blabla.
\end{enumerate}

\begin{enumerate}
	\item Blabla.
	\item Blabla.
\end{enumerate}

\begin{enumerate}
	\item Blabla with reference \ref{name} blabla.
	\item Blabla.
\end{enumerate}

\end{multicols}

\end{document}
Nag says this :
Package nag Warning: \label in float, but not after \caption on input line
Any idea of what may be wrong here ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

3 Nag warnings with title page. Why ?

Post by Stefan Kottwitz »

I guess you have a \label in a figure or table environment, that's not coming after \caption but before.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

3 Nag warnings with title page. Why ?

Post by Cham »

Stefan Kottwitz wrote:I guess you have a \label in a figure or table environment, that's not coming after \caption but before.
Well, I don't understand this, since this label is just inside a list, which is itself inside a multicol environment. There's no table or figure on this part. There's something fishy here !
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

3 Nag warnings with title page. Why ?

Post by Johannes_B »

Without a reproducable example, nobody can say if there is a package bug, or nag detects something legit or the input is wrong.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply