我当前拥有的代码是:
\scalebox{0.65}{
\begin{minipage}{0.95\textwidth}
\begin{algorithm}[H] %new code
\begin{algorithmic}
\caption{Example Algorithm}
\STATE STEP1
\STATE STEP2
\STATE STEP3
\STATE STEP4
\end{algorithmic}
\end{algorithm}
\end{minipage}%
}
并将剩余的文本放在另一个小页面中。但它看起来不像我想要的图像,所以请给出指示。我没问题,如果不是箭头,而是花括号
答案1
在这里,我保存了各个框,然后将一个框插入另一个框上。
\documentclass{report}
\usepackage{stackengine,xcolor,mathtools}
\begin{document}
\setbox0=\hbox{%
\fboxsep0pt\fbox{\fboxsep3pt\colorbox{black!10}{\parbox{1.5in}{\parskip 1em
$D = a + b$\par
$D = a - b$}}}%
}
\savestack{\graybox}{\box0}
\setbox0=\hbox{\fboxsep3pt\fbox{\parbox{2in}{\parskip 1em
Example Algorithm:\par
Step 1\par
Step 2 $D \xrightarrow{\rule{7ex}{0pt}}$\par
Step 3\par
Step 4\par~}}%
}%
\savestack\whitebox{\box0}
\stackinset{c}{65pt}{c}{9pt}{\graybox}{\whitebox}
\end{document}
如果旋转指向箭头是必要的,那么这个小小的修改可能会有所帮助:
\documentclass{report}
\usepackage{stackengine,xcolor,mathtools,graphicx}
\begin{document}
\setbox0=\hbox{%
\fboxsep0pt\fbox{\fboxsep3pt\colorbox{black!10}{\parbox{1.5in}{\parskip 1em
$D = a + b$\par
$D = a - b$}}}%
}
\savestack{\graybox}{\box0}
\setbox0=\hbox{\fboxsep3pt\fbox{\parbox{2in}{\parskip 1em
Example Algorithm:\par
Step 1\par
Step 2 $D$ \smash{\rotatebox{-10}{$\xrightarrow{\rule{7ex}{0pt}}$}}\par
Step 3\par
Step 4\par~}}%
}%
\savestack\whitebox{\box0}
\stackinset{c}{65pt}{c}{6pt}{\graybox}{\whitebox}
\end{document}