[NTG-context] On the topic of fonts

2016-03-02 Thread Brian Ballsun-Stanton
Hi Wolfgang, Pablo.

I'm having a great deal of difficulties deploying custom user fonts using
the luatex loading sequence with either the new or old simplefonts setups.

Is there a wiki page which is most correct on how to go from "no user font
loaded" to "define font family, \input knuth" with instructions? I've got
the feeling I've been looking in the wrong places.

For the most desirable user font, can we presume 14.04 and the system
package fonts-roboto? (ttf) or I'm happy to attach the .otf compiled
versions I made if you think that worthwhile. We certainly can use whatever
directories we want -- but I'm just unsure about how to most consistently
achieve this.

Cheers,
-Brian
___
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] Custom syntax highlighting

2016-03-02 Thread Alan BRASLAU
On Wed, 2 Mar 2016 11:45:54 +0100
Nicola  wrote:

> > You don't need scite installed so it's quite efficient as it's the
> > method that is used, not the binary (and the context related lexers
> > ship with the context distribution).  
> 
> That's clear now, thanks!

Hans is referring to syntax highlighting within ConTeXt and a method
that uses the lua lexers that he originally wrote for SciTe.

I would like to point out that in order to use this highlighting *in the
SciTe editor* itself, one needs to have the lpeg library compiled for
SciTe. Currently, this only exists as a DLL for Windows and has not
been ported to any other system. This was our conclusion at the last
ConTeXt meeting where we spent a little time, probably not enough,
trying to compile this library without success.

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] issue with font loading

2016-03-02 Thread Pablo Rodriguez
On 03/02/2016 07:12 PM, Wolfgang Schuster wrote:
>> Pablo Rodriguez 2. März 2016 um 17:17
>> [...]
>> If another "key=value" pair is specified, "tf=file:newg8-regular"
>> doesn’t seem to work.
>>
>> What am I doing wrong?
> 
> Don’t write just some garbage as third argument for the
> \definefontfamily or \definefallbackfamily commands.
> 
> In the attached picture you can see the fonforge information for the
> font names, needed for the \definefontfamily command is the "family
> name" value.
> 
> \definefallbackfamily[mainface][rm][GaramondNo8][scale=0.88,range=0x22C0]

Many thanks for your reply, Wolfgang.

I wanted to avoid the installation of the font, because I had another
version of GaramondNo8 already installed.

So, I renamed the font and installed it. Everything works fine now.

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

Re: [NTG-context] Custom syntax highlighting

2016-03-02 Thread Nicola

On 2016-03-02 20:11:56 +, Aditya Mahajan said:


You can change the space before and after display environments using
spacebefore and spaceafter keys (see the documentation of filter
module[1], which is used by the vim module)


Thanks, it works!
Nicola


___
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] Custom syntax highlighting

2016-03-02 Thread Aditya Mahajan

On Wed, 2 Mar 2016, Nicola wrote:


On 2016-03-02 19:34:00 +, Aditya Mahajan said:


On Wed, 2 Mar 2016, Nicola wrote:


On 2016-03-01 15:35:07 +, Aditya Mahajan said:


On Tue, 1 Mar 2016, Nicola wrote:


I'm using the latest beta, and I need syntax coloring for SQL
(PostgreSQL variant). According to the wiki, there is no SQL
syntax coloring available for MKIV yet, but I'd be happy to
be wrong :)


You can use the vim module:

https://github.com/adityam/filter/blob/master/vim-README.md


I've set up your module and it works perfectly. It saved me a
lot of time! But I need help for one more thing:
\inlineMYLANG{X} adds a new line before and after X, as in
\startMYLANG X \stopMYLANG. How do I prevent that? Well, why
is that the case to begin with?


It shouldn't. Can you send me a minimal example.


I have figured out myself: I have defined

\definevimtyping[pgsql][..., before={\blank},after={\blank}, ...]

which, I have realized, applies to inline text, too. How do I set up
the environment so that there is some blank space before and after
without affecting inline code?


You can change the space before and after display environments using 
spacebefore and spaceafter keys (see the documentation of filter 
module[1], which is used by the vim module)


