欢迎提出环境建议

欢迎提出环境建议

我正在尝试实现这样的构造:

图像

但是到目前为止,我还没有成功实现这一点。我想我尝试了所有错误的环境 - 添加了作为数学函数导致缩进的问题,右侧的两条双(三)线也有问题。我尝试了数组,无法强制 lyx 将括号放在所有行上。上次我使用了表格,但在这种情况下,括号不会延伸到所有行...

尽管 Latex 非常灵活,但我想我一定错过了一些更简单的方法来实现这一点。

顺便说一句:我不在乎右侧的点,只要两个部分以某种方式分开即可 - 理想情况下就像一个段落。

有人有想法吗?感谢任何反馈

答案1

解决方案如下blkarray

\documentclass{article}
\usepackage{amsmath}
\usepackage{blkarray, multirow}%
\usepackage{xcolor}
\usepackage{enumitem}
\usepackage{setspace}
\usepackage{marvosym}

\newcommand\mycbox[1]{\colorbox{white}{\color{red}\bfseries#1}}

\begin{document}

\sffamily \[%
\renewcommand{\arraystretch}{2}
\colorbox{blue}{\color{yellow}\begin{blockarray}{l <{\enspace }\}@{\qquad} >{\color{white}\setstretch{1.33}}l}
\mycbox{Carburizing} & \multirow{4}{7cm}[3ex]{%
\begin{itemize}[wide = 0pt ]
    \item Forming harder and stronger surface \MVRightArrow{} introducing compressive residual stress
    \item The strengthening effect depends on the diameter of the part and the depth of the surface hardening. 
\end{itemize}}\\
\mycbox{Nitriding} \\
\mycbox{Flame hardening} \\
\mycbox{Induction hardening} \\
  \end{blockarray} }
            \]%
\end{document} 

在此处输入图片描述

对于黑白版本,请删除 xcolor 加载并使用此代码:

\[%
\renewcommand{\arraystretch}{2}
\begin{blockarray}{ >{\enspace $\sffamily\bfseries}l <{\enspace $}\}@{\qquad} >{\setstretch{1.33}}l <{\enspace}}
Carburizing & \multirow{4}{6.3cm}[3ex]{%
\begin{itemize}[wide = 0pt ]
    \item Forming harder and stronger surface \MVRightArrow{} introducing compressive residual stress
    \item The strengthening effect depends on the diameter of the part and the depth of the surface hardening.
\end{itemize}}\\
Nitriding \\
Flame hardening \\
Induction hardening \\
  \end{blockarray}
            \]%

在此处输入图片描述

答案2

这是一个tcolorbox基础解决方案。第一个环境遵循您的图片,并添加了一些内容,例如红色框的圆角。

下面两个添加标题,调整红框的宽度,最后添加一个好看的阴影(只是为了好玩):

\documentclass{article}
\usepackage[many]{tcolorbox}
\usetikzlibrary{decorations.pathreplacing}
\usepackage{enumitem,pifont}

\newtcolorbox{myenvironment}[1][]{%
  enhanced,sidebyside,lefthand width=3.7cm,%
  sharp corners,left=2mm,right=2mm,boxrule=0.4pt,
  colframe=blue!50!black,
  interior style={left color=blue!75!black,right color=blue},
  lower separated=false,
  fontlower=\sffamily\large,
  overlay={\draw[yellow,solid,very thick,decorate,decoration={brace,amplitude=8pt}]
    ([xshift=-4pt,yshift=-3mm]segmentation.north) -- ([xshift=-4pt,yshift=3mm]segmentation.south);},
  raster columns=1,
  raster force size=false,
  raster every box/.style={enhanced,fontupper=\sffamily\bfseries,size=small,
    colupper=red,colback=white,colframe=red!50!white,center upper},
  before upper=\begin{tcbraster},
  after upper=\end{tcbraster},
  before lower={\flushleft\color{white}\begin{itemize}[wide=0pt]},
  after lower={\end{itemize}},
  fonttitle=\bfseries\sffamily\large,center title,
  #1
}

\begin{document}

