How could a verbatimtab environment in a figure environment be resized (perhaps using the package adjustbox
)? I have some code something like the following:
\begin{figure}[htb]
\centering
\begin{verbatimtab}
2012-12-03
- thesis
+ relationship
/ - go to space
/ - #shopping notebook
\ - jazz in The 78
X - sleep at a reasonable time
\end{verbatimtab}
\caption{illustration of simple list}
\label{fig:list_1}
\end{figure}
The verbatimtab environment is provided by the package moreverb
. In the case of tabular environments, the package adjustbox
can be used; the tabular environment can be contained in an adjustbox environment in a way such as the following:
\begin{table}[H]
\centering
\begin{adjustbox}{width=\hsize, totalheight=\textheight, keepaspectratio}
\begin{tabular}{lll}
% table content
\end{tabular}
\end{adjustbox}
\end{table}
How could something like that rescaling for the tabular environment in the table environment be done for the verbatimtab environment in the figure environment?
Below is a minimal working example which should be modified such that the verbatim text is rescaled to fit within the usable text area of the page (\hsize):
\documentclass{article}
% page margins
\usepackage[
left=5cm,
right=5cm,
top=5cm,
bottom=5cm
]{geometry}
% rescaling
\usepackage{adjustbox}
% verbatim
\usepackage{moreverb}
% table handling
\usepackage{float}
\restylefloat{table}
% custom figure and table caption prefixes
\renewcommand{\figurename}{figure}
\renewcommand{\tablename}{table}
\begin{document}
\begin{table}[H]
\centering
\begin{adjustbox}{width=\hsize, totalheight=\textheight, keepaspectratio}
\begin{tabular}{lll}
\hline
\hline
a&b&c\\
\hline
\hline
\end{tabular}
\end{adjustbox}
\end{table}
\begin{figure}[htb]
\centering
\begin{verbatimtab}
2012-12-03
- thesis
+ relationship
/ - go to space
/ - #shopping notebook
\ - jazz in The 78
X - sleep at a reasonable time
2013-10-24T1629
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
\end{verbatimtab}
\caption{illustration of simple list}
\label{fig:list_1}
\end{figure}
\end{document}
verbatimtab
; but you can withBVerbatim
fromfancyvrb
. Or you can encloseverbatimtab
in avarwidth
environment which is given a very large natural width, say\begin{varwidth}{.5\maxdimen}
(requires\usepackage{varwidth}
)