有人能找到代码中的错误吗?每次我编译它时,它都会给出一个失控错误消息,然后紧急停止。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[sc]{mathpazo}
\usepackage{amsmath,amssymb,amsfonts,mathrsfs}
\usepackage[amsmath,thmmarks]{ntheorem}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{geometry}
\usepackage{booktabs,makecell,longtable}
\usepackage{lipsum}
\usepackage{pdfpages}
\usepackage{balance}
\usepackage{lastpage}
\usepackage{amsmath,bm}
\usepackage{textcomp}
\usepackage{subeqnarray}
\usepackage{float}
\usepackage{mathtools}
\usepackage{cite}
\usepackage[export]{adjustbox}
\usepackage{etoolbox}
\usepackage{enumitem}
\usepackage{lmodern}
\usepackage[labelfont=bf,font=sf,labelsep=space]{caption}
\usepackage{mathpazo}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\pgfkeys{/pgf/number format/.cd,1000 sep={}}
\newcommand{\myfont}{\fontfamily{cmss}\selectfont}% used with mathpazo
\DeclareMathOperator{\Tr}{Tr}
\setcounter{tocdepth}{2}
\pgfplotsset{compat=1.5.1}
\pgfplotsset{label style={font=\Large},
tick label style={font=\Large}}
\pgfplotsset{error bars/.cd,
x dir=both, x explicit,
y dir=both, y explicit,
}
\pgfplotsset{/pgfplots/error bars/error bar style={semithick,black}}
%\pgfplotsset{/pgfplots/label shift={0pt}}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
xmode=log,
ymode=normal,
enable tick line clipping=false,
axis line style=semithick,
width=9cm,
height=7cm,
legend image post style={mark options={scale=1}},
legend style={at={(0.95,0.9)},draw=none,
legend style={row sep=1pt},
legend style={column sep=3pt}},
legend cell align={left},
x tick style={black,semithick},
x label style=
{at={(ticklabel cs:0.5)},anchor=near ticklabel},
xlabel={{$\dot{\epsilon}_n$} [{\myfont s$^{-1}$}]},
xmin=0.05,xmax=2000,
xtick={0.1,1,10,100,1000},
xtick pos=bottom,
minor x tick num=9,
xtick align=outside,
y tick style={black,semithick},
y label style=
{at={(ticklabel cs:0.5)},anchor=near ticklabel},
ylabel={{$E$} [{\myfont GPa}]},
ymin=0,ymax=5,
ytick={0,1,...,5},
ytick pos=left,
ytick align=outside,
]
\addplot [black,only marks,mark=*,mark options={scale=1.5,fill=white}]
table [x=x, y=y, y error=ey] {
x y ey
0.1 89.4 5.9
1 88.16 3.75
10 79.43 2.61
100 84.39 5.26
1000 86.18 7.19
};
\addlegendentry{\myfont machine direction}
\addplot [black,only marks,mark=square*,mark options={scale=1.5,thick,fill=white] table [x=x, y=y, y error=ey] {
x y ey
0.1 101.72 12.04
1 114.03 6.45
10 82.07 0.6
100 103.66 8.56
1000 91.28 7.61
};
\addlegendentry{\myfont transverse direction}
\addplot [black,dashed,semithick] table [x=x, y=y] {
x y
0.05 2.1
2000 2.1
};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
答案1
错误信息是
Runaway argument?
black,only marks,mark=square*,mark options={scale=1.5,thick,fill=whit\ETC.
并搜索你找到的文本
\addplot [black,only marks,mark=square*,mark options={scale=1.5,thick,fill=white]
缺少}
\addplot [black,only marks,mark=square*,mark options={scale=1.5,thick,fill=white}]
运行无错误。