LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Werner LEMBERG <[log in to unmask]>
Mon, 31 Jul 2017 16:23:37 +0200
Text/Plain (1 lines)

[Not sure whether this is a generic LaTeX 3 problem or specific to
 `fontspec' – however, I guess this question is of greater importance,
 thus writing to this list.]


let's assume that I want to modify the `fontspec' package, adding
xelatex support for some new OpenType scripts, say.  Let's further
assume that no new fontspec release is planned in the near future so
that I'm forced to use the modified package instead of waiting for the
next release.

To satisfy the LPPL I thought the right solution is to copy
`fontspec.sty' to `fontspec-patched.sty', then applying the following

  < { \RequirePackageWithOptions{fontspec-xetex}  \endinput }
  > { \RequirePackageWithOptions{fontspec-xetex-patched}  \endinput }

Consequently, I copied `fontspec-xetex.sty' to
`fontspec-xetex-patched.sty' and applied my changes.

Finally, I thought I can now distribute `fontspec-patched.sty' and
`fontspec-xetex-patched.sty' within my package documentation
directory, where the documentation TeX file simply contains


to enforce loading the patched fontspec, then calling


for Libertine font support (which would load the unpatched `fontspec'
by itself otherwise).

Unfortunately, this fails.  xelatex bombs out with

  ! LaTeX error: "kernel/command-already-defined"
  ! Control sequence \l__fontspec_firsttime_bool already defined.
  ! See the LaTeX3 documentation for further information.
  ! For immediate help type H <return>.

  l.36 \bool_new:N \l__fontspec_firsttime_bool

What can I do?