雜項觀察:

雜項觀察:

我正在使用課程準備秋季課程文件tufte-handout,並且我想使用termcal.所以我這樣做:

\documentclass{tufte-handout}
\usepackage{fontspec}
\usepackage{termcal}

\defaultfontfeatures{Mapping=tex-text}

  \renewcommand{\allcapsspacing}[1]{{\addfontfeature{LetterSpace=20.0}#1}}
      \renewcommand{\smallcapsspacing}[1]{{\addfontfeature{LetterSpace=5.0}#1}}
      \renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}}
\renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{#1}}}

\renewcommand{\calprintclass}{}

\title{Course overview}
\author{English 220}
\date{Fall 2017}

    \begin{document}

        \maketitle

        \begin{fullwidth}

            \setlength{\calwidth}{6in}
            \begin{calendar}{9/4/17}{10}

                \calday[Monday]{\classday} % Monday
                \calday[Tuesday]{\classday} % Wednesday
                \calday[Wednesday]{\classday}
                \calday[Thursday]{\classday} % Thursday (unnumbered)
                \calday[Friday]{\classday} % Friday
                \skipday\skipday % weekend (no class)
                % Holidays
                \options{9/21/17}{\noclassday}
                \caltext{9/21/17}{No Class\\Rosh Hashanah}

                % Key dates

                \caltext{9/5/17}{Introductions}

                \caltext{9/18/17}{Bring to class \emph{TOTC} \& \emph{The Passion}}

                % Exams
                \caltext{9/15/17}{Review test on 9th grade grammar \& vocab}
                \caltext{9/29/17}{Quiz on vocab list 7}
                \caltext{10/20/17}{Quiz on vocab lists 7--8}
                \caltext{10/27/17}{Quiz on adj. \& adv. clauses}



            \end{calendar}
        \end{fullwidth}
    \end{document}

輸出很奇怪。我想發布一張圖片,但由於某種原因,我現在無法實現這一點(按照那部戲劇這裡如果你好奇的話),所以我必須描述它。

  • 日曆中的第一個日期是正確的(9 月 4 日);隨後的日期為 10 月 -25 日、11 月 -55 日、12 月 -84 日、1 月 -114 日,依此類推。 (是的,日期是負數。)
  • Sep. 4 的儲存格也包含表達式「Fall 2017>30」。第二個單元格(10 月 -25 日)包含“Fall 2017>31”,依此類推。

所以看起來termcal線路有問題

\date{Fall 2017}

雜項觀察:

  • 如果我將該行更改為\date{},我會收到一堆錯誤訊息,並且標題列中沒有日期行,但日曆顯示正確。
  • 如果我完全刪除日期行,標題列將包含今天的日期(我不想要),但日曆會正確顯示。
  • 如果我將文檔類別更改為article,問題就完全消失了。

date有沒有一種方法可以像我通常使用的方式使用該命令並且仍然可以termcal正常工作?還是這個包與這個文檔類別不相容?

答案1

怪罪termcaltufte-common.def--定義和使用\thedate;-)

tufte-common.def\thedate使用其參數進行設定\date是一個壞主意,因為\the...巨集通常應僅用於計數器輸出。

termcal定義了一個名為 的新計數器date,這意味著 的自動定義\thedate,但是,這是透過 完成的\gdef\thedate{...},並用 覆蓋舊定義tufte-common.def

實際上,tufte-common.def這是在做一些設計不當的事情。

一個解決方案,而不是改變 的明顯正確行為,是在開始行動之前termcal獲取\date由 設計的原始命令,說 with並說而不是,這會搞砸系統。LaTeX\documentclass\let\latexdate\date\latexdate{Fall 2017}\date{Fall 2017}

\let\latexdate\date

\documentclass{tufte-handout}
\usepackage{fontspec}
\usepackage{termcal}

\defaultfontfeatures{Mapping=tex-text}

\renewcommand{\allcapsspacing}[1]{{\addfontfeature{LetterSpace=20.0}#1}}
\renewcommand{\smallcapsspacing}[1]{{\addfontfeature{LetterSpace=5.0}#1}}
\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}}
\renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{#1}}}

\renewcommand{\calprintclass}{}

\title{Course overview}
\author{English 220}
\latexdate{Fall 2017}

\begin{document}

\maketitle

\begin{fullwidth}

  \setlength{\calwidth}{6in}
  \begin{calendar}{9/4/17}{10}

    \calday[Monday]{\classday} % Monday
    \calday[Tuesday]{\classday} % Wednesday
    \calday[Wednesday]{\classday}
    \calday[Thursday]{\classday} % Thursday (unnumbered)
    \calday[Friday]{\classday} % Friday
    \skipday\skipday % weekend (no class)
    % Holidays
    \options{9/21/17}{\noclassday}
    \caltext{9/21/17}{No Class\\Rosh Hashanah}

    % Key dates

    \caltext{9/5/17}{Introductions}

    \caltext{9/18/17}{Bring to class \emph{TOTC} \& \emph{The Passion}}

    % Exams
    \caltext{9/15/17}{Review test on 9th grade grammar \& vocab}
    \caltext{9/29/17}{Quiz on vocab list 7}
    \caltext{10/20/17}{Quiz on vocab lists 7--8}
    \caltext{10/27/17}{Quiz on adj. \& adv. clauses}



  \end{calendar}
\end{fullwidth}
\end{document}

更好的版本,重新定義\date取決於 termcal 是否已載入

\documentclass{tufte-handout}
\usepackage{fontspec}
\usepackage{termcal}

\makeatletter
\providecommand\tuftedate{}
\@ifpackageloaded{termcal}{%
  \renewcommand{\date}[1]{%
    \gdef\@date{#1}%
    \begingroup%
    % TODO store contents of \thanks command
    \renewcommand{\thanks}[1]{}% swallow \thanks contents
    \protected@xdef\tuftedate{#1}%
    \endgroup%
  }{%
    % Do nothing else, there's no need to redefine \date
  }
}
\makeatother
\defaultfontfeatures{Mapping=tex-text}

\renewcommand{\allcapsspacing}[1]{{\addfontfeature{LetterSpace=20.0}#1}}
\renewcommand{\smallcapsspacing}[1]{{\addfontfeature{LetterSpace=5.0}#1}}
\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}}
\renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{#1}}}

\renewcommand{\calprintclass}{}

\title{Course overview}
\author{English 220}
\date{Fall 2017}

\begin{document}
\maketitle

\begin{fullwidth}

  \setlength{\calwidth}{6in}
  \begin{calendar}{9/4/17}{10}

    \calday[Monday]{\classday} % Monday
    \calday[Tuesday]{\classday} % Wednesday
    \calday[Wednesday]{\classday}
    \calday[Thursday]{\classday} % Thursday (unnumbered)
    \calday[Friday]{\classday} % Friday
    \skipday\skipday % weekend (no class)
    % Holidays
    \options{9/21/17}{\noclassday}
    \caltext{9/21/17}{No Class\\Rosh Hashanah}

    % Key dates

    \caltext{9/5/17}{Introductions}

    \caltext{9/18/17}{Bring to class \emph{TOTC} \& \emph{The Passion}}

    % Exams
    \caltext{9/15/17}{Review test on 9th grade grammar \& vocab}
    \caltext{9/29/17}{Quiz on vocab list 7}
    \caltext{10/20/17}{Quiz on vocab lists 7--8}
    \caltext{10/27/17}{Quiz on adj. \& adv. clauses}



  \end{calendar}
\end{fullwidth}
\end{document}

在此輸入影像描述

相關內容