
수업을 이용하여 가을학기 강의자료를 준비하고 있는데 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"이라는 표현도 포함되어 있습니다. 두 번째 셀(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}