设置波浪形侧边栏

设置波浪形侧边栏

有没有办法让framed.stysidebar环境使用长波浪线,例如,使用 的mathabx.sty可变\lfilet大小分隔符构建?

答案1

这是一种使用的可能性mdframed以及coil来自TikZ

\documentclass{article}
\usepackage[a6paper]{geometry}% just for the example
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{decorations.pathmorphing,calc}
\usepackage{lipsum}% just to generate text for the example

\newcommand\wavydecor{%
    \draw[decoration={coil,aspect=0.1,segment length=5pt,amplitude=0.8pt},decorate,line width=1.5pt,black]
      (O|-P) -- (O);
}

\newmdenv[
hidealllines=true,
innerleftmargin=10pt,
innerrightmargin=0pt,
innertopmargin=0pt,
innerbottommargin=0pt,
leftmargin=-10pt,
skipabove=.5\baselineskip,
skipbelow=.5\baselineskip,
singleextra={\wavydecor},
firstextra={\wavydecor},
secondextra={\wavydecor},
middleextra={\wavydecor}
]{wavysbar}

\begin{document}

\lipsum[4]
\begin{wavysbar}
\lipsum[4]
\end{wavysbar}
\lipsum[4]
\begin{wavysbar}
\lipsum[4-5]
\end{wavysbar}
\lipsum[4]

\end{document}

在此处输入图片描述

只是为了展示一些其他的装饰可能性:

\documentclass{article}
\usepackage[a6paper]{geometry}% just for the example
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{shapes,decorations.pathmorphing,decorations.shapes,backgrounds,calc}
\usepackage{lipsum}% just to generate text for the example

\newcommand\sawdecor{%
    \draw[decoration={saw,aspect=0.1,segment length=9pt,amplitude=3pt},decorate,line width=1.5pt,red!50!black]
      (O|-P) -- (O);
}

\newcommand\triangledecor{%
    \draw[decoration={triangles,shape size=4,segment length=6pt},fill=orange!70!black,draw=orange,decorate]
      (O|-P) -- (O);
}

\newmdenv[
hidealllines=true,
innerleftmargin=10pt,
innerrightmargin=0pt,
innertopmargin=0pt,
innerbottommargin=0pt,
leftmargin=-10pt,
skipabove=.5\baselineskip,
skipbelow=.5\baselineskip,
singleextra={\sawdecor},
firstextra={\sawdecor},
secondextra={\sawdecor},
middleextra={\sawdecor}
]{bumpsbar}

\newmdenv[
hidealllines=true,
innerleftmargin=10pt,
innerrightmargin=0pt,
innertopmargin=0pt,
innerbottommargin=0pt,
leftmargin=-10pt,
skipabove=.5\baselineskip,
skipbelow=.5\baselineskip,
singleextra={\triangledecor},
firstextra={\triangledecor},
secondextra={\triangledecor},
middleextra={\triangledecor}
]{trisbar}

\begin{document}

\begin{trisbar}
\lipsum[4]
\end{trisbar}
\lipsum[4]
\begin{bumpsbar}
\lipsum[4-5]
\end{bumpsbar}
\lipsum[4]

\end{document}

在此处输入图片描述

相关内容