Graphics, Figures & TablesHow to place caption above the "quadro" environment?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ruiscpt
Posts: 1
Joined: Wed Feb 07, 2024 8:41 pm

How to place caption above the "quadro" environment?

Post by ruiscpt »

Hello everyone,

I'm having some trouble with the placement of captions in my LaTeX document. I'm using the trivfloat package to create a "quadro" environment for my tables, similar to the regular "table" environment.

Here's a minimal example of my code:

Code: Select all

\documentclass{article}
\usepackage{caption}
\usepackage{trivfloat}

\trivfloat{quadro}

\begin{document}

\section{Introduction}

\begin{table}[!htbp]
    \centering
    \caption{Example of a table}
    \begin{tabular}{|c|c|}
        \hline
        Column 1 & Column 2 \\
        \hline
        Data 1   & Data 2   \\
        Data 3   & Data 4   \\
        \hline
    \end{tabular}
\end{table}

\begin{quadro}[!htbp]
    \centering
    \caption{Example of a quadro}
    \begin{tabular}{|c|c|}
        \hline
        Column 1 & Column 2 \\
        \hline
        Data 1   & Data 2   \\
        Data 3   & Data 4   \\
        \hline
    \end{tabular}
\end{quadro}

\end{document}

As you can see, the caption for the "table" environment is placed above the table, which is what I want. However, the caption for the "quadro" environment is placed below the table, and I'd like it to be above the quadro, similar to the "table" environment.

Is there a way to achieve this using the trivfloat package, or is there another package or method I should be using instead?

Any help or suggestions would be greatly appreciated. Thank you in advance!
Last edited by Stefan Kottwitz on Wed Feb 07, 2024 8:48 pm, edited 1 time in total.
Reason: code marked

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

How to place caption above the "quadro" environment?

Post by Stefan Kottwitz »

Welcome to the forum!

After

Code: Select all

\trivfloat{quadro}
add this:

Code: Select all

\floatstyle{plaintop}
\restylefloat{quadro}
Stefan
LaTeX.org admin
Post Reply