[NTG-context] Re: Use headcommand in \definedescription together with \definehighlight (now: \definestartstop)

2024-07-01 Thread Gerion Entrup
Am Freitag, 28. Juni 2024, 11:59:19 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 28.06.2024 um 11:40:
> 
> > Do you know, why the groupedcommand solution does not work?
> 
> The command and the environment which are created by \definestartstop 
> can't be interchanged when you use the before/after and left/right keys.
> 
>  begin example
> \usemodule[visual]
> 
> \definestartstop
>[Example]
>[before={\par\leftaligned{\tttf [before]}\par},
>  after={\par\leftaligned{\tttf [after]}\par},
>left={{\tttf [left]}},
>   right={{\tttf [right]}}]
> 
> \starttext
> 
> \fakewords{10}{20}
> \startExample
> \fakewords{10}{20}
> \stopExample
> \fakewords{10}{20}
> 
> \blank
> 
> \fakewords{3}{5}
> \Example{\fakewords{3}{5}}
> \fakewords{3}{5}
> 
> \stoptext
>  end example
> 
> Wolfgang
> 

Ok, thanks for the explanation (I have added the example to the wiki).

Gerion


signature.asc
Description: This is a digitally signed message part.
___
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] Re: Use headcommand in \definedescription together with \definehighlight (now: \definestartstop)

2024-06-28 Thread Wolfgang Schuster

Gerion Entrup schrieb am 28.06.2024 um 11:40:


Do you know, why the groupedcommand solution does not work?


The command and the environment which are created by \definestartstop 
can't be interchanged when you use the before/after and left/right keys.


 begin example
\usemodule[visual]

\definestartstop
  [Example]
  [before={\par\leftaligned{\tttf [before]}\par},
after={\par\leftaligned{\tttf [after]}\par},
 left={{\tttf [left]}},
right={{\tttf [right]}}]

\starttext

\fakewords{10}{20}
\startExample
\fakewords{10}{20}
\stopExample
\fakewords{10}{20}

\blank

\fakewords{3}{5}
\Example{\fakewords{3}{5}}
\fakewords{3}{5}

\stoptext
 end example

Wolfgang
___
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] Re: Use headcommand in \definedescription together with \definehighlight (now: \definestartstop)

2024-06-28 Thread Gerion Entrup
Am Donnerstag, 27. Juni 2024, 22:19:02 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 25.06.2024 um 08:41:
> > Am Dienstag, 25. Juni 2024, 00:09:09 MESZ schrieb Wolfgang Schuster:
> >> Gerion Entrup schrieb am 24.06.2024 um 23:57:
> >>> Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan:
> >>>> On Mon, 24 Jun 2024, Gerion Entrup wrote:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> I was in the process to convert an itemize part to a description and 
> >>>>> wanted to simplify the code in the same move.
> >>>>> I discovered headcommand for that, but struggled to set the text in an 
> >>>>> highlight _and_ make a colon at the end.
> >>>> Not sure what exactly you want, but how about:
> >>>>
> >>>> \definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}]
> >>>> % This is the wrong way to define such a command as '>' is not part of 
> >>>> the style. I have left this definition just for comparison with the soln 
> >>>> below.
> >>> Is there a better way to define a highlight that sets a style (color, 
> >>> font) _and_ a prefix (symbol)?
> >>> Another way, I know of, would be just a plain def, something like 
> >>> \def{\hl}{\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I 
> >>> want to define a highlight (just with an additional prefix).
> >>
> >> 1. ConTeXt already uses \hl as name for a existing command.
> >>
> >> 2. Use \definestartstop:
> >>
> >> \definestartstop [gerion] [style=mono,left={›\thinspace}]
> >>
> >> \starttext
> >>
> >> text
> >>
> >> \gerion{text}
> >>
> >> \stoptext
> >>
> >>>> \definedescription[category][
> >>>>  alternative=top,
> >>>>  headstyle=bold,
> >>>>  width=broad,
> >>>> ]
> >>>>
> >>>> \definedescription[desc][
> >>>>  width=fit,
> >>>>  distance={\widthofstring{~}},
> >>
> >> distance=\spaceamount,
> >>
> >> Wolfgang
> > 
> > This seems to be much better but does not lead to the wanted result. The 
> > full example now is:
> > ```
> > \definestartstop[myhl][style=mono,left={›\thinspace}]
> > 
> > \definedescription[categorie][
> > alternative=top,
> > headstyle=bold,
> > width=broad,
> > ]
> > 
> > \definedescription[desc][
> > width=broad,
> > distance=\spaceamount,
> > headcommand={\groupedcommand{\startmyhl}{\stopmyhl :}},
> > headstyle=,
> > before={\startpacked},
> > after={\stoppacked},
> > alternative=hanging
> > ]
> > 
> > \starttext
> > 
> > This is a \myhl{highlight}.
> > 
> > Some listings
> > 
> > \startcategorie{Itemize}
> > \startitemize[packed]
> > \item \myhl{first}: one
> > \item \myhl{second}: two
> > \stopitemize
> > \stopcategorie
> > 
> > Now the same as desc:
> > \startcategorie{Desc}
> > \startdesc{first} one \stopdesc
> > \startdesc{second} two \stopdesc
> > \stopcategorie
> > 
> > \stoptext
> > ```
> > 
> > This adopts the correct style in \startdesc \stopdesc and sets the colon 
> > but omits the › (the left part).
> 
> You can do the following in the next version.
> 
> 1. Add "arguments=yes" to \definestartstop to enable the optional 
> argument for the new command.
> 
> 2. Use the new commands with the "headcommand" key and apply ":" as 
> right delimiter for the content of \Highlight.
> 
> \definestartstop
>[Highlight]
>[arguments=yes,
> style=mono,
>  left={›\thinspace}]
> 
> \definedescription
>[description]
>[  width=broad,
>distance=\spaceamount,
> headcommand=\Highlight[right=:],
> alternative=hanging]
> 
> \starttext
> 
> This is a \Highlight{highlight}.
> 
> \startdescription[title={Lorem ipsum}]
> \samplefile{lorem}
> \stopdescription
> 
> \stoptext
> 
> Wolfgang

Thanks, that will work.
Do you know, why the groupedcommand solution does not work?

Gerion


signature.asc
Description: This is a digitally signed message part.
___
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] Re: Use headcommand in \definedescription together with \definehighlight (now: \definestartstop)

2024-06-27 Thread Wolfgang Schuster

Gerion Entrup schrieb am 25.06.2024 um 08:41:

Am Dienstag, 25. Juni 2024, 00:09:09 MESZ schrieb Wolfgang Schuster:

Gerion Entrup schrieb am 24.06.2024 um 23:57:

Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan:

On Mon, 24 Jun 2024, Gerion Entrup wrote:


Hi,

I was in the process to convert an itemize part to a description and wanted to 
simplify the code in the same move.
I discovered headcommand for that, but struggled to set the text in an 
highlight _and_ make a colon at the end.

Not sure what exactly you want, but how about:

\definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}]
% This is the wrong way to define such a command as '>' is not part of the 
style. I have left this definition just for comparison with the soln below.

