programming-journal / programming

21 stars 15 forks source link

Incorrectly typeset date #60

Closed lovrosdu closed 11 months ago

lovrosdu commented 11 months ago

Compiling the same document on two different machines produces differently typeset dates, even though both machines also use the same Tex Live 2021 installation. The results are consistent and so far I haven't been able to identify the cause. I suspect the useregional option passed to datetime2 might have something to do with it.

Wrong: wrong

Correct: correct

krono commented 11 months ago

Hi, thanks for the report, can you please give the log file and the options passed to the class file?

Have you passed anything else than english as language options to the class file?

lovrosdu commented 11 months ago

Hi! Here's a complete MRE instead (but let me know if you need the log file still). No language options other than english are used. The issue is present whether compiling with pdfTeX or LuaTeX.

\documentclass[english]{programming}

\paperdetails{
  submitted=2021-01-01,
  published=2021-01-02
}

\begin{document}

\begin{abstract}
  Lorem ipsum.
\end{abstract}

\end{document}

Removing the english option makes both machines produce the "wrong" output.

krono commented 11 months ago

Thanks. Can you pleas attach the Log files from both runs?

krono commented 11 months ago

Also, can you try running latex with LANG=en_us.UTF-8 environment setting?

lovrosdu commented 11 months ago

Here are the two logs. Yep, both of the machines already have LANG set to en_US.UTF-8.

krono commented 11 months ago

Both installations differ quite substantially. In particular:

Also, I am seeing

Package babel Info: You haven't specified a language. I'll use 'nil'
(babel)             as the main language.

Which surely can be a cause of problems. I have never seen this issue before. Also doclicense is complaining:

Package doclicense Warning: The language of your document is not defined.

This has never occured before to me.

This not completely dissimilar issue suggests that maybe a system package (maybe texlive-babel-english?) is mising
Maybe worth a shot?

lovrosdu commented 11 months ago

Sorry, I erroneously left out the english option in both of the above runs when producing the logs. Here are the corrected logs:

With the addition of english, the above errors disappear. However, taking a closer look at the "wrong" log this time, I noticed this line:

Package datetime2 Warning: Date-Time Language Module `english' not installed on
 input line 1913.

Installing datetime2-english (via tlmgr in my case since it's a local installation; no system packages required) was enough to correct the issue.

I assume babel-english and datetime2-english are both "silent" dependencies of this class file, meaning that the compilation won't necessarily fail if they're not present, but will produce unexpected results. It would be nice to make these packages a hard requirement and produce an error instead if possible.

krono commented 11 months ago

Good to see this is solved for you.

There is no package dependency management facility for plain LaTeX class files. I have no way to fix that.