There are two modes: location=paragraph and location=text. In 
location=paragraph you get


\blank[]



\blank[]

In location=text (which is used by \inline...) you get

  

The behaviour that you see is because, by default, I have set

   \c!left=\externalfilterparameter\c!before,
   \c!right=\externalfilterparameter\c!after,

Looking at git-blame, I see that this was always the case, ever since the 
left and right keys were added (I guess to keep backward compatibility at 
that time). Looking back, I think that this is not a good default and I 
will change it.


In the meanwhile, simply use

\definevimtyping[...][left=, right=,]

Aditya

[1]: https://github.com/adityam/filter


___
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] Custom syntax highlighting

2016-03-02 Thread Aditya Mahajan

On Wed, 2 Mar 2016, Nicola wrote:


On 2016-03-01 15:35:07 +, Aditya Mahajan said:


 On Tue, 1 Mar 2016, Nicola wrote:

>  I'm using the latest beta, and I need syntax coloring for SQL
>  (PostgreSQL variant). According to the wiki, there is no SQL
>  syntax coloring available for MKIV yet, but I'd be happy to
>  be wrong :)

 You can use the vim module:

 https://github.com/adityam/filter/blob/master/vim-README.md


I've set up your module and it works perfectly. It saved me a
lot of time! But I need help for one more thing:
\inlineMYLANG{X} adds a new line before and after X, as in
\startMYLANG X \stopMYLANG. How do I prevent that? Well, why
is that the case to begin with?


It shouldn't. Can you send me a minimal example.

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] issue with font loading

2016-03-02 Thread Thomas A. Schmitz

On 03/02/2016 07:12 PM, Wolfgang Schuster wrote:

Don’t write just some garbage as third argument for the
\definefontfamily or \definefallbackfamily commands.

In the attached picture you can see the fonforge information for the
font names,
needed for the \definefontfamily command is the "family name" value.

\definefallbackfamily[mainface][rm][GaramondNo8][scale=0.88,range=0x22C0]

Wolfgang


Or, if you happen to have texlive installed:

otfinfo -a 
___
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] Custom syntax highlighting

2016-03-02 Thread Nicola

On 2016-03-01 15:35:07 +, Aditya Mahajan said:


On Tue, 1 Mar 2016, Nicola wrote:


I'm using the latest beta, and I need syntax coloring for SQL
(PostgreSQL variant). According to the wiki, there is no SQL
syntax coloring available for MKIV yet, but I'd be happy to
be wrong :)


You can use the vim module:

https://github.com/adityam/filter/blob/master/vim-README.md


I've set up your module and it works perfectly. It saved me a
lot of time! But I need help for one more thing:
\inlineMYLANG{X} adds a new line before and after X, as in
\startMYLANG X \stopMYLANG. How do I prevent that? Well, why
is that the case to begin with?

Nicola


___
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] issue with font loading

2016-03-02 Thread Wolfgang Schuster

Pablo Rodriguez 
2. März 2016 um 17:17

Wolfgang,

I’m afraid that even with that, I’m afraid it doesn’t work well:

\definefallbackfamily[mainface][rm][Latin Modern Math]
[tf=file:newg8-regular, scale=0.88, range=0x22C0]
\definefallbackfamily[mainface][rm][Latin Greek Math]
[tf=file:newg8-regular, range=preset:greek]
\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][tt][GreekTT][tf=file:newg8-regular]
\definefontfamily[mainface][ss][GaraMath][tf=file:newg8-regular]

\setupbodyfont[mainface]

\starttext
α ⋀ {\tt α} a{\ss a}b{\ss b}c{\ss c}g{\ss g}
\stoptext

If another "key=value" pair is specified, "tf=file:newg8-regular"
doesn’t seem to work.

What am I doing wrong?
Don’t write just some garbage as third argument for the 
\definefontfamily or \definefallbackfamily commands.


In the attached picture you can see the fonforge information for the 
font names,

needed for the \definefontfamily command is the "family name" value.

\definefallbackfamily[mainface][rm][GaramondNo8][scale=0.88,range=0x22C0]

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] issue with font loading

