GeneralHow to create a "list of boxes"?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
robertoneto123
Posts: 13
Joined: Thu Sep 25, 2008 1:20 pm

How to create a "list of boxes"?

Post by robertoneto123 »

Hello,

I have to create a "List of boxes" for my document. A "box" is basically a fancy-formatted table. But te problem is that I need to create a list of tables and a list of boxes.

I thought create a "box-something" environment like described in http://kuscsik.blogspot.com/2006/12/how ... latex.html . But after that, how can I make a "List of boxes"?

My idea is to create an environment with a code like:

Code: Select all

\newcounter{Examplecount}
\setcounter{Examplecount}{0}
\newenvironment{example}
{% This is the begin code
\stepcounter{Examplecount} {\bf\small Example} \arabic{Examplecount}\scriptsize \begin{it}
}
{% This is the end code
\end{it} }

\begin{document}

\begin{example}
This is an example
\end{example}
This is the right way to do that?

Thanks!

Recommended reading 2024:

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

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

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

How to create a "list of boxes"?

Post by localghost »

You should clarify what you want to insert in this new example environment. Moreover it could be of interest whether this environment should be a float or if it is more for mathematical purposes like theorems or similar stuff.


Best regards
Thorsten¹
robertoneto123
Posts: 13
Joined: Thu Sep 25, 2008 1:20 pm

How to create a "list of boxes"?

Post by robertoneto123 »

You should clarify what you want to insert in this new example environment. Moreover it could be of interest whether this environment should be a float or if it is more for mathematical purposes like theorems or similar stuff.
It will be a tabular data, but formatted in a different way.

(the rule that I'm trying to follow is: a table is a set of tabular data formatted in a fancy-mathematical way; a grid for example - with formatting rules more flexible, will be put in a box)

Thanks!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: How to create a "list of boxes"?

Post by localghost »

Now I've got an idea about the contents. But that doesn't answer my question about the possibility of floating.
robertoneto123
Posts: 13
Joined: Thu Sep 25, 2008 1:20 pm

How to create a "list of boxes"?

Post by robertoneto123 »

Hello localghost,

Well, I took a look on your post and google some ideas. I got everything done, except for the entries on the table of contents. It's showing "0 ................................ 1" (1 is the page).

The code is bellow. How could I put the caption on the content line? The idea is to print:

"A programmable compiler...........................1"

Thanks!!!!

Code: Select all

\newcommand{\listBoxesname}{List of Boxes}
\newlistof{boxes}{qud}{\listBoxesname}

\floatstyle{boxed}
\newfloat{Boxes}{thp}{lop}
\floatname{Boxes}{Quadro}

\newenvironment{boxes}
{\refstepcounter{boxes}

\addcontentsline{qud}{example}{\numberline{\thechapter}}

\begin{Boxes}\begin{center}
}
{\end{center}\end{Boxes}}

\listofboxes

\begin{boxes}
 sfdkj
sdghsdgh
sghsgh
sfghsgh
sfghsfgh
\caption{A programmable compiler.}\label{qqq:programmable-compiler}
\end{boxes}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to create a "list of boxes"?

Post by localghost »

You have to provide a minimal working example (MWE) to make this comprehensible for me. Obviously you are using an additional package to declare a new float, but I can't figure out which package that is (perhaps float?). So I got no idea of the final result.
robertoneto123
Posts: 13
Joined: Thu Sep 25, 2008 1:20 pm

How to create a "list of boxes"?

Post by robertoneto123 »

(sorry, I'm newbie on Latex :oops: )

The example is:

Code: Select all

\documentclass[espaco=umemeio,appendix=Name]{abnt}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usepackage{float}
\usepackage{tocloft}
\def\Versao$#1 #2${#2}
\def\Data$#1 #2 #3${#2}
\makeatletter

\newcommand{\listQuadrosname}{Lista de Quadros}
\newlistof{quadros}{qud}{\listQuadrosname}

\floatstyle{boxed}
\newfloat{Quadros}{thp}{lop}
\floatname{Quadros}{Quadro}

\newenvironment{quadros}
{\refstepcounter{quadros}

\addcontentsline{qud}{example}{\numberline{\thechapter}}
\begin{Quadros}\begin{center}
}
{\end{center}\end{Quadros}}

\begin{document}
\sumario
\setcounter{page}{1}

\listofquadros
\chapter{Chapter 1}
\begin{quadros}
 Test 123
 \caption{This is the caption}
\end{quadros}

\end{document}
The result is attached. My problems:

1. I need that the \listOfQuadros (create the "Lista de Quadros") generate entryes like:
This is a sample caption..................................................................................................... p. 1

2. The Caption at the quadros environment must be numbered as figures and tables, following: [chapter number].[counter]
For example: Quadro 1.1; Quadro 1.2; <new chapter> Quadro 2.1; ...

I believe that are simple things, but I'm kinda lost. I thank any help on this matter...
Attachments
listOfBoxesMWE.pdf
(51.81 KiB) Downloaded 413 times
Post Reply