file-syn.mkvi /size: 1828 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=file-syn, % was core-fil,
3
%D version=20110701, % 1997.11.15,
4
%D title=\CONTEXT\ File Macros,
5
%D subtitle=Module Support,
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is
11
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12
%C details.
13 14
\writestatus
{
loading
}{
ConTeXt
File
Macros
/
Synonyms
}
15 16
\unprotect
17 18
\registerctxluafile
{
file
-
syn
}{}
19 20
%D \macros
21
%D {definefilesynonym,definefilefallback}
22
%D
23
%D One of the problems with loading files is that their names
24
%D can depend on the interface language. We therefore need a
25
%D method to define filesynonyms. The actual synonyms are
26
%D defined elsewhere, but look like:
27
%D
28
%D \starttyping
29
%D \definefilesynonym [chemic] [chemie]
30
%D \definefilesynonym [einheit] [unit]
31
%D \definefilesynonym [unit] [unit]
32
%D \stoptyping
33
%D
34
%D So we can say in english:
35
%D
36
%D \starttyping
37
%D \usemodules[pictex,chemic,unit]
38
%D \stoptyping
39
%D
40
%D and in dutch:
41
%D
42
%D \starttyping
43
%D \usemodules[pictex,chemie,unit]
44
%D \stoptyping
45 46
\unexpanded
\def
\definefilesynonym
{
\dodoubleempty
\syst_files_define_synonym
}
47
\unexpanded
\def
\definefilefallback
{
\dodoubleargument
\syst_files_define_fallback
}
% still used?
48 49
\def
\syst_files_define_synonym
[#
name
][#
realname
]
{
\clf_definefilesynonym
{
#
name
}{
#
realname
}}
50
\def
\syst_files_define_fallback
[#
name
][#
alternatives
]
{
\clf_definefilefallback
{
#
name
}{
#
alternatives
}}
51 52
%D \macros
53
%D {truefilename}
54
%D
55
%D At the system level such a filename can be called upon by
56
%D saying:
57
%D
58
%D \starttyping
59
%D \truefilename{filename/filesynonym}
60
%D \stoptyping
61
%D
62
%D The implementation shows that nesting is supported.
63 64
\def
\truefilename
#
1
{
\clf_truefilename
{
#
1
}}
65 66
\protect
\endinput
67