Is there a better way to define a highlight that sets a style (color, font) 
_and_ a prefix (symbol)?
Another way, I know of, would be just a plain def, something like 
\def{\hl}{\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I want to 
define a highlight (just with an additional prefix).


1. ConTeXt already uses \hl as name for a existing command.

2. Use \definestartstop:

\definestartstop [gerion] [style=mono,left={›\thinspace}]

\starttext

text

\gerion{text}

\stoptext


\definedescription[category][
alternative=top,
headstyle=bold,
width=broad,
]

\definedescription[desc][
width=fit,
distance={\widthofstring{~}},


distance=\spaceamount,

Wolfgang


This seems to be much better but does not lead to the wanted result. The full 
example now is:
```
\definestartstop[myhl][style=mono,left={›\thinspace}]

\definedescription[categorie][
alternative=top,
headstyle=bold,
width=broad,
]

\definedescription[desc][
width=broad,
distance=\spaceamount,
headcommand={\groupedcommand{\startmyhl}{\stopmyhl :}},
headstyle=,
before={\startpacked},
after={\stoppacked},
alternative=hanging
]

\starttext

This is a \myhl{highlight}.

Some listings

\startcategorie{Itemize}
\startitemize[packed]
\item \myhl{first}: one
\item \myhl{second}: two
\stopitemize
\stopcategorie

Now the same as desc:
\startcategorie{Desc}
\startdesc{first} one \stopdesc
\startdesc{second} two \stopdesc
\stopcategorie

\stoptext
```

This adopts the correct style in \startdesc \stopdesc and sets the colon but 
omits the › (the left part).


You can do the following in the next version.

1. Add "arguments=yes" to \definestartstop to enable the optional 
argument for the new command.


2. Use the new commands with the "headcommand" key and apply ":" as 
right delimiter for the content of \Highlight.


\definestartstop
  [Highlight]
  [arguments=yes,
   style=mono,
left={›\thinspace}]

\definedescription
  [description]
  [  width=broad,
  distance=\spaceamount,
   headcommand=\Highlight[right=:],
   alternative=hanging]

\starttext

This is a \Highlight{highlight}.

\startdescription[title={Lorem ipsum}]
\samplefile{lorem}
\stopdescription

\stoptext

Wolfgang


Highlight.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] Re: Use headcommand in \definedescription together with \definehighlight (now: \definestartstop)

2024-06-24 Thread Gerion Entrup
Am Dienstag, 25. Juni 2024, 00:09:09 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 24.06.2024 um 23:57:
> > Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan:
> >> On Mon, 24 Jun 2024, Gerion Entrup wrote:
> >>
> >>> Hi,
> >>>
> >>> I was in the process to convert an itemize part to a description and 
> >>> wanted to simplify the code in the same move.
> >>> I discovered headcommand for that, but struggled to set the text in an 
> >>> highlight _and_ make a colon at the end.
> >> Not sure what exactly you want, but how about:
> >>
> >> \definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}]
> >> % This is the wrong way to define such a command as '>' is not part of the 
> >> style. I have left this definition just for comparison with the soln below.
> > Is there a better way to define a highlight that sets a style (color, font) 
> > _and_ a prefix (symbol)?
> > Another way, I know of, would be just a plain def, something like 
> > \def{\hl}{\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I want 
> > to define a highlight (just with an additional prefix).
> 
> 1. ConTeXt already uses \hl as name for a existing command.
> 
> 2. Use \definestartstop:
> 
> \definestartstop [gerion] [style=mono,left={›\thinspace}]
> 
> \starttext
> 
> text
> 
> \gerion{text}
> 
> \stoptext
> 
> >> \definedescription[category][
> >>alternative=top,
> >>headstyle=bold,
> >>width=broad,
> >> ]
> >>
> >> \definedescription[desc][
> >>width=fit,
> >>distance={\widthofstring{~}},
> 
> distance=\spaceamount,
> 
> Wolfgang

This seems to be much better but does not lead to the wanted result. The full 
example now is:
```
\definestartstop[myhl][style=mono,left={›\thinspace}]

\definedescription[categorie][
alternative=top,
headstyle=bold,
width=broad,
]

\definedescription[desc][
width=broad,
distance=\spaceamount,
headcommand={\groupedcommand{\startmyhl}{\stopmyhl :}},
headstyle=,
before={\startpacked},
after={\stoppacked},
alternative=hanging
]

\starttext

This is a \myhl{highlight}.

Some listings

\startcategorie{Itemize}
\startitemize[packed]
\item \myhl{first}: one
\item \myhl{second}: two
\stopitemize
\stopcategorie

Now the same as desc:
\startcategorie{Desc}
\startdesc{first} one \stopdesc
\startdesc{second} two \stopdesc
\stopcategorie

\stoptext
```

This adopts the correct style in \startdesc \stopdesc and sets the colon but 
omits the › (the left part).

Gerion


mwe.pdf
Description: Adobe PDF document


signature.asc
Description: This is a digitally signed message part.
___
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] Re: Use headcommand in \definedescription together with \definehighlight

2024-06-24 Thread Wolfgang Schuster

Gerion Entrup schrieb am 24.06.2024 um 23:57:

Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan:

On Mon, 24 Jun 2024, Gerion Entrup wrote:


Hi,

I was in the process to convert an itemize part to a description and wanted to 
simplify the code in the same move.
I discovered headcommand for that, but struggled to set the text in an 
highlight _and_ make a colon at the end.

Not sure what exactly you want, but how about:

\definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}]
% This is the wrong way to define such a command as '>' is not part of the 
style. I have left this definition just for comparison with the soln below.

Is there a better way to define a highlight that sets a style (color, font) 
_and_ a prefix (symbol)?
Another way, I know of, would be just a plain def, something like 
\def{\hl}{\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I want to 
define a highlight (just with an additional prefix).


1. ConTeXt already uses \hl as name for a existing command.

2. Use \definestartstop:

\definestartstop [gerion] [style=mono,left={›\thinspace}]

\starttext

text

\gerion{text}

\stoptext


\definedescription[category][
alternative=top,
headstyle=bold,
width=broad,
]

\definedescription[desc][
width=fit,
distance={\widthofstring{~}},


distance=\spaceamount,

Wolfgang

___
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] Re: Use headcommand in \definedescription together with \definehighlight

2024-06-24 Thread Gerion Entrup
Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan:
> On Mon, 24 Jun 2024, Gerion Entrup wrote:
> 
> > Hi,
> > 
> > I was in the process to convert an itemize part to a description and wanted 
> > to simplify the code in the same move.
> > I discovered headcommand for that, but struggled to set the text in an 
> > highlight _and_ make a colon at the end.
> 
> Not sure what exactly you want, but how about:
> 
> \definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}]
> % This is the wrong way to define such a command as '>' is not part of the 
> style. I have left this definition just for comparison with the soln below.

Is there a better way to define a highlight that sets a style (color, font) 
_and_ a prefix (symbol)?
Another way, I know of, would be just a plain def, something like 
\def{\hl}{\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I want to 
define a highlight (just with an additional prefix).

> \definedescription[category][
>   alternative=top,
>   headstyle=bold,
>   width=broad,
> ]
> 
> \definedescription[desc][
>   width=fit,
>   distance={\widthofstring{~}},
> headcommand={\groupedcommand{>\,}{:}}, 

Hmm, this works, but duplicates the above definition.
If I don't want to use > as prefix but ›, I need to replace it in two places.

>   headstyle=\tt,
>   before={\startpacked},
>   after={\stoppacked},
>   alternative=hanging,
> ]

Gerion



signature.asc
Description: This is a digitally signed message part.
___
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] Re: Use headcommand in \definedescription together with \definehighlight

2024-06-24 Thread Aditya Mahajan
On Mon, 24 Jun 2024, Gerion Entrup wrote:

> Hi,
> 
> I was in the process to convert an itemize part to a description and wanted 
> to simplify the code in the same move.
> I discovered headcommand for that, but struggled to set the text in an 
> highlight _and_ make a colon at the end.

Not sure what exactly you want, but how about:

\definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}]
% This is the wrong way to define such a command as '>' is not part of the 
style. I have left this definition just for comparison with the soln below.

\definedescription[category][
alternative=top,
headstyle=bold,
width=broad,
]

\definedescription[desc][
width=fit,
distance={\widthofstring{~}},
headcommand={\groupedcommand{>\,}{:}}, 
headstyle=\tt,
before={\startpacked},
after={\stoppacked},
alternative=hanging,
]

\starttext

This is a \hl{highlight}.

Some listings

\startcategory{Itemize}
\startitemize[packed]
\item \hl{first}: one
\item \hl{second}: two
\stopitemize
\stopcategory

Now the same as desc:
\startcategory{Desc}
\startdesc{first} one \stopdesc
\startdesc{second} two \stopdesc
\stopcategory

\stoptext

Aditya
___
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] Use headcommand in \definedescription together with \definehighlight

2024-06-24 Thread Gerion Entrup
Hi,

I was in the process to convert an itemize part to a description and wanted to 
simplify the code in the same move.
I discovered headcommand for that, but struggled to set the text in an 
highlight _and_ make a colon at the end.
Do you know, if this is possible?

