\ date {} in a table environment!

I would like to create a table using a table environment, and in one of the cells in my table I need to indicate the actual date. Then a sensible approach would be to use the \ date {} command, but I cannot get it to work to include the \ date {} command inside the table environment ... is this not possible?

Greetings

Karsten

+4
source share
2 answers

\date does not receive the date, sets the date of the document. If you are looking at the source code of latex.ltx , you will find:

 \def\date#1{\gdef\@date{#1}} 

So, if the document date is specified in the preamble, you can get it using \@date . Unfortunately (for you) this macro has @ , so you cannot use it directly in the text of a regular document. So you would have to put this in your preamble:

 \makeatletter \let\insertdate\@date \makeatother 

Then \insertdate is an alias \@date and inserts the date specified in the preamble into the current text.

But you also indicated the β€œactual” date, which may mean the current date since the document was compiled. This information is stored by TeX in \today .

By the way, you can find entire communities in TeX StackExchange , where the question related to TeX is too small.

+5
source

In the preamble, you can put the following:

 \usepackage{datetime} \newdateformat{bkdate}{\THEYEAR-\shortmonthname-\twodigit{\THEDAY}} 

and then print the date anywhere in the document body

 \bkdate\today 
0
source

Source: https://habr.com/ru/post/1338837/


All Articles