OCaml Forge

# Detail: [#1341] Sadly order of package declaration is relevant in latex

Bugs: Browse | Download .csv | Monitor

# [#1341] Sadly order of package declaration is relevant in latex

Date:
2013-11-05 17:05
Priority:
3
State:
Open
Submitted by:
Pierre Boutillier (pirbo)
Assigned to:
Nobody (None)
Hardware:
All
Resolution:
Accepted As Bug
Severity:
None
Version:
None
Component:
None
Operating System:
None
Product:
None

URL:
Summary:
Sadly order of package declaration is relevant in latex

Detailed description
the code

let () =
Melt.emit (Latex.document
~documentclass:`Article
~title:("foo")
~packages:([
"fontenc","T1";
"inputenc","utf8x";
"hyperref","";
"libertine","";
"newtxmath","libertine";
]) Latex.par_

emits
[...]
\usepackage[libertine]{newtxmath}
\usepackage[]{libertine}
\usepackage[utf8x]{inputenc}
\usepackage[]{hyperref}
\usepackage[T1]{fontenc}
\usepackage[]{amssymb}
[...]

but in order for the custom font to work, "fontenc" has to be put before "amssymb" that have to be put before "libertine" !
Yes, this is a deseaster because all the mecanism of "auto include" of packages is down ...

I don't see any work around. Maybe, at least, argument order of Latex.document ~packages can be preserved.

## Followup

Message
Date: 2013-11-08 09:54
Sender: Pierre Boutillier

Thanks for the workaround.
If ~prelude would have been put before automatically used packages, it would have been even better because automatically used packages wouldn't have to be included a second time now that they know the font encoding. Anyway, a workaround has to work not to be beautyful...
Date: 2013-11-07 17:36
Sender: Romain Bardou

Interesting. And ugly indeed. Well, one could imagine a way to specify dependencies between packages. And as you say the package order could be preserved.

Meanwhile, there is actually a workaround; you can use function Latex.usepackage in the ~prelude argument of Latex.document.

## Changes:

Field Old Value Date By
ResolutionNone2013-11-07 17:36doomeer