跑步时pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %filename%.tex
它给:
Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-error interaction=batchmode -jobname "tikzfiles/nistco2-figure0" "\def\tikzexternalrealjob{nistco2}\input{nistco2}"' did NOT result in a usable output file 'tikzfiles/nistco2-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in 'tikzfiles/nistco2-figure0.log'. If you continue now, I'll try to typeset the picture.
*-figure.log 文件仅包含
! TeX capacity exceeded, sorry [main memory size=5000000].
最小工作示例是
\documentclass[12pt,a4paper]{article}
\usepackage[left=10mm, top=15mm, right=10mm, bottom=15mm]{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{tikz}
\usepgfplotslibrary{external}
\tikzexternalize[prefix=tikzfiles/]
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot table [x=v, y=p, col sep=comma] {trt.csv};
\end{axis}
\end{tikzpicture}
\end{document}
文件trt.csv
包含大约2K-3K对坐标例如
1,1
1.1,1.2
1.213233,1.2323
您可以在以下位置找到此文件https://wdfiles.ru/d54a24
我通常使用 TeXMaker,但它在命令行中重现
pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian)
kpathsea version 6.3.1
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.01
答案1
我将分享我用来处理 R 查询统计数据库生成的 10k 到 30k 个数据点的设置。(Windows 操作系统,8192 MB 内存)
开始编辑pdflatex.ini
:
使用MikTeX
,在我的电脑中它位于
C:\Users\<user name>\AppData\Local\Programs\MikTeX\miktex\config
在其他安装中可能是C:\Programs Files\MikTeX\miktex\config
在文件开头添加(我通过反复试验找到了这些值,但我不知道是否一切都是必要的)
main_memory=230000000
save_size=79999
extra_mem_bot=79999999
extra_mem_top=79999999
font_mem_size=799999
pool_size=39999999
buf_size=29999999
EnableWrite18=p
stack-size=200000
max-strings=79999999
tikzfiles
在工作目录中创建目录并运行我的示例以获取
./tikzfiles
目录中的这些文件
%%% This is file TestExternalize.tex
% !TeX TS-program = pdflatex
\documentclass[12pt,a4paper]{article}
\usepackage[left=10mm, top=15mm, right=10mm, bottom=15mm]{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize[%
up to date check={simple},
prefix=./tikzfiles/]% Folder needs to be created before compiling
\tikzset{external/system call={%
pdflatex \tikzexternalcheckshellescape
-halt-on-error -shell-escape -interaction=batchmode
-jobname "\image" "\texsource"}}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot table [x=v, y=p, col sep=comma] {trt.csv};
\end{axis}
\end{tikzpicture}
\end{document}
检查第二次输出是否立即完成。
.log
这是文件的结尾
{C:/Users/SD/AppData/Local/MiKTeX/pdftex/config/pdftex.map} <./tikzfiles/TestExternalize-figure0.pdf>] (TestExternalize.aux) )
Here is how much of TeX's memory you used:
22489 strings out of 479321
602372 string characters out of 39607058
81007926 words of memory out of 83725312
39608 multiletter control sequences out of 15000+600000
403728 words of font info for 28 fonts, out of 799999 for 9000
1141 hyphenation exceptions out of 8191
102i,5n,103p,740b,609s stack positions out of 5000i,500n,10000p,29999999b,79999s
<C:/Users/SD/AppData/Local/Programs/MiKTeX/fonts/type1/public/amsfonts/cm/cmmi12.pfb>
<C:/Users/SD/AppData/Local/Programs/MiKTeX/fonts/type1/public/amsfonts/cm/cmr12.pfb>
Output written on TestExternalize.pdf (1 page, 266897 bytes).
PDF statistics:
25 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
18 words of extra memory for PDF output out of 10000 (max. 10000000)