[NTG-context] How to implement word corrections

2023-12-27 Thread Jairo A. del Rio
Hi, list! I'm writing a small module to print word corrections, e.g.,
things like "irregardless" > "regardless"or "alverja" > "arveja" ('pea' in
Spanish) with overstrikes and underlines, but I want feedback to make a
module in the ConTeXt fashion. I hope the PDF attached explains better what
I mean. Just in case, I want to know if anyone else in the mailing list is
acquainted with grammar and orthography quizzes/exercises/exams in ConTeXt.
Merry Christmas and Happy New Year!

Best regards,

Jairo


correction_draft.tex
Description: Binary data


correction_draft.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] barring changes

2022-07-28 Thread Henning Hraban Ramm via ntg-context
Please consider the attached example – some of the “barring” macros are 
defunct already for a while, some more within a TABLE:


\underbar works, but not in TABLE
\underbarsworks
\underdot doesn’t work
\underdotsdoesn’t work
\underdashdoesn’t work
\underdashes  doesn’t work
\underrandom  doesn’t work
\underrandoms doesn’t work
\overbar  works, but not in TABLE
\overbars works
\overstrike   works, but not in TABLE
\overstrikes  works
\understrike  works, but not in TABLE
\understrikes works

The nested example
\overbar{Über} \underbar{Unterstrich \underbar{steigt \overbar{auf} den 
\underdot{Unterberg}}}.

works only once, afterwards all the underbars are missing.


Hraban

bartest.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] double underbars

2021-11-30 Thread Denis Maier via ntg-context
Ok, so I will see. But, if even you gave up, I should better hope that someone 
else hears our desperate cries ;)

Denis

> -Ursprüngliche Nachricht-
> Von: Taco Hoekwater 
> Gesendet: Dienstag, 30. November 2021 14:52
> An: mailing list for ConTeXt users 
> Cc: Maier, Denis Christian (UB) 
> Betreff: Re: [NTG-context] double underbars
> 
> 
> 
> > On 30 Nov 2021, at 14:38, Denis Maier via ntg-context  cont...@ntg.nl> wrote:
> >
> > Thanks, Taco. Good to know. Although it's not what I wanted to hear, of
> course...
> >
> > I was thinking using mp to draw the combination could be solution, but
> unfortunately I don't know metafun yet.
> >
> > If my understanding of https://source.contextgarden.net/node-rul.mkiv is
> correct, it should be possible to build upon the defintion of rules:under:dots
> (l. 327) Any hints how I could get this started?
> 
> Yes, that is the right part to get started with. You could just copy the whole
> \startuseMPgraphic and rename it for editing (to let’s say
> rules:under:bardots), then do
> 
>   \definebar[underbardot][undergraphic][mp=rules:under:bardots]
> 
> and play with the mp until you are happy with the output.
> 
> But the problem is that you have to create an “underbardot" that contains
> both the bar and the dots, to fix the non-nesting problem. It is then quite
> hard to get that definition to align properly with any enclosing “underbar” (I
> tried something like that a while ago and basically gave up. I did not want to
> spend a whole of time on it so I just told the client “computer says no").
> 
> 
> > Another question: what do you mean with a dy-shift version?
> 
> Nested bars have a parameter ‘dy’ which controls the vertical shifts needed
> to make sure that they do not overlap. Text backgrounds do not have that
> option at all.
> 
> >
> > Best,
> > Denis
> >
> >> -Ursprüngliche Nachricht-
> >> Von: Taco Hoekwater 
> >> Gesendet: Dienstag, 30. November 2021 14:19
> >> An: mailing list for ConTeXt users 
> >> Cc: Maier, Denis Christian (UB) 
> >> Betreff: Re: [NTG-context] double underbars
> >>
> >>
> >>
> >>> On 30 Nov 2021, at 12:06, Denis Maier via ntg-context  >> cont...@ntg.nl> wrote:
> >>>
> >>> Hi,
> >>>
> >>> for a current project I’ll need different variants of underbars.
> >>>
> >>> - A normal underbar
> >>> - A dotted underbar
> >>> - A combination of both
> >>>
> >>> Is there a way to combine them? I was hoping to have the dotted
> >>> variant
> >> above the normal bar.
> >>
> >> I would like to have this type of “complete” bar nesting as well.
> >>
> >> As it stands, you can nest \underbars inside \underbars and
> >> \overstrikes inside \overstrikes and \overbars inside \overbars, but
> >> no other combinations work. Interoperability between these (as well
> >> as \underdot, \underdash, \underrandom ...) would be really cool.
> >>
> >> Either with \bar or a nestable dy-shift version of
> >> textbackgrounds would be really handy sometimes. :)
> >>
> >>
> >>
> >>>
> >>> This is not working
> >>>
> >>> %%%
> >>> \starttext
> >>>
> >>> \underbar{asdf}
> >>>
> >>> \underdot{asdf}
> >>>
> >>> \underbar{\underdot{asdf}}
> >>>
> >>> \stoptext
> >>> %%%
> >>>
> >>>
> >>> Best,
> >>> Denis
> >>>
> >>>
> >>
> __
> >> 
> >>> _ 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
> >>>
> >>
> __
> >> 
> >>> _
> >>
> >> —
> >> Taco Hoekwater  E: t...@bittext.nl
> >> genderfluid (all pronouns)
> >>
> >>
> 

