
私はクラスを使用して秋学期のコース資料を準備しており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 日、などです (はい、日付は負の数です)。
- 9 月 4 日のセルには、「Fall 2017>30」という表現も含まれています。2 番目のセル (10 月 -25 日) には、「Fall 2017>31」などが含まれています。
termcal
どうやら回線に問題があるようだ
\date{Fall 2017}
その他の観察事項:
- その行を に変更すると
\date{}
、多数のエラー メッセージが表示され、タイトル ブロックに日付行が表示されなくなりますが、カレンダーは正しく表示されます。 - 日付行を完全に削除すると、タイトル ブロックに今日の日付 (これは不要) が含まれますが、カレンダーは正しく表示されます。
- ドキュメント クラスを に変更すると
article
、問題は完全に解消されます。
date
通常の方法でコマンドを使用しても、正常に動作する方法はありますかtermcal
? または、このパッケージはこのドキュメント クラスと互換性がないだけでしょうか?
答え1
非難するtermcal
かtufte-common.def
、または定義して使用するか\thedate
;-)
tufte-common.def
マクロは通常、カウンター出力にのみ使用されるため\thedate
、引数を使用して設定するの\date
は良い考えではありません。\the...
termcal
は という名前の新しいカウンタを定義しますdate
。これは の自動定義を意味します\thedate
が、これは を使用して行われ\gdef\thedate{...}
、 によって古い定義が上書きされますtufte-common.def
。
実際のところ、tufte-common.def
ここでは何か不適切な設計が行われています。
解決策としては、 の明らかに適切な動作を変更するのではなく、 が動作する前に によって設計された元のコマンドtermcal
を取得し、の代わりにと を使用することですが、これではシステムが台無しになります。\date
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}