General\begin{center} && \hline

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
danielpm
Posts: 2
Joined: Wed Jan 05, 2011 10:28 pm

\begin{center} && \hline

Post by danielpm »

Hey guys! I have a little problem here in my LaTeX code, wich only appears when I put a \begin{center} & \end{center}, that gives me this error:

Code: Select all

./trabli.tex:38: LaTeX Error: Something's wrong--perhaps a missing \item.
and if i don't put the begin & end {center}, but basically a \hline, give me this error:

Code: Select all

./trabli.tex:39: Misplaced \noalign.
\hline ->\noalign 
                  {\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...
here is my code:

Code: Select all

\documentclass{article}
\usepackage[portuges]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{csvtools}
\usepackage{overpic}

\paperwidth 89mm
\paperheight 55mm
\textwidth 89mm
\textheight 55in
\oddsidemargin -26mm
\evensidemargin -26mm
\hoffset 0mm
\topmargin -33mm
\itemindent 0mm
\parindent 0mm
\renewcommand\familydefault{\sfdefault}


\setlength{\unitlength}{1mm}
\begin{document}
	\applyCSVfile{./csv.csv }{
		\begin{minipage}[t]{89mm}
			\begin{overpic}[unit=1mm]{./design/background-participante.png}
				\includegraphics{./design/logo.jpg}
				\begin{center}
					\huge{NAME}
					\scriptsize{
					\begin{tabular}{0.75\textwidth}{c}
						\hline
					\end{tabular}}
					COMPANY
				\end{center}	
			\end{overpic}
		\end{minipage}	
	}
\end{document}
As you can see, the begin{center} is right after the "\includegraphics{./design/logo.jpg}" . The \hline code happen if i remove the begin{center} and put a \hline.

Can someone help me? I really need to finish this :/ .
Cheers & thanks!

Recommended reading 2024:

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

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

\begin{center} && \hline

Post by frabjous »

This has nothing to do with \hline. You get the same error if you comment that out. The overpic environment is a picture environment, not a paragraph-like environment. You put things in there with \put commands (see here), and so can't use something like \begin{center} ... \end{center}.

What are you actually trying to do?

In the future, please try to create a genuine minimal working example. It is very hard to help someone with code when it calls upon documents (.csv files and images, etc.) that we do not have access to. In general, it's best to remove anything unrelated to the specific problem you're having. Create fake files if you need to.

Also, the syntax \begin{tabular}{0.75\textwidth}{c} is wrong. I assume you mean \begin{tabular}[0.75\textwidth]{c}.
danielpm
Posts: 2
Joined: Wed Jan 05, 2011 10:28 pm

Re: \begin{center} && \hline

Post by danielpm »

Thanks, it helped me a lot! :D
cheers!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

\begin{center} && \hline

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as clearly written in the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.


Thorsten
Post Reply