\VerbatimInput
调用一个test.dat
文件并产生以下输出,其中长行并不完全可见:
解决方案是\BVerbatimInput
与一起使用\begin{adjustbox}
。这解决了长行的问题。但是,显示的信息test.dat
在第一页的末尾被截断:
有没有办法让其余内容test.dat
显示在后续页面中?
产生这两个示例的代码:
\documentclass[12pt]{article}
\usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{adjustbox}
\usepackage{fancyvrb}
\usepackage{color,soul}
\usepackage[dvipsnames]{xcolor}
\begin{document}
\section{VerbatimInput}
\RecustomVerbatimCommand{\VerbatimInput}{VerbatimInput}%
{fontsize=\footnotesize,
%
frame=lines,
framesep=2em,
rulecolor=\color{Gray},
%
label=\fbox{\color{Black}test.dat},
labelposition=topline,
}
\VerbatimInput{./test.dat}
\clearpage
\section{BVerbatimInput and adjustbox}
\begin{adjustbox}{max width=\linewidth}
\RecustomVerbatimCommand{\BVerbatimInput}{BVerbatimInput}%
{fontsize=\footnotesize,
%
frame=lines,
framesep=2em,
rulecolor=\color{Gray},
%
label=\fbox{\color{Black}test.dat},
labelposition=topline,
}
\BVerbatimInput{./test.dat}
\end{adjustbox}
\end{document}
文件test.dat
:
#####l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220
14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220
14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220
14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220
14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220
14.756876 # -> reorientation volumregfddfg
#l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg
#l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg
####l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg
#l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg
#l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg
#####l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg
####l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg
####l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg
#l.253:
AL BL LC AA BB CC E
2.75319 2.75319 2.75319 60.67009 65.70804 68.04220 14.756876 # -> reorientation volumregfddfg
答案1
嗯adjustbox
是盒子不是多页。生成的框不能跨页拆分。但是,我(的作者adjustbox
)研究了一些键,将包含的段落拆分为多个框,然后可以将其放在多页上。获取最新版本的软件包(版本 v1.0 – 2012/05/21)并查看手册中的split
和键(第 4.15 节pagebreak
实验键)。请注意,分页是通过分割缩放框来完成的,而不是通过在行之间进行正常的分页来完成的。这意味着最后一行可以垂直切成两部分!
我实际上建议不要adjustbox
完全使用,而是相应地设置字体大小。