2016-03-02 Thread Pablo Rodriguez
On 03/02/2016 04:56 PM, Pablo Rodriguez wrote:
> On 03/02/2016 03:59 PM, Wolfgang Schuster wrote:
>>
>> The \definefontfamily can only use font which are indexed by context
>> (mtxrun --script font --reload) which doesn’t seem to be the case here.

Wolfgang,

I’m afraid that even with that, I’m afraid it doesn’t work well:

\definefallbackfamily[mainface][rm][Latin Modern Math]
[tf=file:newg8-regular, scale=0.88, range=0x22C0]
\definefallbackfamily[mainface][rm][Latin Greek Math]
[tf=file:newg8-regular, range=preset:greek]
\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][tt][GreekTT][tf=file:newg8-regular]
\definefontfamily[mainface][ss][GaraMath][tf=file:newg8-regular]

\setupbodyfont[mainface]

\starttext
α ⋀ {\tt α} a{\ss a}b{\ss b}c{\ss c}g{\ss g}
\stoptext

If another "key=value" pair is specified, "tf=file:newg8-regular"
doesn’t seem to work.

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

Re: [NTG-context] Tables vs tables (deprecation paranoia again)

2016-03-02 Thread Hans Hagen

On 3/2/2016 4:52 PM, Nicola wrote:

I read in the wiki that my beloved \starttable...\stoptable is
deprecated. Tabulate seems their next of kin, but... does it
support cells spanning more than one row?


\starttable will always stay around (after all, it had been partially 
mkiv'd); it's just that some of the other mechanisms have more features 
and can/will be extended if needed


(not that much got deprecated; of course we got rid of encodings and 
some more no-longer-relevant mechanisms in mkiv but functionality stays)


Hans

(1) ok, this year old school bibtex support is depricated (still around 
as module) so we do change some defaults


(2) and the current beta has new columnset code which also depricates 
some old obscure features in favor of new ones


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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] issue with font loading

2016-03-02 Thread Pablo Rodriguez
On 03/02/2016 03:59 PM, Wolfgang Schuster wrote:
> 
> The \definefontfamily can only use font which are indexed by context
> (mtxrun --script font --reload) which doesn’t seem to be the case here.

Even if the font is on the same directory as the ConTeXt source file? I
invoke it by its file name.

Sorry, this was outside the ConTeXt tree. And I didn’t know that it has
to be indexed by ConTeXt.

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

[NTG-context] Tables vs tables (deprecation paranoia again)

2016-03-02 Thread Nicola

I read in the wiki that my beloved \starttable...\stoptable is
deprecated. Tabulate seems their next of kin, but... does it
support cells spanning more than one row?

Nicola


___
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] Custom syntax highlighting

2016-03-02 Thread Nicola

On 2016-03-02 14:45:54 +, Aditya Mahajan said:


On Wed, 2 Mar 2016, Nicola wrote:


On 2016-03-02 02:14:33 +, Aditya Mahajan said:


I do not load the default vimrc, because that drastically slows down the
module.


That makes sense. So, Vim is run with something like `vim -u NONE`, I 
guess.


Yes. And if the vimrc option is used, then it is saved on file, and vim -u 
\vimrc_filename is run.


Crystal clear, thanks!


\startvimrc[name=pgsql]
set nocompatible
set runtimepath+=~/.vim/bundle/pgsql
let g:sql_type_default='pgsql'
% ...
\stopvimrc


I will add a note to the docs about runtimepath. When I wrote the module, 
bundle was not popular, but it is the default now.


I use Pathogen, and `bundle` is its default path for plugins. But recently
Vim has introduced a feature called `packages` in the core (:h packages), so
one may expect that in the future the default will be `pack`.

Nicola___
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] issue with font loading

2016-03-02 Thread Wolfgang Schuster

Pablo Rodriguez 
2. März 2016 um 15:43

Wolfgang,

I’m afraid it doesn’t work.

Just in case it helps, directly generated from
http://github.com/rbrito/urw-garamond/, you have the font itsef at
http://ousia.tk/newg8-regular.otf.

Many thanks for your help,


Pablo
Wolfgang Schuster 
2. März 2016 um 14:54
Does this work?

\definefontfamily[mainface][ss][GaraMath][tf=file:newg8-regular]

