Re: [NTG-context] Modifying bibliography entries using lua

2018-07-23 Thread Hans Hagen

On 7/23/2018 10:17 PM, Stanislav Sokolenko wrote:

Thanks Hans, that's really helpful!


This is not for the fainthearted so here we go

\startluacode
    function document.MyBoldPub(set,tag)
 -- local a = publications.getfield(set,tag,"author")
 -- inspect(a)
 -- local c = publications.getcasted(set,tag,"author")
 -- inspect(c)
    if c[1].surnames[1] == "Myname" then
    context.bold(function()
    context.btxflush('author')
    end )
    else
    context.btxflush('author')
    end
    end
\stopluacode


So if I wanted to bold one specific author in a reference of many, I can 
just loop over publications.getcasted(...), and print the appropriate 
names, initials, etc...


That said -- is there any way to call the appropriate authorconversion 
routine based on the \setupbtx settings? I found the 
publications.authorhashers method table, which seems to do most of this 
work, but I'm not sure how to pick the appropriate method and ensure 
that the correct separators are used.

Best use the setups provided than reinvent the logic.

\startluacode
function document.CheckMeB(set,tag,aut)
local c = publications.getcasted(set,tag,"author")
if c[aut].surnames[1] == "Foo" then
context("\\bf")
end
end
\stopluacode


\startsetups btx:list:author:normalshort
\fastsetup{btx:list:author:concat}
\begingroup

\ctxluacode{document.CheckMeB("\currentbtxdataset","\currentbtxtag",\number\currentbtxauthorindex)}
\ifx\currentbtxinitials\empty \else
\currentbtxinitials
\btxparameter{separator:initials}
\fi
\ifx\currentbtxvons\empty \else
\currentbtxvons
\ifx\currentbtxsurnames\empty \else
\btxparameter{separator:vons}
\fi
\fi
\ifx\currentbtxsurnames\empty \else
\currentbtxsurnames
\ifx\currentbtxjuniors\empty \else
\btxparameter{separator:juniors}
\currentbtxjuniors
\fi
\fi
\endgroup
\fastsetup{btx:list:author:others}
\stopsetups

Or something similar (there are several wasy to do this).

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] Modifying bibliography entries using lua

2018-07-23 Thread Stanislav Sokolenko

Thanks Hans, that's really helpful!


This is not for the fainthearted so here we go

\startluacode
    function document.MyBoldPub(set,tag)
 -- local a = publications.getfield(set,tag,"author")
 -- inspect(a)
 -- local c = publications.getcasted(set,tag,"author")
 -- inspect(c)
    if c[1].surnames[1] == "Myname" then
    context.bold(function()
    context.btxflush('author')
    end )
    else
    context.btxflush('author')
    end
    end
\stopluacode


So if I wanted to bold one specific author in a reference of many, I can 
just loop over publications.getcasted(...), and print the appropriate 
names, initials, etc...


That said -- is there any way to call the appropriate authorconversion 
routine based on the \setupbtx settings? I found the 
publications.authorhashers method table, which seems to do most of this 
work, but I'm not sure how to pick the appropriate method and ensure 
that the correct separators are used.


Stan


___
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] Modifying bibliography entries using lua

2018-07-23 Thread Hans Hagen

On 7/23/2018 6:42 PM, Stanislav Sokolenko wrote:

Dear list,

I'm struggling to output bibliography entries into lua for string 
modification (like making a particular author name bold). In effect, I 
just need something like the following:


\starttexdefinition btx:customauthor
     \startluacode
     local text = context.btxflush('author')
     -- tex.sprint(text) -- fails because text remains nil
     \stopluacode
\stoptexdefinition

It's clear that btxflux is the wrong function for this as it writes the 
contents to file rather than returning a variable in lua... Is there a 
way to directly access what btxflush is writing through the publications 
table or other means? I've gone over the source code but I can't 
decipher what btxflush is actually doing.


This is not for the fainthearted so here we go

