Re: [NTG-context] Minimal code for exporting custom tags

2020-05-18 Thread Aditya Mahajan

On Mon, 18 May 2020, Aditya Mahajan wrote:


Thanks! This also helped me find the documentation in hybrid.pdf.


Also epub-mkiv.pdf. Not sure why I didn't think of looking there.


How do I pass options so that the export is

...

(or some variant of that). I thought that

\startelement[mycommand][name=whatever]

should work (there are some such examples in the texmf tree), but it does 
not.


epub-mkiv.pdf states that I need `\setupexport[properties=yes]`, but that 
doesn't work either:

```
\setupbackend[export=xml]
\setupexport [properties=my]

\setelementbackendtag[mycommand]
\setelementnature[mycommand][mixed]

\starttext
\startsection[title={Sample document}]
  \startparagraph
This is a paragraph
  \stopparagraph
  \startelement[mycommand][name=whatever]
This is mycommand
  \stopelement
\stopsection
\stoptext
```

gives

```






http://www.w3.org/1998/Math/MathML;>
 
 
 
  
   1
   Sample document
  
  
   This is a paragraph
   This is mycommand
  
 

```

What am I still missing?

On a different note, I didn't realize that interfaces.implement could create 
macros which could be used like this:

```
\unexpanded\def\dostartexport
  {%\glet\dostartexport\relax
   \let\currentexport\empty
   \clf_setupexport
   align  {\exportparameter\c!align}%
   bodyfont   \dimexpr\exportparameter\c!bodyfont\relax
   width  \dimexpr\exportparameter\c!width\relax
   properties {\exportparameter\c!properties}%
   hyphen {\exportparameter\c!hyphen}%
   title  {\exportparameter\c!title}%
   subtitle   {\exportparameter\c!subtitle}%
   author {\exportparameter\c!author}%
   firstpage  {\exportparameter\c!firstpage}%
   lastpage   {\exportparameter\c!lastpage}%
   svgstyle   {\exportparameter\c!svgstyle}%
   cssfile{\exportparameter\c!cssfile}%
   file   {\exportparameter\c!file}%
   export {\backendparameter\c!export}%
   \relax}

```

This nicely gets around TeX's limitation of 9 arguments!

Aditya


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] LMTX not working in Windows 10

2020-05-18 Thread Jairo A. del Rio
Hi everyone! I've tried installing LMTX on Windows 10 (x64) (I use Ubuntu,
but my PC isn't available now). Whatever. When I try to execute context.exe
the following appears:

! Parameters must be numbered consecutively.

0
l.214 \def\gobbleoneargument   #0
   {}
! Parameters must be numbered consecutively.

0
l.215 \def\gobbletwoarguments#0
 #0{}
! Parameters must be numbered consecutively.

0
l.215 \def\gobbletwoarguments#0#0
   {}
! Parameters must be numbered consecutively.

0
l.216 \def\gobblethreearguments#0
   #0#0{}
! Parameters must be numbered consecutively.

0
l.216 \def\gobblethreearguments#0#0
 #0{}
! Parameters must be numbered consecutively.

0
l.216 \def\gobblethreearguments#0#0#0
   {}
! Parameters must be numbered consecutively.

0
l.217 \def\gobblefourarguments   #0
 #0#0#0{}
! Parameters must be numbered consecutively.

0
l.217 \def\gobblefourarguments   #0#0
   #0#0{}
! Parameters must be numbered consecutively.

0
l.217 \def\gobblefourarguments   #0#0#0
 #0{}
! Parameters must be numbered consecutively.

0
l.217 \def\gobblefourarguments   #0#0#0#0
   {}
! Parameters must be numbered consecutively.

0
l.218 \def\gobblefivearguments   #0
 #0#0#0{}
! Parameters must be numbered consecutively.

0
l.218 \def\gobblefivearguments   #0#0
   #0#0{}
! Parameters must be numbered consecutively.

0
l.218 \def\gobblefivearguments   #0#0#0
 #0{}
! Parameters must be numbered consecutively.

0
l.218 \def\gobblefivearguments   #0#0#0#0
   {}
! Parameters must be numbered consecutively.

0
l.219 \def\gobblesixarguments#0
 #0#0#0{}
! Parameters must be numbered consecutively.

0
l.219 \def\gobblesixarguments#0#0
   #0#0{}
! Parameters must be numbered consecutively.

0
l.219 \def\gobblesixarguments#0#0#0
 #0{}
! Parameters must be numbered consecutively.

0
l.219 \def\gobblesixarguments#0#0#0#0
   {}