Wolfgang
Pablo Rodriguez 
2. März 2016 um 12:11
Dear list,

I have the following sample:

\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][ss][GaraMath][file={newg8-regular.otf}]

\setupbodyfont[mainface]

\starttext
a{\ss a}b{\ss b}c{\ss c}g{\ss g}
\stoptext

I don’t get a sans typeface different from Latin Modern Roman.

If the font is on the same directory as the ConTeXt source file, what is
wrong in my code?
The \definefontfamily can only use font which are indexed by context 
(mtxrun --script font --reload) which doesn’t seem to be the case here.


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] Custom syntax highlighting

2016-03-02 Thread Aditya Mahajan

On Wed, 2 Mar 2016, Nicola wrote:


On 2016-03-02 02:14:33 +, Aditya Mahajan said:


I do not load the default vimrc, because that drastically slows down the
module.


That makes sense. So, Vim is run with something like `vim -u NONE`, I 
guess.


Yes. And if the vimrc option is used, then it is saved on file, and vim -u 
\vimrc_filename is run.



 Instead, there is an option to create a specific vimrc using:

\startvimrc[name=pgsql]
let g:sql_type_default='pgsql'
\stopvimrc

and then

\definevimtyping[SQL][..., vimrc=pgsql, ...]

By default, the script searches everything in `runtimepath`. If your 

local
vim folder is not in runtimepath, you can set the runtimepath in the 

vimrc

above.


I had to set both runtimepath and nocompatible. Maybe this should be noted
in the docs, or the module could run `vim -u NONE -N` (who needs compatible
nowadays?). So, for future reference, this works:


I explicitly set compatible (but I don't remember why I did that anymore). 
This is the full command that is run:



\def\vimtyping@filter_command
  {vim -u \vimrc_filename\space % read global config file
% --startuptime log
% -V3log
   -X % dont connect to X server
   -i NONE % dont use viminfo file
   --noplugin % dont load plugins
   -e % run in ex mode
   -s % silent
   -C % set compatible
   -n % no swap file
   -c "syntax manual" % don't load filetype detection
   -c "set syntax=\externalfilterparameter\c!syntax" %
   -c "set tabstop=\externalfilterparameter\c!tab" %
   % vim only accepts 10 -c commands, so we combine a few let 
statements
   -c "let contextstartline=\externalfilterparameter\c!start 
\letterbar\space %
   let contextstopline=\externalfilterparameter\c!stop 
\letterbar\space %
   let 
strip=\getvalue{\vimtyping@id-\c!strip-\externalfilterparameter\c!strip}" 
%
   -c "let 
escapecomments=\getvalue{\vimtyping@id-\c!escape-\externalfilterparameter\c!escape}" 
%

   -c "let highlight=[\externalfilterparameter\c!highlight]" %
   \vimrc_extras\space
   -c "source \vimtyping@script_name" %
   -c "qa" %
   \externalfilterinputfile\space
   \externalfilteroutputfile}


I'll run my test suite with -N instead of -C. If everything works, I'll 
change to -N.



\startvimrc[name=pgsql]
set nocompatible
set runtimepath+=~/.vim/bundle/pgsql
let g:sql_type_default='pgsql'
% ...
\stopvimrc


I will add a note to the docs about runtimepath. When I wrote the module, 
bundle was not popular, but it is the default now.


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] issue with font loading

2016-03-02 Thread Pablo Rodriguez
On 03/02/2016 02:54 PM, Wolfgang Schuster wrote:
>> Pablo Rodriguez 2. März 2016 um 12:11
>> [...]
>> \definefontfamily[mainface][rm][Latin Modern Roman]
>> \definefontfamily[mainface][ss][GaraMath][file={newg8-regular.otf}]
> 
> Does this work?
> 
> \definefontfamily[mainface][ss][GaraMath][tf=file:newg8-regular]

Wolfgang,

I’m afraid it doesn’t work.

Just in case it helps, directly generated from
http://github.com/rbrito/urw-garamond/, you have the font itsef at
http://ousia.tk/newg8-regular.otf.

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

Re: [NTG-context] issue with font loading

