\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}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This code produces some problem with the QR (background) as shown:
On some pages, it's fine, but on some others, it's not.
I have found that if I comment out these lines
\makeatletter
\renewcommand\tableofcontents{
\@starttoc{toc}
}
\makeatother
where I used to fix the tableofcontents
. Then it works fine again...
Why? How can I fix this while keep not showing Contents
itself?
Update: 14 Dec 2022
Some have suggested that to use article
class instead, but I got the same problem with multiple compilations...
Is this possibly a bug from MikTeX distribution?
Would that help if I post the log as well?
Anyone got any clues?