\oldstylenums 的奇怪行为

问题描述

我刚刚复制了一份乳胶文档,这是我去年所做的演示文稿(投影类),我在标题幻灯片上写了这样的日期:

\date{\oldstylenums{\today}}

我运行古文档还是可以的 -->

enter image description here

但是当我运行副本时,它告诉我,月份已被一个音符取代(?!):

enter image description here

更普遍的似乎是关于显示月份的问题,例如如果我写:

\date{\oldstylenums{1 Juillet 2021}}

它给了我:

enter image description here

有没有人知道这种有趣的行为以及如何纠正它? 提前致谢

解决方法

oldstylenums 使用另一种字体编码。您可以通过仅将其用于数字来避免该问题:

\documentclass{beamer}

\date{\oldstylenums{30} juin \oldstylenums{2021}}

\begin{document}
    
\begin{frame}
    \titlepage
\end{frame} 
    
\end{document}

或者你可以使用另一种默认使用它们的字体:

\documentclass{beamer}

\usepackage{cfr-lm}

\date{30 juin 2021}

\begin{document}
    
\begin{frame}
    \titlepage
\end{frame} 
    
\end{document}

至于你为什么在新项目中遇到这个问题? Overleaf 通常不会更改现有项目的 texlive 版本,因此您的旧项目使用 texlive 2019(或更旧)。如果您开始一个新项目,它将使用 overleaf 当前使用的 texlive 版本(目前这是已经过时的 texlive 2020)。但是,您可以在左侧边栏中的菜单中选择版本。如果您在新项目中切换回