Graphics, Figures & TablesCustom float error

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
fr33sh1
Posts: 5
Joined: Tue Jul 21, 2009 5:35 pm

Custom float error

Post by fr33sh1 »

First of all Hi!
I am trying to write my masters with MiKTeX and LEd editor. However I have stumbled upon an error while creating custom float. Here is the code:

Code: Select all

\floatstyle{plain}
\newfloat{board}{p}{ext}
\floatname{board}{Tablica}
The error message is as follows:

Code: Select all

! Undefined control sequence.
<argument> board.\theHboard

1.7 ..., co obrazuje tablica \ref{cebula-kontrola}
                                               . Można zaobserwować tubul...
And here is the float it refers to:

Code: Select all

\begin{board}
\centering
\caption[Przekrój poprzeczny przez korzeń cebuli - kontrola metody]{Przekrój poprzeczny przez korzeń cebuli.} 
\includegraphics[height=0.9\textheight]{cebulakontrnegatpozyt}
{(A) kontrola negatywna, (B) pracująca metoda, znacznik powiększenia = 10 $\mu$m}
\label{cebula-kontrola}
\end{board}

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Custom float error

Post by localghost »

You have to provide a minimal working example (MWE) because nobody knows which packages you are using. Only a very few users are willing to take part in a quiz.


Best regards and welcome to the board
Thorsten
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Custom float error

Post by sommerfee »

\floatstyle{plain}
\newfloat{board}{p}{ext}
\floatname{board}{Tablica}
The float package is a quite old package and therefore not adapted to the hyperref package.

So either follow exactly the instructions regarding the float package which can be found in the hyperref README file, or use my caption package for defining new plain-styled floating environments instead:

Code: Select all

\usepackage{caption}
\DeclareCaptionType{board}[Tablica]
HTH,
Axel
fr33sh1
Posts: 5
Joined: Tue Jul 21, 2009 5:35 pm

Re: Custom float error

Post by fr33sh1 »

Thank you! It is working :-)!
I was trying to build MWE as Thorsten said and came to the same conclusion. When I commented hyperref package it worked just fine. But using the caption package is much better since I am able to get pdf easily with pdflatex.

Thanks for your help!
Post Reply