1

I have a long list of risks I want to put in my document.

I manage to make it work with longtable as can be seen in pic1 (It's in portuguese because it's my masters disstertaion).

enter image description here

The problem I'm facing here is that there's a configuration in the template that separates Tables from "Quadros" (which are mainly used for text and have the outer lines). This table should be a "Quadro" not a "Tabela" and should be included in that list.

I'm facing this problem because I am using a document class called abntex2 which takes everything into the right formatting for my masters and one of the things created was a new float Quadro to take care of this differentiation

This is how a Quadro is usually instantiated:

\begin{quadro}[htb]
\caption{Editores de Texto Livres}
\label{quadro:editores_texto_livres}
\centering
\begin{tabular}{|l|l|r|}        \hline
Editor     & Multiplataforma & Específico para Latex \\ \hline
Kwriter    & Sim             & Não                   \\
Texmaker   & Sim             & Sim                   \\
Kile       & Sim             & Sim                   \\
Geany      & Sim             & Não                   \\ \hline
\end{tabular}
\end{quadro}

If I try to encapsulate the long table in the Quadro float, it simply doesn't show up, And I'm pretty sure it's because it's just too long.

So I was wondering:

Is there a way to make tables be counted and named as quadros and have a combined list of quadros? I don't have any tables in my doc, just quadros. So if I could just have all of these floats be called the same and counted as the same it'd be perfect!

I'm using overleaf so I'm trying to get something that would work in a .cls class doc for the .tex but would be happy with anything that helps. BTW this is what the quadro config looks like:

\newcommand{\listquadroname}{Lista de quadros}
\newcommand{\quadroname}{Quadro}
\newcommand{\quadrorefname}{Quadro}
\newcommand{\chartautorefname}{Quadro}

\addto\captionsenglish{% ingles
    \renewcommand{\listquadroname}{List of charts}
    \renewcommand{\quadroname}{Chart}
    \renewcommand{\quadrorefname}{Chart}
    \renewcommand{\chartautorefname}{Chart}
}

\newfloat{quadro}{htbp}{loq}[chapter]
\floatname{quadro}{\quadroname}
\floatstyle{plaintop}
\restylefloat{quadro}
\newlistof{listofquadros}{loq}{\listquadroname}
\newlistentry{quadro}{loq}{0}
\renewcommand{\thequadro}{\thechapter.\@arabic\c@quadro}
\setfloatadjustment{quadro}{\centering}

\renewcommand{\cftquadroname}{\quadroname\space}
\renewcommand*{\cftquadroaftersnum}{\hfill\textendash\hfill}
2

You wrote,

Is there a way to make tables be counted and named as quadros and have a combined list of quadros? I don't have any tables in my doc, just quadros. So if I could just have all of these floats be called the same and counted as the same it'd be perfect!

Since your document doesn't feature table floats that need to be kept separate from quadro floats, why not just map some of the strings that go with table and longtable environments into strings that go with quadro environments?

enter image description here

Addendum: I suppose another, much more elaborate, solution could consist of creating a longquadro environment that's based on the longtable environment. That way, your document could employ cuadro and longcuadro environments -- and also employ table and longtable (labelled as "Tabelas") environments should the need to do so arise.

enter image description here

\documentclass{abntex2}
\addto\captionsbrazil{%
     \renewcommand{\tablename}{Quadro}
     \renewcommand{\listtablename}{Lista de quadros}
     }
\usepackage{longtable} % for 'longtable' environment

\hypersetup{colorlinks,linktocpage} % optional

%% enable advanced cross-referencing commands
\usepackage[brazilian,nameinlink,capitalize]{cleveref}
\crefname{table}{quadro}{quadros} % default is 'tabela' and 'tabelas'

\begin{document}
\listoftables

\bigskip\hrule

\begin{table}[h]     \caption{Olá}   \label{tab:1} \end{table}
\begin{longtable}{c} \caption{Mundo} \label{tab:2} \end{longtable}

\noindent
Algumas referências cruzadas para \Cref{tab:1,tab:2}.
\end{document}
  • Hey Mico, this is an interesting solution and it does work for it's intended purposes! I can't stop using the float defined as quadro because of a bunch of other definitions that are running within the defined float that is a quadro. How hard would it be to instantiate a longtable type of quadro? Like you mentioned in the appendum? I'm asking because I plan to leave my configs to the masters program as a template for anyone who wants to use LATEX for their dissertation and not a terrible word template – Victor Archela Nov 27 '20 at 19:42
  • @VictorArchela - May I suggest that you post a new query, in which you mention which document class you employ, describe how the quadro float type is defined, and ask how the longtable environment might have to be modified to create a longquadro environment? Thanks. – Mico Nov 27 '20 at 20:57
  • Ok will do that! Thanks for the help! – Victor Archela Nov 27 '20 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.