Here is a MWE:
```
\definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}]

\definedescription[category][
alternative=top,
headstyle=bold,
width=broad,
]

\definedescription[desc][
width=broad,
distance={\widthofstring{~}},
headcommand={\groupedcommand{\hl}{:}},
% headcommand={\groupedcommand{}{:}}, % this compiles but the highlight 
is lost
% headcommand={\groupedcommand{\starthl}{\stophl :}}, % this does not 
compile
headstyle=,
before={\startpacked},
after={\stoppacked},
alternative=hanging,
]

\starttext

This is a \hl{highlight}.

Some listings

\startcategory{Itemize}
\startitemize[packed]
\item \hl{first}: one
\item \hl{second}: two
\stopitemize
\stopcategory

Now the same as desc:
\startcategory{Desc}
\startdesc{first} one \stopdesc
\startdesc{second} two \stopdesc
\stopcategory

\stoptext
```
The itemize looks like it should look (except of the dots).

Best,
Gerion

signature.asc
Description: This is a digitally signed message part.
___
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
___


Re: [NTG-context] need defaults for \definehighlight

2015-02-09 Thread Wolfgang Schuster

> Am 09.02.2015 um 14:34 schrieb Keith Schultz :
> 
> Hi Hans, Idris, All,
> 
> fonts and color are as such appearance.
> But, when one uses different fonts and colors or mix
> then then we add meaning or as you tend to call
> it structure. 
> 
> If their use does not add to the structure, then only one font style
> and color is needed.
> 
> So actually, in the end they should be tagged, too!
> 
> Wolfgang has mentioned that we have definestyle is that 
> tagged or not!

No.

> Furthermore, it is possible in ConTeXt to setup for example
> the style italic, etc to what ever one cares to! for example one could
> make and italic style be mono or bold! (naturally, it is
> nonsense to do this).

\definefontfamily[mixed][rm][Latin Modern 
Roman][tf=style:bold,it=style:bolditalic,bf=style:italic,bi=style:normal]

\setupbodyfont[mixed]

\starttext
Upright, {\it Italic,} {\bf Bold,} {\bi BoldItalic}
\stoptext

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-09 Thread Keith Schultz
Hi Hans, Idris, All,

fonts and color are as such appearance.
But, when one uses different fonts and colors or mix
then then we add meaning or as you tend to call
it structure. 

If their use does not add to the structure, then only one font style
and color is needed.

So actually, in the end they should be tagged, too!

Wolfgang has mentioned that we have definestyle is that 
tagged or not!

Furthermore, it is possible in ConTeXt to setup for example
the style italic, etc to what ever one cares to! for example one could
make and italic style be mono or bold! (naturally, it is
nonsense to do this).

Also, many authors of text, do think along the lines of markup in their
coding and do use \em, but simply \it, \bf for emphasis!

Similarly, many use quotation characters/glyphs in stead of \quotation
and \quote.

If we are exporting to xml then we should catch these cases!

Basically, any switch of style or font is the designation of the intention of 
an author
for a structural change! That is to make something stand out for one reason or 
the 
other.

regards
Keith.

> Am 08.02.2015 um 22:51 schrieb Hans Hagen :
> 
> On 2/8/2015 8:08 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> 
>> Ok. It's clear that I'm doing a lot of guessing, so question: Can you
>> specify exactly what does *not* get tagged in xml-export? What exactly
>> do we need to worry about? Then we can go from there...
> 
> everything that has some structure or meaning gets tagged
> 
> font/colors have no meaning they're appearance so they don't get tagged
> 
> highlights are for the few things left ... but often one can also use 
> \startelement for that
> 

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-09 Thread Alan BRASLAU
On Sun, 8 Feb 2015 13:56:54 +0100
"Keith J. Schultz"  wrote:

> As to setting up defaults, the question is their a generic usage of
> such ways of for so called highlights. These are, basically, by those
> that: 1) like this much fluff
> 2) idiosyncratic terminology
> 
> 1) is supposed to avoided! And basically makes ConTeXt look like Word!

Indeed, it is very poor writing style to make abusive use of visuals.

Alan
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-09 Thread Hans Hagen

On 2/9/2015 12:42 AM, Keith Schultz wrote:

Hi Hans, Idris, All,

Then we should call it definetag of definestyletag ! It would describe
its function better!

Like I said I find the command highlight nice because it is alot easier than
define my own commands for setting styles with color!


it's no problem to use the command for that (after all export is a 
rather special thing)


in fact, you can use the description mechanism for non-descriptions and 
itemizes for non-itemizes too etc


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Keith Schultz
Hi Hans, Idris, All,

Then we should call it definetag of definestyletag ! It would describe
its function better!

Like I said I find the command highlight nice because it is alot easier than
define my own commands for setting styles with color!

regards
Keith.

> Am 08.02.2015 um 15:01 schrieb Hans Hagen :
> 
> On 2/8/2015 1:56 PM, Keith J. Schultz wrote:
> 
>> Basically, a highlight allows one so setup a font style and color to be
>> applied
>> to it contents.
> 
> the only reason why highlight exists is that it can be used to tag stuff that 
> is otherwise untagged in the exporter to xml which is why there is nothing 
> predefined
> 
> Hans

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Idris Samawi Hamid ادريس سماوي حامد

On Sun, 08 Feb 2015 14:51:44 -0700, Hans Hagen  wrote:


On 2/8/2015 8:08 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:


Ok. It's clear that I'm doing a lot of guessing, so question: Can you
specify exactly what does *not* get tagged in xml-export? What exactly
do we need to worry about? Then we can go from there...


everything that has some structure or meaning gets tagged

font/colors have no meaning they're appearance so they don't get tagged


Ok, but here: http://wiki.contextgarden.net/Export it says,

==
Also note that switches like \em don’t translate into output structure,  
you need to \definehighlight[emph][style=italic] and use as  
\emph{emphasized}.

==

Now \em does have structural meaning (emphasis) so either the wiki is  
wrong or we have some inconsistency here -)


highlights are for the few things left ... but often one can also use  
\startelement for that


Do you have any good examples for using \start-stopelement? Thanks and

Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Hans Hagen

On 2/8/2015 8:08 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:


Ok. It's clear that I'm doing a lot of guessing, so question: Can you
specify exactly what does *not* get tagged in xml-export? What exactly
do we need to worry about? Then we can go from there...


everything that has some structure or meaning gets tagged

font/colors have no meaning they're appearance so they don't get tagged

highlights are for the few things left ... but often one can also use 
\startelement for that


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Idris Samawi Hamid ادريس سماوي حامد

Hi Wolfgang,

On Sun, 08 Feb 2015 12:17:11 -0700, Wolfgang Schuster  
 wrote:




Am 08.02.2015 um 15:40 schrieb Idris Samawi Hamid ادريس سماوي حامد  
:


[…]

There seems to be a bug with \smallcaps. Otherwise I think the above  
makes a good default set to start with.


Hans changed the effect of “style=smallcaps”, in the ConTeXt used \sc  
when you did this setups
but now ConTeXt just enables small capitals in the active font. The  
problem here is that ConTeXt’s
default font Latin Modern uses a separate file for small capitals unlike  
other fonts like TeX Gyre Pagella.


What you can do to avoid this problem with Latin Modern is to use  
“style=\sc” in your setup.


Thanks for this pointer! Yes, it does work now (tried both LM and  
TeX-Gyre). And I see that \smallcaps works in TeX-Gyre but not LM... an  
interesting subtlety.


So to sum: \sc [etc. I presume] is defined for the typescript and  
\smallcaps [etc. I presume] is defined for the font itself (where can add  
and subtract opentype features etc.). Thanks again and


Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Wolfgang Schuster

> Am 08.02.2015 um 15:40 schrieb Idris Samawi Hamid ادريس سماوي حامد 
> :
> 
> […]
> 
> There seems to be a bug with \smallcaps. Otherwise I think the above makes a 
> good default set to start with.

Hans changed the effect of “style=smallcaps”, in the ConTeXt used \sc when you 
did this setups
but now ConTeXt just enables small capitals in the active font. The problem 
here is that ConTeXt’s
default font Latin Modern uses a separate file for small capitals unlike other 
fonts like TeX Gyre Pagella.

What you can do to avoid this problem with Latin Modern is to use “style=\sc” 
in your setup.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Idris Samawi Hamid ادريس سماوي حامد

On Sun, 08 Feb 2015 10:38:14 -0700, Hans Hagen  wrote:


On 2/8/2015 3:40 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

On Sun, 08 Feb 2015 07:01:31 -0700, Hans Hagen  wrote:


the only reason why highlight exists is that it can be used to tag
stuff that is otherwise untagged in the exporter to xml


Ok, so I suppose \quote and \quotation already work in the exporter. The
following iteration then:

