summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/file-syn.mklx
blob: 25f36f742fc786517b93281d6c3d15ca13dcbe75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
%D \module
%D   [       file=file-syn, % was core-fil,
%D        version=20110701, % 1997.11.15,
%D          title=\CONTEXT\ File Macros,
%D       subtitle=Module Support,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt File Macros / Synonyms}

\unprotect

\registerctxluafile{file-syn}{}

%D \macros
%D   {definefilesynonym,definefilefallback}
%D
%D One of the problems with loading files is that their names can depend on the
%D interface language. We therefore need a method to define filesynonyms. The actual
%D synonyms are defined elsewhere, but look like:
%D
%D \starttyping
%D \definefilesynonym [chemic]  [chemie]
%D \definefilesynonym [einheit] [unit]
%D \definefilesynonym [unit]    [unit]
%D \stoptyping
%D
%D So we can say in english:
%D
%D \starttyping
%D \usemodules[pictex,chemic,unit]
%D \stoptyping
%D
%D and in dutch:
%D
%D \starttyping
%D \usemodules[pictex,chemie,unit]
%D \stoptyping

\permanent\tolerant\def\definefilesynonym     [#name]#spacer[#realname]{\clf_definefilesynonym {#name}{#realname}}
\permanent\tolerant\def\definefilefallback[#name]#spacer[#alternatives]{\clf_definefilefallback{#name}{#alternatives}}

%D \macros
%D   {truefilename}
%D
%D At the system level such a filename can be called upon by saying:
%D
%D \starttyping
%D \truefilename{filename/filesynonym}
%D \stoptyping
%D
%D The implementation shows that nesting is supported.

\permanent\def\truefilename#1{\clf_truefilename{#1}}

\protect \endinput