! Parameters must be numbered consecutively.

0
l.220 \def\gobblesevenarguments#0
   #0#0#0#0{}
! Parameters must be numbered consecutively.

0
l.220 \def\gobblesevenarguments#0#0
 #0#0#0{}
! Parameters must be numbered consecutively.

0
l.220 \def\gobblesevenarguments#0#0#0
   #0#0{}
! Parameters must be numbered consecutively.

0
l.220 \def\gobblesevenarguments#0#0#0#0
 #0{}
! Parameters must be numbered consecutively.

0
l.220 \def\gobblesevenarguments#0#0#0#0#0
   {}
! Parameters must be numbered consecutively.

0
l.221 \def\gobbleeightarguments  #0
 #0#0#0#0#0{}
! Parameters must be numbered consecutively.

0
l.221 \def\gobbleeightarguments  #0#0
   #0#0#0#0{}
! Parameters must be numbered consecutively.

0
l.221 \def\gobbleeightarguments  #0#0#0
 #0#0#0{}
! Parameters must be numbered consecutively.

0
l.221 \def\gobbleeightarguments  #0#0#0#0
   #0#0{}
! Parameters must be numbered consecutively.

0
l.221 \def\gobbleeightarguments  #0#0#0#0#0
 #0{}
! Parameters must be numbered consecutively.

0
l.221 \def\gobbleeightarguments  #0#0#0#0#0#0
   {}
! Parameters must be numbered consecutively.

0
l.222 \def\gobbleninearguments #0
   #0#0#0#0#0#0{}
! Parameters must be numbered consecutively.

0
l.222 \def\gobbleninearguments #0#0
 #0#0#0#0#0{}
! Parameters must be numbered consecutively.

0
l.222 \def\gobbleninearguments #0#0#0
   #0#0#0#0{}
! Parameters must be numbered consecutively.

0
l.222 \def\gobbleninearguments #0#0#0#0
 #0#0#0{}
! Parameters must be numbered consecutively.

0
l.222 \def\gobbleninearguments #0#0#0#0#0
   #0#0{}
! Parameters must be numbered consecutively.

0
l.222 \def\gobbleninearguments #0#0#0#0#0#0
 #0{}
! Parameters must be numbered consecutively.

0
l.222 

[NTG-context] Problem updating to new version for Win64

2020-05-18 Thread Todd DeVries
Hello,

I tried updating my version of LMTX.  A file which compiled under the old 
version (from earlier this year) now errors out.  I moved my directory, 
downloaded a fresh copy of the install scripts and made a fresh installation.  
What am I missing?

Errors below are from my terminal.

l.2674 \def\secondofsixarguments#0#2#0#0

  #0#0{#2}  
  ! Parameters must be
numbered consecutively. 
   
  

(That makes 100 errors; please try again.)resolvers   | formats |   

resolvers   | formats | binary path  : C:/lmtx/tex/texmf-win64/bin  

resolvers   | formats | format path  : 
C:/lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1f32e/formats/luametatex


resolvers   | formats | luatex engine: luametatex   

resolvers   | formats | lua startup file : 
C:/lmtx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua 
resolvers   | formats | context file : 
C:/lmtx/tex/texmf-context/tex/context/base/mkiv/cont-en.mkxl  resolvers 
  | formats
| run time : 4.533 seconds  
  
resolvers   | formats | return value : error

resolvers   | formats | 

mtx-context | error, no format found with name: cont-en, aborting system
  | total runtime: 5.171 seconds of 5.216 seconds   
   

-- 
Todd DeVries
*Phone: (208) 847-5996*
Secure chat: https://keybase.io/tdevries/chat

“Not less than knowing, doubting pleases me.”
—DANTE, The Inferno
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] two superscript versions with Garamond Libre

2020-05-18 Thread Henning Hraban Ramm


> Am 18.05.2020 um 17:18 schrieb Pablo Rodriguez :
> 
> Typeface is available at
> https://github.com/dbenjaminmiller/garamond-libre/releases/latest.

Thank you for the hint, I’m always looking for interesting fonts.
This is a nicely designed classical Garamond with a big glyph repertoire 
(Latin, poly Greek, Cyrillic, Byzantine/Greek music symbols, math and other 
symbols), but after first tests I found flaws:
– Numbers are a bit too dark; table numbers look a bit too big, oldstyle 
numbers a bit too small.
– Small caps are lacking accented vowels including umlauts.
– Cyrillic is missing Kyrgyz/Kazakh letters (i.e. Cyrillic extended).
– Kerning is not yet perfect.
– Accents sit a bit too close on the letters.
– Swash capitals don’t fit the style at all, they look like some modern hand 
font like Lucida Handwriting.

