LaTex使用minted包报错(亲测可行!) Package minted Error: You must invoke LaTeX with the -shell-escape flag.

使用TexStudio软件进行文档的编译时,提示错误信息如下:

Package minted Error: You must invoke LaTeX with the -shell-escape flag.

其实,我们从上述报错信息中很容易得知,只需在使用LaTex时调用-shell-escape就能避免报错信息的出现,那么如何解决呢?

方法1:

1.打开菜单栏的“选项->设置TexStudio;

2. 在左栏中选择“构建”,在右栏的“用户命令”框中,点击“添加”;

3. 新出现一行中,左框任意填,右框填写以下代码,并保存设置;

xelatex.exe -synctex=1 -interaction=nonstopmode --shell-escape %.tex

4. 编译文件时,选择菜单栏的“工具->用户->你的命令名称”;

5. 点击工具栏的放大镜图标即可查看生成pdf文件。

如下图所示:

但方法1每次调用时都需要按照“工具->用户->用户命令”才能正确编译文件,直接使用“构建并查看”仍然无法成功编译。 推荐使用方法2!

 方法2:

1.打开菜单栏的“选项->设置TexStudio;

2. 在左栏中选择“命令”,在右栏的“XeLaTex”框中,添加“-shell-escape”;(注意:我在左栏的“构建”中选择的默认编译器是XeLatex,如果你使用pdfLaTex等其它编译器,就在对应的编译器框中添加“-shell-escape”);

3. 点击保存设置;

4. 即可正常构建并查看tex文件。

 

  • 6
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
对于您的问题,"E: Unable to locate package sdl2"表示在Ubuntu 22.04上找不到sdl2软件。这可能是因为sdl2软件不在默认的Ubuntu软件源中。要解决该问题,您可以尝试以下方法: 方法1: 1. 确保您的软件源已更新。可以使用以下命令更新软件源: ``` sudo apt update ``` 2. 然后尝试重新安装sdl2软件: ``` sudo apt install sdl2 ``` 方法2: 1. 检查您是否已将适当的软件源添加到您的系统。您可以编辑`/etc/apt/sources.list`文件,并确保已添加含sdl2软件的软件源。例如,您可以添加以下行: ``` deb http://archive.ubuntu.com/ubuntu xenial main universe ``` 2. 更新软件源并尝试重新安装sdl2软件: ``` sudo apt update sudo apt install sdl2 ``` 如果以上方法都无法解决问题,您还可以尝试从其他来源手动安装sdl2软件。您可以从sdl2的官方网站或其他可信的软件源下载并安装sdl2软件。请确保您从可信的来源下载软件,并按照提供的安装说明进行操作。 : http://stackoverflow.com/questions/11401079/makeinfo-package-missing-in-ubuntu-12-04 : root@Ubuntu32:/home/zhangbin/ffmpeg/ffmpegx86/ffmpeg-1.2# apt-get install texi2html Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: latex2html The following NEW packages will be installed: texi2html 0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded. Need to get 401 kB of archives. After this operation, 1,851 kB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main texi2html all 1.82-1ubuntu1 [401 kB] Fetched 401 kB in 2s (171 kB/s) Selecting previously unselected package texi2html. (Reading database ... 211335 files and directories currently installed.) Unpacking texi2html (from .../texi2html_1.82-1ubuntu1_all.deb) ... Processing triggers for install-info ... Processing triggers for man-db ... Processing triggers for doc-base ... Processing 1 added doc-base file... Setting up texi2html (1.82-1ubuntu1) ... : dtc下载地址:git.qemu-project.org/?p=dtc.git;a=snapshot;h=1760e7ca03894689118646e229ca9487158cd0e8;sf=tgz

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值