2016-03-02 Thread Wolfgang Schuster

Pablo Rodriguez 
2. März 2016 um 12:11
Dear list,

I have the following sample:

\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][ss][GaraMath][file={newg8-regular.otf}]

Does this work?

\definefontfamily[mainface][ss][GaraMath][tf=file:newg8-regular]

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] footnotes and links

2016-03-02 Thread Pablo Rodriguez
On 03/02/2016 01:54 PM, Hans Hagen wrote:
> On 3/2/2016 1:32 PM, Pablo Rodriguez wrote:
> 
>> My (ignorant) guess is that updating luatex from 0.89.0 to 0.89.2
>> contained the fix.
> 
> no, it doesn't relate to the engine as context doesn't use the engine 
> for links and so .. just macro magic mixed with lua code

Well, I was simply wrong.

Could we have some more magic for indices?

\setupinteraction[state=start, focus=standard]
\enabledirectives[references.border]
\starttext
This is \index{text}text.\footnote{This is a footnote.}
\title{Index}
\placeindex
\stoptext

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

Re: [NTG-context] footnotes and links

2016-03-02 Thread Hans Hagen

On 3/2/2016 1:32 PM, Pablo Rodriguez wrote:

> My (ignorant guess) is that updating luatex from 0.89.0 to 0.89.2

contained the fix.


no, it doesn't relate to the engine as context doesn't use the engine 
for links and so .. just macro magic mixed with lua code


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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] issue with font loading

2016-03-02 Thread Hans Hagen

On 3/2/2016 1:07 PM, Pablo Rodriguez wrote:

On 03/02/2016 12:28 PM, Hans Hagen wrote:

On 3/2/2016 12:11 PM, Pablo Rodriguez wrote:

[...]
I don’t get a sans typeface different from Latin Modern Roman.

If the font is on the same directory as the ConTeXt source file, what is
wrong in my code?


doesn't the log tell you something


Many thanks for your reply, Hans.

searching for font in the log file, this is what I get:

fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > 2 > 3 > /home/ousia/a.tex
fonts   > preloading modern-designsize (math)
fonts   > typescripts > unknown library 'modern-designsize'
fonts   > 'fallback modern-designsize mm 12pt' is loaded
fonts   > preloading modern-designsize (mono)
fonts   > 'fallback modern-designsize tt 12pt' is loaded

used file   >6: filename=lmroman10-regular.otf filetype=otf
format=otf
foundname=/home/ousia/ctxbeta/tex/texmf/fonts/opentype/public/lm/lmroman10-regular.otf
usedmethod=database

mkiv lua stats  > loaded fonts: 1 files: lmroman10-regular.otf
mkiv lua stats  > font engine: otf 3.013, afm 1.500, tfm 1.000, 4
instances, 3 shared in backend, 1 common vectors, 2 common hashes, load
time 0.060 seconds

Same results (no font embedding) with latest stable version from the
ConTeXt Suite.

If you want me to, I can attach the font itself in a private message (it
is URW Garamond [no copyright infringement, unless you plan to sell it
;-)]).


i think Wolfgang has to answer it .. he knows that define*family 
mechanism better


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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] footnotes and links