Best, Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] two superscript versions with Garamond Libre

2020-05-18 Thread Pablo Rodriguez
On 5/18/20 6:13 PM, Hans Hagen wrote:
> On 5/18/2020 5:18 PM, Pablo Rodriguez wrote:
>> [...]
>> Sorry, but I’m a bit thick now. Does anyone know why characters and OT
>> sups provide differently sized glyphs?
>>
>> I think there might be a bug in the typeface, but I need to know first
>> what to report.
> designers decisions ... i guess ... features are just tags and afaik
> nothing really prescribes how to implement them (relative to each other)

Many thanks for your reply, Hans.

I see now that there are two series of “superscripts” (numr and sups).
The Unicode superscript use the OpenType numerator glyphs.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Minimal code for exporting custom tags

2020-05-18 Thread Aditya Mahajan

On Mon, 18 May 2020, Aditya Mahajan wrote:


On Mon, 18 May 2020, Hans Hagen wrote:


On 5/18/2020 9:09 AM, Aditya Mahajan wrote:

Hi,

What is needed to enable export of user defined macros? Consider the 
following example:


What am I missing in order to pass user-defined macros to the exporter?

you're probably missing documentation + a high level define command

This registers (extra) elements:

\setelementbackendtag[mycommand]
\setelementnature[mycommand][mixed]



Thanks! This also helped me find the documentation in hybrid.pdf.


How do I pass options so that the export is

...

(or some variant of that). I thought that

\startelement[mycommand][name=whatever]

should work (there are some such examples in the texmf tree), but it does not.

```
\setelementbackendtag[mycommand]
\setelementnature[mycommand][mixed]

\setupbackend[export=xml, level=0]

\starttext
\startsection[title={Sample document}]
  \startparagraph
This is a paragraph
  \stopparagraph
  \startelement[mycommand][name=whatever]
This is mycommand
  \stopelement
\stopsection
\stoptext
```

Using `\dostarttagged{mycommand}{whatever}` does export as ``, and looking at the code, I don't see why `\startelement` 
should behave differently.

Thanks,
Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Styling of included buffers or files

2020-05-18 Thread Wolfgang Schuster

Marco Patzer schrieb am 17.05.2020 um 19:04:

On Sun, 17 May 2020 18:16:13 +0200
"Jan U. Hasecke"  wrote:


I am currently writing a text where I want to include text snippets
either by including files or including buffers.

What is the best way to style all these included buffers?

I know that I can do something like this:

\startcolumns
\getbuffer[Muenchen]
\stopcolumns

Or do something with \defineparagraph

Is it somehow possible to apply styles to all buffers that gets
included via \getbuffer by defining a special getbuffer-style?


\setupbuffer has before and after keys which can be used. Example:

\setupbuffer
  [before=\blank\blackrule\startnarrower\BufferStyle,
   after=\stopnarrower\blackrule\blank]

[...]

\definehighlight
   [BufferStyle]
   [style=smallitalic,
color=blue]


Use the highlight-environment or create a new startstop-environment to 
apply style and color settings to the buffer.


\definestartstop
  [BufferStyle]
  [style=smallitalic,
   color=blue]

\setupbuffer
 [before={... \startBufferStyle ...},
   after={... \stopBufferStyle  ...}]

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] two superscript versions with Garamond Libre

2020-05-18 Thread Hans Hagen

On 5/18/2020 5:18 PM, Pablo Rodriguez wrote:

Dear list,

I’m accesing superscript glyphs for Garamond Libre with the OT feature
and the character with the following sample:

 \definefontfeature[sups][script=latn, sups=yes]
 \definefontfamily[twoface][rm][GaramondLibre]
 \definefontfamily[mainface][rm][EB Garamond 12]
 \setupbodyfont[mainface]
 \starttext
 \startTEXpage[offset=1ex]
 {\feature[+][sups]1}¹{\feature[+][sups]2}²{\feature[+][sups]3}³%
 {\feature[+][sups]8}⁸{\feature[+][sups]9}⁹{\feature[+][sups]0}⁰\\
 \setupbodyfont[twoface]
 {\feature[+][sups]1}¹{\feature[+][sups]2}²{\feature[+][sups]3}³%
 {\feature[+][sups]8}⁸{\feature[+][sups]9}⁹{\feature[+][sups]0}⁰\\
 \stopTEXpage
 \stoptext

