在 Latex 中使用 tikz 注释方程式时超时/无法编译

在 Latex 中使用 tikz 注释方程式时超时/无法编译

我一直在尝试 Latex 中的带注释的方程式:https://github.com/synercys/annotated_latex_equations

但是,我只使用了三个,就导致超时错误,无法在我的 .pdf 或单独的图形中进行编译。

例如,这是我尝试过的第一个导致问题的方法。有什么建议吗?

我在带注释的方程式提供的模板中包含了一个我尝试过的示例:https://www.overleaf.com/5578564312nrfqvbngfmst

保险.tex

\begin{equation}
    maxNetValue = (\tikzmarknode{p}{\highlight{red}{p}} - \tikzmarknode{g}{\highlight{blue}{g}})Loans + (\tikzmarknode{g}{\highlight{blue}{g}} - \tikzmarknode{d}{\highlight{plum}{d}})Deposits
\end{equation}

\begin{tikzpicture}[overlay,remember picture,>=stealth,nodes={align=left,inner ysep=1pt},<-]
        % For "p"
        \path (p.north) ++ (0,2em) node[anchor=south west,color=red!67] (scalep){\textbf{predicted value of y (the dependent variable)}};
        \draw [color=red!57](p.north) |- ([xshift=-0.3ex,color=red]scalep.south east);
        % For "g"
        \path (g.south) ++ (0,-1.5em) node[anchor=north west,color=blue!67] (mean){\textbf{new input variable}};
        \draw [color=blue!57](x.south) |- ([xshift=-0.3ex,color=blue]mean.south east);
        % For d
        \path (d.north) ++ (0, 1.8em) node[anchor=north west,color=Plum!85] (scalep){\textbf{interest rate on Deposits}}
        \draw [color=Plum!85](d.north) | - ([xshift=0.3ex,colour=Plum!]scalep.north west);
\end{tikzpicture} ```

答案1

(1)从序言中删除\usepackage[pdftex]{graphicx}

insurance.tex(2)档案中存在多处错误banking.tex

A

使用这些文件以便构建能够顺利完成并且不会出现错误。

还需要做一些工作来在双列环境中排列图形并在它们和文本之间添加空格。

新文件banking.tex

%File banking.tex

\begin{wrapfigure}{l}{0.7\columnwidth}
    \vspace{3\baselineskip}
    
\begin{equation}
    %maxNetValue = (p-g)Loans + (g-d)Deposits
    maxNetValue = (\tikzmarknode{p}{\highlight{red}{p}} - \tikzmarknode{g}{\highlight{blue}{g}})Loans + (\tikzmarknode{g}{\highlight{blue}{g}} - \tikzmarknode{d}{\highlight{green}{d}})Deposits
\end{equation}
%$g =$ \textit{opportunity cost}\\
%$p =$ \textit{interest rate on Loans}\\
%$d =$ \textit{interest rate on Deposits}

 \begin{tikzpicture}[overlay,remember picture,>=stealth,nodes={align=left,inner ysep=1pt},<-]
        % For "p"
        \path (p.north) ++ (0,4em) node[anchor=south west,color=red!67] (scalep){\textbf{predicted value of y (the dependent variable)}};
        \draw [color=red!57](p.north) |- ([xshift=-0.3ex,color=red]scalep.south east);
        % For "g"
        \path (g.south) ++ (0,-1.5em) node[anchor=north west,color=blue!67] (mean){\textbf{new input variable}};
        \draw [color=blue!57](g.south) |- ([xshift=-0.3ex,color=blue]mean.south east);
        % For d
         \path (d.north) ++ (0, 1.8em) node[anchor=south west,color=green!80] (scalep) {\textbf{interest rate on Deposits}};
        \draw [color=green!85](d.north)   |- ([xshift= 0.3ex,color=green!80]scalep.south east);        
\end{tikzpicture}

 \vspace{4\baselineskip}
\end{wrapfigure}

新文件insurance.tex

%%File insurance.tex

\begin{wrapfigure}{l}{0.7\columnwidth}
    \vspace{3\baselineskip}

\begin{equation}
    \tikzmarknode{q}{\highlight{red}{q}}- \tikzmarknode{p}{\highlight{blue}{p}} - \tikzmarknode{pc}{\highlight{green}{pc}} = {[q-(1+c)p]}- \tikzmarknode{X}{\highlight{cyan}{X}}
\end{equation}

\begin{tikzpicture}[overlay,remember picture,>=stealth,nodes={align=left,inner ysep=1pt},<-]
        % For “qX”
        \path (q.north) ++ (0,4em) node[anchor=south west,color=red!67] (scalep){\textbf{consumer price paid for insurance}};
        \draw [color=red!57](q.north) |- ([xshift=-0.3ex,color=red]scalep.south east);
        % For "g"
        \path (p.south) ++ (0,-3.5em) node[anchor=north west,color=blue!67] (mean){\textbf{probability of claim for X value}};
        \draw [color=blue!57](p.south) |- ([xshift=-0.3ex,color=blue]mean.south east);
        % For pcX
        \path (pc.north) ++ (0, 1.8em) node[anchor=south west,color=green!80] (scalep) {\textbf{expected administrative costs of claim}};
        \draw [color=green!85](pc.north)   |- ([xshift= 0.3ex,color=green!80]scalep.south east);
        %For X
        \path (X.south) ++ (0,-1.5em) node[anchor=north west,color=cyan!67] (mean){\textbf{claim for X value to be paid by insurer}};
        \draw [color=blue!57](X.south) |- ([xshift=-0.3ex,color=cyan]mean.south east);
\end{tikzpicture}

 \vspace{4\baselineskip}
\end{wrapfigure}

相关内容