=
\unprotect

\definehighlight[\v!italic] [\c!command=\v!no,\c!style=\v!italic]
\definehighlight[\v!bold  ] [\c!command=\v!no,\c!style=\v!bold]
\definehighlight[\v!bolditalic]  
[\c!command=\v!no,\c!style=\v!bolditalic]

\definehighlight[\v!mono]   [\c!command=\v!no,\c!style=\v!mono]
\definehighlight[\v!monobold]   [\c!command=\v!no,\c!style=\v!monobold]
\definehighlight[\v!smallcaps]  [\c!command=\v!no,\c!style=\v!smallcaps]


i don't like these as tags (you can define start-stops if needed)


You don't like them? But these were in your original sample file!


\definehighlight[emphasis]  [\c!command=\v!no,\c!style=\v!italic] %
Does Hans prefer slanted here for default??


depends \em would do


Ah, \em can go outside now... So we have

\definehighlight[emphasis]  [\c!command=\v!no,\c!style=\em] % without  
the 'v!'



\definehighlight[important] [\c!command=\v!no,\c!style=\v!bold]
\definehighlight[veryimportant] [\c!command=\v!no,\c!style=\v!smallcaps]
\definehighlight[unimportant]   [\c!command=\v!no,\c!color=darkgray]
\definehighlight[warning]
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkblue]
\definehighlight[error]
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkred]

\definehighlight[booktitle] [\c!command=\v!no,\c!style=\v!italic]
\definehighlight[abbreviation]  [\c!command=\v!no,\c!style=\v!smallcaps]
\definehighlight[propername][\c!command=\v!no,\c!style=\v!smallcaps]


we have an abbreviations mechanism already


Ok


\definehighlight[typing][\c!command=\v!no,\c!style=\v!mono]


we have a typing environment already


Ok. It's clear that I'm doing a lot of guessing, so question: Can you  
specify exactly what does *not* get tagged in xml-export? What exactly do  
we need to worry about? Then we can go from there...


[snip]


There seems to be a bug with \smallcaps.


Can you look at \smallcaps? Thanks and

Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Wolfgang Schuster

> Am 08.02.2015 um 13:56 schrieb Keith J. Schultz :
> 
> Hi Hans, Irdis, All,
> 
> It might sound like splitting hairs, but I find we should be careful how we 
> call this beast!
> 
> Basically, a highlight allows one so setup a font style and color to be 
> applied
> to it contents.
> 
> The problem is that is this REALLY a Highlight! 
> 
> A style and color is applied so, what we have is a use color and style!
> 
> would it not be better to call it
> definecharstyle
> or
> definetextstyle
> 
> For compatibility we could use keep the definehighlight as a synonym.
> 
> As to setting up defaults, the question is their a generic usage of such ways 
> of
> for so called highlights. These are, basically, by those that:
> 1) like this much fluff
> 2) idiosyncratic terminology
> 
> 1) is supposed to avoided! And basically makes ConTeXt look like Word!
> 
> The use of another way of defining a command for the standard font styles
> is proof enough for 2. Also, not everybody would want the predefined styles 
> and colors
> so they will have to be changed in the setuphighlight anyway!
> 
> The use of such a command is convient, but we should think about the 
> nomenclature!
> The nomenclature should reflect what it does. We can have synonyms to satisfy 
> the
> semantic usage of it!

There is a \definestyle command (you can disable the creation of command [e.g. 
\strong]
when you add “method=” to \definestyle) but it doesn’t add tags in the export 
command.

\definestyle [strong] [style=bold]
\definestyle [emphasized] [style=italic]

\starttext

Strong: You can use \style[strong]{strong} or \strong{strong} or 
\startstyle[strong]strong\stopstyle.

Emphasized: You can use \style[emphasized]{emphasized} or 
\emphasized{emphasized} or \startstyle[emphasized]emphasized\stopstyle.

\stoptext

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Hans Hagen

On 2/8/2015 3:40 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

On Sun, 08 Feb 2015 07:01:31 -0700, Hans Hagen  wrote:


the only reason why highlight exists is that it can be used to tag
stuff that is otherwise untagged in the exporter to xml


Ok, so I suppose \quote and \quotation already work in the exporter. The
following iteration then:

=
\unprotect

\definehighlight[\v!italic] [\c!command=\v!no,\c!style=\v!italic]
\definehighlight[\v!bold  ] [\c!command=\v!no,\c!style=\v!bold]
\definehighlight[\v!bolditalic] [\c!command=\v!no,\c!style=\v!bolditalic]
\definehighlight[\v!mono]   [\c!command=\v!no,\c!style=\v!mono]
\definehighlight[\v!monobold]   [\c!command=\v!no,\c!style=\v!monobold]
\definehighlight[\v!smallcaps]  [\c!command=\v!no,\c!style=\v!smallcaps]


i don't like these as tags (you can define start-stops if needed)


\definehighlight[emphasis]  [\c!command=\v!no,\c!style=\v!italic] %
Does Hans prefer slanted here for default??


depends \em would do


\definehighlight[important] [\c!command=\v!no,\c!style=\v!bold]
\definehighlight[veryimportant] [\c!command=\v!no,\c!style=\v!smallcaps]
\definehighlight[unimportant]   [\c!command=\v!no,\c!color=darkgray]
\definehighlight[warning]
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkblue]
\definehighlight[error]
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkred]

\definehighlight[booktitle] [\c!command=\v!no,\c!style=\v!italic]
\definehighlight[abbreviation]  [\c!command=\v!no,\c!style=\v!smallcaps]
\definehighlight[propername][\c!command=\v!no,\c!style=\v!smallcaps]


we have an abbreviations mechanism already


\definehighlight[typing][\c!command=\v!no,\c!style=\v!mono]


we have a typing environment already


\protect

\starttext

 \highlight[italic] {italic}
 \highlight[bolditalic] {bolditalic}
 \highlight[bold]   {bold}
 \highlight[mono]   {mono}
 \highlight[monobold]   {monobold}
 \highlight[smallcaps]  {smallcaps}

 {\sc smallcaps}% this works
 \smallcaps{smallcaps}  % this command doesn't work!!
 {\smallcaps smallcaps} % this command doesn't work!!

 \highlight[important]  {important}
 \highlight[veryimportant]  {very important}
 \highlight[extraimportant] {extra important}
 \highlight[unimportant]{unimportant}
 \highlight[warning]{warning}
 \highlight[error]  {error}

 \highlight[emphasis] {emphasis}
 \highlight[abbreviation] {abbreviation}
 \highlight[booktitle]{Book Title}
 \highlight[propername]   {Proper Name}

 \highlight[typing]{typing}
\stoptext
=

There seems to be a bug with \smallcaps. Otherwise I think the above
makes a good default set to start with.

Best wishes
Idris



--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Idris Samawi Hamid ادريس سماوي حامد

On Sun, 08 Feb 2015 07:01:31 -0700, Hans Hagen  wrote:

the only reason why highlight exists is that it can be used to tag stuff  
that is otherwise untagged in the exporter to xml


Ok, so I suppose \quote and \quotation already work in the exporter. The  
following iteration then:


=
\unprotect

\definehighlight[\v!italic] [\c!command=\v!no,\c!style=\v!italic]
\definehighlight[\v!bold  ] [\c!command=\v!no,\c!style=\v!bold]
\definehighlight[\v!bolditalic] [\c!command=\v!no,\c!style=\v!bolditalic]
\definehighlight[\v!mono]   [\c!command=\v!no,\c!style=\v!mono]
\definehighlight[\v!monobold]   [\c!command=\v!no,\c!style=\v!monobold]
\definehighlight[\v!smallcaps]  [\c!command=\v!no,\c!style=\v!smallcaps]

\definehighlight[emphasis]  [\c!command=\v!no,\c!style=\v!italic] %  
Does Hans prefer slanted here for default??


\definehighlight[important] [\c!command=\v!no,\c!style=\v!bold]
\definehighlight[veryimportant] [\c!command=\v!no,\c!style=\v!smallcaps]
\definehighlight[unimportant]   [\c!command=\v!no,\c!color=darkgray]
\definehighlight[warning]
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkblue]
\definehighlight[error]  
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkred]


\definehighlight[booktitle] [\c!command=\v!no,\c!style=\v!italic]
\definehighlight[abbreviation]  [\c!command=\v!no,\c!style=\v!smallcaps]
\definehighlight[propername][\c!command=\v!no,\c!style=\v!smallcaps]