Typeface is available at
https://github.com/dbenjaminmiller/garamond-libre/releases/latest.

Sorry, but I’m a bit thick now. Does anyone know why characters and OT
sups provide differently sized glyphs?

I think there might be a bug in the typeface, but I need to know first
what to report.
designers decisions ... i guess ... features are just tags and afaik 
nothing really prescribes how to implement them (relative to each other)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] two superscript versions with Garamond Libre

2020-05-18 Thread Pablo Rodriguez
Dear list,

I’m accesing superscript glyphs for Garamond Libre with the OT feature
and the character with the following sample:

\definefontfeature[sups][script=latn, sups=yes]
\definefontfamily[twoface][rm][GaramondLibre]
\definefontfamily[mainface][rm][EB Garamond 12]
\setupbodyfont[mainface]
\starttext
\startTEXpage[offset=1ex]
{\feature[+][sups]1}¹{\feature[+][sups]2}²{\feature[+][sups]3}³%
{\feature[+][sups]8}⁸{\feature[+][sups]9}⁹{\feature[+][sups]0}⁰\\
\setupbodyfont[twoface]
{\feature[+][sups]1}¹{\feature[+][sups]2}²{\feature[+][sups]3}³%
{\feature[+][sups]8}⁸{\feature[+][sups]9}⁹{\feature[+][sups]0}⁰\\
\stopTEXpage
\stoptext

Typeface is available at
https://github.com/dbenjaminmiller/garamond-libre/releases/latest.

Sorry, but I’m a bit thick now. Does anyone know why characters and OT
sups provide differently sized glyphs?

I think there might be a bug in the typeface, but I need to know first
what to report.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Minimal code for exporting custom tags

2020-05-18 Thread Aditya Mahajan

On Mon, 18 May 2020, Hans Hagen wrote:


On 5/18/2020 9:09 AM, Aditya Mahajan wrote:

Hi,

What is needed to enable export of user defined macros? Consider the 
following example:


What am I missing in order to pass user-defined macros to the exporter?

you're probably missing documentation + a high level define command

This registers (extra) elements:

\setelementbackendtag[mycommand]
\setelementnature[mycommand][mixed]



Thanks! This also helped me find the documentation in hybrid.pdf.

I am not using a high-level interface because I was looking at how to get the 
output of `t-filter` and `t-vim` modules export correctly.

Aditya

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Looking for a way to use lua to output console/debug messages from MetaPost instead of 'show'

