16

In LaTeX code written by other people, I sometimes see a date specified as an optional argument for \usepackage:

\usepackage{iftex}[2013/04/04]

Intuition tells me that this is some way to ensure that the package version meets a certain minimal requirement, but I would like to read about its usage in the official manual, as opposed to blindly paste it in my code based on guesswork.

19

From source2e.pdf, page 479 (CTAN page or texdoc source2e in a terminal):

<code>\usepackage[<package-option-list>]{<package-list>}[<version>]</code>//There can be any number of these declarations. All packages in <code><package-list></code> are called with the same options.//Each <code><package></code> file defines new elements (or modifies those defined in the <code><class></code>), and thus extends the range of documents which can be processed. The <code><package-option-list></code> is a list of options which can modify the formatting of elements defined in the <code><package></code> file. The <code><version></code> is a version number, beginning with a date in the format <code>YYYY/MM/DD</code>. If an older version of the package is found, a warning is issued.

  • Perfect. (I guess I failed to find it myself because of the non-obvious name of the manual file). – ScumCoder Feb 13 at 19:36
  • @ScumCoder There are probably other documents saying this :) (sorry, but 7 what?) – Phelype Oleinik Feb 13 at 19:38
  • @PhelypeOleinik we should update that documentation..... – David Carlisle Feb 13 at 20:48
  • @DavidCarlisle Ooh, Frank's format :) – Phelype Oleinik Feb 13 at 20:53
11

Phelype Oleinik pointed you at the LaTeX sources but there is also a user guide called usrguide.pdf

 texdoc usrguide

will open the document in texlive. Section 3.2 on preamble commands has the syntax for \usepackage.

This argument was extended with new syntax last year so you may also want to look at LaTeX News 28 in texdoc ltnews which points you at this article from TUGBoat on the project website

https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf

  • How can I access the usrguide.pdf document from MiKTeX? – Reinhard Neuwirth Feb 19 at 21:40
  • 1
    @ReinhardNeuwirth no idea about miktex, I assume it has some option equivalent to texdoc, but the document is available from multiple places on the net eg latex-project.org/help/documentation/usrguide.pdf – David Carlisle Feb 19 at 22:34
  • Unable to determine the miktex option, but found the document. – Reinhard Neuwirth Feb 21 at 5:49
  • 1
    I'm told texdoc should work in miktex just as in texlive. – David Carlisle Feb 27 at 12:51
  • Just noticed that for texdoc url, texdoc siunitx etc. plugged in at the command prompt MiKTeX delivers the goods as expected. texdoc usrguide seems to be the one exception. Perhaps the document goes by another name? – Reinhard Neuwirth Feb 28 at 13:40

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.