環境建議表示讚賞

環境建議表示讚賞

我正在嘗試實現這樣的構造:

影像

然而到目前為止我還沒有成功達成這個目標。我想我嘗試了所有錯誤的環境 - 補充說,由於數學函數導致縮進問題,並且右側的兩條雙(三)線也有問題。我嘗試了該數組,但無法強制 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}

相關內容