\startluacode
function document.MyBoldPub(set,tag)
 -- local a = publications.getfield(set,tag,"author")
 -- inspect(a)
 -- local c = publications.getcasted(set,tag,"author")
 -- inspect(c)
if c[1].surnames[1] == "Myname" then
context.bold(function()
context.btxflush('author')
end )
else
context.btxflush('author')
end
end
\stopluacode

\starttexdefinition btx:customauthor
\ctxluacode{document.MyBoldPub("\currentbtxdataset","\currentbtxtag")}
\stoptexdefinition

try to avoid tex.print cum suis, use the proper context.* interface instead



Thanks,

Stan

Longer MNWE:

\stopluacode

\startbuffer[ref]
@article{solo,
   author = {Lastname, Firstname},
   title = {Solo work},
   journal = {Journal},
   year = {2000},
   month = {1},
   volume = {1}
}
\stopbuffer

\usebtxdataset[ref][ref.buffer]
\setupbtx[dataset=ref]

\definebtxrendering[ref][dataset=ref]
\setupbtx[default:cite]
   [alternative=authoryear,
    etallimit=1]


\starttexdefinition btx:customauthor
     \startluacode
     local text = context.btxflush('author')
     -- tex.sprint(text) -- text remains nill
     \stopluacode
\stoptexdefinition

\startsetups btx:default:list:article
     \texdefinition{btx:customauthor}
     \texdefinition{btx:default:title}
     \texdefinition{btx:default:journal}
     \texdefinition{btx:default:year}
     \removeunwantedspaces
     \removepunctuation
     \btxperiod
\stopsetups

\starttext

Citations: \cite[solo]

\startsubject[title=Bibliography]
\placelistofpublications[ref][method=dataset]
\stopsection

\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
___



--

-
  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] How to get mail and phone symbols?

2018-07-23 Thread Lizardo M. Reyna Bowen
Thanks Hans, there are many symbols.


On 07/23/2018 11:20 AM, Hans Hagen wrote:
> On 7/23/2018 5:52 PM, Lizardo M. Reyna Bowen wrote:
>> Hi,
>>
>> I want to use the some symbols for phone and email (envelope) in my
>> curriculum vitae to get it look more modern.
>>
>> How is the way to do it in ConTexT?
> \usesymbols[mvs]
> % \setupsymbolset[martinvogel 2]
>
> \starttext
>
>   % \symbol[Telephone]
>   % \symbol[EMail]
>   % \symbol[Letter]
>
>     \symbol[martinvolel 2][Telephone]
>     \symbol[martinvolel 2][EMail]
>     \symbol[martinvolel 2][Letter]
>
>   % \showsymbolset[martinvogel 2]
>
> \stoptext
>
> One of these days we should discuss supporting the new symbols in the
> tex gyre fonts.
>
> 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
> -

-- 
Dr. Lizardo M. Reyna Bowen
Docente
Facultad de Ingeniería Agrícola | Universidad Técnica de Manabí
[Dirección]  Lodana, Santa Ana, Manabí, Ecuador
[Móvil]  +593  982924637
PGP Key: 0xa35a15b90ee64e8d

___
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] How to get mail and phone symbols?

2018-07-23 Thread Lizardo M. Reyna Bowen
Thanks to all, the fontawesome solution was the simplest. It look nice now.



-- 
Dr. Lizardo M. Reyna Bowen
Docente
Facultad de Ingeniería Agrícola | Universidad Técnica de Manabí
[Dirección]  Lodana, Santa Ana, Manabí, Ecuador
[Móvil]  +593  982924637
PGP Key: 0xa35a15b90ee64e8d

___
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] SHA512 for LuaTeX-5.2

2018-07-23 Thread Pablo Rodriguez
On 07/23/2018 06:23 PM, Hans Hagen wrote:
> On 7/23/2018 6:04 PM, Pablo Rodriguez wrote:
>> [...]
>> Would it be possible to use the function to hash external binary files?
>>
>> Many thanks for your help,
> 
> utilities.sha2.hash512(io.loaddata("foo.bin"))
> 
> on the average it's fast enough

