我怎样才能创建如图所示的蜿蜒线条?
\documentclass[10pt,a4paper]{article}
\usepackage[many]{tcolorbox}
\usepackage[tikz]{bclogo}
\usepackage{mathtools,systeme,amssymb,amsfonts,amsmath,mathabx,fge,skak}
\usepackage{mathrsfs,eufrak,yfonts,pifont}
\usepackage{polyglossia}
\setdefaultlanguage[calendar=gregorian,locale=algeria]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1]{Amiri}
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1.2]{Amiri}
\newfontfamily\myfont[Script=Arabic,Scale=1.3]{Amiri}
\newtcolorbox{proof 1}[2][]{
freelance,before skip=0mm,after skip=0pt,
colback=white,title={\hspace*{-0.6cm}\bccrayon\ \bfseries\myfont\textcolor{red!90!black}{إثبـــات}},
bottomrule=0pt,top=-0cm,left=0mm,right=3mm,bottom=-4mm,
boxrule=0pt,colframe=white,
overlay unbroken and first={
\draw[red!40,line width=2.1pt,]
([xshift=-1.3mm,yshift=-8mm]frame.north east) --
([xshift=-1.3mm,yshift=-8mm]frame.north east) --
([xshift=-1.3mm,yshift=-0mm]frame.south east);
\hfill \textcolor{red!70!black}{$\blacksquare$};}}
\begin{document}
\begin{proof 1}
اكتب هنا\\
اكتب هنا\\
اكتب هنا\\
اكتب هنا\\
اكتب هنا\\
اكتب هنا\\
اكتب هنا\\
اكتب هنا\\
\end{proof 1}
\end{document}
答案1
我无法使用阿拉伯字体的代码,所以我适应了欧洲字符。垂直线可以decorated
用decoration
库来表示TikZ
,请咨询文档并使其符合您的口味。
关于title
,我认为最好使用fonttitle
和coltitle
选项,而不是将所有内容都包含在title
选项中。您也可以使用before title
或after title
选项来包含\bccrayon
。
\documentclass[10pt,a4paper]{article}
\usepackage[many]{tcolorbox}
\usepackage[tikz]{bclogo}
\usepackage{mathtools,amssymb,amsfonts,amsmath}
%\usepackage{mathrsfs,eufrak,yfonts,pifont}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{polyglossia}
%\setdefaultlanguage[calendar=gregorian,locale=algeria]{arabic}
%\setotherlanguage{english}
%\newfontfamily\arabicfont[Script=Arabic,Scale=1]{Amiri}
%\newfontfamily\arabicfontsf[Script=Arabic,Scale=1.2]{Amiri}
%\newfontfamily\myfont[Script=Arabic,Scale=1.3]{Amiri}
\newtcolorbox{proof 1}[2][]{
enhanced, before skip=0mm, after skip=0pt,
colback=white, coltitle=red!90!black,
fonttitle=\bfseries,
bottomrule=0pt,top=-0cm,left=0mm,right=3mm,bottom=-4mm,
boxrule=0pt,colframe=white,
title=#2,
after title=\hfill\bccrayon,
overlay unbroken and first={
\draw[red!40,line width=2.1pt,solid, decorate, line width=1mm, decoration={coil, aspect=0}]
([xshift=-1.3mm,yshift=-8mm]frame.north east) --
([xshift=-1.3mm,yshift=-0mm]frame.south east);
\hfill \textcolor{red!70!black}{$\blacksquare$};},
#1}
\begin{document}
\begin{proof 1}{Test}
\vspace{5cm}
\end{proof 1}
\end{document}
答案2
在这个答案中,我只关注制作类似于波浪的东西。我甚至无法复制你的代码,因为我的旧编辑器无法处理特殊字符,对不起。complete sines
是从这里。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations}
\pgfdeclaredecoration{complete sines}{initial}
{
\state{initial}[
width=+0pt,
next state=sine,
persistent precomputation={\pgfmathsetmacro\matchinglength{
\pgfdecoratedinputsegmentlength / int(\pgfdecoratedinputsegmentlength/\pgfdecorationsegmentlength)}
\setlength{\pgfdecorationsegmentlength}{\matchinglength pt}
}] {}
\state{sine}[width=\pgfdecorationsegmentlength]{
\pgfpathsine{\pgfpoint{0.25\pgfdecorationsegmentlength}{0.5\pgfdecorationsegmentamplitude}}
\pgfpathcosine{\pgfpoint{0.25\pgfdecorationsegmentlength}{-0.5\pgfdecorationsegmentamplitude}}
\pgfpathsine{\pgfpoint{0.25\pgfdecorationsegmentlength}{-0.5\pgfdecorationsegmentamplitude}}
\pgfpathcosine{\pgfpoint{0.25\pgfdecorationsegmentlength}{0.5\pgfdecorationsegmentamplitude}}
}
\state{final}{}
}
\begin{document}
\tikzset{fancy sines/.style={decoration={
complete sines,
segment length=3mm,
amplitude=1mm
},decorate,to path={
(\tikztostart) -- (\tikztotarget) \tikztonodes
},
execute at begin to={\foreach \X in {1,...,5}
{\draw[decorate,#1]
([xshift=\X*\pgflinewidth/sqrt(1.9),yshift=-\X*\pgflinewidth/sqrt(1.9)]\tikztostart)
-- ([xshift=\X*\pgflinewidth/sqrt(1.9),yshift=-\X*\pgflinewidth/sqrt(1.9)]\tikztotarget);}}}
}
\begin{tikzpicture}
\draw[red,fancy sines=red] (0,0) to (0,-3);
\end{tikzpicture}
\end{document}