2016-03-02 Thread Pablo Rodriguez
On 02/27/2016 11:28 PM, Pablo Rodriguez wrote:
> On 02/27/2016 02:40 PM, Hans Hagen wrote:
> [...]
>> I can't check much (as I don't know what to expect, but there is no real 
>> definition of qualitative behaviour there anyway) but this is what can 
>> be done. I have no clue to what extent complex interactions between 
>> footnote splitting and their content can interfere.
> 
> I’m afraid that this modification of your sample shows an issue:
> 
> \setupnotes[location=text]
> \setupinteraction[state=start,focus=standard]
> 
> \starttext
> \chapter{Text}
> \dorecurse{10}{note #1%
> \footnote[reference:#1]{\input ward \input tufte\relax}\par}
> \par
> \goto{OEPS  3}[reference:3]
> \goto{OEPS 10}[reference:10]
> \chapter{Notes}
> \placefootnotes
> \stoptext
> 
> Links from the first page land in the next footnote than they should.
> Links that come back to the first page seem to be fine.

Many thanks for your fix, Hans.

After updating to latest beta (from yesterday), footnote links work fine
(not extensively checked yet).

My (ignorant guess) is that updating luatex from 0.89.0 to 0.89.2
contained the fix.

Also for the record, so that no good action leaves unpublished :-).

Many thanks again for this huge improvement,


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

Re: [NTG-context] issue with font loading

2016-03-02 Thread Pablo Rodriguez
On 03/02/2016 12:28 PM, Hans Hagen wrote:
> On 3/2/2016 12:11 PM, Pablo Rodriguez wrote:
>> [...]
>> I don’t get a sans typeface different from Latin Modern Roman.
>>
>> If the font is on the same directory as the ConTeXt source file, what is
>> wrong in my code?
> 
> doesn't the log tell you something

Many thanks for your reply, Hans.

searching for font in the log file, this is what I get:

fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > 2 > 3 > /home/ousia/a.tex
fonts   > preloading modern-designsize (math)
fonts   > typescripts > unknown library 'modern-designsize'
fonts   > 'fallback modern-designsize mm 12pt' is loaded
fonts   > preloading modern-designsize (mono)
fonts   > 'fallback modern-designsize tt 12pt' is loaded

used file   >6: filename=lmroman10-regular.otf filetype=otf
format=otf
foundname=/home/ousia/ctxbeta/tex/texmf/fonts/opentype/public/lm/lmroman10-regular.otf
usedmethod=database

mkiv lua stats  > loaded fonts: 1 files: lmroman10-regular.otf
mkiv lua stats  > font engine: otf 3.013, afm 1.500, tfm 1.000, 4
instances, 3 shared in backend, 1 common vectors, 2 common hashes, load
time 0.060 seconds

Same results (no font embedding) with latest stable version from the
ConTeXt Suite.

If you want me to, I can attach the font itself in a private message (it
is URW Garamond [no copyright infringement, unless you plan to sell it
;-)]).

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

Re: [NTG-context] issue with font loading

2016-03-02 Thread Hans Hagen

On 3/2/2016 12:11 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

 \definefontfamily[mainface][rm][Latin Modern Roman]
 \definefontfamily[mainface][ss][GaraMath][file={newg8-regular.otf}]

 \setupbodyfont[mainface]

 \starttext
 a{\ss a}b{\ss b}c{\ss c}g{\ss g}
 \stoptext

I don’t get a sans typeface different from Latin Modern Roman.

If the font is on the same directory as the ConTeXt source file, what is
wrong in my code?


doesn't the log tell you something

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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] Custom syntax highlighting

2016-03-02 Thread Nicola

On 2016-03-02 11:06:34 +, Nicola said:


On 2016-03-02 02:14:33 +, Aditya Mahajan said:


On Tue, 1 Mar 2016, Nicola wrote:


On 2016-03-01 15:35:07 +, Aditya Mahajan said:


On Tue, 1 Mar 2016, Nicola wrote:


I'm using the latest beta, and I need syntax coloring for SQL
(PostgreSQL variant). According to the wiki, there is no SQL
syntax coloring available for MKIV yet, but I'd be happy to
be wrong :)


You can use the vim module:

https://github.com/adityam/filter/blob/master/vim-README.md


I have a relatively minor problem with linked highlight groups.
As far as I can see, the module resolves linked groups so that,
for example, if String links to Constant, then the generated code
for 'a string' will be something like \SYN[Constant]{'a string'},
rather than \SYN[String]{'a string'}. In my specific case, strings
use the sqlString group, which links by default to String, which in
turn links to Constant.

Is there a way to decouple linked highlight groups, so that, for
example, I may distinguish Constant from String? I have already
tried to put commands like

hi! clear sqlString
hi! link String NONE
etc...

in the vimrc block, to no avail.


Ok, I have found it:

hi! link sqlString NONE

With that, I get \SYN[sqlString]{'a string'}, as expected.

Nicola


___
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] issue with font loading

2016-03-02 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][ss][GaraMath][file={newg8-regular.otf}]

\setupbodyfont[mainface]

\starttext
a{\ss a}b{\ss b}c{\ss c}g{\ss g}
\stoptext

