在 LuaLaTeX 中打包 Moodle 時第一頁上的框架出現問題

在 LuaLaTeX 中打包 Moodle 時第一頁上的框架出現問題

我正在嘗試使用 Tikz 添加框架。

我的範例在此位置不起作用:

\begin{tikzpicture}[overlay, remember picture]
    \draw[line width=0.5mm] 
    ($(current page.north west) + (20mm, -10mm)$)
    rectangle
    ($(current page.south east) + (-10mm, 10mm)$);
\end{tikzpicture}

TeXStudio 中的編譯選項:

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

如何在沒有 Tikz 的情況下添加框架或如何修復它?

微量元素:

% !TeX program = lualatex
%==========================================================
\documentclass[14pt]{extarticle}
\usepackage{polyglossia}
%==========================================================
\usepackage{amsmath,amssymb}
\usepackage{unicode-math}
%==========================================================
\setdefaultlanguage[spelling=modern]{russian}
\setotherlanguage{english}
\setmonofont{Courier New}
\newfontfamily\cyrillicfonttt[Script=Cyrillic]{Courier New}[Scale=0.976]
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Times New Roman}
\newfontfamily\cyrillicfont{Times New Roman}[Scale=0.976]
\setsansfont{Arial}
\newfontfamily\cyrillicfontsf{Arial}[Scale=0.976]
\linespread{0.976}
%==========================================================
\usepackage[tracking=true]{microtype}
\microtypecontext{kerning=russian}
\usepackage[a4paper, left=25mm, right=15mm, top=20mm, bottom=20mm, headsep=0pt]{geometry}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{calc, decorations.pathmorphing}
%==========================================================
\usepackage[section]{moodle}
\moodleset{ppi=100}
%==========================================================
\begin{document}
\begin{tikzpicture}[overlay, remember picture]
    \draw[line width=0.5mm] 
    ($(current page.north west) + (20mm, -10mm)$)
    rectangle
    ($(current page.south east) + (-10mm, 10mm)$);
\end{tikzpicture}
~\vfill
\centerline{Title}
~\vfill
\thispagestyle{empty}
\newpage
\begin{quiz}{Section-1}
    \begin{numerical}[points=2]{Basic addition}
        What is $8+3$?
        \item 11
    \end{numerical}
\end{quiz}
\end{document}

答案1

moodle軟體包載入externalTi 的庫kZ. 因此,TikZ 將嘗試將tikzpicture文件中的所有 s 外部化。這可能會導致問題,特別是(但不僅)對於使用和節點tikzpicture的 s 。另請參閱overlaycurrent page這個問題

您可以透過在相關問題\tikzset{external/export next=false}之前新增以下內容來暫時停用外部化tikzpicture

\documentclass[14pt]{extarticle}

\usepackage{tikz}

\usepackage[section]{moodle}
\moodleset{ppi=100}

\begin{document}
\tikzset{external/export next=false}
\begin{tikzpicture}[overlay, remember picture]
    \draw[line width=0.5mm] 
    ([shift={(20mm, -10mm)}]current page.north west)
    rectangle
    ([shift={(-10mm, 10mm)}]current page.south east);
\end{tikzpicture}
~\vfill
\centerline{Title}
~\vfill
\thispagestyle{empty}
\newpage
\begin{quiz}{Section-1}
    \begin{numerical}[points=2]{Basic addition}
        What is $8+3$?
        \item 11
    \end{numerical}
\end{quiz}
\end{document}

在此輸入影像描述

相關內容