我有一个在单独框架中的 mz 文档中进行通信的示例,为此我使用了 fbox + minipage。我怎样才能让它跨越 2 页?下面的 MWE,我保留了所有使用的包,以防它们干扰。
\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{geometry}
\geometry{
a4paper,
top=22mm,
bottom=22mm,
inner=35.6mm,
outer=35.6mm
}
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage[export]{adjustbox}
\usepackage{ragged2e}
\usepackage{csquotes}
\usepackage{hyperref}
\usepackage{blindtext}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{amsmath}
\usepackage{array}
\usepackage{threeparttable}
\usepackage{caption}
\usepackage{tabularray}
\usepackage{xcolor}
\usepackage[
backend=biber,
style=authoryear,
citestyle=authoryear,
sorting=nty,
maxcitenames=2
]{biblatex}
\addbibresource{Sources.bib}
\usepackage{marginnote}
\PassOptionsToPackage{hyphens}{url}
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks
\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j%
\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t%
\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D%
\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N%
\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X%
\do\Y\do\Z\do\*\do\-\do\~\do\'\do\"\do\-}%
\usepackage{titlesec}
\titleformat
{\chapter} % command
[hang] % shape
{\bfseries\Huge} % format
{\thechapter} % label
{1ex} % sep
{} % before-code
[] % after-code
\setlength{\parskip}{0,5 em}
\setlength{\parindent}{2em}
\linespread{1}
\begin{document}
\chapter{Test}
\blindtext
\blindtext
\begin{center}
\fbox{\begin{minipage}{0.9\linewidth}
\begin{center}
\textbf{Guardian}\\
\vspace*{2mm}
Griffin, this is Guardian, prepare to receive five liner. Over.\\
\vspace*{2mm}
\textbf{Griffin}\\
\vspace*{2mm}
Guardian, this is Griffin, send traffic. Over.\\
\vspace*{2mm}
\textbf{Guardian}\\
\vspace*{2mm}
Requesting strike on one times truck, SE of our location, close.\\
Marker on map, grid 189235.\\
Guns only.\\
No remarks. Over.\\
\vspace*{2mm}
\textbf{Griffin}\\
\vspace*{2mm}
Guardian, this is Griffin. Copy.\\
Strike on one times truck, SE of ground units, close.\\
Marker on map, grid 189235.\\
Guns only.\\
No remarks. Over.\\
\vspace*{2mm}
\textbf{Guardian}\\
\vspace*{2mm}
Good readback.\\
\vspace{0.5cm}
\textit{*Splash strike}\\
\vspace{0.5cm}
Good effect, break. Over and out.
\end{center}
\end{minipage}}
\end{center}
\captionof{figure}{An example of communication}
\par
\blindtext
\end{document}
谢谢您并祝您有美好的一天。
答案1
minipages
不会在页面之间拆分。或者,您可以使用包framed
提供的环境framed
。
可以通过向该环境添加可选参数来改变框架的宽度。
\renewenvironment{framed}[1][\hsize]
{\MakeFramed{\hsize#1\advance\hsize-\width \FrameRestore}}%
{\endMakeFramed}
\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{geometry}
\geometry{
a4paper,
top=22mm,
bottom=22mm,
inner=35.6mm,
outer=35.6mm
}
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage[export]{adjustbox}
\usepackage{ragged2e}
\usepackage{csquotes}
\usepackage{hyperref}
\usepackage{blindtext}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{amsmath}
\usepackage{array}
\usepackage{threeparttable}
\usepackage{caption}
\usepackage{tabularray}
\usepackage{xcolor}
\usepackage[
backend=biber,
style=authoryear,
citestyle=authoryear,
sorting=nty,
maxcitenames=2
]{biblatex}
%%\addbibresource{Sources.bib}
\usepackage{marginnote}
\PassOptionsToPackage{hyphens}{url}
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks
\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j%
\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t%
\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D%
\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N%
\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X%
\do\Y\do\Z\do\*\do\-\do\~\do\'\do\"\do\-}%
\usepackage{titlesec}
\titleformat
{\chapter} % command
[hang] % shape
{\bfseries\Huge} % format
{\thechapter} % label
{1ex} % sep
{} % before-code
[] % after-code
\setlength{\parskip}{0,5 em}
\setlength{\parindent}{2em}
\linespread{1}
%******************************************* added <<<<<<<<<<<
\usepackage{framed}
\renewenvironment{framed}[1][\hsize]
{\MakeFramed{\hsize#1\advance\hsize-\width \FrameRestore}}%
{\endMakeFramed}
%*******************************************
\begin{document}
\chapter{Test}
\blindtext
\blindtext
\begin{center}
% \fbox{\begin{minipage}{0.9\linewidth}
\begin{framed}[0.9\linewidth] % added <<<<<<<<<<<<
\begin{center}
\textbf{Guardian}\\
\vspace*{2mm}
Griffin, this is Guardian, prepare to receive five liner. Over.\\
\vspace*{2mm}
\textbf{Griffin}\\
\vspace*{2mm}
Guardian, this is Griffin, send traffic. Over.\\
\vspace*{2mm}
\textbf{Guardian}\\
\vspace*{2mm}
Requesting strike on one times truck, SE of our location, close.\\
Marker on map, grid 189235.\\
Guns only.\\
No remarks. Over.\\
\vspace*{2mm}
\textbf{Griffin}\\
\vspace*{2mm}
Guardian, this is Griffin. Copy.\\
Strike on one times truck, SE of ground units, close.\\
Marker on map, grid 189235.\\
Guns only.\\
No remarks. Over.\\
\vspace*{2mm}
\textbf{Guardian}\\
\vspace*{2mm}
Good readback.\\
\vspace{0.5cm}
\textit{*Splash strike}\\
\vspace{0.5cm}
Good effect, break. Over and out.
\end{center}
\end{framed} % added <<<<<<<<<<<<<<
% \end{minipage}}
\captionof{figure}{An example of communication} % here
\end{center}
\par
\blindtext
\end{document}