Le 02/06/2015 23:56, Enrico Forestieri a écrit :
On Tue, Jun 02, 2015 at 11:47:45PM +0100, Guillaume M-M wrote:Le 02/06/2015 23:38, Enrico Forestieri a écrit :On Tue, Jun 02, 2015 at 12:04:20AM +0200, Enrico Forestieri wrote:On Mon, Jun 01, 2015 at 08:07:11PM +0100, Guillaume M-M wrote:By the way, a safer way to force not loading a package is to prepend \usepackage with "\@namedef{[email protected]}{9999/12/31}". If you just strip the line from the preamble you can easily run into troubles. In addition, at some point I had it on two lines like this (note the %): \usepackage[protrusion=true%,expansion=false ]{microtype} in which case your regexp fails if I understood correctly. I suggest just adding "\@namedef{[email protected]}{9999/12/31}" before the preamble whether we suspect that microtype is used or not, without testing for its presence. (Unless you see other errors this might generate.)Ok, thanks for the tip.Unfortunately, this does not work if options are also used. LaTeX is tricked into thinking that the package was already loaded but the used options are not acknowledged and errors are thrown. I have now followed a different and safe way for dealing with this issue by redefining \usepackage and simply omitting microtype when in dvi mode. This takes care of your example above (and also of other more contrived ones).You are right! I just sent a message suggesting to pass the draft option to microtype which should suffice according to the manual, unfortunately our messages crossed each other.BTW, that would still not work. \PassOptionToPackage only works if the package is loaded without options.
I did the test, I wrote the following in the preamble:
\PassOptionsToPackage{draft}{microtype}
\usepackage[protrusion=true,expansion=true,tracking=true,kerning=true,spacing=true]{microtype}
and managed to compile in postscript and dvi without encountering any
error (while it fails without the \PassOptions line).
