summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/l3kernel/CHANGELOG.md14
-rw-r--r--macros/latex/contrib/l3kernel/README.md2
-rw-r--r--macros/latex/contrib/l3kernel/expl3.dtx4
-rw-r--r--macros/latex/contrib/l3kernel/expl3.pdfbin584850 -> 585016 bytes
-rw-r--r--macros/latex/contrib/l3kernel/interface3.pdfbin1534739 -> 1534855 bytes
-rw-r--r--macros/latex/contrib/l3kernel/interface3.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3alloc.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3basics.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3bootstrap.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3box.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3candidates.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3clist.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3coffins.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3color-base.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3debug.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3deprecation.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3doc.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3docstrip.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3docstrip.pdfbin263278 -> 263427 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3expan.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3file.dtx258
-rw-r--r--macros/latex/contrib/l3kernel/l3final.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3flag.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-assign.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-aux.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-basics.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-convert.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-expo.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-extended.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-logic.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-parse.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-random.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-round.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-traps.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-trig.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fparray.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3int.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3intarray.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3kernel-functions.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3keys.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3legacy.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3luatex.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3msg.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3names.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3prefixes.pdfbin59064 -> 59064 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3prg.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3prop.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3quark.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3regex.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3seq.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3skip.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3sort.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3str-convert.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3str.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3styleguide.pdfbin279983 -> 280134 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3styleguide.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3syntax-changes.pdfbin227703 -> 227863 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3syntax-changes.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3sys.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3term-glossary.pdfbin186491 -> 186644 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3term-glossary.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3tl-analysis.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3tl.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3token.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3unicode.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/source3.pdfbin5696096 -> 5694328 bytes
-rw-r--r--macros/latex/contrib/l3kernel/source3.tex2
-rw-r--r--macros/latex/contrib/onedown/examples/onedown-examples.pdfbin0 -> 855928 bytes
-rw-r--r--macros/latex/contrib/onedown/examples/onedown-ref.pdfbin0 -> 228347 bytes
-rw-r--r--macros/latex/contrib/subfiles/README2
-rw-r--r--macros/latex/contrib/subfiles/subfiles.dtx384
-rw-r--r--macros/latex/contrib/subfiles/subfiles.ins4
-rw-r--r--macros/latex/contrib/subfiles/subfiles.pdfbin231568 -> 222713 bytes
-rw-r--r--macros/latex/contrib/ucalgmthesis/README.md27
-rw-r--r--macros/latex/contrib/ucalgmthesis/appendix.tex2
-rw-r--r--macros/latex/contrib/ucalgmthesis/sample-thesis.pdfbin117697 -> 117829 bytes
-rw-r--r--macros/latex/contrib/ucalgmthesis/sample-thesis.tex52
-rw-r--r--macros/latex/contrib/ucalgmthesis/ucalgmthesis.cls15
79 files changed, 570 insertions, 306 deletions
diff --git a/macros/latex/contrib/l3kernel/CHANGELOG.md b/macros/latex/contrib/l3kernel/CHANGELOG.md
index 6b70a9cd60..d92192c90b 100644
--- a/macros/latex/contrib/l3kernel/CHANGELOG.md
+++ b/macros/latex/contrib/l3kernel/CHANGELOG.md
@@ -7,6 +7,17 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2019-10-24]
+
+### Changed
+
+- File names are now returned without quotes by `\file_full_name:n`
+
+### Fixed
+
+- `\file_if_exist:n(TF)`, etc., when dealing with file names containing
+ spaces (see #642)
+
## [2019-10-21]
### Added
@@ -578,7 +589,8 @@ this project uses date-based 'snapshot' version identifiers.
- Step func­tions have been added for dim vari­ables,
e.g. `\dim_step_in­line:nnnn`
-[Unreleased]: https://github.com/latex3/latex3/compare/2019-10-21...HEAD
+[Unreleased]: https://github.com/latex3/latex3/compare/2019-10-24...HEAD
+[2019-10-24]: https://github.com/latex3/latex3/compare/2019-10-21...2019-10-24
[2019-10-21]: https://github.com/latex3/latex3/compare/2019-10-14...2019-10-21
[2019-10-14]: https://github.com/latex3/latex3/compare/2019-10-11...2019-10-14
[2019-10-11]: https://github.com/latex3/latex3/compare/2019-10-02...2019-10-11
diff --git a/macros/latex/contrib/l3kernel/README.md b/macros/latex/contrib/l3kernel/README.md
index ffbbb81606..0663e1d40c 100644
--- a/macros/latex/contrib/l3kernel/README.md
+++ b/macros/latex/contrib/l3kernel/README.md
@@ -1,7 +1,7 @@
LaTeX3 Programming Conventions
==============================
-Release 2019-10-21
+Release 2019-10-24
Overview
--------
diff --git a/macros/latex/contrib/l3kernel/expl3.dtx b/macros/latex/contrib/l3kernel/expl3.dtx
index e9d6fd84ad..b7f5ee329d 100644
--- a/macros/latex/contrib/l3kernel/expl3.dtx
+++ b/macros/latex/contrib/l3kernel/expl3.dtx
@@ -24,7 +24,7 @@
%
%<*driver|generic|package|2ekernel>
%</driver|generic|package|2ekernel>
-\def\ExplFileDate{2019-10-21}%
+\def\ExplFileDate{2019-10-24}%
%<*driver>
\documentclass[full]{l3doc}
\usepackage{graphicx}
@@ -51,7 +51,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/expl3.pdf b/macros/latex/contrib/l3kernel/expl3.pdf
index 973fa0880c..f2774a17db 100644
--- a/macros/latex/contrib/l3kernel/expl3.pdf
+++ b/macros/latex/contrib/l3kernel/expl3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/interface3.pdf b/macros/latex/contrib/l3kernel/interface3.pdf
index 5295e1c0e2..0a57e5db23 100644
--- a/macros/latex/contrib/l3kernel/interface3.pdf
+++ b/macros/latex/contrib/l3kernel/interface3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/interface3.tex b/macros/latex/contrib/l3kernel/interface3.tex
index 7248ad387c..96303297d7 100644
--- a/macros/latex/contrib/l3kernel/interface3.tex
+++ b/macros/latex/contrib/l3kernel/interface3.tex
@@ -54,7 +54,7 @@ for those people who are interested.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2019-10-21}
+\date{Released 2019-10-24}
\pagenumbering{roman}
\maketitle
diff --git a/macros/latex/contrib/l3kernel/l3alloc.dtx b/macros/latex/contrib/l3kernel/l3alloc.dtx
index 4e8d1c4f59..9a33252331 100644
--- a/macros/latex/contrib/l3kernel/l3alloc.dtx
+++ b/macros/latex/contrib/l3kernel/l3alloc.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3basics.dtx b/macros/latex/contrib/l3kernel/l3basics.dtx
index 412dabcdc2..d891de3c15 100644
--- a/macros/latex/contrib/l3kernel/l3basics.dtx
+++ b/macros/latex/contrib/l3kernel/l3basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3bootstrap.dtx b/macros/latex/contrib/l3kernel/l3bootstrap.dtx
index 015aa0d455..d5566552df 100644
--- a/macros/latex/contrib/l3kernel/l3bootstrap.dtx
+++ b/macros/latex/contrib/l3kernel/l3bootstrap.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3box.dtx b/macros/latex/contrib/l3kernel/l3box.dtx
index c72c9fa587..bc3396e870 100644
--- a/macros/latex/contrib/l3kernel/l3box.dtx
+++ b/macros/latex/contrib/l3kernel/l3box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3candidates.dtx b/macros/latex/contrib/l3kernel/l3candidates.dtx
index bfbe86059b..03d378033a 100644
--- a/macros/latex/contrib/l3kernel/l3candidates.dtx
+++ b/macros/latex/contrib/l3kernel/l3candidates.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3clist.dtx b/macros/latex/contrib/l3kernel/l3clist.dtx
index fb63bdac21..3642e7f30a 100644
--- a/macros/latex/contrib/l3kernel/l3clist.dtx
+++ b/macros/latex/contrib/l3kernel/l3clist.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3coffins.dtx b/macros/latex/contrib/l3kernel/l3coffins.dtx
index c0d393bbaa..1e2656c9f6 100644
--- a/macros/latex/contrib/l3kernel/l3coffins.dtx
+++ b/macros/latex/contrib/l3kernel/l3coffins.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3color-base.dtx b/macros/latex/contrib/l3kernel/l3color-base.dtx
index 9b80753bda..5d7b133889 100644
--- a/macros/latex/contrib/l3kernel/l3color-base.dtx
+++ b/macros/latex/contrib/l3kernel/l3color-base.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3debug.dtx b/macros/latex/contrib/l3kernel/l3debug.dtx
index 898152fd13..d00dde81e6 100644
--- a/macros/latex/contrib/l3kernel/l3debug.dtx
+++ b/macros/latex/contrib/l3kernel/l3debug.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3deprecation.dtx b/macros/latex/contrib/l3kernel/l3deprecation.dtx
index e3dd8581ee..386635eb71 100644
--- a/macros/latex/contrib/l3kernel/l3deprecation.dtx
+++ b/macros/latex/contrib/l3kernel/l3deprecation.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3doc.dtx b/macros/latex/contrib/l3kernel/l3doc.dtx
index 5ad6932e9e..50788f226f 100644
--- a/macros/latex/contrib/l3kernel/l3doc.dtx
+++ b/macros/latex/contrib/l3kernel/l3doc.dtx
@@ -79,7 +79,7 @@ and all files in that bundle must be distributed together.
%
% \title{The \cls{l3doc} class}
% \author{\Team}
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
% \maketitle
% \tableofcontents
%
diff --git a/macros/latex/contrib/l3kernel/l3docstrip.dtx b/macros/latex/contrib/l3kernel/l3docstrip.dtx
index 1ecd193852..7248ff24d8 100644
--- a/macros/latex/contrib/l3kernel/l3docstrip.dtx
+++ b/macros/latex/contrib/l3kernel/l3docstrip.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3docstrip.pdf b/macros/latex/contrib/l3kernel/l3docstrip.pdf
index 1e80cda2fc..d40df37311 100644
--- a/macros/latex/contrib/l3kernel/l3docstrip.pdf
+++ b/macros/latex/contrib/l3kernel/l3docstrip.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3expan.dtx b/macros/latex/contrib/l3kernel/l3expan.dtx
index c06f0c2981..67fb29ff75 100644
--- a/macros/latex/contrib/l3kernel/l3expan.dtx
+++ b/macros/latex/contrib/l3kernel/l3expan.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3file.dtx b/macros/latex/contrib/l3kernel/l3file.dtx
index 19807253e3..2170ccb1f4 100644
--- a/macros/latex/contrib/l3kernel/l3file.dtx
+++ b/macros/latex/contrib/l3kernel/l3file.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
@@ -65,9 +65,9 @@
% may contain both literal items and expandable content, which should on
% full expansion be the desired file name. Active characters (as
% declared in \cs{l_char_active_seq}) are \emph{not} expanded,
-% allowing the direct use of these in file names. File names are quoted
-% using |"| tokens if they contain spaces: as a result, |"| tokens are
-% \emph{not} permitted in file names.
+% allowing the direct use of these in file names. Quote tokens (|"|) are
+% not permitted in file names as they are reserved for internal use by some
+% \TeX{} primitives.
%
% Spaces are trimmed at the beginning and end of the file name:
% this reflects the fact that some file systems do not allow or interact
@@ -1059,7 +1059,7 @@
\tex_openin:D #1
\sys_if_engine_luatex:TF
{ {#2} }
- { #2 \scan_stop: }
+ { \exp_not:N \__kernel_file_name_quote:n {#2} \scan_stop: }
}
% \end{macrocode}
% \end{macro}
@@ -1436,10 +1436,7 @@
\cs_new_protected:Npn \iow_open:Nn #1#2
{
\tl_set:Nx \l_@@_file_name_tl
- {
- \__kernel_file_name_quote:e
- { \__kernel_file_name_sanitize:n {#2} }
- }
+ { \__kernel_file_name_sanitize:n {#2} }
\iow_close:N #1
\seq_gpop:NNTF \g_@@_streams_seq \l_@@_stream_tl
{ \@@_open_stream:NV #1 \l_@@_file_name_tl }
@@ -1459,7 +1456,8 @@
{
\tex_global:D \tex_chardef:D #1 = \l_@@_stream_tl \scan_stop:
\prop_gput:NVn \g_@@_streams_prop #1 {#2}
- \tex_immediate:D \tex_openout:D #1 #2 \scan_stop:
+ \tex_immediate:D \tex_openout:D
+ #1 \__kernel_file_name_quote:n {#2} \scan_stop:
}
\cs_generate_variant:Nn \@@_open_stream:Nn { NV }
% \end{macrocode}
@@ -2362,15 +2360,18 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}[rEXP]{\__kernel_file_name_sanitize:n}
-% \begin{macro}[rEXP]{\__kernel_file_name_expand_loop:w}
-% \begin{macro}[rEXP]{\__kernel_file_name_expand_N_type:Nw}
-% \begin{macro}[rEXP]{\__kernel_file_name_expand_group:nw}
-% \begin{macro}[rEXP]{\__kernel_file_name_expand_space:w}
-% \begin{macro}[rEXP]{\__kernel_file_name_trim_spaces:n}
-% \begin{macro}[rEXP]{\__kernel_file_name_trim_spaces:nw}
-% \begin{macro}[rEXP]{\__kernel_file_name_trim_spaces_aux:n}
-% \begin{macro}[rEXP]{\__kernel_file_name_trim_spaces_aux:w}
+% \begin{macro}[EXP]{\__kernel_file_name_sanitize:n}
+% \begin{macro}[EXP]{\__kernel_file_name_expand_loop:w}
+% \begin{macro}[EXP]{\__kernel_file_name_expand_N_type:Nw}
+% \begin{macro}[EXP]{\__kernel_file_name_expand_group:nw}
+% \begin{macro}[EXP]{\__kernel_file_name_expand_space:w}
+% \begin{macro}[EXP]{\__kernel_file_name_strip_quotes:n}
+% \begin{macro}[EXP]{\__kernel_file_name_strip_quotes:nnnw}
+% \begin{macro}[EXP]{\__kernel_file_name_strip_quotes:nnn}
+% \begin{macro}[EXP]{\__kernel_file_name_trim_spaces:n}
+% \begin{macro}[EXP]{\__kernel_file_name_trim_spaces:nw}
+% \begin{macro}[EXP]{\__kernel_file_name_trim_spaces_aux:n}
+% \begin{macro}[EXP]{\__kernel_file_name_trim_spaces_aux:w}
% Expanding the file name without expanding active characters is done
% using the same token-by-token approach as for example case changing.
% The finale outcome only need be \texttt{e}-type expandable, so there
@@ -2380,8 +2381,11 @@
{
\exp_args:Ne \__kernel_file_name_trim_spaces:n
{
- \__kernel_file_name_expand_loop:w #1
- \q_recursion_tail \q_recursion_stop
+ \exp_args:Ne \__kernel_file_name_strip_quotes:n
+ {
+ \__kernel_file_name_expand_loop:w #1
+ \q_recursion_tail \q_recursion_stop
+ }
}
}
\cs_new:Npn \__kernel_file_name_expand_loop:w #1 \q_recursion_stop
@@ -2431,6 +2435,30 @@
\exp_not:N \__kernel_file_name_expand_loop:w
}
% \end{macrocode}
+% Quoting file name uses basically the same approach as for
+% \texttt{luaquotejobname}: count the |"| tokens and remove them.
+% \begin{macrocode}
+\cs_new:Npn \__kernel_file_name_strip_quotes:n #1
+ {
+ \__kernel_file_name_strip_quotes:nnnw {#1} { 0 } { }
+ #1 " \q_recursion_tail " \q_recursion_stop
+ }
+\cs_new:Npn \__kernel_file_name_strip_quotes:nnnw #1#2#3#4 "
+ {
+ \quark_if_recursion_tail_stop_do:nn {#4}
+ { \__kernel_file_name_strip_quotes:nnn {#1} {#2} {#3} }
+ \__kernel_file_name_strip_quotes:nnnw {#1} { #2 + 1 } { #3#4 }
+ }
+\cs_new:Npn \__kernel_file_name_strip_quotes:nnn #1#2#3
+ {
+ \int_if_even:nT {#2}
+ {
+ \__kernel_msg_expandable_error:nnn
+ { kernel } { unbalanced-quote-in-filename } {#1}
+ }
+ #3
+ }
+% \end{macrocode}
% Spaces need to be trimmed from the start of the name and from the end of
% any extension. However, the name we are passed might not have an extension:
% that means we have to look for one. If there is no extension, we still use
@@ -2461,37 +2489,16 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}[rEXP]{\__kernel_file_name_quote:n, \__kernel_file_name_quote:e}
-% \begin{macro}[rEXP]{\__kernel_file_name_quote_auxi:nnnw}
-% \begin{macro}[rEXP]{\__kernel_file_name_quote_auxii:nnn}
-% \begin{macro}[rEXP]{\__kernel_file_name_quote_auxiii:nw}
-% Quoting file name uses basically the same approach as for
-% \texttt{luaquotejobname}: count the |"| tokens, remove them then
-% re-add at the extremities.
+% \begin{macro}[EXP]{\__kernel_file_name_quote:n}
+% \begin{macro}[EXP]{\__kernel_file_name_quote:nw}
% \begin{macrocode}
\cs_new:Npn \__kernel_file_name_quote:n #1
- {
- \__kernel_file_name_quote_auxi:nnnw {#1} { 0 } { }
- #1 " \q_recursion_tail " \q_recursion_stop
- }
-\cs_generate_variant:Nn \__kernel_file_name_quote:n { e }
-\cs_new:Npn \__kernel_file_name_quote_auxi:nnnw #1#2#3#4 "
- {
- \quark_if_recursion_tail_stop_do:nn {#4}
- { \__kernel_file_name_quote_auxii:nnn {#1} {#2} {#3} }
- \__kernel_file_name_quote_auxi:nnnw {#1} { #2 + 1 } { #3#4 }
- }
-\cs_new:Npn \__kernel_file_name_quote_auxii:nnn #1#2#3
- {
- \int_if_even:nT {#2}
- {
- \__kernel_msg_expandable_error:nnn
- { kernel } { unbalanced-quote-in-filename } {#1}
- }
- \__kernel_file_name_quote_auxiii:nw {#3} #3 ~ \q_nil \q_stop
- }
-\cs_new:Npn \__kernel_file_name_quote_auxiii:nw #1 #2 ~ #3 \q_stop
+ { \__kernel_file_name_quote:nw {#1} #1 ~ \q_nil \q_stop }
+\cs_new:Npn \__kernel_file_name_quote:nw #1 #2 ~ #3 \q_stop
{
\quark_if_nil:nTF {#3}
{ #1 }
@@ -2500,8 +2507,6 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \begin{variable}{\c_@@_marker_tl}
% The same idea as the marker for rescanning token lists: this pair of
@@ -2537,18 +2542,22 @@
}
{ \prg_return_false: }
}
-\cs_new_protected:Npn \@@_get_aux:nnN #1#2#3
+\cs_new_protected:Npx \@@_get_aux:nnN #1#2#3
{
- \if_false: { \fi:
+ \exp_not:N \if_false: { \exp_not:N \fi:
\group_begin:
\int_set_eq:NN \tex_tracingnesting:D \c_zero_int
- \exp_args:No \tex_everyeof:D { \c_@@_marker_tl }
+ \exp_not:N \exp_args:No \tex_everyeof:D
+ { \exp_not:N \c_@@_marker_tl }
#2 \scan_stop:
- \exp_after:wN \@@_get_do:Nw
- \exp_after:wN #3
- \exp_after:wN \prg_do_nothing:
- \tex_input:D #1 \scan_stop:
- \if_false: } \fi:
+ \exp_not:N \exp_after:wN \exp_not:N \@@_get_do:Nw
+ \exp_not:N \exp_after:wN #3
+ \exp_not:N \exp_after:wN \exp_not:N \prg_do_nothing:
+ \exp_not:N \tex_input:D
+ \sys_if_engine_luatex:TF
+ { {#1} }
+ { \exp_not:N \__kernel_file_name_quote:n {#1} \scan_stop: }
+ \exp_not:N \if_false: } \exp_not:N \fi:
}
\exp_args:Nno \use:nn
{ \cs_new_protected:Npn \@@_get_do:Nw #1#2 }
@@ -2561,38 +2570,31 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@@_file_size:n}
+% \begin{macro}{\@@_size:n}
% A copy of the primitive where it's available, or the \LuaTeX{}
% equivalent if relevant.
% \begin{macrocode}
-\cs_new_eq:NN \@@_file_size:n \tex_filesize:D
+\cs_new_eq:NN \@@_size:n \tex_filesize:D
\sys_if_engine_luatex:T
{
- \cs_gset:Npn \@@_file_size:n #1
+ \cs_gset:Npn \@@_size:n #1
{
\lua_now:e
- {
- l3kernel.filesize
- ( " \lua_escape:e {#1} " )
- }
+ { l3kernel.filesize ( " \lua_escape:e {#1} " ) }
}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[rEXP]{\file_full_name:n, \@@_full_name:n}
-% \begin{macro}[rEXP]{\@@_full_name:nn}
-% \begin{macro}[rEXP]{\@@_full_name_aux:nn}
-% \begin{macro}[rEXP]{\@@_full_name_aux:n}
-% \begin{macro}[rEXP]{\@@_file_name_cleanup:w}
-% \begin{macro}[rEXP]{\@@_file_name_end:}
-% \begin{macro}[rEXP]{\@@_file_name_ext_check:n}
-% \begin{macro}[rEXP]
-% {
-% \@@_file_name_ext_check_auxi:nw ,
-% \@@_file_name_ext_check_auxii:nw ,
-% \@@_file_name_ext_check_auxiii:nw
-% }
+% \begin{macro}[EXP]{\file_full_name:n, \@@_full_name:n}
+% \begin{macro}[EXP]{\@@_full_name_aux:nn}
+% \begin{macro}[EXP]{\@@_full_name_aux:n}
+% \begin{macro}[EXP]{\@@_name_cleanup:w}
+% \begin{macro}[EXP]{\@@_name_end:}
+% \begin{macro}[EXP]{\@@_name_ext_check:n}
+% \begin{macro}[EXP]{\@@_name_ext_check:nw}
+% \begin{macro}[EXP]{\@@_name_ext_check:nnw}
+% \begin{macro}[EXP]{\@@_name_ext_check:nn}
% File searching can be carried out if the \tn{pdffilesize} primitive
% or an equivalent is available. That of course means we need to
% arrange for everything else to here to be done by expansion too.
@@ -2604,35 +2606,30 @@
\exp_args:Ne \@@_full_name:n
{ \__kernel_file_name_sanitize:n {#1} }
}
-\cs_new:Npn \@@_full_name:n #1
- {
- \exp_args:Ne \@@_full_name:nn
- { \__kernel_file_name_quote:n {#1} } {#1}
- }
% \end{macrocode}
% First, we check of the file is just here: no mapping so we do not
% need the break part of the broader auxiliary. We are using the fact
% that the primitive here returns nothing if the file is entirely absent.
% For package mode, \tn{input@path} is a token list not a sequence.
% \begin{macrocode}
-\cs_new:Npn \@@_full_name:nn #1#2
+\cs_new:Npn \@@_full_name:n #1
{
\tl_if_blank:nF {#1}
{
- \tl_if_blank:eTF { \@@_file_size:n {#1} }
+ \tl_if_blank:eTF { \@@_size:n {#1} }
{
\seq_map_tokens:Nn \l_file_search_path_seq
- { \@@_full_name_aux:nn {#2} }
+ { \@@_full_name_aux:nn {#1} }
%<*package>
\cs_if_exist:NT \input@path
{
\tl_map_tokens:Nn \input@path
- { \@@_full_name_aux:nn {#2} }
+ { \@@_full_name_aux:nn {#1} }
}
%</package>
- \@@_file_name_end:
+ \@@_name_end:
}
- { \@@_file_ext_check:n {#1} }
+ { \@@_ext_check:n {#1} }
}
}
% \end{macrocode}
@@ -2640,60 +2637,52 @@
% twice in the event we find the right file.
% \begin{macrocode}
\cs_new:Npn \@@_full_name_aux:nn #1#2
- {
- \exp_args:Ne \@@_full_name_aux:n
- { \__kernel_file_name_quote:e { \tl_to_str:n {#2} / #1 } }
- }
+ { \exp_args:Ne \@@_full_name_aux:n { \tl_to_str:n {#2} / #1 } }
\cs_new:Npn \@@_full_name_aux:n #1
{
- \tl_if_blank:eF { \@@_file_size:n {#1} }
+ \tl_if_blank:eF { \@@_size:n {#1} }
{
\seq_map_break:n
{
- \@@_file_ext_check:n {#1}
- \@@_file_name_cleanup:w
+ \@@_ext_check:n {#1}
+ \@@_name_cleanup:w
}
}
}
-\cs_new:Npn \@@_file_name_cleanup:w #1 \@@_file_name_end: { }
-\cs_new:Npn \@@_file_name_end: { }
+\cs_new:Npn \@@_name_cleanup:w #1 \@@_name_end: { }
+\cs_new:Npn \@@_name_end: { }
% \end{macrocode}
% As \TeX{} automatically adds |.tex| if there is no extension,
-% there is a little clean up to do here. First, find the file
-% extension if present, ignoring any quotes and avoiding dots in
-% the path.(The quoted name is retained for the common case that
-% there is no additional work to do.)
+% there is a little clean up to do here. First, make sure we are not in the
+% directory part, saving that. Then check for an extension.
% \begin{macrocode}
-\cs_new:Npn \@@_file_ext_check:n #1
- { \@@_file_ext_check_auxi:nw {#1} #1 " #1 " \q_stop }
-\cs_new:Npn \@@_file_ext_check_auxi:nw #1#2 " #3 " #4 \q_stop
- { \@@_file_ext_check_auxii:nw {#1} #3 / \q_nil / \q_stop }
-\cs_new:Npn \@@_file_ext_check_auxii:nw #1#2 / #3 / #4 \q_stop
+\cs_new:Npn \@@_ext_check:n #1
+ { \@@_ext_check:nw { / } #1 / \q_nil / \q_stop }
+\cs_new:Npn \@@_ext_check:nw #1 #2 / #3 / #4 \q_stop
{
\quark_if_nil:nTF {#3}
- { \@@_file_ext_check_auxiii:nw {#1} #2 . \q_nil . \q_stop }
- { \@@_file_ext_check_auxii:nw {#1} #3 / #4 \q_stop }
+ {
+ \exp_args:No \@@_ext_check:nnw
+ { \use_none:n #1 } {#2} #2 . \q_nil . \q_stop
+ }
+ { \@@_ext_check:nw { #1 #2 / } #3 / #4 \q_stop }
}
-\cs_new:Npx \@@_file_ext_check_auxiii:nw #1#2 . #3 . #4 \q_stop
+\cs_new:Npx \@@_ext_check:nnw #1#2#3 . #4 . #5 \q_stop
{
- \exp_not:N \quark_if_nil:nTF {#3}
+ \exp_not:N \quark_if_nil:nTF {#4}
{
- \exp_not:N \exp_args:Nee \exp_not:N \@@_file_ext_check_auxiv:nn
- { \exp_not:N \__kernel_file_name_quote:n {#1} }
- {
- \exp_not:N \__kernel_file_name_quote:n
- { #1 \tl_to_str:n { .tex } }
- }
+ \exp_not:N \@@_ext_check:nn
+ { #1 #2 } { #1 #2 \tl_to_str:n { .tex } }
}
- {#1}
+ { #1 #2 }
}
-\cs_new:Npn \@@_file_ext_check_auxiv:nn #1#2
+\cs_new:Npn \@@_ext_check:nn #1#2
{
- \tl_if_blank:eTF { \@@_file_size:n {#2} }
+ \tl_if_blank:eTF { \@@_size:n {#2} }
{#1}
{
\int_compare:nNnTF
- { \@@_file_size:n {#1} } = { \@@_file_size:n {#2} }
+ { \@@_size:n {#1} } = { \@@_size:n {#2} }
{#2}
{#1}
}
@@ -2727,6 +2716,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\file_get_full_name:nN, \file_get_full_name:VN}
% \begin{macro}[TF]{\file_get_full_name:nN, \file_get_full_name:VN}
@@ -2806,10 +2796,7 @@
\cs_new_protected:Npn \@@_get_full_name_search:nN #1#2
{
\tl_set:Nx \l_@@_full_name_tl
- {
- \__kernel_file_name_quote:e
- { \tl_to_str:n {#1} \l_@@_base_name_tl }
- }
+ { \tl_to_str:n {#1} \l_@@_base_name_tl }
\__kernel_ior_open:No \g_@@_internal_ior \l_@@_full_name_tl
\ior_if_eof:NF \g_@@_internal_ior { #2 { \prg_break: } }
}
@@ -3092,19 +3079,22 @@
{ \@@_input:V \l_@@_full_name_tl }
{ \__kernel_file_missing:n {#1} }
}
-\cs_new_protected:Npn \@@_input:n #1
+\cs_new_protected:Npx \@@_input:n #1
{
%<*initex>
- \seq_gput_right:Nn \g_@@_record_seq {#1}
+ \seq_gput_right:Nn \exp_not:N \g_@@_record_seq {#1}
%</initex>
%<*package>
- \clist_if_exist:NTF \@filelist
- { \@addtofilelist {#1} }
- { \seq_gput_right:Nn \g_@@_record_seq {#1} }
+ \exp_not:N \clist_if_exist:NTF \exp_not:N \@filelist
+ { \exp_not:N \@addtofilelist {#1} }
+ { \seq_gput_right:Nn \exp_not:N \g_@@_record_seq {#1} }
%</package>
- \@@_input_push:n {#1}
- \tex_input:D #1 \c_space_tl
- \@@_input_pop:
+ \exp_not:N \@@_input_push:n {#1}
+ \exp_not:N \tex_input:D
+ \sys_if_engine_luatex:TF
+ { {#1} }
+ { \exp_not:N \__kernel_file_name_quote:n {#1} \scan_stop: }
+ \exp_not:N \@@_input_pop:
}
\cs_generate_variant:Nn \@@_input:n { V }
% \end{macrocode}
diff --git a/macros/latex/contrib/l3kernel/l3final.dtx b/macros/latex/contrib/l3kernel/l3final.dtx
index 1854521b7d..031f473316 100644
--- a/macros/latex/contrib/l3kernel/l3final.dtx
+++ b/macros/latex/contrib/l3kernel/l3final.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3flag.dtx b/macros/latex/contrib/l3kernel/l3flag.dtx
index 809e4f57ae..4b4448bcb7 100644
--- a/macros/latex/contrib/l3kernel/l3flag.dtx
+++ b/macros/latex/contrib/l3kernel/l3flag.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-assign.dtx b/macros/latex/contrib/l3kernel/l3fp-assign.dtx
index 0fc8aab6b6..0fa01c2d7b 100644
--- a/macros/latex/contrib/l3kernel/l3fp-assign.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-assign.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
% \maketitle
%
% \begin{documentation}
diff --git a/macros/latex/contrib/l3kernel/l3fp-aux.dtx b/macros/latex/contrib/l3kernel/l3fp-aux.dtx
index 437f05d0e3..74515d97aa 100644
--- a/macros/latex/contrib/l3kernel/l3fp-aux.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-aux.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-basics.dtx b/macros/latex/contrib/l3kernel/l3fp-basics.dtx
index 81d6720ef6..0063bdd726 100644
--- a/macros/latex/contrib/l3kernel/l3fp-basics.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-basics.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-convert.dtx b/macros/latex/contrib/l3kernel/l3fp-convert.dtx
index f0279aeb49..9c776d5431 100644
--- a/macros/latex/contrib/l3kernel/l3fp-convert.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-convert.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-expo.dtx b/macros/latex/contrib/l3kernel/l3fp-expo.dtx
index 9fa0d3c9fe..36c4fbe7d5 100644
--- a/macros/latex/contrib/l3kernel/l3fp-expo.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-expo.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-extended.dtx b/macros/latex/contrib/l3kernel/l3fp-extended.dtx
index a244448ff5..b41794cf28 100644
--- a/macros/latex/contrib/l3kernel/l3fp-extended.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-extended.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-logic.dtx b/macros/latex/contrib/l3kernel/l3fp-logic.dtx
index d1a58ad433..cbd988aadf 100644
--- a/macros/latex/contrib/l3kernel/l3fp-logic.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-logic.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-parse.dtx b/macros/latex/contrib/l3kernel/l3fp-parse.dtx
index 89347e5ef0..347d2d94ec 100644
--- a/macros/latex/contrib/l3kernel/l3fp-parse.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-parse.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-random.dtx b/macros/latex/contrib/l3kernel/l3fp-random.dtx
index 37434dd256..2965738f3a 100644
--- a/macros/latex/contrib/l3kernel/l3fp-random.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-random.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-round.dtx b/macros/latex/contrib/l3kernel/l3fp-round.dtx
index 1cdf625a2d..c2511e1e3f 100644
--- a/macros/latex/contrib/l3kernel/l3fp-round.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-round.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-traps.dtx b/macros/latex/contrib/l3kernel/l3fp-traps.dtx
index ab486d81dc..4bd9cc1f24 100644
--- a/macros/latex/contrib/l3kernel/l3fp-traps.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-traps.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
% \maketitle
%
% \begin{documentation}
diff --git a/macros/latex/contrib/l3kernel/l3fp-trig.dtx b/macros/latex/contrib/l3kernel/l3fp-trig.dtx
index a1d63f396b..e40b41e72f 100644
--- a/macros/latex/contrib/l3kernel/l3fp-trig.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-trig.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp.dtx b/macros/latex/contrib/l3kernel/l3fp.dtx
index ad4011b6d5..41f4da38c7 100644
--- a/macros/latex/contrib/l3kernel/l3fp.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fparray.dtx b/macros/latex/contrib/l3kernel/l3fparray.dtx
index 4476f0377e..5952ba4cd7 100644
--- a/macros/latex/contrib/l3kernel/l3fparray.dtx
+++ b/macros/latex/contrib/l3kernel/l3fparray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3int.dtx b/macros/latex/contrib/l3kernel/l3int.dtx
index 52d769c49a..c388ef5578 100644
--- a/macros/latex/contrib/l3kernel/l3int.dtx
+++ b/macros/latex/contrib/l3kernel/l3int.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3intarray.dtx b/macros/latex/contrib/l3kernel/l3intarray.dtx
index dad25796c3..37c0f9a630 100644
--- a/macros/latex/contrib/l3kernel/l3intarray.dtx
+++ b/macros/latex/contrib/l3kernel/l3intarray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
index ed13c7b993..2d1f9b98b1 100644
--- a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
+++ b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3keys.dtx b/macros/latex/contrib/l3kernel/l3keys.dtx
index b1533c8f20..45ccdc067f 100644
--- a/macros/latex/contrib/l3kernel/l3keys.dtx
+++ b/macros/latex/contrib/l3kernel/l3keys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3legacy.dtx b/macros/latex/contrib/l3kernel/l3legacy.dtx
index c5528a7889..7112522870 100644
--- a/macros/latex/contrib/l3kernel/l3legacy.dtx
+++ b/macros/latex/contrib/l3kernel/l3legacy.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3luatex.dtx b/macros/latex/contrib/l3kernel/l3luatex.dtx
index 199db4a628..843a534d07 100644
--- a/macros/latex/contrib/l3kernel/l3luatex.dtx
+++ b/macros/latex/contrib/l3kernel/l3luatex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3msg.dtx b/macros/latex/contrib/l3kernel/l3msg.dtx
index 64608fb541..bbf6307afe 100644
--- a/macros/latex/contrib/l3kernel/l3msg.dtx
+++ b/macros/latex/contrib/l3kernel/l3msg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3names.dtx b/macros/latex/contrib/l3kernel/l3names.dtx
index 72a8af0373..e91ed8458f 100644
--- a/macros/latex/contrib/l3kernel/l3names.dtx
+++ b/macros/latex/contrib/l3kernel/l3names.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3prefixes.pdf b/macros/latex/contrib/l3kernel/l3prefixes.pdf
index 44b47156ee..50bf5edf09 100644
--- a/macros/latex/contrib/l3kernel/l3prefixes.pdf
+++ b/macros/latex/contrib/l3kernel/l3prefixes.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3prg.dtx b/macros/latex/contrib/l3kernel/l3prg.dtx
index 835d005860..b44ecce01c 100644
--- a/macros/latex/contrib/l3kernel/l3prg.dtx
+++ b/macros/latex/contrib/l3kernel/l3prg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3prop.dtx b/macros/latex/contrib/l3kernel/l3prop.dtx
index 570b7a7ade..44a53408cd 100644
--- a/macros/latex/contrib/l3kernel/l3prop.dtx
+++ b/macros/latex/contrib/l3kernel/l3prop.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3quark.dtx b/macros/latex/contrib/l3kernel/l3quark.dtx
index dbe2e6e817..f19cb58b6d 100644
--- a/macros/latex/contrib/l3kernel/l3quark.dtx
+++ b/macros/latex/contrib/l3kernel/l3quark.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3regex.dtx b/macros/latex/contrib/l3kernel/l3regex.dtx
index deda64aa3a..b1fe867420 100644
--- a/macros/latex/contrib/l3kernel/l3regex.dtx
+++ b/macros/latex/contrib/l3kernel/l3regex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3seq.dtx b/macros/latex/contrib/l3kernel/l3seq.dtx
index b376d5644e..69a76c2cd5 100644
--- a/macros/latex/contrib/l3kernel/l3seq.dtx
+++ b/macros/latex/contrib/l3kernel/l3seq.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3skip.dtx b/macros/latex/contrib/l3kernel/l3skip.dtx
index 86cc965c91..8d61a42381 100644
--- a/macros/latex/contrib/l3kernel/l3skip.dtx
+++ b/macros/latex/contrib/l3kernel/l3skip.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3sort.dtx b/macros/latex/contrib/l3kernel/l3sort.dtx
index bea3f77030..eb549030e5 100644
--- a/macros/latex/contrib/l3kernel/l3sort.dtx
+++ b/macros/latex/contrib/l3kernel/l3sort.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3str-convert.dtx b/macros/latex/contrib/l3kernel/l3str-convert.dtx
index e6b49a4d39..5d25f30146 100644
--- a/macros/latex/contrib/l3kernel/l3str-convert.dtx
+++ b/macros/latex/contrib/l3kernel/l3str-convert.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3str.dtx b/macros/latex/contrib/l3kernel/l3str.dtx
index 09ed5b723e..54bbb62b41 100644
--- a/macros/latex/contrib/l3kernel/l3str.dtx
+++ b/macros/latex/contrib/l3kernel/l3str.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3styleguide.pdf b/macros/latex/contrib/l3kernel/l3styleguide.pdf
index 6c53631dcd..d0d55018b1 100644
--- a/macros/latex/contrib/l3kernel/l3styleguide.pdf
+++ b/macros/latex/contrib/l3kernel/l3styleguide.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3styleguide.tex b/macros/latex/contrib/l3kernel/l3styleguide.tex
index c2c12020e6..a0da8ccdaa 100644
--- a/macros/latex/contrib/l3kernel/l3styleguide.tex
+++ b/macros/latex/contrib/l3kernel/l3styleguide.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2019-10-21}
+\date{Released 2019-10-24}
\begin{document}
diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
index a373517264..14c94f795d 100644
--- a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
+++ b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.tex b/macros/latex/contrib/l3kernel/l3syntax-changes.tex
index 41230dd97c..827004a90d 100644
--- a/macros/latex/contrib/l3kernel/l3syntax-changes.tex
+++ b/macros/latex/contrib/l3kernel/l3syntax-changes.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2019-10-21}
+\date{Released 2019-10-24}
\newcommand{\TF}{\textit{(TF)}}
diff --git a/macros/latex/contrib/l3kernel/l3sys.dtx b/macros/latex/contrib/l3kernel/l3sys.dtx
index c2a6e79142..709a68b5e3 100644
--- a/macros/latex/contrib/l3kernel/l3sys.dtx
+++ b/macros/latex/contrib/l3kernel/l3sys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.pdf b/macros/latex/contrib/l3kernel/l3term-glossary.pdf
index fe3e68b4bc..7ecb562305 100644
--- a/macros/latex/contrib/l3kernel/l3term-glossary.pdf
+++ b/macros/latex/contrib/l3kernel/l3term-glossary.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.tex b/macros/latex/contrib/l3kernel/l3term-glossary.tex
index 4bd29c2daa..86b9e43a0e 100644
--- a/macros/latex/contrib/l3kernel/l3term-glossary.tex
+++ b/macros/latex/contrib/l3kernel/l3term-glossary.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2019-10-21}
+\date{Released 2019-10-24}
\newcommand{\TF}{\textit{(TF)}}
diff --git a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
index fe34f9698e..4bcb52fa16 100644
--- a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
+++ b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3tl.dtx b/macros/latex/contrib/l3kernel/l3tl.dtx
index 5e8551a7b1..c090740a26 100644
--- a/macros/latex/contrib/l3kernel/l3tl.dtx
+++ b/macros/latex/contrib/l3kernel/l3tl.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3token.dtx b/macros/latex/contrib/l3kernel/l3token.dtx
index 3ac24900ee..2db4d6eea8 100644
--- a/macros/latex/contrib/l3kernel/l3token.dtx
+++ b/macros/latex/contrib/l3kernel/l3token.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3unicode.dtx b/macros/latex/contrib/l3kernel/l3unicode.dtx
index 45bedf0cbf..a3fcdba29e 100644
--- a/macros/latex/contrib/l3kernel/l3unicode.dtx
+++ b/macros/latex/contrib/l3kernel/l3unicode.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-21}
+% \date{Released 2019-10-24}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/source3.pdf b/macros/latex/contrib/l3kernel/source3.pdf
index d4e1544019..5dd662b3c3 100644
--- a/macros/latex/contrib/l3kernel/source3.pdf
+++ b/macros/latex/contrib/l3kernel/source3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/source3.tex b/macros/latex/contrib/l3kernel/source3.tex
index d13109340f..f0f0263443 100644
--- a/macros/latex/contrib/l3kernel/source3.tex
+++ b/macros/latex/contrib/l3kernel/source3.tex
@@ -53,7 +53,7 @@ for those people who are interested.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2019-10-21}
+\date{Released 2019-10-24}
\pagenumbering{roman}
\maketitle
diff --git a/macros/latex/contrib/onedown/examples/onedown-examples.pdf b/macros/latex/contrib/onedown/examples/onedown-examples.pdf
new file mode 100644
index 0000000000..60c32c6677
--- /dev/null
+++ b/macros/latex/contrib/onedown/examples/onedown-examples.pdf
Binary files differ
diff --git a/macros/latex/contrib/onedown/examples/onedown-ref.pdf b/macros/latex/contrib/onedown/examples/onedown-ref.pdf
new file mode 100644
index 0000000000..8b6f3b9018
--- /dev/null
+++ b/macros/latex/contrib/onedown/examples/onedown-ref.pdf
Binary files differ
diff --git a/macros/latex/contrib/subfiles/README b/macros/latex/contrib/subfiles/README
index ef27bf62ee..f456d4f9b4 100644
--- a/macros/latex/contrib/subfiles/README
+++ b/macros/latex/contrib/subfiles/README
@@ -1,6 +1,6 @@
subfiles - class and package for multi-file projects in LaTeX
-Author: Federico Garcia
+Author: Federico Garcia, Gernot Salzer
This material is subject to the LaTeX Project Public License. See
http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
diff --git a/macros/latex/contrib/subfiles/subfiles.dtx b/macros/latex/contrib/subfiles/subfiles.dtx
index 1033a03e98..dacece0461 100644
--- a/macros/latex/contrib/subfiles/subfiles.dtx
+++ b/macros/latex/contrib/subfiles/subfiles.dtx
@@ -2,7 +2,7 @@
%
% subfiles - class and package for multi-file projects in LaTeX
% Copyright 2002, 2012 Federico Garcia (feg8@pitt.edu, fedegarcia@hotmail.com)
-% Copyright 2018 Gernot Salzer (salzer@logic.at)
+% Copyright 2018, 2019 Gernot Salzer (salzer@logic.at)
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -23,13 +23,13 @@
%
%<*driver>
% \fi
-\ProvidesFile{subfiles.dtx}[2018/07/31 v1.2 Multi-file projects]
+\ProvidesFile{subfiles.dtx}[2019/09/28 v1.3 Multi-file projects]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{subfiles.dtx}
-\title{A Document Class and a Package for handling multi-files projects}
+\title{A Document Class and a Package\\for Handling Multi-File Projects}
\date{\filedate{}}
- \author{Federico Garcia\\{\small (v1.2 update by Gernot Salzer)}}
+ \author{Federico Garcia, Gernot Salzer}
\begin{document}
\maketitle
@@ -38,68 +38,205 @@
%</driver>
% \fi
% \begin{abstract}
-% With the |subfiles| set, the typesetting of a multi-file project consisting of one main file and one or more subsidiary files (subfiles) is more comfortable, since the user can \LaTeX\ either the main file, which will |\input| the subfiles normally, or the subfiles by themselves, which take the preamble of the main file and become self-sufficient \LaTeX\ documents.
+% The |subfiles| package allows authors to split a document into one main file and one and more subsidiary files (subfiles) akin to the |\input| command, with the added benefit of making the subfiles compilable by themselves.
+% This is achieved by reusing the preamble of the main file also for the subfiles.
% \end{abstract}
% \section{Introduction}
-% \LaTeX\ commands |\include| and |\input| allow for the creation of different input files to be typeset jointly into a single output. The advantages of this are evident in the creation of large documents with many chapters, but there are also other circumstances in which the author might want to use this feature. I have used it particularly for long-coded examples, tables, figures, etc\@.\footnote{In my case most times it has been musical examples, whose code in MusiX\TeX\ is long, intrincate, and barely readable.}, which require a considerable amount of trial-and-error.
+% The \LaTeX\ commands |\include| and |\input| allow the user to split the \TeX\ source of a document into several input files.
+% This is useful when creating documents with many chapters, but also for handling large tables, figures, and code samples, which require a considerable amount of trial-and-errors.%
+% \footnote{Frederico had to typset numerous musical examples, whose code in MusiX\TeX\ is long, intrincate, and barely readable.}
%
-% In this process the rest of the document is of little use, and it can even disturb.\footnote{For example, the error messages indicate not only a wrong line number, but even the wrong file.} Frequently, one ends up wanting to work \emph{only} on the new file, which means following three steps:
+% In this process the rest of the document is of little use, and can even interfere.
+% For example, error messages may indicate not only the wrong line number, but may point to the wrong file.
+% Frequently, one ends up wanting to work only on the new file:
%
% \begin{itemize}
-% \item Create a new file, and copy-paste in it the preamble of the main file;
-% \item Work in the example, typeset it \emph{alone} as many times as necessary;
-% \item When the result is satisfactory, delete the preamble from the new file (and the |\end{document}|!), and |\include| or (more frequently) |\input| it from the main file.
+% \item Create a new file, and copy-paste the preamble of the main file into it.
+% \item Work on this file, typeset it \emph{alone} as many times as necessary.
+% \item Finally, when the result is satisfactory, delete the preamble from the file (alongside with |\end{document}|!), and |\include| or |\input| it from the main file.
% \end{itemize}
%
-% It is desirable to reduce these three steps to the only interesting one, the middle one. This would mean that each new, subordinated file (henceforth, `subfile') should be \emph{both} part of a project and a self-sufficient \LaTeX\ document, depending on whether it is \LaTeX ed or |\included|/|\input|. This is what the set of class and package under the name |subfiles| is intended for.
-%
-% The main idea behind it is the redefinition of |\documentclass| and the |document| environment; while these two features of \LaTeX\ are important to keep unchanged, |subfiles| changes them, as far as I know, harmlessly, and I have took care of undoing the changes when finished. This is the first version of |subfiles|, and although I have tried it a few times, it is still susceptible to conflicts with other packages and/or classes. (In fact, a conflict with the |revtex4| class later gave rise to version 1.2 of the package.)
-%
-% \section{Usage}
-%
-% \subsection{Setting up}
-%
-% The files involved have the following basic structures:
+% It is desirable to reduce these three steps to the interesting, middle one.
+% Each new, subordinate file (henceforth `subfile') should behave both as a self-sufficient \LaTeX\ document and as part of the whole project, depending on whether it is \LaTeX ed individually or |\included|/|\input| from the main document.
+% This is what the class |subfiles.cls| and the package |subfiles.sty| are intended for.
%
+% \section{Basic usage}
+%
+% The main file, i.e., the file with the preamble to be shared with the subfiles, has to load the package |subfiles| \emph{at the very end of the preamble}:
+% \begin{center}
+% \begin{tabular}{l}
+% |\usepackage{subfiles}|\\
+% |\begin{document}|
+% \end{tabular}
+% \end{center}
+% Subordinate files (subfiles) are loaded from the main file or from other subfiles with the command
+% \begin{center}
+% |\subfile{|\meta{subfile\_name}|}|
+% \end{center}
+% The subfiles have to start with the line
+% \begin{center}
+% |\documentclass[|\meta{main\_file\_name}|]{subfiles}|
+% \end{center}
+% which loads the class |subfiles|.
+% Its only `option', which is actually mandatory, gives the name of the main file.
+% This name follows \TeX\ conventions: |.tex| is the default extension, the path has to be provided if the main file is in a different directory, and directories in the path have to be separated by |/| (not |\|).
+% Thus, we have the following structure:
% \begin{center}\small
-% \begin{tabular}{ll}
-% \multicolumn{1}{c}{\emph{MAIN FILE}} & \multicolumn{1}{c}{\emph{SUBFILE}}\\
-% \qquad\meta{some preamble} & |\documentclass[|\meta{main\_file\_name}|]{subfiles}|\\
-% |\usepackage{subfiles}| & |\begin{document}|\\
-% |\begin{document}| & \qquad\meta{text, graphics, etc.}\\
-% \qquad\meta{text}&|\end{document}|\\
-% |\subfile{|\meta{subfile\_name}|}|\\
-% \qquad\meta{more text}\\
-% |\end{document}|
-% \end{tabular}
+% \begin{tabular}[t]{l}
+% \multicolumn{1}{c}{main file} \\
+% \hline
+% |\documentclass[...]{...}| \\
+% \meta{shared preamble} \\
+% |\usepackage{subfiles}| \\
+% |\begin{document}| \\
+% \dots \\
+% |\subfile{|\meta{subfile\_name}|}| \\
+% \dots \\
+% |\end{document}| \\
+% \hline
+% \end{tabular}
+% \hfill
+% \begin{tabular}[t]{l}
+% \multicolumn{1}{c}{subfile} \\
+% \hline
+% |\documentclass[|\meta{main\_file\_name}|]{subfiles}| \\
+% |\begin{document}| \\
+% \dots \\
+% |\end{document}| \\
+% \hline
+% \end{tabular}
% \end{center}
-%
-% The |subfiles| package is to be loaded in the main file of a \LaTeX\ project at the end of the preamble, and the |subfiles| class is to be loaded by each subordinate file. Note that the |subfiles| class handles only \emph{one} `option' (whose presence is actually mandatory), the name of the main file. The name should be given according to \TeX\ conventions: |.tex| is the default extension; the path has to be indicated (|/|, not |\|) if the main file is in a different directory from the subfile; spaces are gobbled (at least under Windows).
-%
-% \subsection{Results}
-% This done, \LaTeX ing either the main or the subordinate file produces the following results:
+% Now there are two possibilities.
% \begin{itemize}
-% \item If the subfile is typeset by itself, it takes as preamble the one of the main file (including its |\documentclass|). The rest is typeset normally.
-% \item If the subordinated file was |\subfile|'d, it ignores everything before and including |\begin{document}|, and then ignores |\end{document}| too. (The body of the file, nothing else, is effectively |\input|.)
+% \item If \LaTeX\ is run on the subfile, the line |\documentclass[..]{subfiles}| is replaced by the preamble of the main file (including its |\documentclass| command).
+% The rest of the subfile is processed normally.
+% \item If \LaTeX\ is run on the main file, the subfile is loaded like with an |\input| command, except that the three lines |\documentclass[..]{subfiles}|, |\begin{document}|, and |\end{document}| are ignored.
% \end{itemize}
+%
+% \section{Advanced usage}
+%
+% \subsection{Hierarchy of directories}
+%
+% Sometimes it is desirable to put a subfile together with its images and further files into its own directory.
+% The difficulty now is that these additional files have to be addressed by different pathes depending on whether the main files or the subfile is typeset.
+% As of version 1.3, the |subfiles| package handles this problem by using the |import| package.
+%
+% As an example, consider the following hierarchy of files:
+% \begin{center}\ttfamily
+% \begin{tabular}{l}
+% main.tex\\
+% mypreamble.tex\\
+% dir1/subfile1.tex\\
+% dir1/image1.jpg\\
+% dir1/text1.tex\\
+% dir1/dir2/subfile2.tex\\
+% dir1/dir2/image2.jpg\\
+% dir1/dir2/text2.tex
+% \end{tabular}
+% \end{center}
+% where |main|, |subfile1|, and |subfile2| have the following contents:
+% \begin{center}
+% \begin{tabular}[t]{l}
+% \multicolumn{1}{c}{|main.tex|} \\
+% \hline
+% |\documentclass{article}| \\
+% |\input{mypreamble}| \\
+% |\usepackage{graphicx}| \\
+% |\usepackage{subfiles}| \\
+% |\begin{document}| \\
+% |\subfile{dir1/subfile1}|\\
+% |\end{document}|\\
+% \hline
+% \end{tabular}%
+% \hfill
+% \begin{tabular}[t]{l}
+% \multicolumn{1}{c}{|subfile1.tex|} \\
+% \hline
+% |\documentclass[../main]{subfiles}| \\
+% |\begin{document}| \\
+% |\input{text1}|\\
+% |\includegraphics{image1.jpg}|\\
+% |\subfile{dir2/subfile2}| \\
+% |\end{document}| \\
+% \hline
+% \end{tabular}\\[2ex]
+% \begin{tabular}[t]{l}
+% \multicolumn{1}{c}{|subfile2.tex|} \\
+% \hline
+% |\documentclass[../../main]{subfiles}| \\
+% |\begin{document}| \\
+% |\input{text2}|\\
+% |\includegraphics{image2.jpg}|\\
+% |\end{document}| \\
+% \hline
+% \end{tabular}
+% \end{center}
+% Then each of the three files can be typeset individually in its respective directory, where \LaTeX\ is able to locate all included text files and images.
%
-% The |\subfile| command is more like |\input| than |\include| in the sense that it does not start a new page. It allows nesting, but there is no exclusion mechanism analogous to |\includeonly|.
+% \subsection{Additional definitions for subfiles}
%
-% \subsection{Further details and warnings}
+% Usually all definitions and packages required by the subfiles should go into the preamble of the main file.
+% There are some places, though, where one might consider adding definitions for the subfiles.
%
-% To be precise, a subfile typeset by itself does not exactly take the preamble of the main file, but \emph{everything outside} \verb|\begin{document}| and \verb|\end{document}|. This has two consequences: $a)$~the user can add some commands to be read only when the subfiles are typeset by themselves---which in any case are processed as part of the preamble; but also $b)$~the user has to be careful even \emph{after} |\end{document}| (in the main file), for any syntax error there will ruin the \LaTeX ing of the subfile(s).
+% \paragraph{Code after the end of the main document} is added to the preamble of the subfiles, but is ignored when typesetting the main file.
+% This happens because a subfile typeset by itself does not really take the preamble of the main file, but \emph{everything outside} of \verb|\begin{document}| and \verb|\end{document}|.
+% This has two consequences: \emph{a)}~the user can add some commands to be processed as part of the preamble only when the subfiles are typeset by themselves; but also \emph{b)}~the user has to be careful even \emph{after} |\end{document}| in the main file, for any syntax error there will ruin the \LaTeX ing of the subfile(s).
%
-% The preamble of the main file can |\input| (not |\include| nor |\subfile|) other files (e.g.\ files with definitions and shorthand-commands), and the subfiles will too. But it has to be kept in mind that each subfile is |\input| within a group, so definitions made within them might not work outside. A good practice when using |subfiles| (and also when not using it) is to make any definitions in the preamble of the main file, avoiding confusion and allowing to find them easily.
+% \paragraph{Code in the preamble of a subfile} is processed as part of the text when typesetting the main file, but as part of the preamble when typesetting the subfile.
+% This means that the preamble of a subfile can only contain stuff that is acceptable for both, the preamble and the text area.
+% One should also keep in mind that each subfile is |\input| within a group, so definitions made within may not work outside.
+% A good practice when using |subfiles| (and also when not using it) is to make any definitions in the preamble of the main file, avoiding confusion and allowing the reader to find them easily.
+%
+% \subsection{Avoiding extra spaces}
+%
+% Sometimes you may want to load the contents of a subfile without white space separating it from the contents of the main file.
+% In this respect |\subfile| behaves like |\input|.
+% Any space or newline before and after the |\subfile| command will appear in the typeset document, as will any white space between the last character of the subfile and |\end{document}|.
+% Therefore, to load the contents of a subfile without intervening spaces, you have either to add comment signs:
+% \begin{center}
+% \begin{tabular}[t]{l}
+% \multicolumn{1}{c}{|main.tex|}\\
+% \hline
+% \dots\\
+% |text before%|\\
+% |\subfile{sub.tex}%|\\
+% |text after|\\
+% \hline
+% \end{tabular}
+% \qquad
+% \begin{tabular}[t]{l}
+% \multicolumn{1}{c}{|sub.tex|}\\
+% \hline
+% |\documentclass[main.tex]{subfiles}|\\
+% |\begin{document}|\\
+% |contents of subfile%|\\
+% |\end{document}|\\
+% \hline
+% \end{tabular}
+% \end{center}
+% or to put everything on the same line:
+% \begin{center}
+% |text before\subfile{sub.tex}text after|\\
+% |contents of subfile\end{document}|
+% \end{center}
%
-% In principle, nesting files with |\subfile| should work and has worked in my tries, as far as every subfile loads the main file as its option to the |subfiles| class. However, who knows, the behavior can be unpredictable in weird situations. In any case, |subfiles| does \emph{not} disable |\include| nor |\input|, which remain available for free use.
+% \section{Dependencies}
%
-% The |subfiles| package requires the |verbatim| package (whose |comment| environment is used to ignore the different parts of different files); this should not be a problem since it makes part of the standard distribution of \LaTeX $2_\varepsilon$.
+% The |subfiles| package requires the |verbatim| package, whose |comment| environment is used to ignore the text area of the main file when typesetting subfiles separately.
+% Moreover, the |import| package is needed to load subfiles and their auxiliary files from different directories.
+% Both packages are part of the standard \TeX\ distributions.
%
-% \subsection{Version history}
+% \section{Version history}
%
% \begin{description}
-% \item[v1.1:] Start of version history. Written by Federico Garcia.
-% \item[v1.2:] The |subfiles| package is now compatible with classes and packages that modify the |\document| command, like the class |revtex4|. Modification by Gernot Salzer.
+% \item[v1.1 (FG):]
+% Start of version history.
+% \item[v1.2 (GS):]
+% The |subfiles| package becomes compatible with classes and packages that modify the |\document| command, like the class |revtex4|.
+% \item[v1.3 (GS):]
+% Use of |import| package to handle directory hierarchies.
+% |\ignorespaces| added to avoid spurious spaces.
+% Incompatibility with commands removed that expect |\document| to be equal to |\@onlypreamble| after the preamble (thanks to Eric Domenjoud for analysing the problem).
% \end{description}
%
%\section{The Implementation}
@@ -107,70 +244,169 @@
% \begin{macrocode}
%<*class>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{subfiles}[2018/07/31 Federico Garcia, Gernot Salzer]
+\ProvidesClass{subfiles}[2019/09/28 v1.3 Federico Garcia, Gernot Salzer]
\DeclareOption*{\typeout{Preamble taken from file `\CurrentOption'}%
\let\preamble@file\CurrentOption}
-\ProcessOptions
+\ProcessOptions
% \end{macrocode}
%
-% The first thing to do is to save the regular \LaTeX\ definition of |\documentclass|:
+% We start by saving the regular \LaTeX\ definition of |\documentclass|:
+%
% \begin{macrocode}
-\let\old@documentclass@subfiles\documentclass
+\let\subfiles@documentclass\documentclass
% \end{macrocode}
%
-% Now |\documentclass|, after having already loaded |subfiles.cls|, is set equal to |\LoadClass| such that the class and the options of the main file will be loaded identically.
+% Now |\documentclass| is set equal to |\LoadClass| such that the class and the options of the main file will be loaded as usual.
+%
% \begin{macrocode}
\let\documentclass\LoadClass\relax
% \end{macrocode}
%
-% Now it is possible to |\input| the main file. The main file loads the package |subfiles| as part of the preamble, which saves the contents of |\document| and |\enddocument| as |\old@document@subfiles| and |\old@enddocument@subfiles|, respectively. After having loaded the main file, we can restore the original values of |\document|, |\enddocument| and |\documentclass|. The backup commands are |\undefined| to save memory. That's it.
+% To handle subfiles in separate directories, we load the |import| package.
+%
+% \begin{macrocode}
+\RequirePackage{import}
+% \end{macrocode}
+%
+% The |\subimport| command requires the path and the basename of the file to be loaded in separate arguments.
+% Therefore we have to decompose file names into these two components.
+%
+% \begin{macrocode}
+\def\subfiles@split#1{%
+ \edef\subfiles@filename{#1}%
+ \def\subfiles@dir{}%
+ \def\subfiles@base{}%
+ \def\subfiles@sep{}%
+ \expandafter\subfiles@split@\subfiles@filename/\@nil/%
+}
+\def\subfiles@split@#1/{%
+ \def\tmp{#1}%
+ \ifx\tmp\@nnil
+ \let\subfiles@next\relax
+ \else
+ \edef\subfiles@dir{\subfiles@dir\subfiles@base\subfiles@sep}%
+ \def\subfiles@base{#1}%
+ \def\subfiles@sep{/}%
+ \let\subfiles@next\subfiles@split@
+ \fi
+ \subfiles@next
+}
+% \end{macrocode}
+%
+% After executing e.g.\ |\subfiles@split{../dir1/dir2/file.tex}|, the commands |\subfiles@dir| and |\subfiles@base| expand to |../dir1/dir2/| and |file.tex|, respectively.
+%
+% Now we split the name of the main file that has been provided as optional argument of the document class, and |\subimport| the main file.
+%
+% \begin{macrocode}
+\subfiles@split{\preamble@file}
+\subimport{\subfiles@dir}{\subfiles@base}
+% \end{macrocode}
+%
+% The main file loads the package |subfiles| as part of the preamble, which saves the contents of |\document| and |\enddocument| as |\subfiles@document| and |\subfiles@enddocument|, respectively.
+% Then we restore the original values of |\document|, |\enddocument|, and |\documentclass|. The backup commands are |\undefined| to save memory. That's it.
+%
% \begin{macrocode}
-\input{\preamble@file}
{\catcode`\@=11
-\global\let\document\old@document@subfiles
-\global\let\enddocument\old@enddocument@subfiles
-\global\let\documentclass\old@documentclass@subfiles
-\global\let\old@document@subfiles\undefined
-\global\let\old@enddocument@subfiles\undefined
-\global\let\old@documentclass@subfiles\undefined}
-%</class>
+\global\let\document\subfiles@document
+\global\let\enddocument\subfiles@enddocument
+\global\let\documentclass\subfiles@documentclass
+\global\let\subfiles@document\undefined
+\global\let\subfiles@enddocument\undefined
+\global\let\subfiles@documentclass\undefined
+}
+%</class>
% \end{macrocode}
%
-% It may not be obvious why |@| has to be catcoded to a letter, since we are in a style file anyway. However, the |\preamble@file| occasionally contains |\usepackage| commands that make |@| a non-letter. This is why the part after loading the main preamble needs a |\catcode| command, grouping, and |\global|'s.
+% It may not be obvious why |@| has to be catcoded to a letter, since we are in a style file anyway.
+% However, the |\preamble@file| occasionally contains |\usepackage| commands that make |@| a non-letter.
+% This is why the part after loading the main preamble needs a |\catcode| command, grouping, and |\global|'s.
+%
%
% \subsection{The package}
-% Any option will be ignored.
+%
+% Any option will be ignored.
+%
% \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{subfiles}[2018/07/31 Federico Garcia, Gernot Salzer]
+\ProvidesPackage{subfiles}[2019/09/28 v1.3 Federico Garcia, Gernot Salzer]
\DeclareOption*{\PackageWarning{\CurrentOption ignored}}
\ProcessOptions
\RequirePackage{verbatim}
% \end{macrocode}
%
-% \DescribeMacro{\skip@preamble}
-% The core of the package. It works by redefining the |document| environment, thus making |\begin{document}| and |\end{document}| of the subfile transparent to the inclusion. The redefinition of |\documentclass| is analogous, just having a required and an optional arguments which mean nothing to |\subfile|.
+% To handle subfiles in separate directories, we load the |import| package.
+%
% \begin{macrocode}
-\newcommand{\skip@preamble}{%
- \let\document\relax\let\enddocument\relax%
- \newenvironment{document}{}{}%
- \renewcommand{\documentclass}[2][subfiles]{}}
+\RequirePackage{import}
% \end{macrocode}
+%
+% The |\import| command requires the path and the basename of files in separate arguments.
+% Therefore we have to decompose file names into these two components.
%
+% \begin{macrocode}
+\def\subfiles@split#1{%
+ \edef\subfiles@filename{#1}%
+ \def\subfiles@dir{}%
+ \def\subfiles@base{}%
+ \def\subfiles@sep{}%
+ \expandafter\subfiles@split@\subfiles@filename/\@nil/%
+}
+\def\subfiles@split@#1/{%
+ \def\tmp{#1}%
+ \ifx\tmp\@nnil
+ \let\subfiles@next\relax
+ \else
+ \edef\subfiles@dir{\subfiles@dir\subfiles@base\subfiles@sep}%
+ \def\subfiles@base{#1}%
+ \def\subfiles@sep{/}%
+ \let\subfiles@next\subfiles@split@
+ \fi
+ \subfiles@next
+}
+% \end{macrocode}
+%
+% After executing e.g.\ |\subfiles@split{../dir1/dir2/file.tex}|, the commands |\subfiles@dir| and |\subfiles@base| expand to |../dir1/dir2/| and |file.tex|, respectively.
+%
% \DescribeMacro{\subfile}
-% Note that the new command |\subfile| calls for |\skip@preamble| \emph{within a group}. The changes to |document| and |\documentclass| are undone after the inclusion of the subfile.
+% The command |\subfile| first redefines |\documentclass| and the |document| environment to do nothing.
+% To avoid spurious spaces we |\ignorespaces|.
+% Moreover, we have to set |\document| to the value it usually has after the end of the preamble, since some commands check this value and raise an error saying that the command cannot be used in the preamble.
+%
% \begin{macrocode}
-\newcommand\subfile[1]{\begingroup\skip@preamble\input{#1}\endgroup}
+\newcommand\subfile[1]{%
+ \begingroup
+ \renewcommand\documentclass[2][subfiles]{\ignorespaces}%
+ \renewenvironment{document}{\let\document\@onlypreamble\ignorespaces}{}%
% \end{macrocode}
-% If the package is being processed as part of the main file, then we are done. However, if the initial document class was |subfiles|, then the main file is loaded as part of a subfile. In this case the subsequent text between |\begin{document}| and |\end{document}| has to be skipped, but the contents of the commands |\document| and |\enddocument| has to be retained for using it with the contents of the subfile. Therefore we save the contents of the two commands as |\old@document@subfiles| and |\old@enddocument@subfiles|, respectively. Now the |document| environment is redefined to become the |comment| environment from the |verbatim| package. As a consequence, the body of the main file is ignored by \LaTeX, and only the preamble is read (and anything that comes after |\end{document}|!).
+%
+% Now we split the file name into path and base name and |\subimport| it.
+%
+% \begin{macrocode}
+ \subfiles@split{#1}%
+ \subimport{\subfiles@dir}{\subfiles@base}%
+ \unskip
+ \endgroup
+}
+% \end{macrocode}
+%
+% Note that the changes to |\documentclass| and the |document| environment happen \emph{within a group}, so they are undone after inclusion of the subfile.
+%
+% If the package is being processed as part of the main file, then we are done.
+% However, if the initial document class was |subfiles|, then the main file is loaded as part of a subfile.
+% In this case anything between |\begin{document}| and |\end{document}| has to be skipped, while the contents of the commands |\document| and |\enddocument| has to be retained for later use in the subfile.
+% Therefore we save the contents of the two commands as |\subfiles@document| and |\subfiles@enddocument|, respectively.
+% Now the |document| environment is redefined to become the |comment| environment from the |verbatim| package.
+% Consequently, the body of the main file is ignored by \LaTeX, and only the preamble is read (as well as anything that comes after |\end{document}|!).
% \begin{macrocode}
\@ifclassloaded{subfiles}{%
- \let\old@document@subfiles\document
- \let\old@enddocument@subfiles\enddocument
+ \let\subfiles@document\document
+ \let\subfiles@enddocument\enddocument
\let\document\comment
\let\enddocument\endcomment
}{}
%</package>
% \end{macrocode}
-% By loading the |subfiles| package immediately before |\begin{document}| we ensure that |\old@document@subfiles| and |\old@enddocument@subfiles| contain all modifications that the class and the preamble of the main file may have applied to the |document| environment. E.g., the class |revtex4| prepends some commands to |\document|. \ No newline at end of file
+%
+% By loading the |subfiles| package immediately before |\begin{document}| we ensure that |\subfiles@document| and |\subfiles@enddocument| contain all modifications that the class and the preamble of the main file may have applied to the |document| environment.
+% This happens e.g.\ with the class |revtex4| and the package |pythontex|. \ No newline at end of file
diff --git a/macros/latex/contrib/subfiles/subfiles.ins b/macros/latex/contrib/subfiles/subfiles.ins
index f188c09f37..95380c1670 100644
--- a/macros/latex/contrib/subfiles/subfiles.ins
+++ b/macros/latex/contrib/subfiles/subfiles.ins
@@ -1,6 +1,6 @@
% subfiles - class and package for multi-file projects in LaTeX
% Copyright 2002, 2012 Federico Garcia (feg8@pitt.edu, fedegarcia@hotmail.com)
-% Copyright 2018 Gernot Salzer (salzer@logic.at)
+% Copyright 2018, 2019 Gernot Salzer (salzer@logic.at)
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -23,7 +23,7 @@
This is a generated file.
-Copyright 2002, 2012 Federico Garcia; 2018 Gernot Salzer
+Copyright 2002, 2012 Federico Garcia; 2018, 2019 Gernot Salzer
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/subfiles/subfiles.pdf b/macros/latex/contrib/subfiles/subfiles.pdf
index b3c3d0fcf1..198e52a89d 100644
--- a/macros/latex/contrib/subfiles/subfiles.pdf
+++ b/macros/latex/contrib/subfiles/subfiles.pdf
Binary files differ
diff --git a/macros/latex/contrib/ucalgmthesis/README.md b/macros/latex/contrib/ucalgmthesis/README.md
index 918cd6e6ba..2b3c1b74d4 100644
--- a/macros/latex/contrib/ucalgmthesis/README.md
+++ b/macros/latex/contrib/ucalgmthesis/README.md
@@ -59,6 +59,11 @@ with parts `\include`'d from separate files. Here's a minimal file:
\end{document}
```
+The easiest way to get started is perhaps to rename
+`sample-thesis.tex`, change the metadata and layout options to your
+liking, and put the content of your thesis into the files it includes
+(`frontmatter.tex`, `chapter1.tex`, etc.)
+
Commands
--------
@@ -98,13 +103,17 @@ The class takes a number of options:
- `singlespaced`, `onehalfspaced`, `doublespaced` sets up the line
spacing (`onehalfspaced` is the default).
-- `palatino`, `times`, `garamond`, `utopia`, `libertine` offer some nice
- alternative typefaces (i.e., fonts) to the default Computer Modern.
+- `palatino`, `times`, `garamond`, `utopia`, `libertine` offer some
+ nice alternative typefaces (i.e., fonts) to the default Computer
+ Modern. Note that `garamond` uses the
+ [`garamondx`](https://ctan.org/tex-archive/fonts/garamondx?lang=en)
+ package, which is not included in the TeXLive distibution (and is
+ not available on Overleaf).
-- `headers` produces running heads. Per the guidelines, must not be
- the thesis title or author's name, and must be separated from the
- main text by a line. The class uses the chapter number and title and
- places it flush right in the header.
+- `headers` produces running heads. Per the guidelines, the running
+ heads must not be the thesis title or author's name, and must be
+ separated from the main text by a line. The class uses the chapter
+ number and title and places it flush right in the header.
- `fullpage` calls `\fullpagethesis`, so produces a thesis with 1"
margins all around. This produces very long lines and is not
@@ -186,6 +195,12 @@ Troubleshooting and Known Issues
- `garamond` and `utopia` use the `mathdesign` package, which has a buggy
`\hrulefill` command. The package tries to correct this.
+- `garamond` uses the `garamondx` package. This package has a
+ restrictive license and is thus not included in the TeXLive
+ distribution. Use the
+ [`getnonfreefonts`](https://www.tug.org/fonts/getnonfreefonts/)
+ installer to download it.
+
- The guidelines require that the official filed thesis is laid out
for one-sided printing (equal left and right margins). You may want
to print the thesis two-sided, however, e.g., to give a nice bound
diff --git a/macros/latex/contrib/ucalgmthesis/appendix.tex b/macros/latex/contrib/ucalgmthesis/appendix.tex
index f5700956db..4ef131f611 100644
--- a/macros/latex/contrib/ucalgmthesis/appendix.tex
+++ b/macros/latex/contrib/ucalgmthesis/appendix.tex
@@ -8,7 +8,7 @@
\chapter*{Appendix}\label{appendix}
% \chapter* doesn't include it in the TOC, so we have to do that by
-% hand. If you have multiple chapters, use \chapter instead and
+% hand. If you have multiple appendices, use \chapter instead and
% remove the following line.
\addcontentsline{toc}{chapter}{Appendix}
diff --git a/macros/latex/contrib/ucalgmthesis/sample-thesis.pdf b/macros/latex/contrib/ucalgmthesis/sample-thesis.pdf
index 79e876a302..8cc7d5a167 100644
--- a/macros/latex/contrib/ucalgmthesis/sample-thesis.pdf
+++ b/macros/latex/contrib/ucalgmthesis/sample-thesis.pdf
Binary files differ
diff --git a/macros/latex/contrib/ucalgmthesis/sample-thesis.tex b/macros/latex/contrib/ucalgmthesis/sample-thesis.tex
index 610fe03987..96fc6b4ace 100644
--- a/macros/latex/contrib/ucalgmthesis/sample-thesis.tex
+++ b/macros/latex/contrib/ucalgmthesis/sample-thesis.tex
@@ -1,24 +1,28 @@
% A Sample Thesis for the University of Calgary
% =============================================
-% Load the UCalgary Memoir Thesis class. By default (without options),
-% this produces a 1-1/2 spaced thesis in 11 point font without running
-% heads. Use package options singlespaced or doublespaced for single
-% or double line spacing. The default font is LaTeX's Computer
-% Modern. Use package options times, palatino, libertine, garamond, or
-% utopia for other nice typefaces. (You may need to install the
-% relevant packages to get these to work.) Use package option headers
-% if you want running heads. Use option fullpage if you want the text
-% to occupy all allowable space (1 inch margins all around), or option
-% manuscript if you want a page layout suitable for reviewing and
-% proof reading. Option manuscript selects 12 pt type, doublespaced,
-% approx. 25 lines per page, with approx. 72 characters per line. You
-% may want to remove the option for the version you file in the Vault;
-% it looks nicer and is a bit more compact. You can also use any
-% options that the memoir class recognizes, such as 10pt for 10 point
-% font, 11pt for 11 point font, 12pt for 12 point type,
-% etc. Documentation of the memoir package can be found at
-% https://ctan.org/pkg/memoir?lang=en
+% This is a sample LaTeX document to build a University of Calgary
+% graduate thesis according to the guidelines of the Faculty of
+% Graduate Studies, available here:
+% https://grad.ucalgary.ca/current-students/thesis-based-students/thesis/building-thesis
+
+% To use this sample for your own thesis, rename this file, make any changes
+% necessary, then add the content of your thesis t othe included files
+% frontmatter.tex, chapter1.tex, etc.
+
+% First, we load the UCalgary Memoir Thesis class ucalgmthesis,
+% available at https://github.com/rzach/ucalgmthesis
+
+% By default (without options), this produces a 1-1/2 spaced thesis in
+% 11 point font without running heads. See the README file for a
+% description of all package options.
+
+% In our sample we give three options: Option utopia sets the thesis in a
+% nice font. Option headers produces running heads. Option manuscript
+% formats the page in a way suitable for reading and commenting: 12 pt type,
+% double spaced, approx. 25 lines per page, with approx. 72 characters
+% per line. For filing in the Vault, remove that option to produce a
+% more compact thesis with a slightly better layout.
\documentclass[utopia,headers,manuscript]{ucalgmthesis}
@@ -37,8 +41,7 @@
\usepackage{microtype}
% We'll need some colored links, so we load xcolor and hyperref. But
-% you can take that out if you don't want links at all or are happy
-% with the standard garish colored boxes.
+% you can take that out if you don't want links at all.
\usepackage[dvipsnames]{xcolor}
@@ -100,7 +103,7 @@
% The year
-\thesisyear{2018}
+\thesisyear{2019}
% Tell hyperref to put author and title into the PDF metadata
@@ -123,6 +126,8 @@
% \includeonly{titlepage}
+% and then copy the resulting PDF to a separate file.
+
\begin{document}
\frontmatter
@@ -153,8 +158,9 @@
\include{backmatter}
-% The appendix contains material that would clutter up the main
-% text. Remove it if you don't have an appendix.
+% The appendix contains material that would clutter up the main text,
+% such as program code, survey instruments, or interview transcripts.
+% Remove it if you don't have an appendix.
\appendix
diff --git a/macros/latex/contrib/ucalgmthesis/ucalgmthesis.cls b/macros/latex/contrib/ucalgmthesis/ucalgmthesis.cls
index 23cd021b0d..3e2c691def 100644
--- a/macros/latex/contrib/ucalgmthesis/ucalgmthesis.cls
+++ b/macros/latex/contrib/ucalgmthesis/ucalgmthesis.cls
@@ -11,7 +11,7 @@
% Distributed under the terms of the MIT License
% https://opensource.org/licenses/MIT
-\ProvidesClass{ucalgmthesis}[2019/04/02
+\ProvidesClass{ucalgmthesis}[2019/10/24
University of Calgary Memoir Thesis Class]
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
@@ -85,12 +85,12 @@
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
-% By default, typeset with one half spacing, no running heads, 11 pt
+% By default, typeset with one half spacing, no running heads
\ExecuteOptions{onehalfspaced,plain}
% Tell memoir the document has to be one-sided (i.e., don't switch
-% margins, etc.) and don't add empty pages before new chapters
+% margins, etc.), 11 pt, and don't add empty pages before new chapters
\PassOptionsToClass{openany,oneside,11pt}{memoir}
\ProcessOptions
@@ -119,8 +119,13 @@
\newcommand{\manuscriptthesis}{%
\setlxvchars
- \settypeblocksize{25\baselineskip}{1.1\lxvchars}{*}%
- \setulmargins{*}{*}{*}%
+ \settypeblocksize{25\baselineskip}{1.1\lxvchars}{*}
+ \if@twoside
+ \setlrmargins{*}{*}{1.618}
+ \else
+ \setlrmargins{*}{*}{1}
+ \fi
+ \setulmargins{*}{*}{*}
\checkandfixthelayout}
% fix a bug in mathdesign