Re: [NTG-context] double underbars

2021-11-30 Thread Taco Hoekwater via ntg-context


> On 30 Nov 2021, at 14:38, Denis Maier via ntg-context  
> wrote:
> 
> Thanks, Taco. Good to know. Although it's not what I wanted to hear, of 
> course...
> 
> I was thinking using mp to draw the combination could be solution, but 
> unfortunately I don't know metafun yet.
> 
> If my understanding of https://source.contextgarden.net/node-rul.mkiv is 
> correct, it should be possible to build upon the defintion of 
> rules:under:dots (l. 327) Any hints how I could get this started?

Yes, that is the right part to get started with. You could just copy the whole 
\startuseMPgraphic and rename it for editing (to let’s say 
rules:under:bardots), then do

  \definebar[underbardot][undergraphic][mp=rules:under:bardots]

and play with the mp until you are happy with the output.

But the problem is that you have to create an “underbardot" that contains both 
the bar and the dots, to fix the non-nesting problem. It is then quite hard to 
get that definition to align properly with any enclosing “underbar” (I tried 
something like that a while ago and basically gave up. I did not want to spend 
a whole of time on it so I just told the client “computer says no").


> Another question: what do you mean with a dy-shift version?

Nested bars have a parameter ‘dy’ which controls the vertical shifts needed to 
make sure that they do not overlap. Text backgrounds do not have that option at 
all.

> 
> Best,
> Denis
> 
>> -Ursprüngliche Nachricht-
>> Von: Taco Hoekwater 
>> Gesendet: Dienstag, 30. November 2021 14:19
>> An: mailing list for ConTeXt users 
>> Cc: Maier, Denis Christian (UB) 
>> Betreff: Re: [NTG-context] double underbars
>> 
>> 
>> 
>>> On 30 Nov 2021, at 12:06, Denis Maier via ntg-context > cont...@ntg.nl> wrote:
>>> 
>>> Hi,
>>> 
>>> for a current project I’ll need different variants of underbars.
>>> 
>>> - A normal underbar
>>> - A dotted underbar
>>> - A combination of both
>>> 
>>> Is there a way to combine them? I was hoping to have the dotted variant
>> above the normal bar.
>> 
>> I would like to have this type of “complete” bar nesting as well.
>> 
>> As it stands, you can nest \underbars inside \underbars and \overstrikes
>> inside \overstrikes and \overbars inside \overbars, but no other
>> combinations work. Interoperability between these (as well as \underdot,
>> \underdash, \underrandom ...) would be really cool.
>> 
>> Either with \bar or a nestable dy-shift version of textbackgrounds would
>> be really handy sometimes. :)
>> 
>> 
>> 
>>> 
>>> This is not working
>>> 
>>> %%%
>>> \starttext
>>> 
>>> \underbar{asdf}
>>> 
>>> \underdot{asdf}
>>> 
>>> \underbar{\underdot{asdf}}
>>> 
>>> \stoptext
>>> %%%
>>> 
>>> 
>>> Best,
>>> Denis
>>> 
>>> 
>> __
>> 
>>> _ 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
>>> 
>> __
>> 
>>> _
>> 
>> —
>> Taco Hoekwater  E: t...@bittext.nl
>> genderfluid (all pronouns)
>> 
>> 
> 
> ___
> 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
> ___

— 
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)



___
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] double underbars

2021-11-30 Thread Henning Hraban Ramm via ntg-context

Am 30.11.21 um 14:19 schrieb Taco Hoekwater via ntg-context:

I would like to have this type of “complete” bar nesting as well.


YES, #metoo


As it stands, you can nest \underbars inside \underbars and \overstrikes inside 
\overstrikes and \overbars inside \overbars, but no other combinations work. 
Interoperability between these (as well as \underdot, \underdash, \underrandom 
...) would be really cool.

Either with \bar or a nestable dy-shift version of textbackgrounds would be 
really handy sometimes. :)


\startbar[under,over,strikethrough] ... \stopbar ?

