我想在 LaTeX 中创建如下所示的嵌套框:
我知道如何创建外部框,但我不知道如何创建里面的厚黑色框。
答案1
在 LaTeX 基因图片环境中CreateMySpace
,可以设计一个结构内包含多个盒子的盒子。
通过该\fixedBoX{width}{height}{contents}
命令,可以确定盒子及其内容的高度和宽度。
通过\itemNUNERALS
命令可以将固定框放置在任意位置。
通过这个\fboxrule
可以改变盒子的厚度。
\documentclass[A4paper]{report}
% generate a box of fixed height and width
\newcommand\fixedBOX[3]
{\fbox{\hbox to #1
{\parindent 0pt
\hsize=#1
\vtop to #2
{\strut #3%
\vfil
}}}}
\newenvironment{CreateMySpace}{
\fboxrule=1pt
\clearpage
\noindent
\setlength{\unitlength}{3mm}
\begin{picture}(50,60)(10,0)
\footnotesize
}{
\normalsize
\end{picture}
}
\newcommand\itemONE[3]{\put(0,60){\fixedBOX{#1}{#2}{#3}}}
\newcommand\itemTWO[3]{\put(2,58){\fixedBOX{#1}{#2}{#3}}}
\newcommand\itemTHREE[3]{\put(4,56){\fixedBOX{#1}{#2}{#3}}}
\newcommand\itemFOUR[3]{\put(6,54){\fixedBOX{#1}{#2}{#3}}}
\newcommand\itemFIVE[3]{\put(8,52){\fixedBOX{#1}{#2}{#3}}}
\newcommand\itemSIX[3]{\put(10,50){\fixedBOX{#1}{#2}{#3}}}
\newcommand\itemSEVEN[3]{\put(27,54){\fboxrule=2pt\fixedBOX{#1}{#2}{#3}}}
\begin{document}
\begin{CreateMySpace}
\itemONE{15cm}{9cm}{\bfseries Topological Space $\mathbf {(X,\tau)}$\hfill (homeomorphism)}
\itemTWO{14cm}{8cm}{\bfseries Hausdorff Space $\mathbf{T_2}$}
\itemTHREE{13cm}{7cm}{\bfseries Normal Space $\mathbf{T_4}$}
\itemFOUR{12cm}{6cm}{\bfseries Metric Space $\mathbf{(X,d)}$\hfill (isometry)}
\itemFIVE{11cm}{5cm}{\bfseries Normed Space $\mathbf{(X,|\cdot|)}$}
\itemSIX{10cm}{4cm}{\bfseries Inner-product Space $\mathbf{(X,<\cdot,\cdot>)}$}
\itemSEVEN{3cm}{2cm}{\bfseries Complete MS \par \bigskip Banach Space \par\bigskip Hilbert Space}
\end{CreateMySpace}
\end{document}
答案2
此解决方案的关键(除了嵌套框之外)是使用\stackinset
将第二个框覆盖在原始图像之上。我猜第二个关键是使用\Longstack
,它允许设置行间基线跳过(就像这里一样1.4\baselineskip
)。
\documentclass{article}
\usepackage[usestackEOL]{stackengine}[2013-09-11]
\def\stackalignment{l}
\setstackgap{L}{1.4\baselineskip}
\fboxsep=4pt\relax
\begin{document}
\stackinset{c}{.5in}{t}{.73in}{%
\fboxrule=3pt\relax\framebox[1in][t]{%
\Longstack{Complete MS\\Banach Space\\Hilbert Space\\ }}}{\fboxrule=.75pt%
\fbox{\stackunder{Topological Space $(\mathbf{X},\tau)$%
\hspace{2.3in}(homeomorphism)}%
{\fbox{\stackunder{Hausdorff Space $(\mathbf{X},\mathbf{T}_2)$}%
{\fbox{\stackunder{Normal Space $(\mathbf{X},\mathbf{T}_4)$}%
{\fbox{\stackunder{Metric Space $(\mathbf{X},\mathbf{d})$%
\hspace{2.7in}(isometry)}%
{\fbox{\stackunder{Normal Space $(\mathbf{X}, \left|.\right|)$}%
{\framebox[4.5in][l]{Inner-product Space $(\mathbf{X}, <\dots>)$%
\rule[-10ex]{0ex}{10ex}}}%
}}}}}}}}}
}
\end{document}