\definehighlight[typing][\c!command=\v!no,\c!style=\v!mono]

\protect

\starttext

\highlight[italic] {italic}
\highlight[bolditalic] {bolditalic}
\highlight[bold]   {bold}
\highlight[mono]   {mono}
\highlight[monobold]   {monobold}
\highlight[smallcaps]  {smallcaps}

{\sc smallcaps}% this works
\smallcaps{smallcaps}  % this command doesn't work!!
{\smallcaps smallcaps} % this command doesn't work!!

\highlight[important]  {important}
\highlight[veryimportant]  {very important}
\highlight[extraimportant] {extra important}
\highlight[unimportant]{unimportant}
\highlight[warning]{warning}
\highlight[error]  {error}

\highlight[emphasis] {emphasis}
\highlight[abbreviation] {abbreviation}
\highlight[booktitle]{Book Title}
\highlight[propername]   {Proper Name}

\highlight[typing]{typing}
\stoptext
=

There seems to be a bug with \smallcaps. Otherwise I think the above makes  
a good default set to start with.


Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Idris Samawi Hamid ادريس سماوي حامد

Hi Keith,

On Sun, 08 Feb 2015 05:56:54 -0700, Keith J. Schultz  
 wrote:



Also, not everybody would want the predefined styles and colors
so they will have to be changed in the setuphighlight anyway!


Indeed, but the point is not to predefine the styles but to predefine the  
highlights. E.g., \highlight[emphasis]: The user can redefine/setup the  
style anyway one likes, but the tag 'emphasis' should be standard. Put  
another way: We need some standard tags for maximum portability and fancy  
editor setups.


Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Hans Hagen

On 2/8/2015 1:56 PM, Keith J. Schultz wrote:


Basically, a highlight allows one so setup a font style and color to be
applied
to it contents.


the only reason why highlight exists is that it can be used to tag stuff 
that is otherwise untagged in the exporter to xml which is why there is 
nothing predefined


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-08 Thread Keith J. Schultz
Hi Hans, Irdis, All,

It might sound like splitting hairs, but I find we should be careful how we 
call this beast!

Basically, a highlight allows one so setup a font style and color to be applied
to it contents.

The problem is that is this REALLY a Highlight! 

A style and color is applied so, what we have is a use color and style!

would it not be better to call it
definecharstyle
or
definetextstyle

For compatibility we could use keep the definehighlight as a synonym.

As to setting up defaults, the question is their a generic usage of such ways of
for so called highlights. These are, basically, by those that:
1) like this much fluff
2) idiosyncratic terminology

1) is supposed to avoided! And basically makes ConTeXt look like Word!

The use of another way of defining a command for the standard font styles
is proof enough for 2. Also, not everybody would want the predefined styles and 
colors
so they will have to be changed in the setuphighlight anyway!

The use of such a command is convient, but we should think about the 
nomenclature!
The nomenclature should reflect what it does. We can have synonyms to satisfy 
the
semantic usage of it!

regards
Keith


> Am 07.02.2015 um 13:53 schrieb Hans Hagen :
> 
[snip, snip]

> Anyway, the problem with predefined highlights is that we won't overload 
> existing commands by default, so redefining is not an option in the core.
> 
> An option is to provide a set like:
> 
> \unprotect
> 
> \definehighlight[\v!italic][\c!command=\v!no,\c!style=\v!italic]
> \definehighlight[\v!bold  ][\c!command=\v!no,\c!style=\v!bold]
> \definehighlight[\v!bolditalic][\c!command=\v!no,\c!style=\v!bolditalic]
> \definehighlight[\v!mono]  [\c!command=\v!no,\c!style=\v!mono]
> \definehighlight[\v!monobold]  [\c!command=\v!no,\c!style=\v!monobold]
> 
> \definehighlight[important][\c!command=\v!no,\c!style=\v!bold]
> \definehighlight[unimportant]  [\c!command=\v!no,\c!color=darkgray]
> \definehighlight[warning] 
> [\c!command=\v!no,\c!style=\v!bold,\c!color=darkblue]
> \definehighlight[error] [\c!command=\v!no,\c!style=\v!bold,\c!color=darkred]
> 
> \protect
> 
> \starttext
> 
>\highlight[italic] {italic}
>\highlight[bolditalic] {bolditalic}
>\highlight[bold]   {bold}
>\highlight[mono]   {mono}
>\highlight[monobold]   {monobold}
>\highlight[important]  {important}
>\highlight[unimportant]{unimportant}
>\highlight[warning]{warning}
>\highlight[error]  {error}
> 
> \stoptext
> 
> Keep in mind that coding in terms of 'emph' is rather useless with respect to 
> highlights. Highlights relate to structure (while \it doesn't) so you need 
> tags like 'important' and so.

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-07 Thread Idris Samawi Hamid ادريس سماوي حامد
On Sat, 07 Feb 2015 12:33:00 -0700, Idris Samawi Hamid ادريس سماوي حامد  
 wrote:


\definehighlight[extraimportant] 
[\c!command=\v!no,\c!style=\v!bolditalic]


\definehighlight[extraimportant] 
[\c!command=\v!no,\c!style=\v!smallcaps]
% \definehighlight[extraimportant] 
[\c!command=\v!no,\c!style=\v!bolditalic]

% smallcaps is a better default for extraimportant than bolditalic
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] need defaults for \definehighlight

2015-02-07 Thread Idris Samawi Hamid ادريس سماوي حامد

Hi Hans,

On Sat, 07 Feb 2015 05:53:08 -0700, Hans Hagen  wrote:

Well, if you talk about automatic injection of commands 'short' is  
irrelevant and also likely to clash.


Ok, fair enough. There is also function auto-completion...

Anyway, the problem with predefined highlights is that we won't overload  
existing commands by default, so redefining is not an option in the core.


An option is to provide a set like:

\unprotect

\definehighlight[\v!italic][\c!command=\v!no,\c!style=\v!italic]
\definehighlight[\v!bold  ][\c!command=\v!no,\c!style=\v!bold]
\definehighlight[\v!bolditalic][\c!command=\v!no,\c!style=\v!bolditalic]
\definehighlight[\v!mono]  [\c!command=\v!no,\c!style=\v!mono]
\definehighlight[\v!monobold]  [\c!command=\v!no,\c!style=\v!monobold]

\definehighlight[important][\c!command=\v!no,\c!style=\v!bold]
\definehighlight[unimportant]  [\c!command=\v!no,\c!color=darkgray]
\definehighlight[warning]  
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkblue]
\definehighlight[error]  
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkred]


\protect

\starttext

 \highlight[italic] {italic}
 \highlight[bolditalic] {bolditalic}
 \highlight[bold]   {bold}
 \highlight[mono]   {mono}
 \highlight[monobold]   {monobold}
 \highlight[important]  {important}
 \highlight[unimportant]{unimportant}
 \highlight[warning]{warning}
 \highlight[error]  {error}

\stoptext

Keep in mind that coding in terms of 'emph' is rather useless with  
respect to highlights. Highlights relate to structure (while \it  
doesn't) so you need tags like 'important' and so.


Yes, but when precisely used emphasis is just as structural as important.  
Put another way, important is a species of the genus emphasis. But instead  
of, say, 'lightemphasis', something like 'emphasis' should not cause  
confusion.


Or we could do 'important' and 'veryimportant'. The defaults could be  
something like


\definehighlight[important][\c!command=\v!no,\c!style=\v!italic]
\definehighlight[veryimportant][\c!command=\v!no,\c!style=\v!bold]
\definehighlight[extraimportant] 
[\c!command=\v!no,\c!style=\v!bolditalic]


Also, by defining highlights with the command = no option will provide a  
bit more protection.


Could you explain? Or give an example?


But we need to agree on some kind of reasonable set first.


Ok, take a look at this iteration:

===
\unprotect

\definehighlight[\v!italic][\c!command=\v!no,\c!style=\v!italic]
\definehighlight[\v!bold  ][\c!command=\v!no,\c!style=\v!bold]
\definehighlight[\v!bolditalic][\c!command=\v!no,\c!style=\v!bolditalic]
\definehighlight[\v!mono]  [\c!command=\v!no,\c!style=\v!mono]
\definehighlight[\v!monobold]  [\c!command=\v!no,\c!style=\v!monobold]
\definehighlight[\v!smallcaps]  [\c!command=\v!no,\c!style=\v!smallcaps]

\definehighlight[important][\c!command=\v!no,\c!style=\v!italic]
\definehighlight[veryimportant][\c!command=\v!no,\c!style=\v!bold]
\definehighlight[extraimportant] 
[\c!command=\v!no,\c!style=\v!smallcaps]
% \definehighlight[extraimportant] 
[\c!command=\v!no,\c!style=\v!bolditalic] % smallcaps is a better default  
for extraimportant than bolditalic

\definehighlight[unimportant]  [\c!command=\v!no,\c!color=darkgray]
\definehighlight[warning]  
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkblue]
\definehighlight[error]  
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkred]


