我想隱藏第一列(封面頁)上的列號。
我使用了以下程式碼: 堆疊交換答案
\documentclass[paper=A3, landscape]{scrartcl}
\usepackage{multicol}
\usepackage{blindtext}
\usepackage{everypage}
\newcounter{column}
\AddEverypageHook{\ifdim\columnwidth<\textwidth
\ifodd\value{page}\rlap{\hspace{\oddsidemargin}%
\raisebox{\dimexpr-\topmargin-\headheight-\headsep-\textheight- 0.5\footskip}[0pt][0pt]%
{\makebox[\columnwidth]{\stepcounter{column}\thecolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\thecolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\thecolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\thecolumn}}}%
\else\rlap{\hspace{\evensidemargin}%
\raisebox{\dimexpr-\topmargin-\headheight-\headsep-\textheight-0.5\footskip}[0pt][0pt]%
{\makebox[\columnwidth]{\stepcounter{column}\thecolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\thecolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\thecolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\thecolumn}}}%
\fi%
\fi}
\begin{document}
\begin{multicols}{4}
\blinddocument{} \blindtext
\end{multicols}
\end{document}
我已經嘗試過
\thispagestyle{empty}
但它不起作用。
答案1
您可以使用僅在計數器不同於 1\thecolumn
時才會產生結果的命令來代替。column
\tehcolumn
\documentclass[paper=A3, landscape]{scrartcl}
\usepackage{multicol}
\usepackage{blindtext}
\usepackage{everypage}
\newcounter{column}
\newcommand\tehcolumn{\ifnum\value{column}=1 \else\thecolumn\fi}
\AddEverypageHook{\ifdim\columnwidth<\textwidth
\ifodd\value{page}\rlap{\hspace{\oddsidemargin}%
\raisebox{\dimexpr-\topmargin-\headheight-\headsep-\textheight- 0.5\footskip}[0pt][0pt]%
{\makebox[\columnwidth]{\stepcounter{column}\tehcolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\tehcolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\tehcolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\tehcolumn}}}%
\else\rlap{\hspace{\evensidemargin}%
\raisebox{\dimexpr-\topmargin-\headheight-\headsep-\textheight-0.5\footskip}[0pt][0pt]%
{\makebox[\columnwidth]{\stepcounter{column}\tehcolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\tehcolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\tehcolumn}\hspace{\columnsep}%
\makebox[\columnwidth]{\stepcounter{column}\tehcolumn}}}%
\fi%
\fi}
\begin{document}
\begin{multicols}{4}
\blinddocument{} \blindtext
\end{multicols}
\end{document}