I don’t get a sans typeface different from Latin Modern Roman.

If the font is on the same directory as the ConTeXt source file, what is
wrong in my code?

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

Re: [NTG-context] Custom syntax highlighting

2016-03-02 Thread Nicola

On 2016-03-02 02:14:33 +, Aditya Mahajan said:


On Tue, 1 Mar 2016, Nicola wrote:


On 2016-03-01 15:35:07 +, Aditya Mahajan said:


On Tue, 1 Mar 2016, Nicola wrote:


I'm using the latest beta, and I need syntax coloring for SQL
(PostgreSQL variant). According to the wiki, there is no SQL
syntax coloring available for MKIV yet, but I'd be happy to
be wrong :)


You can use the vim module:

https://github.com/adityam/filter/blob/master/vim-README.md


I have a relatively minor problem with linked highlight groups.
As far as I can see, the module resolves linked groups so that,
for example, if String links to Constant, then the generated code
for 'a string' will be something like \SYN[Constant]{'a string'},
rather than \SYN[String]{'a string'}. In my specific case, strings
use the sqlString group, which links by default to String, which in
turn links to Constant.

Is there a way to decouple linked highlight groups, so that, for
example, I may distinguish Constant from String? I have already
tried to put commands like

hi! clear sqlString
hi! link String NONE
etc...

in the vimrc block, to no avail.

Nicola


___
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] Custom syntax highlighting

2016-03-02 Thread Nicola

On 2016-03-02 09:13:07 +, Hans Hagen said:


On 3/2/2016 9:56 AM, Nicola wrote:

On 2016-03-01 21:53:10 +, Hans Hagen said:


- a relative new mechanism based on the scite lexers that i use (for not
it is loaded by \usemodule[scite]


...which does require Scite? (I've tried your example and it doesn't get
highlighted.)


the sql lexer is in the upcoming beta and i just added the start/stop
but this should work
[snip]


Indeed it does.


You don't need scite installed so it's quite efficient as it's the
method that is used, not the binary (and the context related lexers ship
with the context distribution).


That's clear now, thanks!

Nicola


___
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] References on the same page

2016-03-02 Thread Aidan Nichol
Is there a way to detect if two references are on the same page? I looking for 
a way to determine if I should print a single page number or a range of numbers.
___
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] Custom syntax highlighting

2016-03-02 Thread Hans Hagen

On 3/2/2016 9:56 AM, Nicola wrote:

On 2016-03-01 21:53:10 +, Hans Hagen said:


just fyi (as aditya already provided you a solution) there are three
highlighters

- the build-in one, for which one can define additional variants (there
are few defined, some assume proper syntax, some are line based)


Just to clarify, this is the Lua-based "pretty printers" mentioned in the
wiki, is it?


- the module by aditya which (i assume) also needs vim installed

- a relative new mechanism based on the scite lexers that i use (for not
it is loaded by \usemodule[scite]


...which does require Scite? (I've tried your example and it doesn't get
highlighted.)


the sql lexer is in the upcoming beta and i just added the start/stop 
but this should work


\usemodule[scite]

\starttext

\startbuffer[x]
for i=1cm step 1cm upto 10cm :
draw fullcircle scaled (0cm,i) ;
endfor ;
\stopbuffer

\scitebuffer[mps][x]

\stoptext

You don't need scite installed so it's quite efficient as it's the 
method that is used, not the binary (and the context related lexers ship 
with the context distribution).


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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] Vertically centered text in each page

2016-03-02 Thread Andreas Schneider

Am 2016-02-19 12:23, schrieb Marco Patzer:

On Fri, 19 Feb 2016 11:54:12 +0100
Nicola  wrote:


How do I setup the slide command to do that by default? I have tried
putting {before,after,beforesection,aftersection}=\vfill in various
combinations in \setuphead, but I cannot obtain the desired effect.


\setuphead[slide][
  style=\ssb,
  command=\MySlide,
  color=white,
  insidesection=\vfill,
  aftersection=\vfill,
  page=yes]


I'm in a similar situation currently, but can't quite get it to work 
with the mentioned solution.

The attached example shows several problems.

