[NTG-context] Fontawesome in lmtx

2020-04-10 Thread kaddour kardio
Hi, if there any changes in the interface for using symbols?
I tried today the example from Aditya's Blog but it shows no symbols:

\definetypeface[mainfont][rm][specserif][Linux Libertine O][default]
\definetypeface[mainfont][mm][math] [TeX Gyre Pagella Math][default]
\definetypeface[mainfont][tt][mono] [Dejavu Mono][default] [rscale=0.8,
features=none]
\setupbodyfont[mainfont,11pt]
\usesymbols[fontawesome]

\define\FA{\dosingleargument\doFA}
\def\doFA[#1]{\inlinedbox
{\scale[height=1em]{\symbol[fontawesome][#1]}}}

\starttext
Checked box \FA[check-square-o]
Unchecked box \FA[square-o]
\stoptext
i use luamtetex for archlinux with all luatex modules linked to lmtx folder

-- 
Dr YAHYAOUI Mohamed Kaddour, cardiologue  .
___
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] xhtml export internal command \dostarttaging modify display and other XML/XHTML attributes

2020-04-10 Thread Christoph Hintermüller
Hi Hands, Hi Thomas

Thank you again for your direct and open answers. After some hours
working off my despair physically. I somehow managed, after days of
struggling and not seeing the most obvious to get to the expected
point. I can not fully explain how and why but so far it seems to work
for pdf and xhtml output now. And the css i also will get right now I'm
optimistic again. 

Best
Xristoph


___
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] xhtml export internal command \dostarttaging modify display and other XML/XHTML attributes

2020-04-10 Thread Christoph Hintermüller
On Fri, 2020-04-10 at 16:29 +0200, Hans Hagen wrote:
> On 4/10/2020 3:09 PM, Thomas A. Schmitz wrote:
> > 
> > 
> > > On 10. Apr 2020, at 14:49, Christoph Hintermüller <
> > > christ...@out-world.com> wrote:
> > > 
> 
> Indeed. the exporter is just a reconstructor of content so the
> better 
> structured, the better the export, and the trickier the rendering
> the 
> worse. Also, one can if needed add tags, add attributes etc etc but 
> don't expect me to keep track of all modules and user stuff and add 
> export specififcs. Of course I can make some aspects better but i
> never 
> needed epub so far.


There is no need to keep track, otherwise the modules and user stuff
would be senseless. It is up to them to keep track of their
specialities.


> 
> Then, given an export, one can use xslt or whatever, of have one's
> own 
> css as there is no common ground for rendering idiologies. Ever
> yuser 
> wants something different.
> he best multi-output stuff comes from good neutral input
> and 
> for instance xml is more suitable for that than tex encoded input.
> I'm 
> currently doing just that: making some css for rather extensive kind
> of 
> free xml based content (mostly because i have nothing better todo
> right 
> now).


If the xml is the document source, what for would I need ConTeXt at
all? Why not use typesetting system using xml as native format?


> 
> In the end it all boils down to 'does it pay off' in terms of 
> 'useability', 'neccessity' and 'the fun of it'. We're talking of
> free 
> software so no one can demand something, only request.
> 


I apologize if if missed the proper tone. It was just my frustration,
that any attempt to convince the exporter that it should display spaces
as are in the inputfile and not remove them. The pdf backend properly
keeps it like in typing environment.  
And the second which increased my frustration more and what i could
also not solve by css is that when linenumbers are added later they
appear on separate lines and not on the same line as in the pdf output.
That is also true for typing environment (see attached) example. 

Sorry again.

> Suggestion for Christoph: look at what Thomas has done for a long
> time 
> now: one input (often quite advanced) and multiple output for
> publishing 
> ane educational purposes. And it looks pretty good too.
> 


Thank you very much i will do. You are refering to Thomas Schmitz? 


\setupbackend[
export=yes,
xhtml=yes
]
\setupexport[
title={linenumber placement missmatch example in export},
subtitle={},
author={Xristoph}
]
\definetyping[mine][numbering=line,tab=4,location=left]
\starttext
This is a small example trying to use verbatim linenumbering in xml export

\startmine
#!python
a=12
def hellow_world(hello):
print("simon says: {}".format(hello))
hallo_welt("how do youdo")
\stopmine

The spaces are kept but the linenumbers are placed on intermediate lines as they are not included inside \type{} tags but lateron added outside infront oft the tags.
\stoptext

___
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] xhtml export internal command \dostarttaging modify display and other XML/XHTML attributes

2020-04-10 Thread Hans Hagen

On 4/10/2020 3:09 PM, Thomas A. Schmitz wrote:




On 10. Apr 2020, at 14:49, Christoph Hintermüller  
wrote:

Please increase the USB of ConTeXt by improoving the xml/xhtml exporter
backend by allowing modules to hook into it, defining how the contotent
should be processed and what css attributes the corresponding tags
should receive.

Second i noticed that even in verbatim the line numbers are not on the
line they number but are, due to late injections printed on an empty
line in xhtml. Needs improvement here too.


All the above and some more forces me to push my plans to publish my
lecture notes on programming as pdf and epub to likely next year. And
helping in Improvement is for now not an option too me for now, exempt
maybe lateron in testing.


Happy Easter.


What, precisely, was the point of this long message?
Indeed. the exporter is just a reconstructor of content so the better 
structured, the better the export, and the trickier the rendering the 
worse. Also, one can if needed add tags, add attributes etc etc but 
don't expect me to keep track of all modules and user stuff and add 
export specififcs. Of course I can make some aspects better but i never 
needed epub so far.


Then, given an export, one can use xslt or whatever, of have one's own 
css as there is no common ground for rendering idiologies. Ever yuser 
wants something different.


That said: the best multi-output stuff comes from good neutral input and 
for instance xml is more suitable for that than tex encoded input. I'm 
currently doing just that: making some css for rather extensive kind of 
free xml based content (mostly because i have nothing better todo right 
now).


In the end it all boils down to 'does it pay off' in terms of 
'useability', 'neccessity' and 'the fun of it'. We're talking of free 
software so no one can demand something, only request.


Suggestion for Christoph: look at what Thomas has done for a long time 
now: one input (often quite advanced) and multiple output for publishing 
ane educational purposes. And it looks pretty good too.


Hans

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

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


Re: [NTG-context] xhtml export internal command \dostarttaging modify display and other XML/XHTML attributes

2020-04-10 Thread Thomas A. Schmitz


> On 10. Apr 2020, at 14:49, Christoph Hintermüller  
> wrote:
> 
> Please increase the USB of ConTeXt by improoving the xml/xhtml exporter
> backend by allowing modules to hook into it, defining how the contotent
> should be processed and what css attributes the corresponding tags
> should receive. 
> 
> Second i noticed that even in verbatim the line numbers are not on the
> line they number but are, due to late injections printed on an empty
> line in xhtml. Needs improvement here too.
> 
> 
> All the above and some more forces me to push my plans to publish my
> lecture notes on programming as pdf and epub to likely next year. And
> helping in Improvement is for now not an option too me for now, exempt
> maybe lateron in testing.
> 
> 
> Happy Easter.

What, precisely, was the point of this long message? 

Thomas
___
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] xhtml export internal command \dostarttaging modify display and other XML/XHTML attributes

