Forgot password
 Register account
View 168|Reply 0

\write18写入文本

[Copy link]

3156

Threads

7932

Posts

45

Reputation

Show all posts

hbghlyj posted 2023-5-7 00:47 |Read mode
在Windows命令行运行
  1. echo 123>1.txt
Copy the Code
可以往1.txt写入123 (不带引号)
可以在LaTeX中使用\write18
  1. \documentclass{article}
  2. \pagestyle{empty}
  3. \begin{document}
  4. \mbox{}
  5. \write18{echo 123>1.txt}
  6. \end{document}
Copy the Code
使用latex 1.tex --enable-write18 --shell-escape编译
可以看到1.txt写入了文本123

但若把文本123改成1
在Windows命令行运行
  1. echo 1>1.txt
Copy the Code
1.txt的内容就变成
ECHO is on.
为什么不是1呢

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-6-8 19:08 GMT+8

Powered by Discuz!

Processed in 0.019853 second(s), 25 queries

× Quick Reply To Top Edit