[latex3-commits] [git/LaTeX3-latex3-latex3] master: Set up backend right at the start of \document (fixes #657) (26da686ef)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Jan 6 12:07:47 CET 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/26da686effe1c698bce56fe9302919fb2f7c5e38

>---------------------------------------------------------------

commit 26da686effe1c698bce56fe9302919fb2f7c5e38
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Jan 6 11:07:47 2020 +0000

    Set up backend right at the start of \document (fixes #657)


>---------------------------------------------------------------

26da686effe1c698bce56fe9302919fb2f7c5e38
 l3kernel/CHANGELOG.md | 3 +++
 l3kernel/expl3.dtx    | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index d47b7df42..52f953821 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -13,6 +13,9 @@ this project uses date-based 'snapshot' version identifiers.
 ### Changed
 - Distribute LaTeX3 News
 
+### Fixed
+- Set backend at the beginning of `\document` (see #657)
+
 ## [2019-11-07]
 
 ### Fixed
diff --git a/l3kernel/expl3.dtx b/l3kernel/expl3.dtx
index 1de00b1a8..38e114117 100644
--- a/l3kernel/expl3.dtx
+++ b/l3kernel/expl3.dtx
@@ -1322,13 +1322,17 @@
   }
 %    \end{macrocode}
 %
-%  A backend has to be in place by the start of the document.
+%  A backend has to be in place by the start of the document: this has to be
+%  before global options are checked for use. The odd group stuff avoids
+%  needing to actually patch \tn{document}.
 %    \begin{macrocode}
 %<*2ekernel>
-\AtBeginDocument
+\tl_put_left:Nn \document
   {
+    \endgroup
     \str_if_exist:NF \c_sys_backend_str
       { \sys_load_backend:n { } }
+    \begingroup
   }
 %</2ekernel>
 %<*!2ekernel>





More information about the latex3-commits mailing list