2020-04-10 Thread Christoph Hintermüller
Hi again

On Wed, 2020-04-08 at 11:52 +0200, Christoph Hintermüller wrote:
> 
> I figured so far that 
> with the command 
> \setelementnature[][block]
> 
> I can change the css 'displayÄ attribute of my  to
> display=block
> in the *_templates.css output
> 
> But i did not manage so far to in addition set the 'white-space' css
> attribute of mytag to 'pre-wrap' 
> 
> I tried `\dosettagproperty` and `\setelementexporttag` commands but
> none of the gave me the expected result in the *_templates.css output
> for the xhtm export.
> 
> What other commands do i have to call first, after `\dostarttagged`
> to
> be able to use eg `dosettagproperty` to also set the 'white-space'
> css
> attribute accordingly and/or how is the related context/lua property
> called which will be than translated into `white-space=pre-wrap`. The
> css 'display' attribute is to be changed by changing the 'nature'
> property of the tag.
> 
> Is there anybody who can provide at least some hints which *.tex and
> *.lua source files to look at to figure myself. At least some
> orientation would already help.
> 

Nope there isn't most of the stuff is hardcoded into the backend
expoerter lua. Including template for custome css template which only
considers display (nature) settings. And spaces are striped in any
case. 
All in all the backend exporter seems up to now still handcrafted
experimental proof of concept. Which makes me quenstion my self why did
i switch from latex to context. The major and killer reason was single
source multiple formats. But the only fully functional format so far is
pdf/dvi/ps xhtml/xml/epub are only working for core stuff. All the nice
modules seem not to be supported at all by backend exporter. 

Please increase the USB of ConTeXt by improoving the xml/xhtml exporter
backend by allowing modules to hook into it, defining how the contotent
should be processed and what css attributes the corresponding tags
should receive. 

Second i noticed that even in verbatim the line numbers are not on the
line they number but are, due to late injections printed on an empty
line in xhtml. Needs improvement here too.


All the above and some more forces me to push my plans to publish my
lecture notes on programming as pdf and epub to likely next year. And
helping in Improvement is for now not an option too me for now, exempt
maybe lateron in testing.