2020-05-18 Thread Gerben Wierda
I often need some debugging info to find out what is going on in my METAPOST 
code (as I often do not have exact knowledge of what some things do). 
MetaPost’s ‘show’ command has limited formatting functionality (e.g. I would 
like to add a number as a string to a show message instead of putting it out as 
number and let ‘show' make a lot of lines out of it). 

I would like to instead use a lua function and I think I recall having seen 
somewhere the use of a call like lua( ….) or lua.foo.bar() in a 
MetaPost/MetaFun/LMTX example but I cannot find it anymore. 

Is it possible to do a lua() call from within MetaPost within LMTX and if so, 
what is the way to do it? This below is the state of my misguided attempts:

\startluacode
function warnWithLabelIfVerbose( str, ... )
  texio.write_nl( str .. string.format(...))
end
\stopluacode

\startMPdefinitions{doublefun}
%def somefunction ( expr str, number) =
%  lua.warnWithLabel( "LABEL: ", "%s %d", str, number);
%enddef;
\stopMPdefinitions

\startMPpage[instance=doublefun]
lua.texio.write_nl( "HELLO!"); % This works
%lua.texio.write( "HELLO!\%n"); % This doesn't
%string outs; outs := lua.string.format( "HELLO! \%s \%0.3f", "aap", 12.6);
%somefunction( "aap", 12.6);
\stopMPpage

Thx,

G___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Minimal code for exporting custom tags

2020-05-18 Thread Hans Hagen

On 5/18/2020 9:09 AM, Aditya Mahajan wrote:

Hi,

What is needed to enable export of user defined macros? Consider the 
following example:



```
\def\startmycommand{\dostarttagged{mycommand}\empty}
\def\stopmycommand {\dostoptagged}

\setupbackend[export=xml, level=0]

\starttext
\startsection[title={Sample document}]
   \startparagraph
     This is a paragraph
   \stopparagraph
   \startmycommand
     This is mycommand
   \stopmycommand
\stopsection
\stoptext
```

If I compile using `context --trackers=structures.tags filename`, I get

```
backend > tags > U+0031:1 => U+0031:1 : 4 document>1 
section>1 sectioncaption>1 sectionnumber>1
backend > tags > U+0053:S => U+0074:t : 5 document>1 
section>1 sectioncaption>1 sectiontitle>1
backend > tags > U+0054:T => U+0068:h : 7 document>1 
section>1 sectioncontent>1 paragraph>1
backend > tags > U+0054:T => U+0064:d : 8 document>1 
section>1 sectioncontent>1 mycommand>1

```

so the tag is applied. I can also verify this by looking at the PDF 
which contains


```
<< /K 27 0 R /ParentTree 2 0 R /RoleMap << /document /Div /mycommand 
/Span /paragraph /P /section /Sect /sectioncaption /Div /sectioncontent 
/Div /sectionnumber /H /sectiontitle /H >> /Type /StructTreeRoot >>

```

and the tag `mycommand` is used at appropriate location.

However, the exported xml file contains no tag:

```






file="test-tag" language="en" version="0.35" 
xmlns:m="http://www.w3.org/1998/Math/MathML;>

  
  
  
   
    1
    Sample document
   
   
    This is a paragraph
   
  

```

What am I missing in order to pass user-defined macros to the exporter?

you're probably missing documentation + a high level define command

This registers (extra) elements:

\setelementbackendtag[mycommand]
\setelementnature[mycommand][mixed]

after that you can use \startelement[mycommamd]

\starttext
\startsection[title={Sample document}]
  \startparagraph
This is a paragraph
  \stopparagraph
  \startelement[mycommand]
This is mycommand
  \stopelement
\stopsection
\stoptext



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Styling of included buffers or files

2020-05-18 Thread Jan U. Hasecke
Am 17.05.20 um 19:04 schrieb Marco Patzer:

>>
>> Is it somehow possible to apply styles to all buffers that gets
>> included via \getbuffer by defining a special getbuffer-style?
> 
> \setupbuffer has before and after keys which can be used. Example:
> 
> \setupbuffer
>  [before=\blank\blackrule\startnarrower\BufferStyle,
>   after=\stopnarrower\blackrule\blank]
> 
> %% alternatively define custom buffers
> \definebuffer
>  [foobar]
> 
> \setupblackrules
>   [width=1cm,
>height=1pt,
>color=gray]
> 
> \definehighlight
>   [BufferStyle]
>   [style=smallitalic,
>color=blue]
> 
> \startbuffer
>   \samplefile{knuth}
> \stopbuffer
> 
> \starttext
>   \samplefile{knuth}
>   \getbuffer
>   \samplefile{knuth}
> 
> \stoptext
> 

So easy! I am humbled. For some reason I wasn't able to find this in
setup-en.pdf.

Thanks a lot.

juh

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Minimal code for exporting custom tags

2020-05-18 Thread Aditya Mahajan

Hi,

What is needed to enable export of user defined macros? Consider the following 
example:


```
\def\startmycommand{\dostarttagged{mycommand}\empty}
\def\stopmycommand {\dostoptagged}

\setupbackend[export=xml, level=0]

\starttext
\startsection[title={Sample document}]
  \startparagraph
This is a paragraph
  \stopparagraph
  \startmycommand
This is mycommand
  \stopmycommand
\stopsection
\stoptext
```

If I compile using `context --trackers=structures.tags filename`, I get

```
backend > tags > U+0031:1 => U+0031:1 : 4 document>1 section>1 
sectioncaption>1 sectionnumber>1
backend > tags > U+0053:S => U+0074:t : 5 document>1 section>1 
sectioncaption>1 sectiontitle>1
backend > tags > U+0054:T => U+0068:h : 7 document>1 section>1 
sectioncontent>1 paragraph>1
backend > tags > U+0054:T => U+0064:d : 8 document>1 section>1 
sectioncontent>1 mycommand>1
```

so the tag is applied. I can also verify this by looking at the PDF which 
contains

```
<< /K 27 0 R /ParentTree 2 0 R /RoleMap << /document /Div /mycommand /Span /paragraph /P 
/section /Sect /sectioncaption /Div /sectioncontent /Div /sectionnumber /H /sectiontitle /H >> 
/Type /StructTreeRoot >>
```

and the tag `mycommand` is used at appropriate location.

However, the exported xml file contains no tag:

```






http://www.w3.org/1998/Math/MathML;>
 
 
 
  
   1
   Sample document
  
  
   This is a paragraph
  
 

```

What am I missing in order to pass user-defined macros to the exporter?

Thanks,
Aditya

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___