转括号

转括号

我想在以下代码中翻转括号:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc,tikzmark}
\begin{document}
\hfill\tikzmark{right}
  \begin{itemize}
\item ... \tikzmark{1st}
\item ... \tikzmark{2nd}
    \end{itemize}

\begin{tikzpicture}[overlay, remember picture]
\node[anchor=base] (a) at (pic cs:1st) {\vphantom{h}}; 
\node[anchor=base] (b) at (pic cs:2nd) {\vphantom{g}}; 
\draw [decoration={brace,amplitude=0.5em},decorate,ultra thick,black]
 (a.north -| {pic cs:left}) -- (b.south -| {pic cs:left});
\end{tikzpicture}
\end{document}

因为它现在正朝着“错误”的方向发展

答案1

正如我在评论中提到的:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc,tikzmark}
\begin{document}
\hfill\tikzmark{right}
  \begin{itemize}
\item ... \tikzmark{1st}
\item ... \tikzmark{2nd}
    \end{itemize}

\begin{tikzpicture}[overlay, remember picture]
\node[anchor=base] (a) at (pic cs:1st) {\vphantom{h}};
\node[anchor=base] (b) at (pic cs:2nd) {\vphantom{g}};
\draw [decoration={brace,amplitude=0.5em},decorate,ultra thick,black]
 (a.north -| {pic cs:left}) -- (b.south -| {pic cs:left});
\end{tikzpicture}

\begin{tikzpicture}[overlay, remember picture]
\node[anchor=base] (a) at (pic cs:1st) {\vphantom{h}};
\node[anchor=base] (b) at (pic cs:2nd) {\vphantom{g}};
\draw [decoration={brace,amplitude=0.5em,
        raise=1mm, mirror},       % <--- observe changes!
        decorate,ultra thick,red]
 (a.north -| {pic cs:left}) -- (b.south -| {pic cs:left});
\end{tikzpicture}

\end{document}

在此处输入图片描述

附录:
您可能感兴趣calligraphic brace

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,%
                    calligraphy,% had to be after decorations.pathreplacing
                fit,
                tikzmark,
% if needed, add for compatibility with babel ...
                babel
                }
\tikzset{
BC/.style args = {#1/#2/#3}{
        decorate,
        decoration={calligraphic brace, amplitude=6pt,
        pre =moveto, pre  length=1pt,
        post=moveto, post length=1pt,
        raise=#1,
              #2},% for mirroring of brace
        very thick,
        pen colour={#3}
        },
        }
\begin{document}
\begin{itemize}
\item \tikzmarknode{A}{some text}
\item \tikzmarknode{B}{Some text}%
\end{itemize}

\begin{tikzpicture}[overlay,remember picture,
nodes = {inner ysep=0pt, outer xsep=0.5em, text depth=0.3ex}
                    ]
\node[fit=(A) (B)] (aux) {};
\draw [BC=1mm/mirror/black] (aux.north west) -- (aux.south west);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容