diff options
Diffstat (limited to 'tex/context/base/core-fil.tex')
-rw-r--r-- | tex/context/base/core-fil.tex | 248 |
1 files changed, 127 insertions, 121 deletions
diff --git a/tex/context/base/core-fil.tex b/tex/context/base/core-fil.tex index 27204558d..0f506f3c9 100644 --- a/tex/context/base/core-fil.tex +++ b/tex/context/base/core-fil.tex @@ -1,121 +1,127 @@ -% NOT YET DOCUMENTED !! -% -% overal \normalinput - - -%D \module -%D [ file=core-fil, -%D version=1997.11.15, -%D title=\CONTEXT\ Core Macros, -%D subtitle=File Support, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. Non||commercial use is -%C granted. - -\writestatus{loading}{Context Core Macros / File Support} - -\unprotect - -%D \macros -%D {definefilename} -%D -%D One of the problems with loading files is that their names -%D can depend on the interface language. We therefore need a -%D method to define filesynonyms. The actual synonyms are -%D defined elsewhere, but look like: -%D -%D \starttypen -%D \definefilesynonym [chemic] [chemie] -%D \definefilesynonym [einheit] [eenheid] -%D \definefilesynonym [unit] [eenheid] -%D \stoptypen -%D -%D So we can say in english: -%D -%D \starttypen -%D \usemodules[pictex,chemic,unit] -%D \stoptypen -%D -%D and in dutch: -%D -%D \starttypen -%D \usemodules[pictex,chemie,eenheid] -%D \stoptypen - -\def\definefilesynonym% - {\dodoubleempty\dodefinefilesynonym} - -\def\dodefinefilesynonym[#1][#2]% - {\lowercase{\setevalue{\??fs#1}{#2}}} - -%D \macros -%D {truefilename} -%D -%D At the system level such a filename can be called upon by -%D saying: -%D -%D \starttypen -%D \truefilename{filename/filesynonym} -%D \stoptypen - -\def\truefilename#1% - {\ifundefined{\??fs#1}#1\else\getvalue{\??fs#1}\fi} - -%D \macros -%D {makeshortfilename} -%D -%D To prevent cross platform problems with filenames, we -%D lowercase them as well as only use the first 8~characters. - -\def\domakeshortfilename[#1#2#3#4#5#6#7#8#9]% - {\lowercase{\edef\shortfilename{#1#2#3#4#5#6#7#8.}}% - \expandafter\beforesplitstring\shortfilename\at.\to\shortfilename} - -\def\makeshortfilename[#1]% - {\edef\fullfilename{#1.........}% - \expanded{\domakeshortfilename[\fullfilename]}} - -%D \macros -%D {usemodule} -%D -%D Most of \CONTEXT is preloaded in the format file. Some very -%D domain specific typesetting topics are however dealt with in -%D separate modules, e.g. typesettingof chemical structure -%D formulas. These modules are loaded by: -%D -%D \showsetup{\y!usemodule} -%D -%D More information on the specific modules can be found in -%D their dedicated manuals. - -\def\dodousemodules#1% - {\makeshortfilename[\f!moduleprefix\truefilename{#1}]% - \doifundefinedelse{\shortfilename\v!aan} - {\setgvalue{\shortfilename\v!aan}{}% - \startreadingfile - \readsysfile{\shortfilename}% - {\showmessage{\m!systems}{5}{#1}}% - {\showmessage{\m!systems}{6}{#1}}% - \stopreadingfile} - {\showmessage{\m!systems}{7}{#1}}} - -\def\dousemodules[#1]% - {\doifsomething{#1} - {\processcommalist[#1]\dodousemodules}} - -\def\usemodules% - {\dosingleargument\dousemodules} - -%D We also support a singular call, which saves us for -%D frustrations when we do a typo. - -\def\usemodule% - {\usemodules} - -\protect - -\endinput +% NOT YET DOCUMENTED !!
+%
+% overal \normalinput
+
+
+%D \module
+%D [ file=core-fil,
+%D version=1997.11.15,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=File Support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. Non||commercial use is
+%C granted.
+
+\writestatus{loading}{Context Core Macros / File Support}
+
+\unprotect
+
+%D \macros
+%D {definefilename}
+%D
+%D One of the problems with loading files is that their names
+%D can depend on the interface language. We therefore need a
+%D method to define filesynonyms. The actual synonyms are
+%D defined elsewhere, but look like:
+%D
+%D \starttypen
+%D \definefilesynonym [chemic] [chemie]
+%D \definefilesynonym [einheit] [eenheid]
+%D \definefilesynonym [unit] [eenheid]
+%D \stoptypen
+%D
+%D So we can say in english:
+%D
+%D \starttypen
+%D \usemodules[pictex,chemic,unit]
+%D \stoptypen
+%D
+%D and in dutch:
+%D
+%D \starttypen
+%D \usemodules[pictex,chemie,eenheid]
+%D \stoptypen
+
+\def\definefilesynonym%
+ {\dodoubleempty\dodefinefilesynonym}
+
+%\def\dodefinefilesynonym[#1][#2]%
+% {\lowercase{\setevalue{\??fs#1}{#2}}}
+
+\def\dodefinefilesynonym[#1][#2]%
+ {\lowercase{\edef\!!stringa{#2}}%
+ \setevalue{\??fs#1}{\!!stringa}}
+
+%D \macros
+%D {truefilename}
+%D
+%D At the system level such a filename can be called upon by
+%D saying:
+%D
+%D \starttypen
+%D \truefilename{filename/filesynonym}
+%D \stoptypen
+
+\def\truefilename#1%
+ {\ifundefined{\??fs#1}#1\else\getvalue{\??fs#1}\fi}
+
+%D \macros
+%D {makeshortfilename}
+%D
+%D To prevent cross platform problems with filenames, we
+%D lowercase them as well as only use the first 8~characters.
+
+\def\domakeshortfilename[#1#2#3#4#5#6#7#8#9]%
+ {\lowercase{\edef\shortfilename{#1#2#3#4#5#6#7#8.}}%
+ \expandafter\beforesplitstring\shortfilename\at.\to\shortfilename}
+
+\def\makeshortfilename[#1]%
+ {\edef\fullfilename{#1.........}%
+ \expanded{\domakeshortfilename[\fullfilename]}}
+
+%D \macros
+%D {usemodule}
+%D
+%D Most of \CONTEXT is preloaded in the format file. Some very
+%D domain specific typesetting topics are however dealt with in
+%D separate modules, e.g. typesettingof chemical structure
+%D formulas. These modules are loaded by:
+%D
+%D \showsetup{\y!usemodule}
+%D
+%D More information on the specific modules can be found in
+%D their dedicated manuals.
+
+\def\dododousemodules#1#2%
+ {\makeshortfilename[#1\truefilename{#2}]%
+ \doifundefinedelse{\shortfilename\v!aan}
+ {\setgvalue{\shortfilename\v!aan}{}%
+ \startreadingfile
+ \readsysfile{\shortfilename}%
+ {\showmessage{\m!systems}{5}{#2}}%
+ {\showmessage{\m!systems}{6}{#2}}%
+ \stopreadingfile}
+ {\showmessage{\m!systems}{7}{#2}}}
+
+\def\dodousemodules#1%
+ {\dododousemodules\f!moduleprefix{#1}%
+ \dododousemodules\f!styleprefix {#1}}
+
+\def\dousemodules[#1]%
+ {\doifsomething{#1}{\processcommalist[#1]\dodousemodules}}
+
+\def\usemodules%
+ {\dosingleargument\dousemodules}
+
+%D We also support a singular call, which saves us for
+%D frustrations when we do a typo.
+
+\let\usemodule=\usemodules
+
+\protect
+
+\endinput
|