代码在 Overleaf 中不起作用但在 TeXLive 中起作用

代码在 Overleaf 中不起作用但在 TeXLive 中起作用

我可以在装有 Tex Live 发行版的 TeXstudio 中毫无问题地运行以下代码。

\documentclass{article}
 \usepackage[utf8]{inputenc}
 \usepackage[european]{circuitikz}
 \usepackage{tikz}
    \usetikzlibrary{shapes, calc, intersections}
 \usepackage{pgfplots}
 \pgfplotsset{compat=1.14}
    \usetikzlibrary{pgfplots.groupplots}
 \usepackage{siunitx}
 \usepackage{amsmath}
 \usepackage{amssymb}
 \usepackage{amsfonts}
 \usepackage{subcaption}
 \renewcommand*{\j}{\mathrm{j}}
 \begin{document}
 \begin{figure}[h]
        \begin{tikzpicture}[trim axis right, remember picture]
            \begin{semilogxaxis}[
                name=mag,
                width=\linewidth,
                height=0.5\linewidth,
                ylabel=$20\log_{10}\left(|H\!(\j2\pi f)\right|)$,
                %xlabel=$f\,/\,\si{\Hz}$,
                xmin=1000, xmax=1e10,
                grid=both, minor grid style=dotted, minor y tick num = 4,
                xticklabels={}]

            \addplot [thick, name path=mag] table[x=Magnitude X, y=Magnitude Y, col sep=comma] {bode.csv};
            \draw[red, thick, name path=0dB] (axis cs:1e3,0) -- (axis cs:1e10,0);
            \path [name intersections={of=mag and 0dB,by={intmag}}] (intmag) \pgfextra{\pgfplotspointgetcoordinates{\pgfpointanchor{intmag}{center}} \xdef\myx{\pgfkeysvalueof{/data point/x}}\typeout{\myx}};
            \end{semilogxaxis}

            \begin{semilogxaxis}[
                name=phase,
                at={($(mag.south) - (0,0.05\linewidth)$)},
                anchor=north,
                width=\linewidth,
                height=0.5\linewidth,
                xmin=1000, xmax=1e10,
                xlabel=$f\,/\,\si{\Hz}$,
                ylabel=$\arg\{H(\j2\pi\omega)\}$,
                grid=both, minor grid style=dotted, minor y tick num = 4]

                \addplot [thick, name path= phase] table[x=Phase X, y=Phase Y, col sep=comma] {bode.csv};
                \draw[red, thick, name path= PM] (axis cs:1e3,0) -- (axis cs: 1e10,0) coordinate (pmend);
            \end{semilogxaxis}
            \path [draw, name intersections={of=mag and 0dB,by={intmag}}, name path=vertical] (intmag) coordinate (IM) -- (IM|-phase.south);
            \draw [latex-latex, name intersections={of=vertical and PM, by={intpm}}] (intpm) -- (intpm|-pmend) node[midway, left] {$PM$};
        \end{tikzpicture}
        \caption{Closed-loop Bode plot without Miller compensation}
    \end{figure}
\end{document}

但如果我尝试在 Overleaf 上运行它,它会失败。这是输出日志bode.csv可以被找寻到这里

相关内容