\definehighlight[emphasis][\c!command=\v!no,\c!style=\v!italic] % Does  
Hans prefer slanted here for default??

\definehighlight[booktitle][\c!command=\v!no,\c!style=\v!italic]
\definehighlight[abbreviation][\c!command=\v!no,\c!style=\v!smallcaps]
\definehighlight[propername][\c!command=\v!no,\c!style=\v!smallcaps]

%% Use-mention distinction
% \definehighlight[concept][\c!command=\v!no,\c!command=\v!\quotation]  
% doesn't work!
% \definehighlight[expression][\c!command=\v!no,\c!command=\v!\quote]   
% doesn't work!


\definehighlight[typing][\c!command=\v!no,\c!style=\v!mono]

\protect

\starttext

\highlight[italic] {italic}
\highlight[bolditalic] {bolditalic}
\highlight[bold]   {bold}
\highlight[mono]   {mono}
\highlight[monobold]   {monobold}
\highlight[smallcaps]  {smallcaps}

{\sc smallcaps}   % this works
\smallcaps{smallcaps} % this command doesn't work!!

\highlight[important]  {important}
\highlight[veryimportant]  {very important}
\highlight[extraimportant] {extra important}
\highlight[unimportant]{unimportant}
\highlight[warning]{warning}
\highlight[error]  {error}

\highlight[emphasis] {emphasis}
\highlight[abbreviation] {abbreviation}
\highlight[booktitle]{Book Title}
\highlight[propername]   {Proper Name}

% \highlight[con

Re: [NTG-context] need defaults for \definehighlight

2015-02-07 Thread Hans Hagen

On 2/7/2015 2:07 AM, Idris Samawi Hamid ادريس سماوي حامد wrote:

Dear gang,

Thinking of present and future documents (maximum flexibility in
converting from format to format), I'm moving from the standard {\em
text} to something like \definehighlight[emph][style=italic]. Here's the
question:

Does ConTeXt contain some default highlights that need not be defined by
the user? It seems that some of the basic ones should have presets. This
helps with at least two things:

1. Document portability (independent of a given style or env file);
2. Editor setups.

As an example of the latter: If I select text in Notepad++ I can do

Right-Click -> ConTeXt Typography -> Emphasize

where Emphasize is defined as {\em }

Right now, whenever I release an update to the N++ editor package (now
years overdue, I know) any user can depend upon this right-click
feature. But if I define

\definehighlight[emph][style=italic]

and set up the editor to implement it; then there is no guarantee that
other users will use the same definition.

As issues of conversion from one format to another become ever more
urgent and common, it makes more sense to use tagged and exportable
versions of the common typographical functions and to standardize a few.
So my suggestion is that we develop a set of default or "official"
highlights for commonly used cases, with a list made available somewhere
such as the wiki. Perhaps redefine some existing 1-parameter typography
commands (\emph, \bold, \scap, etc.) as highlights. Some of these should
be kept short (such as \emph, \bold) given their very frequent use.


Well, if you talk about automatic injection of commands 'short' is 
irrelevant and also likely to clash.


Anyway, the problem with predefined highlights is that we won't overload 
existing commands by default, so redefining is not an option in the core.


An option is to provide a set like:

\unprotect

\definehighlight[\v!italic    ][\c!command=\v!no,\c!style=\v!italic]
\definehighlight[\v!bold      ][\c!command=\v!no,\c!style=\v!bold]
\definehighlight[\v!bolditalic][\c!command=\v!no,\c!style=\v!bolditalic]
\definehighlight[\v!mono]  [\c!command=\v!no,\c!style=\v!mono]
\definehighlight[\v!monobold]  [\c!command=\v!no,\c!style=\v!monobold]

\definehighlight[important][\c!command=\v!no,\c!style=\v!bold]
\definehighlight[unimportant]  [\c!command=\v!no,\c!color=darkgray]
\definehighlight[warning] 
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkblue]
\definehighlight[error] 
[\c!command=\v!no,\c!style=\v!bold,\c!color=darkred]


\protect

\starttext

\highlight[italic] {italic}
\highlight[bolditalic] {bolditalic}
\highlight[bold]   {bold}
\highlight[mono]   {mono}
\highlight[monobold]   {monobold}
\highlight[important]  {important}
\highlight[unimportant]{unimportant}
\highlight[warning]{warning}
\highlight[error]  {error}

\stoptext

Keep in mind that coding in terms of 'emph' is rather useless with 
respect to highlights. Highlights relate to structure (while \it 
doesn't) so you need tags like 'important' and so.


Also, by defining highlights with the command = no option will provide a 
bit more protection.


But we need to agree on some kind of reasonable set first.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] need defaults for \definehighlight

2015-02-06 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear gang,

Thinking of present and future documents (maximum flexibility in  
converting from format to format), I'm moving from the standard {\em text}  
to something like \definehighlight[emph][style=italic]. Here's the  
question:


Does ConTeXt contain some default highlights that need not be defined by  
the user? It seems that some of the basic ones should have presets. This  
helps with at least two things:


1. Document portability (independent of a given style or env file);
2. Editor setups.

As an example of the latter: If I select text in Notepad++ I can do

Right-Click -> ConTeXt Typography -> Emphasize

where Emphasize is defined as {\em }

Right now, whenever I release an update to the N++ editor package (now  
years overdue, I know) any user can depend upon this right-click feature.  
But if I define


\definehighlight[emph][style=italic]

and set up the editor to implement it; then there is no guarantee that  
other users will use the same definition.


As issues of conversion from one format to another become ever more urgent  
and common, it makes more sense to use tagged and exportable versions of  
the common typographical functions and to standardize a few. So my  
suggestion is that we develop a set of default or "official" highlights  
for commonly used cases, with a list made available somewhere such as the  
wiki. Perhaps redefine some existing 1-parameter typography commands  
(\emph, \bold, \scap, etc.) as highlights. Some of these should be kept  
short (such as \emph, \bold) given their very frequent use.


Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \definehighlight with style=command problem

2013-05-28 Thread Alan Bowen
Thanks, Wolfgang. I missed this module  first time around, sorry to say.

ConTeXt now has some very nice tools for editorial markup.

Alan



On Mon, May 27, 2013 at 4:48 PM, Wolfgang Schuster <
schuster.wolfg...@gmail.com> wrote:

>
> Am 27.05.2013 um 15:36 schrieb Alan Bowen :
>
> I an trying to use \definehighlight to define a macro that will color and
> overstrike selected text.
> Thus far,
>
> \definehighlight[Delete][color=red,style={\overstrike}]
> \starttext
> test  \Delete{test} test
> \stoptext
>
> reports
>
> ! Too many }'s.
> system  > tex > error on line 4 in file ...TEST.tex: Too many }'s
> ...
>
> If I replace “\overstrike” with “bold”, “\Delete” works. “\overstrike”
> works otherwise, so am I trying the impossible here?
>
>
> \usemodule[annotation]
>
> \defineannotation[Delete][color=red,textcommand=\overstrike]
>
> \starttext
> test  \Delete{test} test
> \stoptext
>
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \definehighlight with style=command problem

2013-05-27 Thread Wolfgang Schuster

Am 27.05.2013 um 15:36 schrieb Alan Bowen :

> I an trying to use \definehighlight to define a macro that will color and 
> overstrike selected text.
> Thus far,
> 
> \definehighlight[Delete][color=red,style={\overstrike}]
> \starttext
> test  \Delete{test} test
> \stoptext
> 
> reports
> 
> ! Too many }'s.
> system  > tex > error on line 4 in file ...TEST.tex: Too many }'s ...
> 
> If I replace “\overstrike” with “bold”, “\Delete” works. “\overstrike” works 
> otherwise, so am I trying the impossible here?