\begin{myenvironment}
  \tcbox{Carburizing}
  \tcbox{Nitriding}
  \tcbox{Flame hardening}
  \tcbox{Induction hardening}
\tcblower
  \item Forming harder and stronger surface \ding{212} introducing compressive
    residual stress.
  \item The strengthening effect depends on the diameter of the part and the
    depth of the surface hardening.
\end{myenvironment}

\begin{myenvironment}[raster force size,title=My environment]
  \tcbox{Carburizing}
  \tcbox{Nitriding}
  \tcbox{Flame hardening}
  \tcbox{Induction hardening}
\tcblower
  \item Forming harder and stronger surface \ding{212} introducing compressive
    residual stress.
  \item The strengthening effect depends on the diameter of the part and the
    depth of the surface hardening.
\end{myenvironment}

\begin{myenvironment}[raster force size,title=My environment,
  rounded corners,drop fuzzy shadow]
  \tcbox{Carburizing}
  \tcbox{Nitriding}
  \tcbox{Flame hardening}
  \tcbox{Induction hardening}
\tcblower
  \item Forming harder and stronger surface \ding{212} introducing compressive
    residual stress.
  \item The strengthening effect depends on the diameter of the part and the
    depth of the surface hardening.
\end{myenvironment}

\end{document}

在此处输入图片描述

左侧宽度是手动设置的,例如较短的宽度:

\documentclass{article}
\usepackage[many]{tcolorbox}
\usetikzlibrary{decorations.pathreplacing}
\usepackage{enumitem,pifont}

\newtcolorbox{myenvironment}[1][]{%
  enhanced,sidebyside,lefthand width=3.7cm,%
  sharp corners,left=2mm,right=2mm,boxrule=0.4pt,
  colframe=blue!50!black,
  interior style={left color=blue!75!black,right color=blue},
  lower separated=false,
  fontlower=\sffamily\large,
  overlay={\draw[yellow,solid,very thick,decorate,decoration={brace,amplitude=8pt}]
    ([xshift=-4pt,yshift=-3mm]segmentation.north) -- ([xshift=-4pt,yshift=3mm]segmentation.south);},
  raster columns=1,
  raster force size=false,
  raster every box/.style={enhanced,fontupper=\sffamily\bfseries,size=small,
    colupper=red,colback=white,colframe=red!50!white,center upper},
  before upper=\begin{tcbraster},
  after upper=\end{tcbraster},
  before lower={\flushleft\color{white}\begin{itemize}[wide=0pt]},
  after lower={\end{itemize}},
  fonttitle=\bfseries\sffamily\large,center title,
  #1
}

\begin{document}

\begin{myenvironment}[lefthand width=3cm]
  \tcbox{Carburizing}
  \tcbox{Nitriding}
  \tcbox{Flame hard.}
  \tcbox{Induction hard.}
\tcblower
  \item Forming harder and stronger surface \ding{212} introducing compressive
    residual stress.
  \item The strengthening effect depends on the diameter of the part and the
    depth of the surface hardening.
\end{myenvironment}

\end{document}

在此处输入图片描述

答案3

如果你没有被视觉设计所困扰,而只是想要一些分组,我会尝试一下block。不知道如何在 LyX 中做到这一点,但这里有一个在常规投影仪中的方法:

在此处输入图片描述

\documentclass{beamer}
\usetheme{madrid}
\begin{document}

\begin{frame}
\frametitle{Title}
\begin{block}{Surface Treatments}
\begin{columns}[c]
\begin{column}{0.3\textwidth}
\begin{itemize}
\item Carburizing
\item Nitriding
\item Flame hardening
\item Induction hardening
\end{itemize}
\end{column}
\begin{column}{0.6\textwidth}
\begin{itemize}
\item Forming harder and stronger surface $\rightarrow$ introducing compressive residual stress
\item The strengthening effect depends on the diameter of the part and the depth of the surface hardening
\end{itemize}
\end{column}
\end{columns}
\end{block}
\begin{block}{Something else}
This is just a placeholder. The slide may look better if this wasn't here.
\end{block}
\end{frame}

\end{document}

相关内容