This works really great and it’s perfect for what I need.

> (luatex 1.09+ will have a faster variant)

These are great news, too.

Many thanks for your excellent work with ConTeXt,

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

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

[NTG-context] Modifying bibliography entries using lua

2018-07-23 Thread Stanislav Sokolenko

Dear list,

I'm struggling to output bibliography entries into lua for string 
modification (like making a particular author name bold). In effect, I 
just need something like the following:


\starttexdefinition btx:customauthor
    \startluacode
    local text = context.btxflush('author')
    -- tex.sprint(text) -- fails because text remains nil
    \stopluacode
\stoptexdefinition

It's clear that btxflux is the wrong function for this as it writes the 
contents to file rather than returning a variable in lua... Is there a 
way to directly access what btxflush is writing through the publications 
table or other means? I've gone over the source code but I can't 
decipher what btxflush is actually doing.


Thanks,

Stan

Longer MNWE:

\stopluacode

\startbuffer[ref]
@article{solo,
  author = {Lastname, Firstname},
  title = {Solo work},
  journal = {Journal},
  year = {2000},
  month = {1},
  volume = {1}
}
\stopbuffer

\usebtxdataset[ref][ref.buffer]
\setupbtx[dataset=ref]

\definebtxrendering[ref][dataset=ref]
\setupbtx[default:cite]
  [alternative=authoryear,
   etallimit=1]


\starttexdefinition btx:customauthor
    \startluacode
    local text = context.btxflush('author')
    -- tex.sprint(text) -- text remains nill
    \stopluacode
\stoptexdefinition

\startsetups btx:default:list:article
    \texdefinition{btx:customauthor}
    \texdefinition{btx:default:title}
    \texdefinition{btx:default:journal}
    \texdefinition{btx:default:year}
    \removeunwantedspaces
    \removepunctuation
    \btxperiod
\stopsetups

\starttext

Citations: \cite[solo]

\startsubject[title=Bibliography]
\placelistofpublications[ref][method=dataset]
\stopsection

\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] How to get mail and phone symbols?

