summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-04-19 22:11:12 +0000
committerKarl Berry <karl@freefriends.org>2012-04-19 22:11:12 +0000
commit675f5610ee1595b20a9e77695a8aad5eb1ef9a2b (patch)
tree10f31614fd1ce80405b7f5624f77c446b4cba9f3 /Master/texmf-dist
parentbc21d95b0a1c5234f88041d0840e45e072357072 (diff)
context-filter (19apr12)
git-svn-id: svn://tug.org/texlive/trunk@26057 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/context/third/filter/filter.txt67
-rw-r--r--Master/texmf-dist/tex/context/third/filter/t-filter.mkii21
-rw-r--r--Master/texmf-dist/tex/context/third/filter/t-filter.mkiv24
3 files changed, 86 insertions, 26 deletions
diff --git a/Master/texmf-dist/doc/context/third/filter/filter.txt b/Master/texmf-dist/doc/context/third/filter/filter.txt
index b2a28a3e534..1560d93fa3a 100644
--- a/Master/texmf-dist/doc/context/third/filter/filter.txt
+++ b/Master/texmf-dist/doc/context/third/filter/filter.txt
@@ -204,6 +204,49 @@ Sometimes, it is desirable to ignore the output, which is done by
read=no,
...]
+Space around the environment
+----------------------------
+
+By default, the `\start<...>` ... `\stop<...>` and the `\type<...>file{...}`
+variant displays the output is _paragraph_ mode (i.e., inserts blanks before and
+after the environment), while the `\inline{...}` variant reads the output in
+_text_ mode (i.e., does not insert blanks before or after the environment).
+
+To change the amount of space inserted before and after the environment, use the
+`spacebefore` and the `spaceafter` keys. For example, if you want big spaces
+around the environment use:
+
+ \defineexternalfilter
+ [...]
+ [....
+ spacebefore=big,
+ spaceafter=big,
+ ...]
+
+The `spacebefore` and `spaceafter` keys accept all values accepted by the
+`\blank[...]` macro.
+
+In the paragraph mode, the next line after `\stop<...>` is indented or not based
+on the value of the `indentnext` key. The default value is `auto` which indents
+the next line if there is an empty line after `\stop<...>`; other options are
+`no`, which never indents the next line and `yes` whcih always indents the next
+line.
+
+If you want the `\start<...>` ... `\stop<...>` and the `\type<...>file{...}`
+variant to behave in _text_ mode, set:
+
+ \defineexternalfilter
+ [...]
+ [....
+ location=text,
+ ...]
+
+(The default value of `location` is `paragraph`).
+
+**Note** that `locatiion=text` is not equivalent to `\inline{...}`. Inline also
+sets `\endlinechar=\minusone`; therefore no space is inserted when the file is
+read. `location=text` does not change `\endlinechar`. Therefore a space is
+inserted after the file is read.
Names of temporary files
------------------------
@@ -312,21 +355,25 @@ Standard options
`\defineexternalfilter` accepts the following standard options:
-- `before` and `after`: to set the spacing of the environment or enclose the
- output in a frame, etc.
+- `spacebefore` and `spaceafter` to specify the blank space to be used
+ before and after the environment.
+- `before` and `after`: to enclose the output in a frame, etc.
- `style` and `color`: to set the color and style of the output.
-- `indentnext`: specify if the next line is indented
+- `indentnext`: specify if the next line is indented (only if `location` is
+ `paragraph`).
- `setups`: specify a list of setups (defined using `\startsetups`). These
setups may be used to define commands that are needed inside the environment.
The order in which these options are executed are:
-1. `before`
-2. `style` and `color`
-3. `setups`
-4. `readcommand`
-5. `after`
-6. check `indentnext`
+1. `\blank[spacebefore]`
+2. `before`
+3. `style` and `color`
+4. `setups`
+5. `readcommand`
+6. `after`
+7. `\blank[afterspace]`
+8. check `indentnext`
Options to a specific environment
---------------------------------
@@ -798,3 +845,5 @@ Version History
- Added `purge=yes|no` to control if the input file is deleted or not
- **2012.03.18**
- Process remote files
+- **2012.04.18**
+ - Added `location`, `spacebefore` and `spaceafter` keys.
diff --git a/Master/texmf-dist/tex/context/third/filter/t-filter.mkii b/Master/texmf-dist/tex/context/third/filter/t-filter.mkii
index de772ec3bd3..46bdf247971 100644
--- a/Master/texmf-dist/tex/context/third/filter/t-filter.mkii
+++ b/Master/texmf-dist/tex/context/third/filter/t-filter.mkii
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-filter,
-%D version=2012.01.26,
+%D version=2012.04.18,
%D title=\CONTEXT\ User Module,
%D subtitle=Filter,
%D author=Aditya Mahajan,
@@ -9,7 +9,7 @@
%D email=adityam <at> ieee <dot> org,
%D license=Simplified BSD License]
-\writestatus{loading}{Filter (ver: 2012.01.26)}
+\writestatus{loading}{Filter (ver: 2012.04.18)}
\ifx\undefined\normalexpanded \let\normalexpanded\expanded \fi
@@ -132,9 +132,9 @@
% #2 = options
\egroup %\bgroup in \start#1
+ \begingroup % to keep assignments local
\edef\externalfilter@name{#1}
- \begingroup % to keep assignments local
\setupexternalfilter[#1][\c!name=,#2]
\externalfilter@set_filenames
@@ -201,10 +201,10 @@
\stoptexdefinition
\starttexdefinition externalfilter@inline [#1][#2]
+ \begingroup % to keep assignments local
\edef\externalfilter@name{#1}
- \begingroup % to keep assignments local
- \setupexternalfilter[#1][\c!numbering=,\c!name=,\c!before=,\c!after=,#2]
+ \setupexternalfilter[#1][\c!numbering=,\c!name=,\c!location=\v!text,#2]
\externalfilter@set_filenames
@@ -402,6 +402,8 @@
\stoptexdefinition
\starttexdefinition externalfilter@read_processed_file_indeed
+ \doif{\externalfilterparameter\c!location}\v!paragraph
+ {\blank[\externalfilterparameter\c!spacebefore]}%
\externalfilterparameter\c!before
\begingroup
@@ -412,14 +414,19 @@
\endgroup
\externalfilterparameter\c!after
+ \doif{\externalfilterparameter\c!location}\v!paragraph
+ {\blank[\externalfilterparameter\c!spaceafter]}%
\stoptexdefinition
%D \section {Default Values}
\setupexternalfilters
[
+ \c!location=\v!paragraph,
\c!before=,
\c!after=,
+ \c!spacebefore=,
+ \c!spaceafter=,
\c!style=,
\c!color=,
\c!indentnext=\v!auto,
@@ -436,10 +443,6 @@
\c!buffer\c!after=,
]
-\doifmodeelse{reuse}
- {\setupexternalfilters[state=stop]}
- {\setupexternalfilters[state=start]}
-
\def\externalfilterbasefile {\externalfilter@base_file}
\def\externalfilterinputfile {\externalfilter@input_file}
\def\externalfilteroutputfile{\externalfilter@output_file}
diff --git a/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv b/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv
index c5b5e15bf3e..d4d4b7a66cf 100644
--- a/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv
+++ b/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-filter,
-%D version=2012.03.18,
+%D version=2012.04.18,
%D title=\CONTEXT\ User Module,
%D subtitle=Filter,
%D author=Aditya Mahajan,
@@ -9,7 +9,7 @@
%D email=adityam <at> ieee <dot> org,
%D license=Simplified BSD License]
-\writestatus{loading}{Filter (ver: 2012.03.18)}
+\writestatus{loading}{Filter (ver: 2012.04.18)}
% For backward compatibility
\ifx\grabbufferdata\undefined \let\grabbufferdata \dostartbuffer \fi
@@ -117,9 +117,9 @@
% #2 = options
\egroup %\bgroup in \externalfilter@start
+ \begingroup % to keep assignments local
\edef\currentexternalfilter{#1}
- \begingroup % to keep assignments local
\setupexternalfilter[#1][\c!name=,#2]
\externalfilter@set_filenames
@@ -192,10 +192,10 @@
{\dodoubleargument\externalfilter@inline_indeed}
\starttexdefinition externalfilter@inline_indeed [#1][#2]
+ \begingroup % to keep assignments local
\edef\currentexternalfilter{#1}
- \begingroup % to keep assignments local
- \setupexternalfilter[#1][\c!numbering=,\c!name=,\c!before=,\c!after=,#2]
+ \setupexternalfilter[#1][\c!numbering=,\c!name=,\c!location=\v!text,#2]
\externalfilter@set_filenames
@@ -375,10 +375,11 @@
% Finalization
\doifinset{\externalfilterparameter\c!cache}{\v!yes,\v!force}
{\doglobal\expandafter\increment\csname\externalfilter@count\endcsname}
- \endgroup
- \expanded{\checknextindentation[\externalfilterparameter\c!indentnext]}
- \dorechecknextindentation
+ \doif{\externalfilterparameter\c!location}\v!paragraph
+ {\expanded{\checknextindentation[\externalfilterparameter\c!indentnext]}
+ \dorechecknextindentation}
+ \endgroup
\stoptexdefinition
%D \subsubject {Execute Filter}
@@ -415,6 +416,8 @@
\stoptexdefinition
\starttexdefinition externalfilter@read_processed_file_indeed
+ \doif{\externalfilterparameter\c!location}\v!paragraph
+ {\blank[\externalfilterparameter\c!spacebefore]}%
\externalfilterparameter\c!before
\begingroup
@@ -427,14 +430,19 @@
\endgroup
\externalfilterparameter\c!after
+ \doif{\externalfilterparameter\c!location}\v!paragraph
+ {\blank[\externalfilterparameter\c!spaceafter]}%
\stoptexdefinition
%D \section {Default Values}
\setupexternalfilters
[
+ \c!location=\v!paragraph,
\c!before=,
\c!after=,
+ \c!spacebefore=,
+ \c!spaceafter=,
\c!style=,
\c!color=,
\c!indentnext=\v!auto,