创建布局框

创建布局框

我偶然发现了这个用 LaTeX 制作的文件,我想学习如何制作。如您所见,我尝试过,但我不擅长使用 mini-page 或 fbox 命令。我想知道是否有更好的方法。任何帮助都非常感谢。

我希望所有盒子都对齐(齐平)


\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=.5in]{geometry}
\usepackage{tcolorbox}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}


\begin{document}


\fbox{\begin{minipage}[t][.5cm]{0,4\textwidth}
The Squeeze Theorem
\end{minipage}}
\qquad
\fbox{\begin{minipage}[t][.5cm]{0,6\textwidth}
Name:
\end{minipage}}

    \vspace{.25in}
\fbox{\begin{minipage}[t][6cm]{0,9\textwidth}
On the grid below, graph $f(x)=x^2,g(x)=x^2\cos\Big(\dfrac{1}{3}\Big)$, and $h(x)=-x^2$.  You may use a calculator, but make sure it is in radian mode. 
   \includegraphics[width=2in]{graph1.png}
    \fbox{\begin{minipage}[t][4cm]{0,3\textwidth}What is $\displaystyle{\lim{x\to 0}\cos\Big(\dfrac{1}{x^3}\Big)}$?
\end{minipage}}
\end{minipage}}

\vspace{1in}

\fbox{\begin{minipage}[t][4cm]{0,9\textwidth}
Suppose that $x-3\leq f(x)\leq x^2+3x-2$ for all $x$. What is $\displaystyle{\lim_{x\to -1}f(x)}$?
\end{minipage}}

\vspace{.25in}

\fbox{\begin{minipage}[t][4cm]{0,9\textwidth}
Use the Squeeze theorem to evaluate $\displaystyle{\lim_{x\to 0}x^4\sin\Big(\dfrac{1}{x^2+1}\big)}$
\end{minipage}}


\end{document}

在此处输入图片描述

答案1

经过几次尝试,我想我找到了一个干净的方法来做到这一点。 原始版本是使用 tikz 创建的。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=.5in]{geometry}
\usepackage[most]{tcolorbox}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{shapes.misc, positioning}
\usetikzlibrary{arrows,shapes,positioning,snakes}
\usetikzlibrary{decorations.markings}
\usepackage{pgfplots}

\newcommand{\bennett}{\begin{tikzpicture}
        \begin{axis}[width=3.5in,thick,
grid style={blue!75},
axis x line = center,
axis y line = center,
xmin = -5,   xmax = 5,
ymin = -3,  ymax = 3,
xtick = {-5,-4,...,5},
ytick = {-3,-2,...,3},
grid = both,
xlabel={$x$},
  ylabel={$y$},
  xlabel style={above right},
  ylabel style={above right},
axis line style={latex-latex},
]
\end{axis}
\end{tikzpicture}}

\begin{document}
\begin{tcbraster}[raster columns=2,raster equal height,nobeforeafter,raster column skip=1cm,colback=white]
  \begin{tcolorbox}
    The Squeeze Theorem
  \end{tcolorbox}
  \begin{tcolorbox}
    Name:
  \end{tcolorbox}
\end{tcbraster}




\begin{tcolorbox}
[text height=9cm,text width=18cm,colback=white]

On the grid below, graph $f(x)=x^2,g(x)=x^2\cos\Big(\dfrac{1}{3}x\Big)$, and $h(x)=-x^2$.  You may use a calculator, but make sure it is in radian mode. 
     \begin{tcbitemize}[raster columns=2,raster equal height,
colback=white,fonttitle=\bfseries]


  \tcbitem
 
\begin{tikzpicture}
        \begin{axis}[width=3.5in,thick,
grid style={blue!75},
axis x line = center,
axis y line = center,
xmin = -5,   xmax = 5,
ymin = -3,  ymax = 3,
xtick = {-5,-4,...,5},
ytick = {-3,-2,...,3},
grid = both,
xlabel={$x$},
  ylabel={$y$},
  xlabel style={above right},
  ylabel style={above right},
axis line style={latex-latex},
]
\end{axis}
\end{tikzpicture}



\tcbitem    What is $\displaystyle{\lim_{x\to 0}\cos\Big(\dfrac{1}{x^3}\Big)}$?
\end{tcbitemize}
\end{tcolorbox}
   
\vspace{.5in}
\begin{tcolorbox}[text height=7cm,colback=white]
Use the Squeeze theorem to evaluate $\displaystyle{\lim_{x\to 0}x^4\sin\Big(\dfrac{1}{x^2+1}\Big)}$
\end{tcolorbox}

\begin{tcolorbox}[colback=white,text height = 7cm]

Suppose that $x-3\leq f(x)\leq x^2+3x-2$ for all $x$. What is $\displaystyle{\lim_{x\to -1}f(x)}$?
\end{tcolorbox}

\end{document}

答案2

虽然不是一个完整的答案,但可以为您提供一些帮助。

% boxprob.tex  SE 598847

\documentclass[draft]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=.5in]{geometry}
\usepackage{tcolorbox}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

%\fbox{\begin{minipage}[t][.5cm]{0,4\textwidth}
\fbox{\begin{minipage}[t][.5cm]{0.3\textwidth}
The Squeeze Theorem
\end{minipage}}
%\qquad
\hfil
%\fbox{\begin{minipage}[t][.5cm]{0,6\textwidth}
\fbox{\begin{minipage}[t][.5cm]{0.5\textwidth}
Name:
\end{minipage}}

    \vspace{.25in}
\fbox{\begin{minipage}[t][6cm]{0,9\textwidth}
On the grid below, graph $f(x)=x^2,g(x)=x^2\cos\Big(\dfrac{1}{3}\Big)$, and $h(x)=-x^2$.  You may use a calculator, but make sure it is in radian mode. 

   \includegraphics[width=2in]{graph1.png}
    \fbox{\raisebox{10.5\baselineskip}{\begin{minipage}[t][10\baselineskip]{0,3\textwidth}What is $\displaystyle{\lim{x\to 0}\cos\Big(\dfrac{1}{x^3}\Big)}$?
%    \fbox{\begin{minipage}[b][4cm]{0,3\textwidth}What is $\displaystyle{\lim{x\to 0}\cos\Big(\dfrac{1}{x^3}\Big)}$?
\end{minipage}}
}
\end{minipage}}

\vspace{1in}

\fbox{\begin{minipage}[t][4cm]{0,9\textwidth}
Suppose that $x-3\leq f(x)\leq x^2+3x-2$ for all $x$. What is $\displaystyle{\lim_{x\to -1}f(x)}$?
\end{minipage}}

\vspace{.25in}

\fbox{\begin{minipage}[t][4cm]{0,9\textwidth}
Use the Squeeze theorem to evaluate $\displaystyle{\lim_{x\to 0}x^4\sin\Big(\dfrac{1}{x^2+1}\big)}$
\end{minipage}}

\end{document}

我仍然不确定您所说的“垂直线一直上下对齐”是什么意思。您想让所有框都具有相同的宽度吗?您展示的图表有很多垂直线,它们要与什么“对齐”?

您必须调整各种长度命令才能获得您想要的结果。

相关内容