2018-07-23 Thread Marcus Vinicius Mesquita
\definesymbol[e-mail][\getglyphdirect{FontAwesome}{\number"F003}]

\definesymbol[phone][\getglyphdirect{FontAwesome}{\number"F095}]

\starttext

\symbol[e-mail] someone@somewhere

\symbol[phone] your number

\stoptext


Fonts Awesome: https://fontawesome.com/
___
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] SHA512 for LuaTeX-5.2

2018-07-23 Thread Hans Hagen

On 7/23/2018 6:04 PM, Pablo Rodriguez wrote:

On 07/23/2018 05:42 PM, Hans Hagen wrote:

On 7/23/2018 4:51 PM, Pablo Rodriguez wrote:

On 07/22/2018 10:56 PM, Hans Hagen wrote:

why not use

utilities.sha2.hash512(str)


Many thanks for your reply, Hans.

  \starttext
  \def\hashfive#1{\ctxlua{context(utilities.sha2.hash512("#1"))}}
  \hashfive{a}
  \stoptext

ConTeXt complains:

  [ctxlua]:1: attempt to index field 'sha2' (a nil value)

What am I doing wrong?


require("util-sha")


Many thanks for your reply, Hans.

It works like a charm.

Would it be possible to use the function to hash external binary files?

Many thanks for your help,

utilities.sha2.hash512(io.loaddata("foo.bin"))

on the average it's fast enough

(luatex 1.09+ will have a faster variant)

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] How to get mail and phone symbols?

2018-07-23 Thread Hans Hagen

On 7/23/2018 5:52 PM, Lizardo M. Reyna Bowen wrote:

Hi,

I want to use the some symbols for phone and email (envelope) in my
curriculum vitae to get it look more modern.

How is the way to do it in ConTexT?

\usesymbols[mvs]
% \setupsymbolset[martinvogel 2]

\starttext

  % \symbol[Telephone]
  % \symbol[EMail]
  % \symbol[Letter]

\symbol[martinvolel 2][Telephone]
\symbol[martinvolel 2][EMail]
\symbol[martinvolel 2][Letter]

  % \showsymbolset[martinvogel 2]

\stoptext

One of these days we should discuss supporting the new symbols in the 
tex gyre fonts.


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] How to get mail and phone symbols?

2018-07-23 Thread Aditya Mahajan

On Mon, 23 Jul 2018, Lizardo M. Reyna Bowen wrote:


Hi,

I want to use the some symbols for phone and email (envelope) in my
curriculum vitae to get it look more modern.

How is the way to do it in ConTexT?


Use a font that provides these symbols. One option is fontawesome.
https://fontawesome.com/icons?from=io

Also see this blog post for scaling fontawesome symbols: 
https://adityam.github.io/context-blog/post/using-fontawesome/


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

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

Re: [NTG-context] SHA512 for LuaTeX-5.2

2018-07-23 Thread Pablo Rodriguez
On 07/23/2018 05:42 PM, Hans Hagen wrote:
> On 7/23/2018 4:51 PM, Pablo Rodriguez wrote:
>> On 07/22/2018 10:56 PM, Hans Hagen wrote:
>>> why not use
>>>
>>> utilities.sha2.hash512(str)
>>
>> Many thanks for your reply, Hans.
>>
>>  \starttext
>>  \def\hashfive#1{\ctxlua{context(utilities.sha2.hash512("#1"))}}
>>  \hashfive{a}
>>  \stoptext
>>
>> ConTeXt complains:
>>
>>  [ctxlua]:1: attempt to index field 'sha2' (a nil value)
>>
>> What am I doing wrong?
> 
> require("util-sha")

Many thanks for your reply, Hans.

It works like a charm.

Would it be possible to use the function to hash external binary files?

Many thanks for your help,

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

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

[NTG-context] How to get mail and phone symbols?

2018-07-23 Thread Lizardo M. Reyna Bowen
Hi,

I want to use the some symbols for phone and email (envelope) in my
curriculum vitae to get it look more modern.

How is the way to do it in ConTexT?


Thanks


-- 
Dr. Lizardo M. Reyna Bowen
Docente
Facultad de Ingeniería Agrícola | Universidad Técnica de Manabí
[Dirección]  Lodana, Santa Ana, Manabí, Ecuador
[Móvil]  +593  982924637
PGP Key: 0xa35a15b90ee64e8d


___
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] SHA512 for LuaTeX-5.2

2018-07-23 Thread Hans Hagen

On 7/23/2018 4:51 PM, Pablo Rodriguez wrote:

On 07/22/2018 10:56 PM, Hans Hagen wrote:

why not use

utilities.sha2.hash512(str)


Many thanks for your reply, Hans.

 \starttext
 \def\hashfive#1{\ctxlua{context(utilities.sha2.hash512("#1"))}}
 \hashfive{a}
 \stoptext

ConTeXt complains:

 [ctxlua]:1: attempt to index field 'sha2' (a nil value)

What am I doing wrong?


require("util-sha")


Many thanks for your help,

Pablo




--

-
  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] Numbering properties in a chapter

2018-07-23 Thread Pablo Rodriguez
On 07/23/2018 05:11 PM, Fabrice Couvreur wrote:
> Hello,
> I would like the numbering of the properties to be like this :
> [...]
> I thought it was enough to use the key way = bychapter

Hi Fabrice,

"way=bychapter" resets numbering in each chapter.

You need this:

\setupenumerations[
   prefix=yes,
   prefixsegments=chapter,
]

You need to enable the prefix and say what you want as prefix.

I hope it helps,

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

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

[NTG-context] Numbering properties in a chapter

2018-07-23 Thread Fabrice Couvreur
Hello,
I would like the numbering of the properties to be like this :

First chapter

Property 1.1

Property 1.2

Second chapter

Property 2.1

