如何在 LaTeX 中排版下图的代码

如何在 LaTeX 中排版下图的代码

我想在 LaTeX 中排版以下图像。可以吗?

在此处输入图片描述

答案1

也许你正在考虑这样的事情:

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}

\usepackage{lipsum} % for mock text

\newenvironment{step}[2]
 {%
  $% start math mode
  \sbox0{\rotatebox[origin=c]{90}{\quad#1\quad}}%
  \vcenter{\hbox{\copy0}}%
  \mkern3mu
  \begin{pmatrix}
  \mkern3mu
  \vphantom{\vcenter{\hbox{\copy0}}}%
  \begin{minipage}{#2}
 }
 {\end{minipage}\mkern3mu\end{pmatrix}$}

\begin{document}

\begin{center}
\begin{step}{Step 1}{8cm}
\lipsum[1][1-5]
\end{step}
\end{center}

\begin{center}
\begin{step}{Step 2}{10cm}
\lipsum[2]
\end{step}
\end{center}

\end{document}

在此处输入图片描述

答案2

使用tcolorbox

\documentclass{book}
\usepackage{lipsum}
\usepackage{xcolor}
%\usepackage{showframe}
\usepackage[most]{tcolorbox}
\newtcolorbox{mybox}[2][]{%
  enhanced,
  boxsep=4pt,
  opacityback=0, 
  frame hidden,% from https://tex.stackexchange.com/a/247509/101651
  left skip=.7cm,
  % copied from https://tex.stackexchange.com/a/431760/101651
  overlay unbroken and first ={%
    \node[rotate=90,
          anchor=south,
          font=\Large,
          inner sep=0pt, 
          yshift=.3cm,
          ]
    at (frame.west) {#2};
    \draw[rounded corners=10, thick] ([xshift=12pt]frame.north west) -- (frame.north west) -- (frame.south west) -- ([xshift=12pt]frame.south west);
    \draw[rounded corners=10, thick] ([xshift=-12pt]frame.north east) -- (frame.north east) -- (frame.south east) -- ([xshift=-12pt]frame.south east);
  }
}
\begin{document}
\begin{mybox}{STEP 1}
    Bla bla bla
\end{mybox}
\begin{mybox}{STEP 2}
    \lipsum[2]
\end{mybox}
\end{document}

在此处输入图片描述

相关内容