\usemodule[annotation]

\defineannotation[Delete][color=red,textcommand=\overstrike]

\starttext
test  \Delete{test} test
\stoptext

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \definehighlight with style=command problem

2013-05-27 Thread Alan Bowen
Wonderful, Hans! Many thanks.

Alan


On Mon, May 27, 2013 at 1:14 PM, Hans Hagen  wrote:

> On 5/27/2013 3:36 PM, Alan Bowen wrote:
>
>> I an trying to use \definehighlight to define a macro that will color
>> and overstrike selected text.
>> Thus far,
>>
>> \definehighlight[Delete][**color=red,style={\overstrike}]
>> \starttext
>> test  \Delete{test} test
>> \stoptext
>>
>> reports
>>
>> ! Too many }'s.
>>
>> system  > tex > error on line 4 in file ...TEST.tex: Too many
>> }'s ...
>>
>>
>> If I replace “\overstrike” with “bold”, “\Delete” works. “\overstrike”
>> works otherwise, so am I trying the impossible here?
>>
>
> The next beta will have \setbar for that purpose, used as:
>
> \setuphead[section][textstyle=**{\setbar[overstrike]},**textcolor=blue]
>
> \definehighlight[Whatever][**color=darkyellow]
> \definehighlight[Delete]  [color=red,style={\setbar[**overstrike]}]
> \definehighlight[Keep][color=green]
>
> \starttext
>
> \setupbar[overstrike][**foregroundcolor=cyan,color=**blue]
>
> \startsection[title={{\green green} foo {\green green}}]
>
> foo \startbar[overstrike]bar\**stopbar
>
> test  \Delete{test} test \Keep{test} test \Whatever{test} test
>
> \color[red]{test  \Delete{test} test \Keep{test} test}
>
> \stopsection
>
> \stoptext
>
> for the source watchers: watch the subtle change in
>
> \mult_interfaces_install_**style_and_color_handler
>
> Hans
>
> --**--**-
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>  | 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 <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : 
> http://foundry.supelec.fr/**projects/contextrev/<http://foundry.supelec.fr/projects/contextrev/>
> wiki : http://contextgarden.net
> __**__**
> ___
>
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \definehighlight with style=command problem

2013-05-27 Thread Hans Hagen

On 5/27/2013 3:36 PM, Alan Bowen wrote:

I an trying to use \definehighlight to define a macro that will color
and overstrike selected text.
Thus far,

\definehighlight[Delete][color=red,style={\overstrike}]
\starttext
test  \Delete{test} test
\stoptext

reports

! Too many }'s.

system  > tex > error on line 4 in file ...TEST.tex: Too many
}'s ...


If I replace “\overstrike” with “bold”, “\Delete” works. “\overstrike”
works otherwise, so am I trying the impossible here?


The next beta will have \setbar for that purpose, used as:

\setuphead[section][textstyle={\setbar[overstrike]},textcolor=blue]

\definehighlight[Whatever][color=darkyellow]
\definehighlight[Delete]  [color=red,style={\setbar[overstrike]}]
\definehighlight[Keep][color=green]

\starttext

\setupbar[overstrike][foregroundcolor=cyan,color=blue]

\startsection[title={{\green green} foo {\green green}}]

foo \startbar[overstrike]bar\stopbar

test  \Delete{test} test \Keep{test} test \Whatever{test} test

\color[red]{test  \Delete{test} test \Keep{test} test}

\stopsection

\stoptext

for the source watchers: watch the subtle change in

\mult_interfaces_install_style_and_color_handler

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] \definehighlight with style=command problem

2013-05-27 Thread Alan Bowen
I an trying to use \definehighlight to define a macro that will color and
overstrike selected text.
Thus far,

\definehighlight[Delete][color=red,style={\overstrike}]
\starttext
test  \Delete{test} test
\stoptext

reports

! Too many }'s.

system  > tex > error on line 4 in file ...TEST.tex: Too many }'s
...

If I replace “\overstrike” with “bold”, “\Delete” works. “\overstrike”
works otherwise, so am I trying the impossible here?

Alan
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \definehighlight + \words | \WORDS

2012-05-08 Thread Hans Hagen

On 8-5-2012 13:28, Wolfgang Schuster wrote:


The next version will support named casing:

WORD
word
Word
Words
capitals cap
Capitals Cap
none
random


It would be also useful to change the following line in font-pre.mkiv to use 
\setcharacterchasing instead of \WORD (won’t work anymore when you remove 
\groupedcommand from the \WORD as written in the comments in typo-cap.mkiv)

\definealternativestyle [\v!WORD]   [\WORD][\WORD]

Additional entries for \word, Words etc. in font-pre.mkvi are useful as well 
because “style=word” looks better than “style={\setcharacterchasing[word]}”.


I had been thinking about a 'vector' key (in addition to style) but 
that's a bit of work as we then need to provide some *vectore variants 
as well and integrate it in the style/color switching helpers which is 
ab it of work


but anyhow, it doesn't hurt to have them as alternative styles so you 
can test it later today (making a beta)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \definehighlight + \words | \WORDS

2012-05-08 Thread Philipp Gesang
On 2012-05-08 13:28, Wolfgang Schuster wrote:
> 
> It would be also useful to change the following line in font-pre.mkiv to use 
> \setcharacterchasing instead of \WORD (won’t work anymore when you remove 
> \groupedcommand from the \WORD as written in the comments in typo-cap.mkiv)
> 
> \definealternativestyle [\v!WORD]   [\WORD][\WORD]
> 
> Additional entries for \word, Words etc. in font-pre.mkvi are useful as well 
> because “style=word” looks better than “style={\setcharacterchasing[word]}”.

Seconded. That would be of great value and at least I will use it
very often.

philipp


> 
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpLbnSpVMsYk.pgp
Description: PGP signature
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \definehighlight + \words | \WORDS

2012-05-08 Thread Wolfgang Schuster

Am 08.05.2012 um 13:17 schrieb Hans Hagen:

> On 8-5-2012 11:18, Philipp Gesang wrote:
>> On 2012-05-08 11:07, Wolfgang Schuster wrote:
>>> 
>>> Am 08.05.2012 um 10:35 schrieb Philipp Gesang:
>>> 
>>>> Dear listmates,
>>>> 
>>>> I rely on automated uppercasing and lowercasing a lot and I’m
>>>> very happy with the \words and \WORD macros. But I can’t find a
>>>> way to properly combine them with the “style” parameter of
>>>> highlights: it breaks frames and enumerations. Example:
>>>> 
>>>> 
>>>> 
>>>> \definehighlight [tolower] [style=\words,]  %%% This is problematic.
>>>> \def\mylower#1{\bgroup\words#1\egroup}  %%% The command itself
>>>>%%% works, though.
>>>> 
>>>> \starttext
>>>> 
>>>> FOO \tolower{FOO} FOO\par %%% Works.
>>>> \framed{BAR \mylower{BAR} BAR}%%% Works.
>>>> \framed{BAR \tolower{BAR} BAR}%%% Fails.
>>>> \startitemize %%% Enumerations don’t work either.
>>>>  \item FOO \mylower{FOO} FOO %%% Works.
>>>>  \item FOO \tolower{FOO} FOO %%% Fails.
>>>> \stopitemize
>>>> 
>>>> \stoptext
>>>> 
>>>> 
>>>> 
>>>> In short: while I can always wrap it in a \def, the more elegant
>>>> doesn’t work in all cases. Is there anything wrong with my
>>>> approach?
>>> 
>>> You can use
>>> 
>>>   \definehighlight [tolower] [style={\setcharactercasing[2]}]
>>> 
>>> to create the \tolower command.
>> 
>> Perfect, thanks a lot. So it was caused by the \groupedcommand in
>> the definition of \word.
> 
> The next version will support named casing:
> 
> WORD
> word
> Word
> Words
> capitals cap
> Capitals Cap
> none
> random

It would be also useful to change the following line in font-pre.mkiv to use 
\setcharacterchasing instead of \WORD (won’t work anymore when you remove 
\groupedcommand from the \WORD as written in the comments in typo-cap.mkiv)

\definealternativestyle [\v!WORD]   [\WORD][\WORD]