Property 2.2

I thought it was enough to use the key way = bychapter

Thanks

Fabrice


\define[1]\ProprieteHeadcommand
  {\textrule[top]{#1}}

\setupenumerations[
   text=Propriété ,
   title=no,
   way=bychapter,
   titlestyle=bold,
   style=slanted,
   width=fit,
   headcommand=\ProprieteHeadcommand,
   numbercommand=\groupedcommand{}{\nbsp},
   after=\textrule
]

\defineenumeration[propriete]


\starttext

\startchapter[title={First chapter}]

  \dorecurse{2}{
\startpropriete
  \input ward
\stoppropriete}


\stopchapter

\startchapter[title={Second chapter}]

 \dorecurse{2}{
\startpropriete
  \input ward
\stoppropriete}


\stopchapter


\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] Align the chapter-title to the middle of the header

2018-07-23 Thread Pablo Rodriguez
On 07/23/2018 03:59 PM, Huseyin Özoguz wrote:
> Dear list,
> 
> how can I align the text of the header in the double-page layout to the 
> middle?
> 
> I want something like that:
> 
> \setupheadertexts
> [{\startalignment[middle] \definedfont[name:Gentium_Basic at 
> 9pt]\getmarking[chapter] \stopalignment}][]
> [][]
> 
> Of course, that does not work. By default, there are only the four 
> places to set the text in the header: left and right in the header for 
> both pages. How to place the chapter-title (or whatever) into the middle 
> of the header?

Hi Huseyin,

this should work:

\setuppagenumbering[alternative=doublesided, location=]
\setupheadertexts[center]
%~ \setupheadertexts[\doifoddpageelse{odd}{even}]
\starttext
\dorecurse{10}{\Romannumerals{\recurselevel}\page}
\stoptext

Uncomment the commented line to get different headers for odd and even
pages.

I hope it helps,

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

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

Re: [NTG-context] Align the chapter-title to the middle of the header

2018-07-23 Thread Aditya Mahajan

On Mon, 23 Jul 2018, Huseyin Özoguz wrote:


Dear list,

how can I align the text of the header in the double-page layout to the 
middle?


I want something like that:

\setupheadertexts
[{\startalignment[middle] \definedfont[name:Gentium_Basic at 
9pt]\getmarking[chapter] \stopalignment}][]

[][]


\setupheadertexts[chapter]

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

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

Re: [NTG-context] SHA512 for LuaTeX-5.2

2018-07-23 Thread Pablo Rodriguez
On 07/22/2018 10:56 PM, Hans Hagen wrote:
> why not use
> 
> utilities.sha2.hash512(str)

Many thanks for your reply, Hans.

\starttext
\def\hashfive#1{\ctxlua{context(utilities.sha2.hash512("#1"))}}
\hashfive{a}
\stoptext

ConTeXt complains:

[ctxlua]:1: attempt to index field 'sha2' (a nil value)

What am I doing wrong?

Many thanks for your help,

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

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

[NTG-context] Align the chapter-title to the middle of the header

2018-07-23 Thread Huseyin Özoguz

Dear list,

how can I align the text of the header in the double-page layout to the 
middle?


I want something like that:

\setupheadertexts
[{\startalignment[middle] \definedfont[name:Gentium_Basic at 
9pt]\getmarking[chapter] \stopalignment}][]

[][]

Of course, that does not work. By default, there are only the four 
places to set the text in the header: left and right in the header for 
both pages. How to place the chapter-title (or whatever) into the middle 
of the header?


Thanks.

Huseyin

___
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] Limit text width in items

2018-07-23 Thread Henning Hraban Ramm
Hello again,

in the MWE below I’d like to limit the run width of the item text so that the 
(page) number is standing out, e.g.

• This is a long and winding text
  that leads to a number .. 99

The text can become one or several lines long.

I tried to put the text in boxes, e.g. \simplealignedbox{}{}{\vbox{...}} but I 
got only ugly spacing.
Also, the last line of the text continues in that leaders and number.

