使用 tikzlibrary 书法进行牙套迷你页面

使用 tikzlibrary 书法进行牙套迷你页面

calligraphy我想在迷你页面的一侧放置来自优秀 TikZ 库的括号。我无法让它工作:

\documentclass{article}

\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.pathreplacing,calligraphy}

\newcommand{\tikzmark}[1]{%
    \tikz[baseline={(#1.base)},remember picture]%
    \node[outer sep=0pt, inner sep=0pt] (#1) {\strut};}

\begin{document}

\begin{minipage}{0.5\textwidth}
\noindent\tikzmark{A}Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi quis est quis arcu pretium imperdiet. Donec facilisis pharetra posuere. Proin auctor purus vel nunc ultrices, et mollis est ultrices. Nulla blandit finibus lacinia. Nam congue ante et libero ornare, et feugiat ipsum cursus. Quisque tincidunt a urna at vestibulum.\tikzmark{B}
\end{minipage}

\tikz[decorate,decoration={calligraphic brace,amplitude=6pt},remember picture,overlay,ultra thick]%
\draw ($(A.north) - (6pt,0)$) -- ($(A |- B.south) - (6pt,0)$);

\end{document}

得出的结果为:

带有 minipage 的失败括号的示例。

没有支架。我遗漏了什么?

答案1

您需要说,\draw[decorate] ...;否则它会画一条普通的线...因此,请尝试对您的 MWE 进行以下更正:

\documentclass{article}

\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.pathreplacing,calligraphy}

\newcommand{\tikzmark}[1]{%
    \tikz[baseline={(#1.base)},remember picture]%
    \node[outer sep=0pt, inner sep=0pt] (#1) {\strut};}

\begin{document}

\begin{minipage}{0.5\textwidth}
\noindent\tikzmark{A}Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi quis est quis arcu pretium imperdiet. Donec facilisis pharetra posuere. Proin auctor purus vel nunc ultrices, et mollis est ultrices. Nulla blandit finibus lacinia. Nam congue ante et libero ornare, et feugiat ipsum cursus. Quisque tincidunt a urna at vestibulum.\tikzmark{B}
\end{minipage}

\tikz[remember picture,overlay,ultra thick,
      decoration={calligraphic brace, mirror,
                  raise=6pt, amplitude=6pt}]%
\draw[decorate] (A.north) -- (A |- B.south);

\end{document}

在此处输入图片描述

相关内容