\barbar[top=single,bottom=double,mp=mp:swiggly]{text} ?

A nestable version of the existing bars would have the advantage that 
you can add bars one after the other.


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] double underbars

2021-11-30 Thread Denis Maier via ntg-context
Thanks, Taco. Good to know. Although it's not what I wanted to hear, of 
course...

I was thinking using mp to draw the combination could be solution, but 
unfortunately I don't know metafun yet.

If my understanding of https://source.contextgarden.net/node-rul.mkiv is 
correct, it should be possible to build upon the defintion of rules:under:dots 
(l. 327) Any hints how I could get this started?

Another question: what do you mean with a dy-shift version?

Best,
Denis

> -Ursprüngliche Nachricht-
> Von: Taco Hoekwater 
> Gesendet: Dienstag, 30. November 2021 14:19
> An: mailing list for ConTeXt users 
> Cc: Maier, Denis Christian (UB) 
> Betreff: Re: [NTG-context] double underbars
> 
> 
> 
> > On 30 Nov 2021, at 12:06, Denis Maier via ntg-context  cont...@ntg.nl> wrote:
> >
> > Hi,
> >
> > for a current project I’ll need different variants of underbars.
> >
> > - A normal underbar
> > - A dotted underbar
> > - A combination of both
> >
> > Is there a way to combine them? I was hoping to have the dotted variant
> above the normal bar.
> 
> I would like to have this type of “complete” bar nesting as well.
> 
> As it stands, you can nest \underbars inside \underbars and \overstrikes
> inside \overstrikes and \overbars inside \overbars, but no other
> combinations work. Interoperability between these (as well as \underdot,
> \underdash, \underrandom ...) would be really cool.
> 
> Either with \bar or a nestable dy-shift version of textbackgrounds would
> be really handy sometimes. :)
> 
> 
> 
> >
> > This is not working
> >
> > %%%
> > \starttext
> >
> > \underbar{asdf}
> >
> > \underdot{asdf}
> >
> > \underbar{\underdot{asdf}}
> >
> > \stoptext
> > %%%
> >
> >
> > Best,
> > Denis
> >
> >
> __
> 
> > _ 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
> >
> __
> 
> > _
> 
> —
> Taco Hoekwater  E: t...@bittext.nl
> genderfluid (all pronouns)
> 
> 

___
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] double underbars

2021-11-30 Thread Taco Hoekwater via ntg-context


> On 30 Nov 2021, at 12:06, Denis Maier via ntg-context  
> wrote:
> 
> Hi,
>  
> for a current project I’ll need different variants of underbars.
>  
> - A normal underbar
> - A dotted underbar
> - A combination of both
>  
> Is there a way to combine them? I was hoping to have the dotted variant above 
> the normal bar.

I would like to have this type of “complete” bar nesting as well. 

As it stands, you can nest \underbars inside \underbars and \overstrikes inside 
\overstrikes and \overbars inside \overbars, but no other combinations work. 
Interoperability between these (as well as \underdot, \underdash, \underrandom 
...) would be really cool.

Either with \bar or a nestable dy-shift version of textbackgrounds would be 
really handy sometimes. :)



>  
> This is not working
>  
> %%%
> \starttext
>  
> \underbar{asdf}
>  
> \underdot{asdf}
>  
> \underbar{\underdot{asdf}}
>  
> \stoptext
> %%%
>  
>  
> Best,
> Denis
>  
> ___
> 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
> ___

— 
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)



___
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] Bar within math (amended)

2020-06-15 Thread Henning Hraban Ramm

> Am 11.06.2020 um 13:41 schrieb Axel Kielhorn :
> 
>> Am 09.06.2020 um 20:41 schrieb Wolfgang Schuster 
>> :
>> 
>> Use a textbackground to highlight parts of your text.
>> 
>> \definetextbackground
>> [Highlight]
>> [frame=off,
>>  background=color,
>>  backgroundcolor=yellow]
>> 
>> \starttext
>> 
>> \m{1 + 2 = \unit{3 kilo newton}}
>> 
>> \m{1 + 2 = \Highlight{\unit{3 kilo newton}}}
>> 
>> \stoptext
>> 
>> Wolfgang
>> 
> 
> Is there a way to highlight just the words and leave the space white?
> Something like \overstrikes?


Wolfgang or whoelse,
when would you advise to use textbackgrounds and when bars? E.g. if I need a 
“marker” highlighting.

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] Bar within math (amended)

2020-06-11 Thread Axel Kielhorn