---

\def\leaderfill{\leaders\hbox to 1em{\hss. \hss}\hfill}

\starttext

\startitemize[packed,joinedup]
\startitem
\input tufte
\leaderfill 33
\stopitem
\startitem
\input knuth
\leaderfill 99
\stopitem
\stopitemize

\stoptext

---


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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] Problem with pagella font (beta)

2018-07-23 Thread Fabrice Couvreur
Hi Wolgang,
I followed your explanations, and it works perfectly. Thank you very much !
Fabrice

2018-07-23 12:39 GMT+02:00 Wolfgang Schuster :

> Hi Fabrice,
>
> you can download the fonts from the GUST [1] website (the flat package is
> enough because you need only the opentype files) and put them in your local
> tex directory in your home folder, e.g.
>
> ~/texmf/fonts/data/texgyre/
>
> or you put them in your tex installation, e.g.
>
> texmf-fonts/fonts/data/texgyre/
>
> [1] http://www.gust.org.pl/projects/e-foundry/tex-gyre/whole
>
> Wolfgang
>
> Fabrice Couvreur 
> 23. Juli 2018 um 11:37
> Hello,
> I only use the standalone version of ConteXt with Emacs. I can not use
> the pagella font anymore because the text is in bold type. Wolfgang told
> me a discussion about this problem that still does not seem to be resolved. By
> cons, no problem with ConteXt of Texlive 2018.
> Thank you
> Fabrice
> 
> ___
> 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
> 
> ___
>
>
>
> 
> ___
> 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
> 
> ___
>
___
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] page interaction in contents list entry

2018-07-23 Thread Henning Hraban Ramm
Dear wizards,

in a list command (i.e. \setuplist[command=\MyCmd]) I use 
\currentlistentrypagenumber to show the page number.
Now I’d like to make this a link, like in a normal ToC. I didn’t find a 
suitable command. Is there one?

Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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] Problem with pagella font (beta)

2018-07-23 Thread Wolfgang Schuster

Hi Fabrice,

you can download the fonts from the GUST [1] website (the flat package 
is enough because you need only the opentype files) and put them in your 
local tex directory in your home folder, e.g.


~/texmf/fonts/data/texgyre/

or you put them in your tex installation, e.g.

texmf-fonts/fonts/data/texgyre/

[1] http://www.gust.org.pl/projects/e-foundry/tex-gyre/whole

Wolfgang

Fabrice Couvreur 
23. Juli 2018 um 11:37
Hello,
I only use the standalone version of ConteXt with Emacs. I can not use 
the pagella font anymore because the text is in bold type. Wolfgang 
told me a discussion about this problem that still does not seem to be 
resolved. By cons, no problem with ConteXt of Texlive 2018.

Thank you
Fabrice
___
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
___


___
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] Problem with pagella font (beta)

2018-07-23 Thread Fabrice Couvreur
Hello,
I only use the standalone version of ConteXt with Emacs. I can not use the
pagella font anymore because the text is in bold type. Wolfgang told me a
discussion about this problem that still does not seem to be resolved. By
cons, no problem with ConteXt of Texlive 2018.
Thank you
Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] two questions about endnotes

2018-07-23 Thread Robert Zydenbos
That was useful! But now I would like to go another step further: in the 
following, slightly altered example, I use a footnote and endnotes. I know that 
with "\setupfootnotes [conversion=characters]" the footnote markers are changed 
to letters instead of numbers. Is there any way of doing this also for 
endnotes? (N.B.: I am using MkII.)

% extended example, with footnote and endnotes

\setupfootnotes [conversion=characters]

\starttext

Dit is iets\footnote{Voetnoot.} met een footnote.\endnote{Wat een zooi. Werkt 
het?}

\page
Het zou moeten werken,\endnote{Ja, toch?} want ik zie tekens in de tekst.

\placenotes [endnote]

\stoptext

% end of example

> On 23. Jul 2018, at 07:56, Henri Menke  wrote: […]


___
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
___