josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.35k stars 139 forks source link

How to display the \date command in a slide? not in a titlepage #833

Closed ouboub closed 1 year ago

ouboub commented 1 year ago

Hi to my surprise

\begin{document}
\begin{frame}[<+->]
  \frametitle{Test date}
The date \date{07-02-2023}
\end{frame}
\end{document}

did not show the date, what do I miss (google did not help) Uwe Brauer

samcarter commented 1 year ago

The \date{....} macro is to set the date. To insert it in your presentation, you can use \insertdate (or \insertshortdate) (note that these macro have no argument)

\documentclass{beamer}

\date{07-02-2023}

\begin{document}
\begin{frame}[<+->]
  \frametitle{Test date}
The date \insertdate
\end{frame}
\end{document}
ouboub commented 1 year ago

Thanks, the only problem with this solutions is: if one wants to insert several different dates Like:

  1. meeting \date{01.01.2020}
  2. meeting \date{02.02.2020}

then that seems to fail (BTW, I could no find your solution in the manual, but maybe I should update the manual)

samcarter commented 1 year ago

If you'd like to insert several different dates, I don't think \date/\insertdate is the appropriate way. This is really meant to store the date of the presentation for reuse in the titlepage, footlines etc.

You could directly type the date as normal text or, if you'd like fancy formatting, have a look at the datetime2 package.

samcarter commented 1 year ago

(BTW, I could no find your solution in the manual, but maybe I should update the manual)

\insertdate is documented in section "10.1 Adding a Title Page" of the beamer user guide

ouboub commented 1 year ago

ok