Tufte 讲义页码问题

Tufte 讲义页码问题

我正在使用tufte-handout,但我的工作示例将每个页码列为 0。我该如何解决这个问题?

\documentclass{tufte-handout}
\usepackage{xeCJK}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{marvosym}
\usepackage{stmaryrd}\usepackage{gb4e}

\makeatletter
\renewcommand\@footnotetext[2][0pt]{%
\@noftnotefalse\setcounter{fnx}{0}% added by gb4e
\marginpar{%
\hbox{}\vspace*{#1}%
\def\baselinestretch {\setspace@singlespace}%
\reset@font\footnotesize%
\@tufte@margin@par% use parindent and parskip settings for marginal text
\vspace*{-1\baselineskip}\noindent%
\protected@edef\@currentlabel{%
   \csname p@footnote\endcsname\@thefnmark%
}%
\color@begingroup%
   \@makefntext{%
     \ignorespaces#2%
   }%
 \color@endgroup%
 }%
 \@noftnotetrue% added by g4be
 }%
 \makeatother

 \newcommand\blfootnote[1]{\begingroup%
 \addtolength{\parsep}{1ex}
 \renewcommand\thefootnote\relax\footnote{#1}%
 \addtocounter{footnote}{-1}%
 \endgroup%
  }

 \title{Title}

 \author[Author Authors]{Author Authors}
 \date{}

 \begin{document}

 \maketitle

 \section{Introduction}

 \pagebreak
 \section{First Section}

 \pagebreak

 \section{Second Section}

 \end{document}

答案1

此代码使用egreg 的回答添加使用 XeLaTeX 的字母间距选项所需缺失的代码(当使用 XeLaTeX 时)。

A

% !TeX TS-program = xelatex

\documentclass{tufte-handout}
\usepackage{xeCJK}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{marvosym}
\usepackage{stmaryrd}
\usepackage{gb4e}

\makeatletter
\renewcommand\@footnotetext[2][0pt]{%
    \@noftnotefalse\setcounter{fnx}{0}% added by gb4e
    \marginpar{%
        \hbox{}\vspace*{#1}%
        \def\baselinestretch {\setspace@singlespace}%
        \reset@font\footnotesize%
        \@tufte@margin@par% use parindent and parskip settings for marginal text
        \vspace*{-1\baselineskip}\noindent%
        \protected@edef\@currentlabel{%
            \csname p@footnote\endcsname\@thefnmark%
        }%
        \color@begingroup%
        \@makefntext{%
            \ignorespaces#2%
        }%
        \color@endgroup%
    }%
    \@noftnotetrue% added by g4be
}%
\makeatother

\usepackage{kantlipsum}% ONLY dummy text <<<<<<<<<<<<<<<<

%************************************** added <<<<<<<<<
%From https://tex.stackexchange.com/a/200725/161015
\ifxetex% <<<<<<<<<<<<<<<<<<
\newcommand{\textls}[2][5]{%
    \begingroup\addfontfeatures{LetterSpace=#1}#2\endgroup
}
\renewcommand{\allcapsspacing}[1]{\textls[15]{#1}}
\renewcommand{\smallcapsspacing}[1]{\textls[10]{#1}}
\renewcommand{\allcaps}[1]{\textls[15]{\MakeTextUppercase{#1}}}
\renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{#1}}}
\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}}
\fi
%**************************************

\newcommand\blfootnote[1]{\begingroup%
    \addtolength{\parsep}{1ex}
    \renewcommand\thefootnote\relax\footnote{#1}%
    \addtocounter{footnote}{-1}%
    \endgroup%
}

\title{Title}

\author[Author Authors]{Author Authors}
\date{}

\begin{document}
    
    \maketitle
    \clearpage  
        
    \section{Introduction}  
    \kant[1-4]  
    \pagebreak
    
    \section{First Section}
    \kant[1-4]  
    \pagebreak
    
    \section{Second Section}    
    \kant[1-4]
    
\end{document}

相关内容