
Estou trabalhando no papel LaTex e descobri que estou usando três pequenas tabelas que quero caber em apenas uma parte da página, não quero dividir a página inteira. Isto é o que parece agora:
E eu quero que eles sejam colocados todos em uma linha horizontal e este é o meu código até agora.
\noindent
\textbf{Escriba las tablas de verdad de una compuerta OR, AND y XOR.}
% compuerta OR
\begin{table}[ht!]
\centering
\caption{Compuerta OR}
\label{tab1}
\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0 & 0 & 0 \\ \hline
0 & 1 & 1 \\ \hline
1 & 0 & 1 \\ \hline
1 & 1 & 1 \\ \hline
\end{tabular}
\end{table}
% compuerta AND
\begin{table}[ht!]
\centering
\caption{Compuerta AND}
\label{tab2}
\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0 & 0 & 0 \\ \hline
0 & 1 & 0 \\ \hline
1 & 0 & 0 \\ \hline
1 & 1 & 1 \\ \hline
\end{tabular}
\end{table}
% compuerta XOR
\begin{table}[ht!]
\centering
\caption{Compuerta XOR}
\label{tab3}
\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0 & 0 & 0 \\ \hline
0 & 1 & 1 \\ \hline
1 & 0 & 1 \\ \hline
1 & 1 & 0 \\ \hline
\end{tabular}
\end{table}
Desde já, obrigado!!! :)
Responder1
É muito simples com o floatrow
pacote e seu ambiente de mesmo nome:
\documentclass{article}
\usepackage{floatrow}
\begin{document}
\noindent
\textbf{Escriba las tablas de verdad de una compuerta OR, AND y XOR.}
% compuerta OR
\begin{table}[ht!]
\begin{floatrow}[3]
\centering
\ttabbox{\caption{Compuerta OR}\label{tab1}}%
{\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0 & 0 & 0 \\ \hline
0 & 1 & 1 \\ \hline
1 & 0 & 1 \\ \hline
1 & 1 & 1 \\ \hline
\end{tabular}}
% compuerta AND
\ttabbox{\caption{Compuerta AND}\label{tab2}}%
{\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0 & 0 & 0 \\ \hline
0 & 1 & 0 \\ \hline
1 & 0 & 0 \\ \hline
1 & 1 & 1 \\ \hline
\end{tabular}}
%
\ttabbox{\caption{Compuerta XOR}\label{tab3}}%
{\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0 & 0 & 0 \\ \hline
0 & 1 & 1 \\ \hline
1 & 0 & 1 \\ \hline
1 & 1 & 0 \\ \hline
\end{tabular}}
\end{floatrow}
\end{table}
\end{document}
Responder2
- Você não fornece sobre classe de documento usada e não de layout de página...
- usar
article
com layout de página padrão e minipáginas fornece:
\documentclass{article}
\usepackage[skip=1ex, font=small]{caption} % <---
\begin{document}
\noindent
\textbf{Escriba las tablas de verdad de una compuerta OR, AND y XOR.}
\begin{table}[ht!]
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta OR}
\label{tab1}
\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0 & 0 & 0 \\ \hline
0 & 1 & 1 \\ \hline
1 & 0 & 1 \\ \hline
1 & 1 & 1 \\ \hline
\end{tabular}
\end{minipage}
\hfill
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta AND}
\label{tab2}
\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0 & 0 & 0 \\ \hline
0 & 1 & 0 \\ \hline
1 & 0 & 0 \\ \hline
1 & 1 & 1 \\ \hline
\end{tabular}
\end{minipage}
\hfill
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta XOR}
\label{tab3}
\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0 & 0 & 0 \\ \hline
0 & 1 & 1 \\ \hline
1 & 0 & 1 \\ \hline
1 & 1 & 0 \\ \hline
\end{tabular}
\end{minipage}
\end{table}
\end{document}
Termo aditivo: você pode gostar do seguinte design de tabelas verdadeiras:
\documentclass{article}
\usepackage[skip=1ex, font=small]{caption}
\usepackage{tabularray}
\begin{document}
\noindent
\textbf{Escriba las tablas de verdad de una compuerta OR, AND y XOR.}
\begin{table}[ht!]
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta OR}
\label{tab1}
\begin{tblr}{colspec = { c c|c },
row{1} = {font=\bfseries}
}
A & B & Output \\
\hline
0 & 0 & 0 \\
0 & 1 & 1 \\
1 & 0 & 1 \\
1 & 1 & 1 \\
\end{tblr}
\end{minipage}
\hfill
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta AND}
\label{tab2}
\begin{tblr}{colspec = { c c|c },
row{1} = {font=\bfseries}
}
A & B & Output \\
\hline
0 & 0 & 0 \\
0 & 1 & 0 \\
1 & 0 & 0 \\
1 & 1 & 1 \\
\end{tblr}
\end{minipage}
\hfill
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta XOR}
\label{tab3}
\begin{tblr}{colspec = { c c|c },
row{1} = {font=\bfseries}
}
A & B & Output \\
\hline
0 & 0 & 0 \\
0 & 1 & 1 \\
1 & 0 & 1 \\
1 & 1 & 0 \\
\end{tblr}
\end{minipage}
\end{table}
\end{document}