Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win系统编译错误 #5

Closed
ghost opened this issue Dec 26, 2019 · 4 comments
Closed

win系统编译错误 #5

ghost opened this issue Dec 26, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 26, 2019

从网站下载的BHCexam文件放到测试文件同一目录下,编译报错,删掉所有的wget部分,依然无法运行.
经过测试查错,终于运行成功,故特列出以下几个可能的问题:

  1. win系统需要加上选项windows
\documentclass[a4paper,windows]{BHCexam}
  1. 在win系统下只能用xelatex编译,且文件名不能为中文;
  2. 部分数学环境中的符号为中文符号;运行后可能无法正确显示(如|等)
@mathedu4all
Copy link
Owner

mathedu4all commented Dec 26, 2019

  1. 调用外部 wget 命令, 需要正确安装wget, 并把wget路径添加到系统PATH. 另外编译时需使用 xelatex 并添加参数 --shell-escape.

  2. 至于中文文件名是否可以编译成功,视具体系统环境而定,我的win10系统是支持中文文件名的, 具体还是看报错指令提示.

  3. 网站默认使用adobe字体, 如果没有安装adobe字体就会报错,正如你所提到的,可以改用windows字体.

  4. 至于数学环境中的中文符号问题, 可以认领相关试题进行编辑修正后,再重新下载试卷.

@ghost
Copy link
Author

ghost commented Dec 26, 2019

  1. 同为win10系统,文件名为中文时用xelatex编译会提示无法编译,根据百度检索结果应该为中文编码问题,放弃;
  2. wget按照提示安装,2019年全国III卷运行成功(修改了部分题目的错误);
  3. \maketitle 报错:Undifined control sequence,但是PDF有对应显示标题

@mathedu4all
Copy link
Owner

  1. 同为win10系统,文件名为中文时用xelatex编译会提示无法编译,根据百度检索结果应该为中文编码问题,放弃;
  2. wget按照提示安装,2019年全国III卷运行成功(修改了部分题目的错误);
  3. \maketitle 报错:Undifined control sequence,但是PDF有对应显示标题

网站系统的后台编译环境就是ubuntu 18.04 + texlive2019 + bhcexam v1.0, 目前未出现除试题原因外造成的编译错误, windows环境的编译我会在今后继续跟进.

当然, 为了让我们能重现你所遇到的问题,你需要提供一个MWE( Minimal Working Examples ). 并在一个issue中指出一个BUG或者问题.

@ghost ghost closed this as completed Dec 27, 2019
@ghost ghost reopened this Dec 27, 2019
@ghost
Copy link
Author

ghost commented Dec 27, 2019

路径问题解决了!
百度搜到的原因大概如下:win系统中文编译方式为gbk,texlive支持的是utf-8,部分中文无法正确转换所以报错。
所以我们只需要修改win系统的编码方式即可,win10系统中打开设置-时间和语言-语言,点击右侧管理语言设置

1

点击更改系统语言区域设置,选择中文(简体,中国),勾选下面的Beta
2

点击确定后系统会要求重新启动,重启后即可编译中文路径下的.tex文件了

@ghost ghost closed this as completed Dec 27, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant