I put some texts enclosed within tabbing
, embedded in fbox
and minipage
:
\fbox{%
\begin{minipage}[t]{0.48\linewidth}%
\begin{tabbing}
\quad \= \quad \= \quad \= \quad \= \quad \= \hspace{5cm} \= \\[-\baselineskip]\kill
...
...
\end{tabbing}
\end{minipage}}\hfill
The question is… if I want to put a caption for the whole text, just under and outside the frame, and make it a reference. Do where should I put this \caption{acap}
and \reference{aref}
?
Could anyone help? Thank you very much!
Edit1: Following the second proposition of @Stefan Kottwitz, I have the following code, which prints the two minipages on the same height. The problem now is that, before adding the outer minipage of the first minipage, there was space between two sides, and their positions were all right. But now, the right minipage has moved a little bit to the left, so that the space has disappeared… Could anyone help? Thank you!
\begin{minipage}[t]{0.48\linewidth}%
\centering
\fbox{
\begin{minipage}[t]{0.48\linewidth}%
\begin{tabbing}
\quad \= \quad \= \quad \= \quad \= \quad \= \hspace{5cm} \= \\[-\baselineskip]\kill
...
\end{tabbing}
\end{minipage}}\hfill
\captionof{table}{A Testbox}\label{testbox}
\end{minipage}
\begin{minipage}[t]{0.48\linewidth}
...
\end{minipage}
Best Answer
You could use a
figure
ortable
environment, using LaTeX's floating objects capabilities:If you don't want the objects to float, but need captions and cross-referencing, you could use the
caption
package and its command\captionof
:I used a
center
environment, you could also use just another minipage around instead. I chosetable
instead offigure
since it's a tabular object. You could also declare your own caption type.