Test 1 and Test 3 show, that the \vfill at the beginning apparently adds 
a forced space (which is worse in Test 3 than in Test 1).


Another problem is, that when the page needs to break (which is fine), 
the last page will not be centered. This is a logic consequence of the 
\vfill being after the section.


Is there any other mechanism to center text on _all_ pages, no matter 
how often the sections or paragraphs need to get broken?


Best regards
Andreas\setuppapersize[S8]

\setupbodyfont[24pt]
\setupinterlinespace[height=0.8]

\setuppagenumbering[location=]

\definelayer
  [header]
  [width=\paperwidth, height=\paperheight]

\define[2]\setheader{%
  \resetlayer[header]%
  \setlayer[header]%
[preset=lefttop, x=10mm, y=5mm, width=15cm, heigth=40pt]%
{#2}%
}
\define[2]\setsubtitle{%
  \setlayer[header]%
[preset=lefttop, x=10mm, y=\dimexpr(5mm+40pt), width=15cm, heigth=22pt]%
{#2}%
}

\setuphead[chapter][command=\setheader, page=yes, before={\setupbackgrounds[page][background={header}, state=repeat]}, after={\strut\blank[-2*line,samepage,disable]}, insidesection=\vfill, aftersection=\vfill]
\setuphead[section][command=\setsubtitle, after={\strut\blank[-2*line,samepage,disable]}, before=]

%\showboxes
\showframe

\starttext

\startchapter[title={Test 1}]

\input knuth
\input knuth

\stopchapter

\startchapter[title={Test 2}]

No page-breaks here.

\stopchapter

\startchapter[title={Test 3}]

\startsection[title={Subtitle}]

\input knuth
\input knuth

\stopsection

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

Re: [NTG-context] Custom syntax highlighting

2016-03-02 Thread Nicola

On 2016-03-01 21:53:10 +, Hans Hagen said:


just fyi (as aditya already provided you a solution) there are three
highlighters

- the build-in one, for which one can define additional variants (there
are few defined, some assume proper syntax, some are line based)


Just to clarify, this is the Lua-based "pretty printers" mentioned in the
wiki, is it?


- the module by aditya which (i assume) also needs vim installed

- a relative new mechanism based on the scite lexers that i use (for not
it is loaded by \usemodule[scite]


...which does require Scite? (I've tried your example and it doesn't get
highlighted.)

Nicola


___
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] Custom syntax highlighting

2016-03-02 Thread Nicola

On 2016-03-02 02:14:33 +, Aditya Mahajan said:


I do not load the default vimrc, because that drastically slows down the
module.


That makes sense. So, Vim is run with something like `vim -u NONE`, I guess.


 Instead, there is an option to create a specific vimrc using:

\startvimrc[name=pgsql]
let g:sql_type_default='pgsql'
\stopvimrc

and then

\definevimtyping[SQL][..., vimrc=pgsql, ...]

By default, the script searches everything in `runtimepath`. If your local
vim folder is not in runtimepath, you can set the runtimepath in the vimrc
above.


I had to set both runtimepath and nocompatible. Maybe this should be noted
in the docs, or the module could run `vim -u NONE -N` (who needs compatible
nowadays?). So, for future reference, this works:

\startvimrc[name=pgsql]
set nocompatible
set runtimepath+=~/.vim/bundle/pgsql
let g:sql_type_default='pgsql'
% ...
\stopvimrc




2) Are pscolor and blackandwhite the only possibilities to customize the
colors? This is important, I need the syntax highlighting to match my
document's colors.


It is relatively easy to tune the color scheme. See, for example how
pscolor is defined:
https://github.com/adityam/filter/blob/cc9d9017bfdd7fe0d67b4723570e960ec6c52e43/t-vim.tex#L280 



You can create similar mappings for your favorite color scheme (It does
require a bit of knowledge of vim syntax groups).


Perfect, thanks!


Finally, your Readme tells to use \definevimtyping[...][...], but I have
found
that I need to use put all the options together: \defienvimtyping[...].


What I mean is \definevimtyping[SQL][numbering=on], etc.


Ops, dumb oversight on my part.

Thanks for your help and your amazing module,
Nicola


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