可能存在错误?\makeatletter 导致某些页面缺少背景

可能存在错误?\makeatletter 导致某些页面缺少背景
\documentclass[12pt, a4paper, UTF8, scheme = plain, twoside]{ctexart}
\usepackage{lipsum}
\usepackage{amsmath,enumerate}
\usepackage[margin = 2cm]{geometry}
\usepackage{adjustbox}
\usepackage{fancyhdr}
\usepackage{totpages}
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyfootoffset[R]{-2.28cm}
\usepackage{pdfpages}
\usepackage{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\renewcommand\tableofcontents{
    \@starttoc{toc}
}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[type={CC}, modifier={by-nc-nd}, version={4.0} ]{doclicense}
\usepackage{tcolorbox}
\tcbuselibrary{skins,xparse}
\tcbset{%
    colback      = white,
    colframe     = black,
    title filled = false
}
\NewTColorBox[
    auto counter,
    number freestyle =  { Q\noexpand\arabic{\tcbcounter} }
    ]{question}{ O{}mo }{
    lowerbox         =  ignored, %invisible/ignored
    fonttitle        =  \bfseries,
    title            =  \thetcbcounter: #2,
% after title/after upper
    after title      =  {\hfill Page~\label{tb\thetcbcounter}\pageref{tb\thetcbcounter}\ of~\pageref{TotPages}},
    #1
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\mytopic}[1]{%%%%%%%%%%%%%%%%%%%
    \begin{question}{ Test }
        #1
    \end{question}
}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\parindent}{0pt}
%%%%% QR
\usepackage{qrcode}
\usepackage{background}
\backgroundsetup{
    contents  = {\qrcode[hyperlink,height=2cm]{http://www.latex.earth}},
    pages     = all,
    placement = bottom,
    color     = black,
    scale     = 1,
    opacity   = 0.5,
    hshift    = 9cm,
    vshift    = 0.5cm
}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\clearpage
\thispagestyle{empty}
\tableofcontents
\newgeometry{top=0.5cm,left=1.5cm,right=0.5cm,bottom=2.28cm}
\lipsum[7]
\pagestyle{fancy}%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lipsum[8]
%%%%%\input{chap1.tex}
\mytopic{\lipsum[1]}
\mytopic{\lipsum[2]}
\mytopic{\lipsum[3]}
\section{111111}
\mytopic{\lipsum[4-5]}
\mytopic{\lipsum[8]}
%% \lipsum[6]
\mytopic{\lipsum[10]}
\mytopic{\lipsum[1]}
\lipsum[9]
\normalsize%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newgeometry{top=0.5cm,left=0.5cm,right=0.5cm,bottom=2.28cm}
\lipsum[7-13]
\newgeometry{margin = 2cm}
\lipsum[1-6]
\clearpage
\mytopic{\lipsum[3]}
\mytopic{\lipsum[4-5]}
\mytopic{\lipsum[8]}
\mytopic{\lipsum[10]}
\mytopic{\lipsum[1]}
\section{33333333}
\mytopic{\lipsum[8]}
\mytopic{\lipsum[4-5]}
\mytopic{\lipsum[3]}
\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{empty}%%%%%%%%%%%%%%%%%%%%%%%%%%%
\centering%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vspace*{\fill}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\huge [THIS PAGE IS INTENTIONALLY LEFT BLANK.]}
\vspace*{\fill}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

此代码与 QR(背景)产生了一些问题,如下所示:

enter image description here enter image description here

在某些页面上,这没问题,但在其他一些页面上,则不然。

我发现如果我注释掉这些行

\makeatletter
\renewcommand\tableofcontents{
    \@starttoc{toc}
}
\makeatother

我曾经修复过tableofcontents。然后它又正常工作了……

为什么?我该如何解决这个问题,但这个问题却一直没有显示Contents出来?

更新:2022 年 12 月 14 日 有人建议改用article类,但我在多次编译时遇到了同样的问题......

这可能是 MikTeX 发行版的一个错误吗?

如果我也发布日志会有帮助吗?

有人有任何线索吗?

相关内容