动画包中的按钮

动画包中的按钮

我想在乳胶中使用以下按钮。

在此处输入图片描述

我尝试按照说明进行操作本网站但它给出了空的结果,如下所示: 在此处输入图片描述

答案1

您不能pstricks与 PDFLaTeX 一起使用,但只能与 XeLaTeX、LuaLaTeX 或 LaTeX (-> dvips -> ps2pdf) 一起使用。

一种解决方法是使用其他绘图包来创建这些符号。例如 TiZ 也可以与 PDFLaTeX 一起使用:

\documentclass[12pt]{article}
\usepackage{tikz}

\NewDocumentCommand{\btnendright}{ }{%
    \tikz[baseline=1pt, overlay]{
        \draw[line width=0.25pt, line join=round] 
            (1pt,1pt) rectangle (14pt,14pt);
        \draw[line width=1pt, line cap=round, line join=round] 
            (4.5pt,4pt) -- (9.5pt,7.5pt) -- (4.5pt,11pt);
        \draw[line width=1pt, line cap=round] 
            (10.5pt,4.4pt) -- (10.5pt,10.6pt);
    }%
}
\NewDocumentCommand{\btnendleft}{ }{%
    \tikz[baseline=1pt, overlay]{
        \draw[line width=0.25pt, line join=round] 
            (1pt,1pt) rectangle (14pt,14pt);
        \begin{scope}[xscale=-1, xshift=-15pt]
            \draw[line width=1pt, line cap=round, line join=round] 
                (4.5pt,4pt) -- (9.5pt,7.5pt) -- (4.5pt,11pt);
            \draw[line width=1pt, line cap=round] 
                (10.5pt,4.4pt) -- (10.5pt,10.6pt);
        \end{scope}
    }%
}
\NewDocumentCommand{\btnstepright}{ }{%
    \tikz[baseline=1pt, overlay]{
        \draw[line width=0.25pt, line join=round] 
            (1pt,1pt) rectangle (14pt,14pt);
        \draw[line width=1pt, line cap=round, line join=round] 
            (5pt,4pt) -- (10pt,7.5pt) -- (5pt,11pt);
    }%
}
\NewDocumentCommand{\btnstepleft}{ }{%
    \tikz[baseline=1pt, overlay]{
        \draw[line width=0.25pt, line join=round] 
            (1pt,1pt) rectangle (14pt,14pt);
        \begin{scope}[xscale=-1, xshift=-15pt]
            \draw[line width=1pt, line cap=round, line join=round] 
                (5pt,4pt) -- (10pt,7.5pt) -- (5pt,11pt);
        \end{scope}
    }%
}
\NewDocumentCommand{\btnplayright}{ }{%
    \tikz[baseline=1pt, overlay]{
        \draw[line width=0.25pt, line join=round] 
            (1pt,1pt) rectangle (14pt,14pt);
        \draw[line width=1pt, line join=round] 
            (5pt,4pt) -- (5pt,11pt) -- (10pt,7.5pt) -- cycle;
    }%
}
\NewDocumentCommand{\btnplayleft}{ }{%
    \tikz[baseline=1pt, overlay]{
        \draw[line width=0.25pt, line join=round] 
            (1pt,1pt) rectangle (14pt,14pt);
        \begin{scope}[xscale=-1, xshift=-15pt]
            \draw[line width=1pt, line join=round] 
                (5pt,4pt) -- (5pt,11pt) -- (10pt,7.5pt) -- cycle;
        \end{scope}
    }%
}
\NewDocumentCommand{\btnpauseright}{ }{%
    \tikz[baseline=1pt, overlay]{
        \draw[line width=0.25pt, line cap=butt, line join=round] 
            (0pt,1pt) -- (14pt,1pt) -- (14pt,14pt) -- (0pt,14pt);
        \draw[line width=2pt, line cap=butt] 
            (2.2pt,4pt) -- (2.2pt,11pt);
    }%
}
\NewDocumentCommand{\btnpauseleft}{ }{%
    \tikz[baseline=1pt, overlay]{
        \begin{scope}[xscale=-1, xshift=-15pt]
            \draw[line width=0.25pt, line cap=butt, line join=round] 
                (0pt,1pt) -- (14pt,1pt) -- (14pt,14pt) -- (0pt,14pt);
            \draw[line width=2pt, line cap=butt] 
                (2.2pt,4pt) -- (2.2pt,11pt);
        \end{scope}
    }%
}
\NewDocumentCommand{\btnminus}{ }{%
    \tikz[baseline=1pt, overlay]{
        \draw[line width=0.25pt, line join=round] 
            (1pt,1pt) rectangle (14pt,14pt);
        \draw[line width=1pt, line cap=butt] 
             (4pt,7.5pt) -- (11pt,7.5pt);
    }%
}
\NewDocumentCommand{\btnplus}{ }{%
    \tikz[baseline=1pt, overlay]{
        \draw[line width=0.25pt, line join=round] 
            (1pt,1pt) rectangle (14pt,14pt);
        \draw[line width=1pt, line cap=butt] 
             (4pt,7.5pt) -- (11pt,7.5pt);
        \draw[line width=1pt, line cap=butt] 
             (7.5pt,4pt) -- (7.5pt,11pt);
    }%
}
\NewDocumentCommand{\btnreset}{ }{%
    \tikz[baseline=1pt, overlay]{
        \draw[line width=0.25pt, line join=round] 
            (1pt,1pt) rectangle (14pt,14pt);
        \draw[line width=1pt, line cap=round] 
             (7.5pt,4pt) -- (7.5pt,11pt);
        \fill[line join=miter] 
             (3.5pt,5pt) -- (7pt,7.5pt) -- (3.5pt,10pt) -- cycle;
        \fill[line join=miter] 
             (11.5pt,5pt) -- (8pt,7.5pt) -- (11.5pt,10pt) -- cycle;
        \draw[line width=1pt, line cap=butt] 
             (3pt,7.5pt) -- (3.5pt,7.5pt);
        \draw[line width=1pt, line cap=butt] 
             (12pt,7.5pt) -- (11.5pt,7.5pt);
    }%
}

\begin{document}

\verb|Left end:   |~\btnendleft \par
\verb|Right end:  |~\btnendright \par
\verb|Minus:      |~\btnminus \par
\verb|Left pause: |~\btnpauseleft \par
\verb|Right pause:|~\btnpauseright \par
\verb|Left play:  |~\btnplayleft \par
\verb|Right play: |~\btnplayright \par
\verb|Plus:       |~\btnplus \par
\verb|Reset:      |~\btnreset \par
\verb|Left step:  |~\btnstepleft \par
\verb|Right step: |~\btnstepright 

\bigskip

\verb!<||> :      !~\btnpauseleft\btnplayleft\hspace{15pt}\btnpauseright\btnplayright

\end{document}

在此处输入图片描述

相关内容