Additional entries for \word, Words etc. in font-pre.mkvi are useful as well 
because “style=word” looks better than “style={\setcharacterchasing[word]}”.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \definehighlight + \words | \WORDS

2012-05-08 Thread Hans Hagen

On 8-5-2012 11:18, Philipp Gesang wrote:

On 2012-05-08 11:07, Wolfgang Schuster wrote:


Am 08.05.2012 um 10:35 schrieb Philipp Gesang:


Dear listmates,

I rely on automated uppercasing and lowercasing a lot and I’m
very happy with the \words and \WORD macros. But I can’t find a
way to properly combine them with the “style” parameter of
highlights: it breaks frames and enumerations. Example:



\definehighlight [tolower] [style=\words,]  %%% This is problematic.
\def\mylower#1{\bgroup\words#1\egroup}  %%% The command itself
%%% works, though.

\starttext

FOO \tolower{FOO} FOO\par %%% Works.
\framed{BAR \mylower{BAR} BAR}%%% Works.
\framed{BAR \tolower{BAR} BAR}%%% Fails.
\startitemize %%% Enumerations don’t work either.
  \item FOO \mylower{FOO} FOO %%% Works.
  \item FOO \tolower{FOO} FOO %%% Fails.
\stopitemize

\stoptext



In short: while I can always wrap it in a \def, the more elegant
doesn’t work in all cases. Is there anything wrong with my
approach?


You can use

   \definehighlight [tolower] [style={\setcharactercasing[2]}]

to create the \tolower command.


Perfect, thanks a lot. So it was caused by the \groupedcommand in
the definition of \word.


The next version will support named casing:

WORD
word
Word
Words
capitals cap
Capitals Cap
none
random




-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \definehighlight + \words | \WORDS

2012-05-08 Thread Philipp Gesang
On 2012-05-08 11:07, Wolfgang Schuster wrote:
> 
> Am 08.05.2012 um 10:35 schrieb Philipp Gesang:
> 
> > Dear listmates,
> > 
> > I rely on automated uppercasing and lowercasing a lot and I’m
> > very happy with the \words and \WORD macros. But I can’t find a
> > way to properly combine them with the “style” parameter of
> > highlights: it breaks frames and enumerations. Example:
> > 
> > ········
> > 
> > \definehighlight [tolower] [style=\words,]  %%% This is problematic.
> > \def\mylower#1{\bgroup\words#1\egroup}  %%% The command itself
> >%%% works, though.
> > 
> > \starttext
> > 
> > FOO \tolower{FOO} FOO\par %%% Works.
> > \framed{BAR \mylower{BAR} BAR}%%% Works.
> > \framed{BAR \tolower{BAR} BAR}%%% Fails.
> > \startitemize %%% Enumerations don’t work either.
> >  \item FOO \mylower{FOO} FOO %%% Works.
> >  \item FOO \tolower{FOO} FOO %%% Fails.
> > \stopitemize
> > 
> > \stoptext
> > 
> > 
> > 
> > In short: while I can always wrap it in a \def, the more elegant
> > doesn’t work in all cases. Is there anything wrong with my
> > approach?
> 
> You can use
> 
>   \definehighlight [tolower] [style={\setcharactercasing[2]}]
> 
> to create the \tolower command.

Perfect, thanks a lot. So it was caused by the \groupedcommand in
the definition of \word.
Philipp


> 
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpM5YJabR3Ne.pgp
Description: PGP signature
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \definehighlight + \words | \WORDS

2012-05-08 Thread Wolfgang Schuster

Am 08.05.2012 um 10:35 schrieb Philipp Gesang:

> Dear listmates,
> 
> I rely on automated uppercasing and lowercasing a lot and I’m
> very happy with the \words and \WORD macros. But I can’t find a
> way to properly combine them with the “style” parameter of
> highlights: it breaks frames and enumerations. Example:
> 
> ········
> 
> \definehighlight [tolower] [style=\words,]  %%% This is problematic.
> \def\mylower#1{\bgroup\words#1\egroup}  %%% The command itself
>%%% works, though.
> 
> \starttext
> 
> FOO \tolower{FOO} FOO\par %%% Works.
> \framed{BAR \mylower{BAR} BAR}%%% Works.
> \framed{BAR \tolower{BAR} BAR}%%% Fails.
> \startitemize %%% Enumerations don’t work either.
>  \item FOO \mylower{FOO} FOO %%% Works.
>  \item FOO \tolower{FOO} FOO %%% Fails.
> \stopitemize
> 
> \stoptext
> 
> 
> 
> In short: while I can always wrap it in a \def, the more elegant
> doesn’t work in all cases. Is there anything wrong with my
> approach?

You can use

  \definehighlight [tolower] [style={\setcharactercasing[2]}]

to create the \tolower command.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] \definehighlight + \words | \WORDS

2012-05-08 Thread Philipp Gesang
Dear listmates,

I rely on automated uppercasing and lowercasing a lot and I’m
very happy with the \words and \WORD macros. But I can’t find a
way to properly combine them with the “style” parameter of
highlights: it breaks frames and enumerations. Example:



\definehighlight [tolower] [style=\words,]  %%% This is problematic.
\def\mylower#1{\bgroup\words#1\egroup}  %%% The command itself
%%% works, though.

\starttext

FOO \tolower{FOO} FOO\par %%% Works.
\framed{BAR \mylower{BAR} BAR}%%% Works.
\framed{BAR \tolower{BAR} BAR}%%% Fails.
\startitemize %%% Enumerations don’t work either.
  \item FOO \mylower{FOO} FOO %%% Works.
  \item FOO \tolower{FOO} FOO %%% Fails.
\stopitemize

\stoptext



In short: while I can always wrap it in a \def, the more elegant
doesn’t work in all cases. Is there anything wrong with my
approach?

Best regards
Philipp



pgpNgAKRut2wp.pgp
Description: PGP signature
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Bug in export with \definehighlight

2011-10-12 Thread Hans Hagen

On 12-10-2011 05:26, Aditya Mahajan wrote:


The "bug" is with xml.css.fontspecification function that does not
handle style=mono (or sans and serif for that matter). The proper
solution is to convert from context font specification into html font
specification for all styles.


I've added mono/type, sans/sanserif and serif parsing (in next beta).

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bug in export with \definehighlight

2011-10-11 Thread Aditya Mahajan

On Tue, 11 Oct 2011, Aditya Mahajan wrote:


On Mon, 10 Oct 2011, Aditya Mahajan wrote:


Compiling the following document

~~~
\definehighlight [object] [style=mono]

\setupbackend [export=yes]

\starttext
\object{test}
\stoptext
~~~

gives

backend > export > saving xml data in 'test.export
backend > export > saving css image definitions in 'test-images.css
backend > export > saving css style definitions in 'test-styles.css
! LuaTeX error bad argument #3 to '?' (value expected).

system  > tex > error on line 0 in file : LuaTeX error  ...



<*> ./test
  \stoptext



Quick workaround: use \definestartstop instead of \definehighlight.


The "bug" is with xml.css.fontspecification function that does not handle 
style=mono (or sans and serif for that matter). The proper solution is to 
convert from context font specification into html font specification for 
all styles.


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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bug in export with \definehighlight

2011-10-11 Thread Aditya Mahajan

On Mon, 10 Oct 2011, Aditya Mahajan wrote:


Compiling the following document

~~~
\definehighlight [object] [style=mono]

\setupbackend [export=yes]

\starttext
\object{test}
\stoptext
~~~

gives

backend > export > saving xml data in 'test.export
backend > export > saving css image definitions in 'test-images.css
backend > export > saving css style definitions in 'test-styles.css
! LuaTeX error bad argument #3 to '?' (value expected).

system  > tex > error on line 0 in file : LuaTeX error  ...



<*> ./test
  \stoptext



Quick workaround: use \definestartstop instead of \definehighlight.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Bug in export with \definehighlight

2011-10-10 Thread Aditya Mahajan

Compiling the following document

~~~
\definehighlight [object] [style=mono]

\setupbackend [export=yes]

\starttext
\object{test}
\stoptext
~~~

gives

backend > export > saving xml data in 'test.export
backend > export > saving css image definitions in 
'test-images.css
backend > export > saving css style definitions in 
'test-styles.css

! LuaTeX error bad argument #3 to '?' (value expected).

system  > tex > error on line 0 in file : LuaTeX error  ...



<*> ./test
   \stoptext


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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___