I want to create a timeline that is based on years, but I don't want to handle a mix of negative and positive numbers (i.e. BC/AD which gives us this year as 2016 and 4032 years ago is also year 2016).

My problem is that if I set the starting year sufficiently far back to always count forward, then the number of years will become ridiculously big. For example, lets say that I want to include the dinosaurs, then the current year would be many millions. So the solution is obviously to always count backward from present time, but this turns out to be more difficult that I thought when it comes to implementation.

There is an accepted timeline called "Before Present", or BP, that starts in 1950 AD because they usually talk about older things. But if you use this way to count, then the year 1951 AD becomes -1 BP, which brings back the problem of negative time.

LaTeX already includes the command \today, which gives the present time. But if I define a new way to count time then \today minus 5 will be a different year next year. So the time should update continually.

Datetime2 package

There are lots of different era's used around the world, not just BC/AD. For example, the Thai use buddist era which gives us the current year as 2560 BE, not 2017 AD. It would be great to be able to handle these types of dates too.

There is a package called datetime2 that handles creating new styles of date and time, and it has multilingual support that may be able to support different types of eras, I guess? Documentation is available here: http://ctan.megagod.net/tex-archive/macros/latex/contrib/datetime2/datetime2.pdf.

My problem is that I can't figure out how to put that code together to handle my issues. They provide the \DTMnewdatestyle command, which is suggested to be used like this:

   \renewcommand{\DTMdisplaydate}[4]{\number##3-\number##2-\number##1 }%

And that would modify the \today command, as I understand... But what I want is to be able to get the output of \today as the time when I compile the docuement, and then have a command like for example \bptime{-1,BP}, which would give exactly the same output as \bptime{1951,AD}, which would give exactly the same output as \bptime{2494,BE}. And the output of all of those should be \today minus 66 years if the year in \today is 2017.

So how can I do this? Any pointers to at least a basic example on how to get it working?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.