On 2011-10-08, PhilipPirrip wrote:
> On 10/07/2011 08:17 AM, Guenter Milde wrote:
>>   Custom LaTeX code before LyX-generated preamble:
>>    +-----------------------------------------------------------------+
>>    | \usepackage[put]{mathdesign}                                |
>>    |                                                             |
>>    +-----------------------------------------------------------------+

> May I object! ;)

Defeated. This was an *example* for a *custom* user written pe-preamble.

This specific example loads a package that is not auto-loaded by LyX, so
there is no danger of an option clash. It is put in the pre-preamble to
ensure it is loaded before the auto-loaded packages.

If the user wants to add options to a LyX-auto-loaded package, then this
could/should be done with \PassOptionsToPackage in the pre-preamble, but
without \usepackage command.

> Please always consider calling \usepackage in two parts, especially in
> LyX generated code: to allow for the possibility of adding more options
> to the packages called. (calling \usepackage with options twice isn't
> allowed)

Acutally, repeated \usepackages with a *different option set* is not
allowed. This is because the second \usepackage is ignored and hence the
different options are ignored too.

However, as the minimal example

\documentclass{minimal}

\PassOptionsToPackage{utopia}{mathdesign}
\usepackage{mathdesign}
\PassOptionsToPackage{greekuppercase=italicized}{mathdesign}
\usepackage{mathdesign}

\begin{document}
$\Gamma$
\end{document}

shows, \PassOptionsToPackage after \usepackage is silently ignored. 
I.e. if LyX were to use it, this would not prevent the error but only the
error detection.

G√ľnter

Reply via email to