Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-17 Thread Aditya Mahajan

On Fri, 18 Aug 2017, Henri wrote:


On Thu, 2017-08-17 at 15:25 +0200, Fabrice Couvreur wrote:

Hello,
To get the alignment, I had to create three \vbox. Can we simplify this code a 
bit ?
Thank you
Fabrice


Use the optional argument of the new framed you defined.


In addition to that, you can also simplify other things as well. This is 
how I would have done it:


% macros=mkvi
\showframe

\setuplayout
   [header=3\lineheight,
headerdistance=\lineheight]

\setupbackgrounds
  [header]
  [text]
  [
frame=off,
bottomframe=on,
framecolor=darkgray,
rulethickness=2pt,
  ]

\defineframed[headerframed]
 [
   frame=off, % For visualization set this to on
   height=fit,
   width=fit,
   location=bottom,
   boffset=\lineheight,
 ]

\starttexdefinition MyHeader #where #day #month #year #title #number #time

\setupheadertexts
  [{\headerframed[align=middle, foregroundstyle=bold, foregroundcolor=red]
{#title n\high{o}\,#number}}]

\setupheadertexts
  [{\headerframed[align=flushleft, foregroundstyle=\ssx]
  {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
  [{\headerframed[align=flushright, foregroundstyle=\ssx]
  {#where \\ {#time}}}]

\stoptexdefinition

\MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}

\starttext
\input knuth
\stoptext

An added benefit is that you get correct interlinespace for the left and 
right header.


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] About \setupheadertexts : simplify a code

2017-08-17 Thread Henri
On Thu, 2017-08-17 at 15:25 +0200, Fabrice Couvreur wrote:
> Hello,
> To get the alignment, I had to create three \vbox. Can we simplify this code 
> a bit ?
> Thank you
> Fabrice

Use the optional argument of the new framed you defined.

\setuplayout
  [header=3\lineheight,
   headerdistance=\lineheight]

\setupbackgrounds
  [header]
  [text]
  [frame=off,
   bottomframe=on,
   framecolor=darkgray,
   rulethickness=2pt]
  
\defineframed
  [headerframed]
  [frame=off,width=fit,height=\headerheight]

\starttexdefinition MyHeader #where #day #month #year #title #number #time 

  \setupheadertexts
[{\headerframed[align=middle]{\\ \ss\sc\bf\red #title n\high{o}\,#number \\ 
}}]
   
  \setupheadertexts
[{\headerframed[align=right]{\tfx \ss Lycée JANSON DE SAILLY \\
\date[d=#day,m=#month,y=#year]}}]
[{\headerframed[align=left]{\tfx\ss #where \\ {#time}}}]

\stoptexdefinition
  
\MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}

\starttext
\input knuth
\stoptext

> 
> % macros=mkvi
> \setuplayout
>    [header=3\lineheight,
>     headerdistance=\lineheight]
> 
> \setupbackgrounds[header][text]
>  [frame=off,
>   bottomframe=on,
>   framecolor=darkgray,
>   rulethickness=2pt]
> 
> \defineframed[headerframedleft]
>  [frame=off,
>   align=left,
>   width=fit,height=\headerheight]
> 
> \defineframed[headerframedright]
>  [frame=off,
>   align=right,
>   width=fit,height=\headerheight]
> 
> \defineframed[headerframedmiddle]
>  [frame=off,
>   align=middle,
>   width=fit,height=\headerheight]
> 
> \starttexdefinition MyHeader #where #day #month #year #title #number #time 
> 
> \setupheadertexts
>    [\headerframedmiddle{\\ \ss\sc\bf\red #title n\high{o}\,#number \\ }]
>    
> \setupheadertexts
>    [\headerframedright{\tfx \ss Lycée JANSON DE SAILLY \\ 
> \date[d=#day,m=#month,y=#year]}]
>    [\headerframedleft{\tfx\ss #where \\ {#time}}]
> 
> \stoptexdefinition
>   
> \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}
> 
> \starttext
> \input knuth
> \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
> ___
___
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] Strange behavior with the Garamond font

2017-08-17 Thread Fabrice Couvreur
Hi Pablo,
When I speak of non-readable, I mean it looks like "hieroglyphics".


fab@debian:~$ mtxrun --script fonts  --list --pattern=garamond --all

resolvers   | trees | analyzing 'home:texmf'
identifierfamilyname
fontname  filename
subfont   instances

cormorantgaramondbold cormorantgaramond
cormorantgaramondbold CormorantGaramond-Bold.otf
cormorantgaramondbolditalic   cormorantgaramond
cormorantgaramondbolditalic   CormorantGaramond-BoldItalic.otf
cormorantgaramonddemi cormorantgaramond
cormorantgaramondsemibold CormorantGaramond-SemiBold.otf
cormorantgaramonditalic   cormorantgaramond
cormorantgaramonditalic   CormorantGaramond-RegularItalic.otf
cormorantgaramondlightcormorantgaramond
cormorantgaramondlightCormorantGaramond-Light.otf
cormorantgaramondlightitalic  cormorantgaramond
cormorantgaramondlightitalic  CormorantGaramond-LightItalic.otf
cormorantgaramondmedium   cormorantgaramond
cormorantgaramondmedium   CormorantGaramond-Medium.otf
cormorantgaramondmediumitalic cormorantgaramond
cormorantgaramondmediumitalic CormorantGaramond-MediumItalic.otf
cormorantgaramondnormal   cormorantgaramond
cormorantgaramondregular  CormorantGaramond-Regular.otf
cormorantgaramondregular  cormorantgaramond
cormorantgaramondregular  CormorantGaramond-Regular.otf
cormorantgaramondsemibold cormorantgaramond
cormorantgaramondsemibold CormorantGaramond-SemiBold.otf
cormorantgaramondsemibolditalic   cormorantgaramond
cormorantgaramondsemibolditalic   CormorantGaramond-SemiBoldItalic.otf
ebgaramond12italicebgaramond
ebgaramond12italicEBGaramond12-Italic.otf
ebgaramond12regular   ebgaramond
ebgaramond12regular   EBGaramond12-Regular.otf
ebgaramondinitialsebgaramondinitials
ebgaramondinitialsEBGaramondInitials.otf
ebgaramondinitialsnormal  ebgaramondinitials
ebgaramondinitialsEBGaramondInitials.otf
ebgaramondinitialsregular ebgaramondinitials
ebgaramondinitialsEBGaramondInitials.otf
ebgaramonditalic  ebgaramond
ebgaramond12italicEBGaramond12-Italic.otf
ebgaramondnormal  ebgaramond
ebgaramond12italicEBGaramond12-Italic.otf
ebgaramondregular ebgaramond
ebgaramond12regular   EBGaramond12-Regular.otf
garamondno8itagaramondno8
garamondno8itaugmri8a.afm
garamondno8italic garamondno8
garamondno8itaugmri8a.afm
garamondno8medgaramondno8
garamondno8medugmm8a.afm
garamondno8medita garamondno8
garamondno8medita ugmmi8a.afm
garamondno8medium garamondno8
garamondno8medugmm8a.afm
garamondno8mediumitalic   garamondno8
garamondno8medita ugmmi8a.afm
garamondno8normal garamondno8
garamondno8regugmr8a.afm
garamondno8reggaramondno8
garamondno8regugmr8a.afm
garamondno8regulargaramondno8
garamondno8regugmr8a.afm
vngaramondno8ita  vngaramondno8
vngaramondno8ita  ugmri8v.afm
vngaramondno8italic   vngaramondno8
vngaramondno8ita  ugmri8v.afm
vngaramondno8med  vngaramondno8
vngaramondno8med  ugmm8v.afm
vngaramondno8medita   vngaramondno8
vngaramondno8medita   ugmmi8v.afm
vngaramondno8medium   vngaramondno8
vngaramondno8med  ugmm8v.afm
vngaramondno8mediumitalic vngaramondno8
vngaramondno8medita   ugmmi8v.afm
vngaramondno8normal   vngaramondno8
vngaramondno8reg  ugmr8v.afm
vngaramondno8reg  vngaramondno8
vngaramondno8reg  ugmr8v.afm
vngaramondno8regular  vngaramondno8
vngaramondno8reg  ugmr8v.afm
fab@debian:~$


Thanks
Fabrice


2017-08-17 21:03 GMT+02:00 Pablo Rodriguez :

> On 08/17/2017 08:28 PM, Fabrice Couvreur wrote:
> > Hello,
> > I compiled the following document with Context Standalone and viewed the
> > file with Evince, it is not readable !
>
> Hi Fabrice,
>
> I copied the fonts from http://wiki.contextgarden.net/URW_Garamond to
> tex/texmf-fonts/ and I got a PDF document with the font embedded (output
> attached).
>
> Before doing that, I couldn’t compile your source.
>
> What do you mean by a document not being readable? Is it properly
> displayed with xpdf or MuPDF?
>
> Does pdffonts list any font in the document? Does the log file reveal
> anything about the font?
>
> Which version do you use? (Use \contextversion in 

Re: [NTG-context] Strange behavior with the Garamond font

2017-08-17 Thread Pablo Rodriguez
On 08/17/2017 08:28 PM, Fabrice Couvreur wrote:
> Hello,
> I compiled the following document with Context Standalone and viewed the
> file with Evince, it is not readable !

Hi Fabrice,

I copied the fonts from http://wiki.contextgarden.net/URW_Garamond to
tex/texmf-fonts/ and I got a PDF document with the font embedded (output
attached).

Before doing that, I couldn’t compile your source.

What do you mean by a document not being readable? Is it properly
displayed with xpdf or MuPDF?

Does pdffonts list any font in the document? Does the log file reveal
anything about the font?

Which version do you use? (Use \contextversion in your source.)

BTW, I don’t know whether this is intended, but I don’t get no fi or fl
ligatures.

Just in case it helps,

Pablo
-- 
http://www.ousia.tk



a.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 / 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] Strange behavior with the Garamond font

2017-08-17 Thread Fabrice Couvreur
Hello,
I compiled the following document with Context Standalone and viewed the
file with Evince, it is not readable !
Thanks
Fabrice


\loadtypescriptfile[mathdesign]
\setupbodyfont[garamond]
\starttext
\input knuth
\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
___

[NTG-context] Strange behavior with enumeration

2017-08-17 Thread Fabrice Couvreur
Hi,
Level two items are not on the same baseline.
Thank you
Fabrice

\starttext
\startitemize[n]
\item 15\,\% d'un stock de 12\,000 jouets sont des jouets
\quotation{1\high{\tfxx er} âge}.

  Le nombre de jouets \quotation{1\high{\tfxx er} âge} est :
  \startitemize[columns,a,three]
  \item \math{\dfrac{15}{100}\times 12\,000.}
  \item \math{1\,500.}
  \item \math{1\,800.}
  \stopitemize
\stopitemize
\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
___

[NTG-context] About \setupheadertexts : simplify a code

2017-08-17 Thread Fabrice Couvreur
Hello,
To get the alignment, I had to create three \vbox. Can we simplify this
code a bit ?
Thank you
Fabrice

% macros=mkvi
\setuplayout
   [header=3\lineheight,
headerdistance=\lineheight]

\setupbackgrounds[header][text]
 [frame=off,
  bottomframe=on,
  framecolor=darkgray,
  rulethickness=2pt]

\defineframed[headerframedleft]
 [frame=off,
  align=left,
  width=fit,height=\headerheight]

\defineframed[headerframedright]
 [frame=off,
  align=right,
  width=fit,height=\headerheight]

\defineframed[headerframedmiddle]
 [frame=off,
  align=middle,
  width=fit,height=\headerheight]

\starttexdefinition MyHeader #where #day #month #year #title #number #time

\setupheadertexts
   [\headerframedmiddle{\\ \ss\sc\bf\red #title n\high{o}\,#number \\ }]

\setupheadertexts
   [\headerframedright{\tfx \ss Lycée JANSON DE SAILLY \\
\date[d=#day,m=#month,y=#year]}]
   [\headerframedleft{\tfx\ss #where \\ {#time}}]

\stoptexdefinition

\MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}

\starttext
\input knuth
\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] context sensitive highlight styles

2017-08-17 Thread Wolfgang Schuster




Henning Hraban Ramm 
16. August 2017 um 17:47
In my current project, section titles are typeset in SansBold while 
the body text (and that of the ToC) is roman.


How can I define \definehighlight[emph], so that I get SansBoldItalic 
in titles and SerifItalic in body text and ToC? (Body text is not a 
problem.)


MNWE:

\setuphead[chapter][page=yes,style={\ss\bfc}]
\setuphead[section][page=no,style={\ss\bfa}]
\definehighlight[emph][style=\it]

\definestyle[emph][style=\italicface]

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

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

Re: [NTG-context] context sensitive highlight styles

2017-08-17 Thread Henning Hraban Ramm
Am 2017-08-16 um 18:09 schrieb Pablo Rodriguez :

> On 08/16/2017 05:47 PM, Henning Hraban Ramm wrote:
>> In my current project, section titles are typeset in SansBold while
>> the body text (and that of the ToC) is roman.
>> 
>> How can I define \definehighlight[emph], so that I get
>> SansBoldItalic in titles and SerifItalic in body text and ToC? (Body
>> text is not a problem.)
> 
> Hi Hraban,
> 
> if I get your question, the reply would be:
> 
>  \definehighlight[emph][style=\em]
>  \setupbodyfontenvironment[default][em=italic]
> 
> Was this what you needed?

Great, thank you!
I should have tried \em myself...
I don’t even need \setupbodyfontenvironment, because I defined slanted as 
italics in my typescript.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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] avoid space after title

2017-08-17 Thread Henning Hraban Ramm
Am 2017-08-16 um 18:50 schrieb Wolfgang Schuster :

> Play with the grid key for \setuphead.
> 
> \setuphead[section][page=no,before=,after=,grid=box]

That does the trick for me. Thank you very much!

(It doesn’t kill all the space, but the result is what I actually needed.)

Thanks for the other suggestions!

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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] (again) issues with typing

2017-08-17 Thread Pablo Rodriguez
On 08/17/2017 12:46 AM, Alan Braslau wrote:
> On Wed, 16 Aug 2017 23:45:30 +0200 Pablo Rodriguez wrote:
> 
>> I have to explain to newcomers (in my Spanish introduction to ConTeXt)
>> what comments are and multiple lines don’t affect the final PDF
>> document.
> 
> For such a document, it can be very useful to put code snippets into
> buffers and then use
> \typeTEXbuffer
> or
> \typeLUAbuffer
> and then
> \getbuffer

Many thanks for your reply, Alan.

I use buffers and ConTeXt types them. But I don’t want to provide
compiled examples (\getbuffer).

I have two reasons for that:

The first one is to motivate the user to try it.

The second one is that I also offer the document in ePub format.

Many thanks for your advice,

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] (again) issues with typing

2017-08-17 Thread Pablo Rodriguez
On 08/17/2017 12:00 AM, Aditya Mahajan wrote:
> On Wed, 16 Aug 2017, Pablo Rodriguez wrote:
> 
>> sorry for insisting, but I need to solve this.
> 
> I don't know how to answer your questions with the default syntax 
> highlighting in ConTeXt, but are you willing to consider t-vim module for 
> typesetting code. The output for your example is attached.
Many thanks for your reply, Aditya,

your t-vim module is really useful, but I’m afraid it isn’t what I needed.

I have to use \xmlprettyprinttext (input sources for most of my
documents in ConTeXt are XML files).

Besides, I think that the code highlighting in ConTeXt is clearer than
the one that vim provides.

Many thanks for your help,

Pablo


> All you need to do is add the following in the document preamble:
> 
> \usemodule[vim]
> \definevimtyping[TEX][syntax=context]
> \definevimtyping[XML][syntax=xml]
> \definevimtyping[LUA][syntax=lua]
> 
> If you have lot of code snippets, you may want to create a directory to 
> store temporary files. You can do this using
> 
> \setupvimtyping[directory=output]
> 
> and then create a directory called "output" in the folder from which you 
> run ConTeXt.
> 
> Aditya


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