termcal:上标 st、nd、th

termcal:上标 st、nd、th

我希望日期的 st、nd 和 th 像这样上标:

第22

我该怎么做?

平均能量损失

\documentclass{article}
\usepackage{termcal}

\newcommand{\WFClass}{%
\skipday % Monday (no class)
\skipday % Tuesday (no class)
\calday[Wednesday]{\classday} % Wednesday
\skipday % Thursday (no class)
\calday[Friday]{\classday} % Friday 
\skipday\skipday % weekend (no class)
}

\newcommand{\Holiday}[2]{%
\options{#1}{\noclassday}
\caltext{#1}{#2}
}


\begin{document}
\begin{center}
\begin{calendar}{1/20/2020}{16} % Date Classes Begin & Length in Weeks
\setlength{\calboxdepth}{.3in}
\WFClass
% schedule
%\caltexton{1}{1.1, 1.2 Review}
\caltextnext{1.3, 1.4 Review}
\caltextnext{2.1, 2.2 Linear Equations}
% ... and so on

% Holidays
\Holiday{1/20/2020}{Martin Luther King Day}
\Holiday{3/8/2020}{Spring Break}
% ... and so on

\options{4/26/2020}{\noclassday} % finals week
\options{4/27/2020}{\noclassday} % finals week
\options{4/28/2020}{\noclassday} % finals week
\options{4/29/2020}{\noclassday} % finals week
\options{4/30/2020}{\noclassday} % finals week
\caltext{4/27/2020}{\textbf{Final Exam}}
\end{calendar}
\end{center}
\end{document}

答案1

您可以使用\textsuperscript(但您不应该;上标是维多利亚时代的遗物,是一个著名的文字处理器任意强加给所有用户的)。

\documentclass{article}
\usepackage{termcal}

\makeatletter
\renewcommand\@rdend[1]{\textsuperscript{\ifcase#1 th\or st\or nd\or rd\else th\fi}}
\makeatother


\newcommand{\WFClass}{%
\skipday % Monday (no class)
\skipday % Tuesday (no class)
\calday[Wednesday]{\classday} % Wednesday
\skipday % Thursday (no class)
\calday[Friday]{\classday} % Friday 
\skipday\skipday % weekend (no class)
}

\newcommand{\Holiday}[2]{%
\options{#1}{\noclassday}
\caltext{#1}{#2}
}


\begin{document}
\begin{center}
\begin{calendar}{1/20/2020}{16} % Date Classes Begin & Length in Weeks
\setlength{\calboxdepth}{.3in}
\WFClass
% schedule
%\caltexton{1}{1.1, 1.2 Review}
\caltextnext{1.3, 1.4 Review}
\caltextnext{2.1, 2.2 Linear Equations}
% ... and so on

% Holidays
\Holiday{1/20/2020}{Martin Luther King Day}
\Holiday{3/8/2020}{Spring Break}
% ... and so on

\options{4/26/2020}{\noclassday} % finals week
\options{4/27/2020}{\noclassday} % finals week
\options{4/28/2020}{\noclassday} % finals week
\options{4/29/2020}{\noclassday} % finals week
\options{4/30/2020}{\noclassday} % finals week
\caltext{4/27/2020}{\textbf{Final Exam}}
\end{calendar}
\end{center}
\end{document}

在此处输入图片描述

我不确定为什么左栏会产生过满的框。

相关内容