MiKTeX / miktex

the MiKTeX source code
https://miktex.org
Other
804 stars 95 forks source link

error of the exam-zh package with option -shell-escape with MikTeX 24.1 but not in TeXLive2024 #1528

Closed Explorer-cc closed 2 months ago

Explorer-cc commented 2 months ago

I attempted to use the package exam-zh to achieve the "teacher-student-two-styles", which in the docs it needs the compile option --shell-escape, which can produce one pdf file for teacher with answer, and another pdf file for students without answer.

A MWE is as below:

\documentclass{exam-zh}
\examsetup{
    page/size=a4paper,
    paren/show-paren=true,
    paren/show-answer=true,
    fillin/show-answer=true,
    question/show-points=true,
}
\ExamPrintAnswerSet{
    paren/show-answer=false,
    fillin/show-answer=false,
}
\title{2021-2022学年第一学期四年级上册语文期末模拟测试卷}

\begin{document}

    \secret

    \maketitle

    \begin{center}
        本试卷共 4 页,31 题。全卷满分 100 分。考试用时 90 分钟。

        \begin{tblr}{hlines,vlines}
            题号 & 一 & 二 & 三 & 四 & 五 & 六 & 课内阅读 & 课外阅读 & 作文 & 总分 \\
            得分 & & & & & & & & & & \\
        \end{tblr}
    \end{center}

    \begin{question}[points = 2]
        设集合 $A = \{x \mid -1 < x < 4\}$,$B = \{2, 3, 4, 5\}$,则 $A \cap B = $ \paren[B]
        \begin{choices}
        \item $\{2\}$
        \item $\{2, 3\}$
        \item $\{3, 4\}$
        \item $\{2, 3, 4\}$
        \end{choices}
    \end{question}

    \begin{question}
        已知函数 $f(x) = x^3 (a \cdot 2^x - 2^{-x})$ 是偶函数,则 $a = $ \fillin[$1$] 。
    \end{question}

\end{document}

Below is the test video and the result is shown below:

image

Is that MikTeX doesn't support the -shell-escape option or just unsuitable for the package exam-zh of v2.1 on CTAN in this case? Tks!

edocevoli commented 2 months ago

I cannot reproduce the bug with your MWE because of many font related errors, e.g., "The font "SimHei" cannot be found".

Your screenshot shows that latexmk is involved which you haven't mentioned in the description.

At the moment, I do not have enough info to work on this issue.

Explorer-cc commented 2 months ago

Sorry for late response, I'm a CJK fonts user and use the MikTeX on Windows 10 systems, this is because the exam-zh package is designed for Chinese Exam, so the xelatex or latexmk with option -xelatex is need as the docs says.

The screenshot described is actually compiled with latexmk -xelatex <filename.tex> but I didn't mention.

So? The fonts problem, is any solution to deal with it to support your computer? for the attribute of exam-zh, it's difficult for me to strip CJK fonts out to produce an MWE? Thank you most sincerely.