Graphics, Figures & TablesNew Float Environment

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
DonutMan
Posts: 3
Joined: Wed Apr 03, 2013 6:03 pm

New Float Environment

Post by DonutMan »

Hi all,

I would like to create a new float environment with a new counter and a different legend name.

So, typically I would like something like that :

Code: Select all

\begin{figure}[h]
\centering
\includegraphics[width=12cm]{Figure.png}
\caption{My figure}
\end{figure}
Result: the Figure.png is displayed with "Figure 1 - My figure" caption

While:

Code: Select all

\begin{illustration}[h]
\centering
\includegraphics[width=12cm]{Illustration.png}
\caption{My illustration}
\end{illustration}
Result : the Illustration.png is displayed with "Illustration 1 - My illustration" caption.

I would like the figure and illustration counters independend.

Do you know if it's easy to have something like that ?

Thanks a lot :)

Donut
Last edited by cgnieder on Mon Apr 08, 2013 6:55 pm, edited 2 times in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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

New Float Environment

Post by localghost »

Search the forum for the newfloat package.


Thorsten
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

New Float Environment

Post by cgnieder »

I agree with Thorsten that the newfloat package is generally the way to go. However, should you happen to use a KOMA-Script there's no need for it as KOMA-Script provides its own mechanism. Search the KOMA-Script documentation (scrguien) for \DeclareNewTOC.

Regards
site moderator & package author
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

New Float Environment

Post by sommerfee »

cgnieder wrote:I agree with Thorsten that the newfloat package is generally the way to go. However, should you happen to use a KOMA-Script there's no need for it as KOMA-Script provides its own mechanism.
Yes and no ;-) The newfloat package defines a FP- (fltpage), sideways- (rotating), SC- (sidecap), and wrap-variant (wrapfig) additionally.

But one rarely needs them, so usually the usage of \DeclareNewTOC is recommended. (And so do I, too.)
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

New Float Environment

Post by cgnieder »

sommerfee wrote:The newfloat package defines a FP- (fltpage), sideways- (rotating), SC- (sidecap), and wrap-variant (wrapfig) additionally.
Good to know! I knew newfloat was powerful but I wasn't aware that it's such an allrounder!

Regards
site moderator & package author
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

New Float Environment

Post by localghost »

And it seems that newfloat also defines a starred version of the new float. But this is seemingly not documented in its manual.
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

New Float Environment

Post by sommerfee »

localghost wrote:But this is seemingly not documented in its manual.
Thanks for the hint, will correct that ASAP.
Post Reply