I'm working on a customised report class, aimed at technical documentation in our company. Among other bells and whistles, I'd like to use the "lmodern" package with the "lighttt" option preferably.
The problem with this arises from the fact that we're using this class with the
\usepackage[lighttt]{lmodern}
not only under modern OS, like an Ubuntu 16.04, but also under SLES11sp2. The latter uses "lmodern 2007/01/14 v1.3", which doesn't have the "lighttt" option yet. So I get an error and the processing stops...
I also tried
\PassOptionsToPackage{lighttt}{lmodern}
\usepackage{lmodern}
but again, an error is reported.
What would be the canonical way in LaTeX to say "Please use the package lmodern with the lighttt option. But if it's not available, loading the bare lmodern package is fine."?
In pseudo code this could potentially look like:
\ifpackagehasoption{lmodern}{lighttt}{%
\usepackage[lighttt]{lmodern}}{% preferred
\usepackage{lmodern}}% fallback
Google searches for "latex load package optionally" and "latex check whether package provides an option" didn't really bring up any useful results.
Some version numbers for the SLES11sp2 system:
pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
LaTeX2e <2005/12/01>
And no, updating the system is not an option. ;) ...and wouldn't answer the actual question anyway.
\@classoptionslistsee https://tex.stackexchange.com/questions/147243/a-class-with-default-language-settings – Ulrike Fischer Aug 25 '17 at 12:49etoolbox.styisn't present on the system, so no\preto. Or is there another trick available for adding the option? – dirkbaechle Aug 25 '17 at 13:14\g@addto@macrofrom the kernel. – Ulrike Fischer Aug 25 '17 at 13:47