> Am 09.06.2020 um 20:41 schrieb Wolfgang Schuster 
> :
> 
> Use a textbackground to highlight parts of your text.
> 
> \definetextbackground
>  [Highlight]
>  [frame=off,
>   background=color,
>   backgroundcolor=yellow]
> 
> \starttext
> 
> \m{1 + 2 = \unit{3 kilo newton}}
> 
> \m{1 + 2 = \Highlight{\unit{3 kilo newton}}}
> 
> \stoptext
> 
> Wolfgang
> 

Is there a way to highlight just the words and leave the space white?
Something like \overstrikes?

Greetings
Axel
___
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] ConTeXt-ifying Kile

2008-01-02 Thread Matija Šuklje
]
\definetabulate[name][name][text]
\definetext[name][position][text][text][text]
# \definetextbackground
\definetextposition[name][settings]
# \definetextvariable[settings][???][???]
\definetype[name][settings]
# \definetypeface
\definetyping[file|typing|name][settings]
\defineversion[name][numbers]
# \defineXMLargument
# \defineXMLcommand
# \defineXMLenvironment
# \defineXMLenvironmentsave
# \defineXMLgrouped
# \defineXMLgsave
# \defineXMLgstore
# \defineXMLignore
# \defineXMLnested
# \defineXMLpickup
# \defineXMLprocess
# \defineXMLsave
# \defineXMLsavecontent
# \defineXMLsingular
# \defineXMLstore
# \defXMLstring
\description{text}text
\determineheadnumber[section]
\determinelistcharacteristics[names][settings]
# \digits
\disableinteractionmenu[position|name][references]
# \disablemode
# \doglobal
# \dogotopar
# \doif
# \doifcommon
# \doifcommonelse
# \doifdefined
# \doifdefinedelse
# \doifelse
# \doifelsenothing
# \doifelsevalue
# \doiffieldelse
# \doifflagged
# \doifinset
# \doifinsetelse
# \doifmode
# \doifmodeelse
# \doifnextcharelse
# \doifnot
# \doifnotcommon
# \doifnotflagged
# \doifnothing
# \doifnotinsetelse
# \doifnotmode
# \doifnotvalue
# \doifsomething
# \doiftext
# \doiftextelse
# \doifundefined
# \doifundefinedelse
# \doifvalue
# \doifXMLdata
# \doifXMLdataelse
# \doifXMLop
# \doifXMLparelse
# \doloop
# \donothing
# \dontleavehmode
\donttest
# \dorecurse
# \dostepwiserecurse
# \dowithnextbox
# \dowithnextboxcontent
# \empty
\emptylines[number]
# \emptytoks
# \enablemode
# \endstrut
\enumeration
# \environment
# \EQ
# \eTABLE
# \eTABLEbody
# \eTABLEfoot
# \eTABLEhead
# \eTABLEnext
# \eTD
# \eTH
# \eTR
# \exitloop
# \expanded
\externalfigure[file][settings]
\field[name]
\fieldstack[name][names][settings]
\fillinfield[text]{text}
\fillinline[settings]
\fillinrules[settings]{text}{text}
\fillintext[settings]{text}{text}
\fitfield[name]
\fixedspaces
# \FLOWchart
# \flushcollector
# \flushlayer
# \flushXMLelement
\followprofile{text}[text]
\followprofileversion{text}[text][text]
\followversion{text}[text]
\footnote[reference]{text}
\footnotetext[reference]{text}
\forceblocks[names][names]
# \forgetall
# \FR
\fraction{text}{text}
\framed[settings]{text}
\framedtext[settings]
\from[reference]
\getbuffer[name]
# \getfiguredimensionsonly
# \getmarking[name][options]
# \getvalue
# \getvariable
# \globalletvalue
\godown[dimension]
\goto{text}{text}[references]
\gotobox{text}[references]
\graycolor[text]
\grid[options]
# \gsaveXMLasdata
\hairline
\head[references]
\headnumber[section]
\headtext{text}
# \hfilll
\hideblocks[names][names]
\high{text}
# \HL
\hl[number]
# \hpos
# \hspace
# \ifconditional
# \ifdefined
# \iftrialtypesetting
# \ifundefined
\in{text}{text}[reference]
# \includeFLOWchart
# \includemenu
# \increment
\indentation
\indenting[options]
\inframed[settings]{text}
\ininner[+|-|low][reference]{text}
\inleft[+|-|low][reference]{text}
\inline[reference]
\inmargin[+|-|low][reference]{text}
\inothermargin[+|-|low][reference]{text}
\inouter[+|-|low][reference]{text}
\inright[+|-|low][reference]{text}
\installlanguage[name][options]
\interactionbar[settings]
\interactionbuttons[settings][names]
\item[references]
\items[settings]{text}
\its[references]
\keepblocks[names][all|names]
\labeling[reference]
\labels[name]
\labeltext{text}
\language[language code]
\leftaligned{text}
# \letgvalue
# \letvalue
\listsymbol[name]{text}
# \loadmapfile
\loadsorts
\loadsynonyms
# \localhsize
\logfields
\lohi[low]{text}{text}
\low{text}
# \LR
\mainlanguage[language code]
\mar[references]{text}
\marginrule[number]{text}
\margintext[+|-|low][reference]{text}
\marking[name]{text}
\markversion
\mathematics{text}
\mediaeval{text}
\midaligned{text}
\mirror{text}
\MONTH{text}
\month{text}
\moveongrid[options]
# \MR
\name{text}
# \NC
# \newcounter
# \nextbox
\nextsection
\nocap{text}
\noheaderandfooterlines
\noindenting
\nolist{text}
\nomarking{text}
\nomoreblocks
\nomorefiles
\nop
\nospace
\note[reference]
\notopandbottomlines
\nowhitespace
# \NR
\numbers{text}
\overbar{text}
\overbars{text text}
# \overlaybutton
# \overlayfigure
\overstrike{text}
\overstrikes{text text}
\packed
\page[options]
\pagereference[reference]
\pagetype[name]
\paragraph
\part[references]{text}
\periods[number]
\placebookmarks[names][names|all]
\placecombinedlist[name][settings]
\placecombinedlist[name][settings]
# \placefigure
\placefloat[options][references]{text}{text}
\placefootnotes[settings]
\placeformula[references]{text}$$ $$
# \placelayer
\placelegend{text}{text}
\placelist[names][settings]
\placelistoffloats
\placelistofsorts
\placelistofsynonyms
\placelocalfootnotes[settings]
\placelogos[names]
\placeongrid[settings{text}
\placeontopofeachother{text}{text}
\placereferencelist[names]
\placeregister[name][settings]
\placeregister[settings]
\placerule[name]
\placesidebyside{text}{text}
\placesubformula[references]{text}$$ $$
\placetextvariable[name]
# \plusone
# \plustwo
\position(numbers){text}
\positiontext[name]{text}
# \prependtoks

Re: [NTG-context] Problems mapping Xml into ConTeXt

2006-10-12 Thread Hans Hagen
Michael Wigston wrote:

 Hans Hagen wrote:
  Michael Wigston wrote:
   1.  This def of u does nothing ...
   \defineXMLgrouped [u] \underbar
  
  \defineXMLargument[u]{\underbar}
 
  underbar is not a font switch but a macro that takes an argument

 Hans,

 Thanks, that works fine with \underbar, as well as \underbars, 
 \overstrike, \overstrikes, \low, \high and \lohi.

 You mentioned that \underbar (and presumably the others I mentioned 
 above) are macros taking arguments e.g. \acommand{...}. However 
 presumably something like \midaligned{...}  is also a macro requiring 
 an argument, but this works as a \defineXMLgrouped and as a 
 \defineXMLargument - why does it  work with both?
the macro ones do manipulate their argument, for instance, underbar is 
not a font charateristic or color switch or so i.e. not a real 
attribute; esp using setups will make your style look better (look into 
x-fo for instance, forget about the dirty tricks there, but it's pretty 
clean; mapping values and so save many macro definitions

 The manual XML in ConTeXt very briefly sketched over these XML 
 commands and I can see great potential to use them directly on XML to 
 generate ConTeXt for PDF rather than the XSLT/XSL-FO route which seems 
 to be gaining momentum in much of the industry. I don't suppose there 
 is another more detailed document which elaborates on the XML 
 commands, and how you may determine which of these is most appropriate 
 for what kind of ConTeXt command mapping? 
you can take a look into the x-* files which show quite some mappings; 
indeed direct mapping is often more convenient than transformations; 
future versions of context will also offer more manipulation possibilities


 Also at the moment a non-mapped element seems to automatically type 
 out its contents as straight text - is there a way to override this 
 behaviour and specify this as an error? (This is rather like the Ruby 
 duck-typing approach - if an XML element is mapped, process it, else 
 it is an error).  
\startXMLignore
\stopXMLignore 

in xtag-pre you can see: 

\defineXMLenvironment [\s!default] \defaultXMLelement \defaultXMLelement
\defineXMLsingular[\s!default] \defaultXMLelement

% \def\defaultXMLelement
%   {\iftraceXMLelements[\currentXMLfullidentifier]\fi}

\def\defaultXMLelement
  {\iftraceXMLelements{\infofont\currentXMLfullidentifier}\fi}

%D We can use the default handler to implement automatic
%D element hiding. Beware: this overloads the tracer.

\def\startXMLignore{\dododefineXMLignore \s!default}
\def\stopXMLignore {\dododefineXMLprocess\s!default}

so you can play with the default handlers 

Hans 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Problems mapping Xml into ConTeXt

2006-10-12 Thread Michael Wigston

 Michael Wigston wrote:
 
  Hans Hagen wrote:
   Michael Wigston wrote:
1. This def of u does nothing ...
\defineXMLgrouped [u] \underbar
   
   \defineXMLargument[u]{\underbar}
  
   underbar is not a font switch but a macro that takes an
argument
 
  Hans,
 
  Thanks, that works fine with \underbar, as well as \underbars,

  \overstrike, \overstrikes, \low, \high and \lohi.
 
  You mentioned that \underbar (and presumably the others I mentioned

  above) are macros taking arguments e.g. \acommand{...}. However

  presumably something like \midaligned{...} is also a macro
requiring 
  an argument, but this works as a \defineXMLgrouped and as a 
  \defineXMLargument - why does it work with both?
 the macro ones do manipulate their argument, for instance, underbar
is 
 not a font charateristic or color switch or so i.e. not a real 
 attribute; esp using setups will make your style look better (look
into 
 x-fo for instance, forget about the dirty tricks there, but it's pretty

 clean; mapping values and so save many macro definitions
 
  The manual XML in ConTeXt very briefly sketched over
these XML 
  commands and I can see great potential to use them directly on
XML to 
  generate ConTeXt for PDF rather than the XSLT/XSL-FO route which
seems 
  to be gaining momentum in much of the industry. I don't suppose
there 
  is another more detailed document which elaborates on the XML

  commands, and how you may determine which of these is most appropriate

  for what kind of ConTeXt command mapping? 
 you can take a look into the x-* files which show quite some mappings;

 indeed direct mapping is often more convenient than transformations;

 future versions of context will also offer more manipulation possibilities
 
 
  Also at the moment a non-mapped element seems to automatically
type 
  out its contents as straight text - is there a way to override
this 
  behaviour and specify this as an error? (This is rather like
the Ruby 
  duck-typing approach - if an XML element is mapped, process it,
else 
  it is an error). 
 \startXMLignore
 \stopXMLignore 
 
 in xtag-pre you can see: 
 
 \defineXMLenvironment [\s!default] \defaultXMLelement \defaultXMLelement
 \defineXMLsingular  [\s!default] \defaultXMLelement
 
 % \def\defaultXMLelement
 %  {\iftraceXMLelements[\currentXMLfullidentifier]\fi}
 
 \def\defaultXMLelement
  {\iftraceXMLelements{\infofont\currentXMLfullidentifier}\fi}
 
 %D We can use the default handler to implement automatic
 %D element hiding. Beware: this overloads the tracer.
 
 \def\startXMLignore{\dododefineXMLignore \s!default}
 \def\stopXMLignore {\dododefineXMLprocess\s!default}
 
 so you can play with the default handlers 
 

Thanks, looks like I'll have to do some digging in
the x-* files ...

Regards,


NOTICE

This e-mail and any attachments are intended for the addressee(s) only and may be confidential.  They may contain legally privileged or copyright material.  You should not read, copy, use or disclose them without authorisation.  If you are not the intended recipient please contact the sender as soon as possible by return e-mail and then please delete both messages.  This notice should not be removed.   
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Problems mapping Xml into ConTeXt

2006-10-11 Thread Michael Wigston

Hans Hagen wrote:
 Michael Wigston wrote:
  1. This def of u does nothing ...
  \defineXMLgrouped [u] \underbar
 
 \defineXMLargument[u]{\underbar}
 
 underbar is not a font switch but a macro that takes an argument

Hans,

Thanks, that works fine with \underbar,
as well as \underbars, \overstrike, \overstrikes, \low, \high and \lohi.

You mentioned that \underbar (and presumably
the others I mentioned above) are macros taking arguments e.g. \acommand{...}.
However presumably something like \midaligned{...} is also a macro
requiring an argument, but this works as a \defineXMLgrouped and as a \defineXMLargument
- why does it work with both?

The manual XML in ConTeXt
very briefly sketched over these XML commands and I can see great potential
to use them directly on XML to generate ConTeXt for PDF rather than the
XSLT/XSL-FO route which seems to be gaining momentum in much of the industry.
I don't suppose there is another more detailed document which elaborates
on the XML commands, and how you may determine which of these is most appropriate
for what kind of ConTeXt command mapping? 

Also at the moment a non-mapped element
seems to automatically type out its contents as straight text - is there
a way to override this behaviour and specify this as an error? (This is
rather like the Ruby duck-typing approach - if an XML element is mapped,
process it, else it is an error). 

Michael
NOTICE

This e-mail and any attachments are intended for the addressee(s) only and may be confidential.  They may contain legally privileged or copyright material.  You should not read, copy, use or disclose them without authorisation.  If you are not the intended recipient please contact the sender as soon as possible by return e-mail and then please delete both messages.  This notice should not be removed.   
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] beta (04.10.06)

2006-10-10 Thread Hans Hagen
Wolfgang Schuster wrote:


 2006/10/4, Hans Hagen [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]:

 Peter Rolf wrote:
  Hi Hans,
 
  there is a file missing in the new beta.
 
  [..]
  ConTeXt  ver: 2006.10.03 21:08 MK II  fmt: 2006.10.4  int:
 english/en
 
  \@@mslingualstitle: \@@mslinguals9 de
  \@@mssystemstitle: \@@mssystems2 cont-new
  (r:/tex/texmf-local/tex/context/base/cont- new.tex
  systems : beware: some patches loaded from cont-new.tex
  ! I can't find file `cont-new.mkii'.
  to be read again
 \relax
  l.1921 \loadmarkfile{cont-new}
  [..]
 
 
 ok, for the moment just make an empty file with that name

 Hans

  
 Hi Hans
  
 you also missed to move \def\currentspaceskip from supp-lan
 (replaced by lan-mis) to another file.
  
 The command is needed for \overstrikes.
  
ok, added to syst-fnt 

thanks or noticing 

Hans 

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Problems mapping Xml into ConTeXt

2006-10-10 Thread Michael Wigston

Hi everyone,

I am attempting to map some XML into
ConTeXt as described in the manual XML in ConTeXt. Essentially
we have a bunch of tagged text (the XML loosely based on some
of the XHTML tags) from which we want to produce PDF letters for
dispatch (via email, post etc). 

I am having particular problems implementing
the following commands: -
\underbar,
\underbars, \overstrike, \overstrikes, \low, \high and \lohi

I was expecting that they would all
easily be defined using the \defineXMLgrouped [name] {command} element
mapping. There is probably something very simple that I have not setup
correctly since I am sure that this has been attempted before and would
appreciate pointers as to where I am going wrong.

The following attempts at mapping element
u to \underbar illustrates my problem which also seems largely
applicable to the strike, sub and sup mapping:
-

1. This def of u does
nothing ...
\defineXMLgrouped [u] \underbar

2. This def of u also
does nothing ...
\defineXMLgrouped [u] {\groupedcommand{\underbar}{}}

3. This def of u underlines
the 1st character only ...
\defineXMLenvironment [u] {\bgroup\underbar}
{\egroup}

4. In the mailing list, there is a suggestion
that \underbar does not allow line-breaking, so I also tried the
following. This def of u works partially, in
that it does underline, however it causes havoc with alignment - everything
seems to shift over to the right about 4cm ...

\defineXMLenvironment [u] \startul \stopul
\definetextbackground[ul]
 [location=text,alternative=1,background="">

\definestartstop[ul]
  [before={\starttextbackground[ul]
},
after={\stoptextbackground\
}]


Below is a sample .tex file that
I have been playing with: -

\usemodule[contml]
\autoXMLnamespace [context]

% Attempts at defining a mapping for
u: -
% This def of u does nothing
...
%\defineXMLgrouped [u] \underbar
% This def of u does nothing
...
%\defineXMLgrouped [u] {\groupedcommand{\underbar}{}}
% This def of u underlines the
1st character only ...
%\defineXMLenvironment [u] {\bgroup\underbar}
{\egroup}
%
% This def of u works
partially, in that it does underline, however it
% causes havoc with alignment - everything
seems to shift over to the right
% about 4cm ...

\defineXMLenvironment [u] \startul \stopul
\definetextbackground[ul]
 [location=text,alternative=1,background="">

\definestartstop[ul]
  [before={\starttextbackground[ul]
},
  %  after={\stoptextbackground\fixedspaces}]
after={\stoptextbackground\
}]

% Other mappings
\defineXMLgrouped [right] \rightaligned
\defineXMLgrouped [centre] \midaligned
\defineXMLgrouped [em] \em
\defineXMLsingular [br] [nr=1]
  {\blank[\XMLop{nr}*medium]}

\showstruts \showframe

\starttext

start of 'normal' \CONTEXT\ text

\underbar{This} is {\em left} aligned
\blank[medium]
\rightaligned{\underbar{This} is {\em
right} aligned}
\blank[medium]
\midaligned{\underbar{This} is {\em
centre} aligned}

end of 'normal' \CONTEXT\ text - starting
xml ...

\startXMLdata

pThis is emleft/em
aligned/p

pcentreuThis/u
is emcentre/em aligned/centre/p

pcentreThis is emcentre/em
aligned/centre/p

prightThis is emright/em
aligned/right/p

\stopXMLdata
\blank[medium]
finished xml - back in 'normal' \CONTEXT\
text
\stoptext



NOTICE

This e-mail and any attachments are intended for the addressee(s) only and may be confidential.  They may contain legally privileged or copyright material.  You should not read, copy, use or disclose them without authorisation.  If you are not the intended recipient please contact the sender as soon as possible by return e-mail and then please delete both messages.  This notice should not be removed.   
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] beta (04.10.06)

2006-10-05 Thread Wolfgang Schuster

2006/10/4, Hans Hagen [EMAIL PROTECTED]:
Peter Rolf wrote: Hi Hans, there is a file missing in the new beta. [..]
 ConTeXtver: 2006.10.03 21:08 MK IIfmt: 2006.10.4int: english/en \@@mslingualstitle: \@@mslinguals9 de \@@mssystemstitle: \@@mssystems2 cont-new (r:/tex/texmf-local/tex/context/base/cont-
new.tex systems : beware: some patches loaded from cont-new.tex ! I can't find file `cont-new.mkii'. to be read again\relax l.1921 \loadmarkfile{cont-new}
 [..]ok, for the moment just make an empty file with that nameHans

Hi Hans

you also missed to move \def\currentspaceskip from supp-lan 
(replaced by lan-mis) to another file.

The command is needed for \overstrikes.

Wolfgang

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] visualising evolution from one version to another

2006-08-06 Thread Peter Münster
Hello,
if you know a bit MS-Word, then you have seen perhaps the feature, that
permits visualising differences between 2 versions of a document: added
text in red, and deleted text stroke out.

I would like to make something similar with ConTeXt: making a pdf-file from
doc-versionX.tex and doc-versionY.tex with added text in some colour and
deleted text displayed with \overstrikes{}.

Do you have some ideas, how to do that?

Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] visualising evolution from one version to another

2006-08-06 Thread Taco Hoekwater
Peter Münster wrote:
 Hello,
 if you know a bit MS-Word, then you have seen perhaps the feature, that
 permits visualising differences between 2 versions of a document: added
 text in red, and deleted text stroke out.
 
 I would like to make something similar with ConTeXt: making a pdf-file from
 doc-versionX.tex and doc-versionY.tex with added text in some colour and
 deleted text displayed with \overstrikes{}.
 
 Do you have some ideas, how to do that?

You need a way to create a merged ConTeXt document from the two separate
files, perhaps using something like this:

   http://search.cpan.org/dist/Text-WordDiff/lib/Text/WordDiff.pm

Cheers, taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] visualising evolution from one version to another

2006-08-06 Thread Taco Hoekwater
Peter Münster wrote:
 On Sun, 6 Aug 2006, Taco Hoekwater wrote:
 
 
You need a way to create a merged ConTeXt document from the two separate
files, perhaps using something like this:

   http://search.cpan.org/dist/Text-WordDiff/lib/Text/WordDiff.pm
 
 
 Thank you for this hint! It's exactly what I need. I've also found a shell
 version: wdiff
 But I still have one problem: I can't have a paragraph in \overstrikes.
 Is there perhaps something like \startoverstrikes ... \stopoverstrikes ?

Not that I know of. It should be possible to cook something up with
metafun and/or \starttextbackgrounds i guess, but I do not have a
ready-to-use solution for you.

Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] visualising evolution from one version to another

2006-08-06 Thread Peter Münster
On Sun, 6 Aug 2006, Taco Hoekwater wrote:

 You need a way to create a merged ConTeXt document from the two separate
 files, perhaps using something like this:
 
http://search.cpan.org/dist/Text-WordDiff/lib/Text/WordDiff.pm

Thank you for this hint! It's exactly what I need. I've also found a shell
version: wdiff
But I still have one problem: I can't have a paragraph in \overstrikes.
Is there perhaps something like \startoverstrikes ... \stopoverstrikes ?

Here is a little script, to show what I'm doing now:

#!/bin/bash
OLD=$1
NEW=$2
OUT=$3
shift 3
echo '\setupcolors[state=start]' $OUT.tex
echo '\long\def\startDeleted*#1\stopDeleted*{\overstrikes{#1}}' $OUT.tex
echo '\long\def\startAdded*#1\stopAdded*{\startcolor[blue]#1\stopcolor}' \
$OUT.tex
wdiff -w '\startDeleted*' -x '\stopDeleted*' \
-y '\startAdded*' -z '\stopAdded*' $OLD $NEW $OUT.tex
texexec $@ $OUT

Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context