Happy Easter.

Xristoph


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

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


[NTG-context] mp strings

2020-04-10 Thread Hans Hagen

Hi,

The *next* lmtx upload (one of these days) will have a small extension 
to the mp library wrt strings. In order to be more " neutral the string 
can be bound by STX/EOT characters (enabled by default). In addition to 
that there is also an option to set the catcode regime. The combination 
of these permits passing and processing strings as-they-are. Just in 
case the Gerbens among us need it.


Hans

 example =

\startTEXpage

\def\foo{x}

\framed{\startMPcode
interim catcoderegime := vrbcatcoderegime ;
draw textext("stream $\string\foo$") withcolor "darkred" ;
\stopMPcode}

\framed{\startMPcode
draw textext("stream $\foo$") withcolor "darkblue" ;
\stopMPcode}

\startlmtxmode

% here the string starts with ascii code 2 (STX) and ends with
% ascii code 3 (EOT) ... visibility depends on the editor and 


% font used; these are normally not used and therefore nice
% alternative string capsules   

\framed{\startMPcode
interim catcoderegime := vrbcatcoderegime ;
draw textext(stream $\string\foo$) withcolor "darkgreen" ;
\stopMPcode}

\framed{\startMPcode
draw textext(stream $\foo$) withcolor "darkyellow" ;
\stopMPcode}

\stoplmtxmode

\stopTEXpage


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

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


Re: [NTG-context] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-10 Thread Gerben Wierda
As I only use one transparency method anyway I could also fix this by passing a 
numeric instead of a pair and use the standard withtransparency (I don’t like 
overriding a standard MetaFun method, one never knows what might break in 
future updates).

vardef Foo( expr w, h, fillColor, fillTransparency) =
  show "FOO:", w, h, fillColor, fillTransparency;
  save pic; picture pic;
  save circ; path circ;
  circ := (fullcircle xyscaled (h,h));
  pic := image (
fill (circ shifted (w-h/2,-h/2)) withcolor fillColor withtransparency 
(1,fillTransparency);
  );
  pic
enddef;

picture pic;
pic := Foo( 150, 50, (0.686,1.000,1.000), 0.5);
draw pic;
\stopMPpage
\stoptext


> On 9 Apr 2020, at 18:06, Hans Hagen  wrote:
> 
> On 4/9/2020 4:58 PM, Gerben Wierda wrote:
>> \starttext
>> \startMPpage[instance=doublefun]
>> vardef Foo( expr w, h, fillColor, fillTransparency) =
>>   show "FOO:", w, h, fillColor, fillTransparency;
>>   save pic; picture pic;
>>   save circ; path circ;
>>   circ := (fullcircle xyscaled (h,h));
>>   pic := image (
>> fill (circ shifted (w-h/2,-h/2)) withcolor fillColor withtransparency 
>> fillTransparency;
>>   );
>>   pic
>> enddef;
>> pic := Foo( 150, 50, (0.686,1.000,1.000), (1,1.000));
>> draw pic;
>> \stopMPpage
>> \stoptext
> 
> Maybe this definition is better then but I need to test it more
> 
> \starttext
> \startMPpage[instance=doublefun]
> 
> def withtransparency expr t =
>if pair t :
>withprescript "tr_alternative="  & decimal 
> transparency_alternative_to_number(xpart t)
>withprescript "tr_transparency=" & decimal ypart t
>else :
>mfun_with_transparency (transparency_alternative_to_number(t))
>fi
> enddef ;
> 
> def mfun_with_transparency (expr a) expr t =
>withprescript "tr_alternative="  & decimal a
>withprescript "tr_transparency=" & decimal t
> enddef ;
> 
> vardef Foo ( expr w, h, fillColor, fillTransparency) =
>  image (
>fill fullcircle xyscaled (h,h) shifted (w-h/2,-h/2)
>withcolor fillColor
>withtransparency fillTransparency
>;
>  )
> enddef;
> 
> vardef FooX ( expr w, h, fillColor) =
>  image (
>fill fullcircle xyscaled (h,h) shifted (w-h/2,-h/2)
>withcolor fillColor
>withtransparency (normaltransparent, .5)
>;
>  )
> enddef;
> 
> vardef FooY ( expr w, h, fillColor) =
>  image (
>fill fullcircle xyscaled (h,h) shifted (w-h/2,-h/2)
>withcolor fillColor
>withtransparency normaltransparent .5
>;
>  )
> enddef;
> 
> draw Foo  ( 350, 50, (0.5,1,0), (1,.5));
> draw FooX ( 250, 50, (1,0.5,1));
> draw FooY ( 150, 50, (1,1,0.5));
> 
> \stopMPpage
> \stoptext
> 
> 
> -- 
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -

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

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