答案1
首先,请阅读 中的教程 1。pgfmanual
之后您将了解如何绘制这个简单的图形。
其次,看一下tcolorbox
文档,您将了解如何格式化此类框。
之后,尝试理解以下代码,您将能够根据您的需要进行调整:
\documentclass[twocolumn]{article}
\usepackage[most]{tcolorbox}
\usetikzlibrary{arrows.meta}
\usepackage{lipsum}
\newtcolorbox{boxone}{%
enhanced,
colback=brown!10,
boxrule=0pt,
sharp corners,
frame hidden,
fontupper=\bfseries,
notitle,
overlay={%
\draw[Circle-Circle, brown!70!black, line width=2pt](frame.north west)--(frame.south west);
\draw[Circle-Circle, brown!70!black, line width=2pt](frame.north east)--(frame.south east);}
}
\newtcolorbox{boxtwo}{%
enhanced,
%frame style={draw=none},
colback=orange!20,
boxrule=0pt,
sharp corners,
frame hidden,
notitle,
overlay={%
\draw[{Triangle[right]}-{Triangle[left]}, , line width=2pt](frame.north west)--(frame.north east);
\draw[{Triangle[left]}-{Triangle[right]}, , line width=2pt](frame.south west)--(frame.south east);}
}
\newtcolorbox{boxthree}[2][]{%
enhanced,
%frame style={draw=none},
colback=orange!10,
colbacktitle=orange!10,
boxrule=0pt,
fonttitle=\Large\bfseries,
coltitle=brown!30!black,
sharp corners,
frame hidden,
title=#2,
overlay={%
\draw[thick, brown!70!black, double=orange, double distance=2pt] (frame.north west)--(frame.north east);
\draw[thick, brown!70!black, double=orange, double distance=2pt] (frame.south west)--(frame.south east);
\fill[red!50!brown] ([shift={(3mm,.5mm)}]title.south west)--([shift={(-3mm,0mm)}]title.south east)--([shift={(3mm,-.5mm)}]title.south west)--cycle;}
}
\begin{document}
\begin{boxone}
\lipsum[1]
\end{boxone}
\begin{boxtwo}
\lipsum[3]
\end{boxtwo}
\begin{boxthree}{Nice maths}
\[\sin^2 x + \cos^2 = 1\]
\end{boxthree}
{\par\centering
\begin{tikzpicture}
\draw[help lines, dotted] (0,0) grid (7,4);
\draw[cyan] (1,1) node[below left, black] {$B$}--node[above left]{$c$} (2,3) node[above, black]{$A$}--node[above right]{$b$} (6,1) node[below right, black]{$C$}--node[below]{$c'$}(2,1) node[below,black]{$H$}--node[below]{$b'$}(1,1)--cycle;
\draw[violet] (2,1)--node[right]{$h$}(2,3);
\draw[violet] (2,1.2)-|(2.2,1);
\draw[thin] (1,.9)--++(-90:.8) (6,.9)--++(-90:.8);
\draw[LaTeX-LaTeX] (1,.3)-- node[fill=white]{$a$}(6,.3);
\end{tikzpicture}
\par}
\end{document}
答案2
您没有展示您尝试过什么。但请看一下以下代码。它将为您提供一个可能的起点。
\documentclass[a4paper,12pt,twocolumn]{article}
\usepackage{amsmath,tcolorbox,tikz}
\begin{document}
\foreach \y in {1,...,34} {
\begin{tcolorbox}
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}
This is another \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[title= My nice title]
\foreach \z in {1,...,10} {This is a long \textbf{tcolorbox}.}
\end{tcolorbox}
}
\end{document}