Re: [NTG-context] Help on tweaking alignment, page numbers and ToC

2020-08-13 Thread Nicola
On 2020-08-13, Pablo Rodriguez  wrote:
> On 8/13/20 6:06 PM, Nicola wrote:
>> [...]
>> Thanks. That works with my MWE, but in my document I actually have
>> a chapter, and chapters start on the right page, even if I add page=no
>> to \setuppagenumbering:
>> [...]
>> I have no idea how to allow chapters to start at arbitrary pages when
>> alternative=doublesided.
>
> Use \page[yes, blank] instead of \page[yes, blank, right].
>
> I hope this helps,

Thank you both. I had tried `yes` already, but I had mixed it with other
interfering settings, which got me confused. Now that I have cleand up
my code, everything is 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Help on tweaking alignment, page numbers and ToC

2020-08-13 Thread Nicola
On 2020-08-13, Pablo Rodriguez  wrote:
> On 8/13/20 5:17 PM, Nicola wrote:
>> Hi,
>> I still have an issue with blank pages...
>>
>>>> 2. Vertically center the ToC (wrt to the text area).
>>>
>>> Use a makeup for the TOC (if and only if it takes a single page).
>>
>> Yes, the ToC takes a single page. The makeup seems to insert a blank
>> page afterwards. MWE:
>
> Hi Nicola,
>
> all makeups do that by default.
>
> "doublesided=no" is what you need.

Thanks. That works with my MWE, but in my document I actually have
a chapter, and chapters start on the right page, even if I add page=no
to \setuppagenumbering:

\setuppagenumbering[alternative=doublesided,page=no]
\definemakeup[ToC][align=middle,pagestate=start,doublesided=no]
\starttext
\startfrontmatter
  \startmakeup[ToC]
\placecontent
  \stopmakeup
  \chapter{Preface}
\stopfrontmatter
\startbodymatter
  \dorecurse{10}{\chapter{Foo}}
\stopbodymatter
\stoptext

I have no idea how to allow chapters to start at arbitrary pages when
alternative=doublesided.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Help on tweaking alignment, page numbers and ToC

2020-08-13 Thread Nicola
Hi,
I still have an issue with blank pages...

>> 2. Vertically center the ToC (wrt to the text area).
>
> Use a makeup for the TOC (if and only if it takes a single page).

Yes, the ToC takes a single page. The makeup seems to insert a blank
page afterwards. MWE:

\setuppagenumbering[alternative=doublesided]
\definemakeup[ToC][align=middle,pagestate=start]
\starttext
\startfrontmatter
  \startmakeup[ToC]
\placecontent
  \stopmakeup
  \input{knuth}
\stopfrontmatter
\startbodymatter
  \dorecurse{10}{\chapter{Foo}}
\stopbodymatter
\stoptext

How do I suppress the blank page after the ToC?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \setfirstline is applied to whole paragraph

2020-08-12 Thread Nicola
When I typeset the example at

https://wiki.contextgarden.net/Command/definefirstline

(reported below for your convenience), \setfirstline is applied to the
whole first paragraph, which is laid out on a single line (hence, it is
cropped at the edge of the page). Besides, the second \setfirstline is
not applied at all, i.e., there are no small caps. If I comment out the
first \setfirstline, then the second one does produce small caps, but
again, a whole paragraph is set in small caps, not just the first line.

$ context --version
mtx-context | ConTeXt Process Management 1.03
mtx-context |
mtx-context | main context file: 
/Users/nicola/Applications/context-osx-64/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2020.08.11 15:59
mtx-context | main context file: 
/Users/nicola/Applications/context-osx-64/tex/texmf-context/tex/context/base/mkiv/context.mkxl
mtx-context | current version: 2020.08.11 15:59

Nicola


\setupbodyfont [heros] %% important: smallcaps capable font!

\definefirstline [italicfirstline] [
  alternative=line,
  style=italic,
]

\definefirstline [smallcapsfirstline] [
  alternative=line,
  color=darkred,
  style=smallcaps,
]

\starttext

  % \setfirstline[italicfirstline]\input knuth \par
  \setfirstline[smallcapsfirstline] \input knuth \par

\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] Help on tweaking alignment, page numbers and ToC

2020-08-12 Thread Nicola
On 2020-08-12, Wolfgang Schuster  wrote:
> Nicola schrieb am 11.08.2020 um 22:21:
>> On 2020-08-11, Pablo Rodriguez  wrote:
>>> On 8/11/20 9:24 PM, Nicola wrote:
>>>> Thank Pablo, Wolfgang,
>>>> I have learned more by reading your replies than by myself in the rest
>>>> of the afternoon.
>>>
>>> Hi Nicola,
>>>
>>> if you found replies useful, please update the wiki (this may help others).
>>>
>>>> Just one more thing:
>>>> [...]
>>>> I'd prefer all the titles to be aligned:
>>>>
>>>>   Preface
>>>> I XYZ
>>>>...
>>>> VIII XYZ
>>>>...
>>>>
>>>> I have tried to do my homework by playing with \setuphead, but I am
>>>> afraid I need your help on this.
>>>
>>> Sorry, but too tired to type a sample.
>>>
>>> How about setting distance for \setuplist[chapter] in the sectionblock
>>> frontpart with the desired width?
>>
>> That does not seem to change the layout, unfortunately. I have tried
>> with `margin` and `aligntitle` as well:
>>
>> \setuplist[chapter][distance=1cm,aligntitle=yes]
>> \startsectionblockenvironment[frontpart]
>> \setuplist[chapter][aligntitle=yes,margin=2cm,distance=2cm]
>> \stopsectionblockenvironment
>>
>> I'll take a fresh look tomorrow.
>
> When you a unnumbered section with the list alternatives a-c your're out
> of luck with the regular \setuplist options because it always use a
> width of 0pt for regular section number. The aligntitle works only for
> numbered entries to align them when you disable the number entry in the TOC.
>
> To show the section entry and align all entries on the same line you can
> use the following method:
>
>1. Set the width and distance for the section number to 0pt.
>
>2. Set the margin key to a value large enough to fit all numbers
>
>3. Apply a command to the numbercommand key where you shift the
> number to the left in the margin area you set in the previous step

Thanks, nice trick!

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Page number 0 in Table of Contents with makeup

2020-08-11 Thread Nicola
On 2020-08-11, Pablo Rodriguez  wrote:
> On 8/11/20 10:11 PM, Nicola wrote:
>> Consider this example:
>>
>> \definemakeup[toc][align=middle]
>> \setuppagenumbering[alternative=doublesided]
>> \starttext
>>   \startfrontmatter
>> \startmakeup[toc]
>>   \placecontent
>> \stopmakeup
>> %\setuppagenumber[number=1]
>> \startchapter[title={A}]\stopchapter
>> \startchapter[title={B}]\stopchapter
>>   \stopfrontmatter
>> \stoptext
>>
>> The first entry in the ToC has page number 0. I can fix it by
>> uncommenting the commented line or by removing the makeup. Is this
>> expected behaviour? If so, why?
>
> Hi Nicola,
>
> makeups have pagestate set to stop by default.
>
> \definemakeup[toc][align=middle, pagestate=start] solves your issue.
>
> I hope it helps,

Yes, it does!

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Help on tweaking alignment, page numbers and ToC

2020-08-11 Thread Nicola
On 2020-08-11, Pablo Rodriguez  wrote:
> On 8/11/20 9:24 PM, Nicola wrote:
>> Thank Pablo, Wolfgang,
>> I have learned more by reading your replies than by myself in the rest
>> of the afternoon.
>
> Hi Nicola,
>
> if you found replies useful, please update the wiki (this may help others).
>
>> Just one more thing:
>> [...]
>> I'd prefer all the titles to be aligned:
>>
>>  Preface
>>I XYZ
>>   ...
>> VIII XYZ
>>   ...
>>
>> I have tried to do my homework by playing with \setuphead, but I am
>> afraid I need your help on this.
>
> Sorry, but too tired to type a sample.
>
> How about setting distance for \setuplist[chapter] in the sectionblock
> frontpart with the desired width?

That does not seem to change the layout, unfortunately. I have tried
with `margin` and `aligntitle` as well:

\setuplist[chapter][distance=1cm,aligntitle=yes]
\startsectionblockenvironment[frontpart]
\setuplist[chapter][aligntitle=yes,margin=2cm,distance=2cm]
\stopsectionblockenvironment

I'll take a fresh look tomorrow.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Page number 0 in Table of Contents with makeup

2020-08-11 Thread Nicola
Consider this example:

\definemakeup[toc][align=middle]
\setuppagenumbering[alternative=doublesided]
\starttext
  \startfrontmatter
\startmakeup[toc]
  \placecontent
\stopmakeup
%\setuppagenumber[number=1]
\startchapter[title={A}]\stopchapter
\startchapter[title={B}]\stopchapter
  \stopfrontmatter
\stoptext

The first entry in the ToC has page number 0. I can fix it by
uncommenting the commented line or by removing the makeup. Is this
expected behaviour? If so, why?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Help on tweaking alignment, page numbers and ToC

2020-08-11 Thread Nicola
Thank Pablo, Wolfgang,
I have learned more by reading your replies than by myself in the rest
of the afternoon. Just one more thing:

>>> 1. Increase the space between Roman numbers and titles in the ToC.
>>
>> distance with dimension is the key in \setuplist.
>
> Correct but it's also important to set "width" to a value which is large
> enough to fit the number.

Chapters in the front matter have no number, so the Preface gets aligned
with the numbers of the other chapters:

Preface
   I XYZ
  ...
VIII XYZ
  ...

I'd prefer all the titles to be aligned:

 Preface
   I XYZ
  ...
VIII XYZ
  ...

I have tried to do my homework by playing with \setuphead, but I am
afraid I need your help on this.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Help on tweaking alignment, page numbers and ToC

2020-08-11 Thread Nicola
Hi,
first of all, let me say *thank you* for the vast improvements on
ConTeXt Garden! Browsing the documentation and finding stuff is so
much easier and pleasant than it used to be (also the site seems
faster).

Thanks to the docs, dropcaps and protrusion have no secrets for me,
but I am still struggling with some basic tasks (see the document
below):

0. Push text to the bottom of the text area (see copyright).
1. Increase the space between Roman numbers and titles in the ToC.
2. Vertically center the ToC (wrt to the text area).
3. Suppress page numbers and headers in all blank pages.
4. Suppress headers in the front matter.
5. Style and position page numbers differently in the front and body
   matter (e.g., centered only in the front matter).

As my full document uses environments, I would like most setups to
be in the environment, if possible. E.g., is it possible to replace

\setuphead[chapter][after={}]

(see below) with an environment setup that applies only to the ToC?

Nicola

%%%
\definepapersize[lsda][width=128.4mm,height=198.3mm]
\setuppapersize[lsda]

\setuplayout[
  backspace=22.9mm,
  width=90.3mm,
  topspace=8.9mm,
  height=181.1mm,
  header=4mm,
  headerdistance=6.4mm,
  footerdistance=6.4mm,
  footer=4mm,
  leftmargin=15.2mm,
  leftmargindistance=0mm,
  rightmargindistance=0mm,
  rightmargin=15.2mm,
]

\setuplabeltext[it][chapter=]
\setuphead[chapter][
  header=empty,
  alternative=middle,
  conversion=Romannumerals,
  numbercommand=\groupedcommand{\blank[20mm]}{\blank[10mm]},
  after={\blank[3cm]},
]
\setupheadtext[content=]

\setupheadertexts[]
\setupheadertexts[\setups{text a}][][][\setups{text b}]
\startsetups[text a]
  \rlap{whatever}
  \hfill
  \getmarking[chapter]
  \hfill
  \llap{whatever}
\stopsetups

\startsetups[text b]
  \rlap{}
  \hfill
  Some text goes here
  \hfill
  \llap{}
\stopsetups

\setuppagenumbering[
  alternative=doublesided,
  location={text,footer,right},
  style=\tfx
]
\definestructureconversionset[frontpart:pagenumber][][romannumerals]
\definestructureconversionset[bodypart:pagenumber] [][numbers]

\starttext
\startfrontmatter
\page[even]
\startalignment[bottom,flushright]
Copyright © 2020 Author
\stopalignment
\start
\setuphead[chapter][after={}]
\completecontent
\stop
\page[odd]
\startchapter[title={Preface}]\input{knuth}\stopchapter
\stopfrontmatter
\startbodymatter
\setuppagenumber[number=1]
\dorecurse{10}{\startchapter[title={XYZ}]\input{tufte}\stopchapter}
\stopbodymatter
\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] A simpler way to install LMTX in macOS Catalina

2020-05-30 Thread Nicola
On 2020-05-30, Arthur Reutenauer  wrote:
>   Nicola,
>
> On Sat, May 30, 2020 at 11:09:28AM -0000, Nicola wrote:
>> 1. Download macOS's version of LMTX from 
>> https://wiki.contextgarden.net/Installation
>> 2. Unpack
>> 3. cd context-osx-64
>> 4. xattr -d com.apple.quarantine bin/mtxrun
>> 5. sh ./install.sh
>
>   It’s nice to report that to the list, could you also add a note on the
> wiki page itself?  That’s where people are most likely to look for this
> kind of information.

I have update https://wiki.contextgarden.net/Installation accordingly.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] A simpler way to install LMTX in macOS Catalina

2020-05-30 Thread Nicola
Today I wanted to try LMTX and I have found these instructions in the wiki:

https://wiki.contextgarden.net/Installing_ConTeXt_LMTX_on_MacOS

Rather than disabling SIP, I have proceeded as follows:

1. Download macOS's version of LMTX from 
https://wiki.contextgarden.net/Installation
2. Unpack
3. cd context-osx-64
4. xattr -d com.apple.quarantine bin/mtxrun
5. sh ./install.sh

Point 4 is important to avoid the dialog "mtxrun cannot be opened
because the developer cannot be verified." Of course, it would be
better if the binary were signed...

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Custom color schemes in t-vim

2020-05-17 Thread Nicola
On 2020-05-17, Nicola  wrote:
> On 2020-05-17, Aditya Mahajan  wrote:

>> Uploaded a new version with a fix.

I have tried the latest beta and, indeed, it now seems to work as
expected.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Custom color schemes in t-vim

2020-05-17 Thread Nicola
On 2020-05-17, Aditya Mahajan  wrote:
>> Since I already map the minor groups to preferred groups in `t-vim`, I think
>> that a good compromise is to enable the minor groups by default. I can do
>> that by adding statements similar to those above in `2context.vim`. This will
>> not have any visual impact on any existing code, but will allow those who
>> want to tweak the highlighting of minor groups to define their own syntax
>> highlighting.
>
> Uploaded a new version with a fix.

Thanks for looking into it. I will download and test that soon.

A couple of remarks:

1. In one of my old documents, I had this command inside the colorscheme
   block:

\setups{vim-minor-groups}

   Was that to achieve the same purpose?

2. The wiki has no mention of \startcolorscheme... \stopcolorscheme or
   \setups. An example of two would be very welcome!

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Custom color schemes in t-vim

2020-05-16 Thread Nicola
On 2020-05-16, Aditya Mahajan  wrote:
> On Sat, 16 May 2020, Aditya Mahajan wrote:

> Moreover, if you comment line line 126 of `2context.vim`
>
>  "let s:id  = synIDtrans (s:id)
>
> [If you make a local copy of 2context.vim, then you need to run the
> file with `--mode=dev-vim` to ensure that the local copy is used]
>
> Then the ruby example generates the following file:
>
> \SYNBOL{}\SYN[rubyComment]{# Ruby program listing}\SYNEOL{}
> \SYNBOL{}\SYN[rubyDefine]{def}\SYN[rubyMethodBlock]{ 
> }\SYN[rubyMethodName]{foobar}\SYNEOL{}
> \SYNBOL{}\SYN[rubyMethodBlock]{  
> print(}\SYN[rubyStringDelimiter]{"}\SYN[rubyString]{Hello 
> World}\SYN[rubyStringDelimiter]{"}\SYN[rubyMethodBlock]{)}\SYNEOL{}
> \SYNBOL{}\SYN[rubyDefine]{end}\SYNEOL{}
>
> So, if you are willing to define wrappers for all ruby syntax blocks,
> then I can provide a configuration option so that `2context` does not
> apply that line.

That might provide a finer control over the highlighting, but the main
issue here seems to be that the generated file has Identifier instead of
Function, Special instead of Delimiter and Constant instead of String.
Looking at 2context.vim, AFAICS s:id_name seems computed correctly.
Maybe, the script does not set the appropriate filetype?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Custom color schemes in t-vim

2020-05-16 Thread Nicola
On 2020-05-14, Aditya Mahajan  wrote:
> On Thu, 14 May 2020, Nicola wrote:
>
>> Quick question: Is \startcolorscheme... \stopcolorscheme (still)
>> supported by t-vim?

> It is supposed to work. If it doesn't, then it is a bug. Could you
> provide a complete MWE.

Please find a MWE at the bottom of this post.

The expected behaviour is that the keyword `function` in the JavaScript
snippet and `foobar` in the Ruby snippet should be colored and in
italics, as comments are. The respective Vim highlight groups are
`javaScriptFunction` and `rubyMethodName`, which both resolve to
`Function`.

The actual behaviour is that comments are highlighted correctly, but
I do not get any syntax highlighting for functions.

Thanks for t-vim, btw: I can't express in words how nice an idea it is!

Nicola


\setupcolors[state=start]

\definecolor[colorone][r=0.251, g=0.349, b=0.322]
\definecolor[colortwo][r=0.612, g=0.608, b=0.478]
\definecolor[colorthree]  [r=1.0,   g=0.827, b=0.576]
\definecolor[colorfour]   [r=1.0,   g=0.592, b=0.310]
\definecolor[colorfive]   [r=0.960, g=0.310, b=0.161]
\definecolor[nearlywhite] [r=0.988, g=0.988, b=0.988]

\setupinteraction[state=start]
\setupcolors[textcolor=colorone]
\setupbackgrounds[page][background=color,backgroundcolor=nearlywhite]

\usemodule[vim]
\unprotect
\startcolorscheme[oceansunset]
  \definesyntaxgroup[Comment][\c!color={colorfive},\c!style=italic]
  \definesyntaxgroup[Function][\c!color={colorfive},\c!style=italic]
  % \definesyntaxgroup[rubyMethodName][\c!color={colorfive},\c!style=italic]
  % \definesyntaxgroup[javaScriptFunction][\c!color={colorfive},\c!style=italic]
\stopcolorscheme
\protect

\definevimtyping[JAVASCRIPT][
  syntax=javascript,
  alternative=oceansunset,
  escape=on
]

\definevimtyping[RUBY][
  syntax=ruby,
  alternative=oceansunset,
  escape=on
]

\starttext
\startJAVASCRIPT
// JavaScript program listing
function foobar() {
  print("Hello World");
}
\stopJAVASCRIPT

\startRUBY
# Ruby program listing
def foobar
  print("Hello World")
end
\stopRUBY
\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] Custom color schemes in t-vim

2020-05-14 Thread Nicola
Quick question: Is \startcolorscheme... \stopcolorscheme (still)
supported by t-vim?

In a template I wrote long time ago to typeset code, I have:

\usemodule[vim]
\unprotect
\startcolorscheme[oceansunset]
  \definesyntaxgroup[Comment][\c!color={colortwo},\c!style=italic]
  % etc.
\stopcolorscheme
\protect

which I use as described in the wiki:

\definevimtyping
 [...]
 [...
  alternative=oceansunset,
  ...]

But that does not seem to have any effect (if I change the colors, the
syntax highlighting does not change). I can use pscolor and
blackandwhite, though. I see that \startcolorscheme is not documented,
so maybe there is another mechanism?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting up macvim in mac os catalina to work with LMTX

2020-04-23 Thread Nicola
On 2020-04-22, Jan-Erik Hägglöf  wrote:
> Output from :messages
>
>   
>   
> [ConTeXt] Typesetting...  
> Fel upptäcktes vid bearbetning av function 
> context#typeset[6]..39_typeset[2
> ]..context#callback[1]..39_callback:
> rad   17:
> E40: Kan inte öppna felfil /Users/janneman/Documents/CTX/GNUPLOT/test3.log

FYI, that error means that test3.log was not found - I guess, as that's
not a language I understand :-) - which likely means that your command
somehow failed without producing a log file (e.g., because the command
name was misspelled).

You seem to have fixed your issue, but, should you bump into further
issues, first make sure that your ConTeXt installation works properly
from the command line. Also, keep in mind that your shell environment
may be different from the environment in which ConTeXt is executed
inside Vim, so you may need to explicitly set some environment variables
(e.g., inside g:context_mtxrun) to make things sail smoothly.

Global variables (whose names start with `g:`) may be set in your vimrc,
which is typically located at $HOME/.vim/vimrc (note that the filename
does *not* start with a dot, only the directory's name does).

Good ConTeXt typesetting in Vim!
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting up macvim in mac os catalina to work with LMTX

2020-04-22 Thread Nicola
On 2020-04-21, Jan-Erik Hägglöf  wrote:
> Hi !
>
> I am curious about testing macvim and it seems doing fine in edit
> mode. But how do i set up the typesetting engine?
>
> As far as I understand, there is, the command :ConteXt with guidance
> from the wiki https://wiki.contextgarden.net/Vim
> <https://wiki.contextgarden.net/Vim>
>
> But I do not understand how to customize it to be directed to the path
> to my engine
>
> I’ve installed the LMTX in /Users/janneman/context-osx-64/

I haven't tried LMTX yet, but you may configure the path to the ConTeXt
executable you want to use by setting `g:context_mtxrun`, e.g.:

:let g:context_mtxrun='/path/to/context/mtxrun'

Then, executing :ConTeXt will run the configured command. You may also
define shell enviroment variables, if needed. For instance, I have
configured Vim to use my installation of ConTeXt Beta as follows:

   :let 
g:context_mtxrun='PATH=$HOME/path/to/context-beta/tex/texmf-osx-64/bin:$PATH 
mtxrun'

> The installation works fine in TeXshop but still an error shows up in
> macvim and the message dissappears very quick so there is not much
> time to read the cause of error.

You may show a log of Vim messages by typing :messages.
If you post the error message, I may better diagnose your issue.

> I have created the subdirectory .vim/ftplugin/ and put the context.vim file 
> there
> also the corresponding in .vim/compiler/context.vim
>
> which is copied from the program located in
> /usr/local/Cellar/macvim/8.2-163/MacVim.app/Contents/Resources/vim/runtime

That's unnecessary. MacVim's runtime path is searched by default.
I recommend that you remove the files that you have copied into ~/.vim.
ConTeXt in Vim works out of the box.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] ConTeXt support for Atom or other text editors

2020-01-21 Thread Nicola
On 2020-01-21, Sébastien Wilmet  wrote:

> I'm actually looking for a text editor on Linux that supports those
> three features:
> - syntax highlighting
> - command completion
> - spell-checking
>
> Does it exist?

Well, Vim has pretty solid support for ConTeXt (disclaimer: I am
maintaining the ConTeXt plugin distributed with Vim), including the
features you mention and much more:

https://wiki.contextgarden.net/Vim

But if you have never used Vim, it has a steeper learning curve that
a typical text editor.

On a side note: a difficulty with maintaining syntax highlighting for
ConTeXt is that I had to write my own script to extract ConTeXt-specific
and MetaFun-specific keywords from source code. Is there any way to do
it with ConTeXt?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Ebooks with ConTeXt?

2019-12-10 Thread Nicola
On 2019-12-10, Hans Hagen  wrote:
> On 12/9/2019 10:13 PM, Nicola wrote:
>> What is the current status of epub support in ConTeXt?
>> 
>> I have never followed ConTeXt's development on the XML front too
>> closely, but recently I have been asked to help format a text-only
>> manuscript for publishing on platforms such as Kindle or Apple Books
>> Store. Can ConTeXt be used (or perhaps even recommended) for that? Or
>> would I have better luck with the proprietary tools (Kindle Create,
>> iBooks Author)?
> context has an xml export (a few variants) and one can start from that 
> ... in the end it all boils down to some css (depends on the book i 
> guess) and tagged content (one can use the divs and spans output or 
> transform the xml to whatever wanted) ... for more complex setups i 
> think there are no generic solutions (unless all books should look 
> alike)

Ok, I imagined that things were like that, but I wasn't sure. Thanks for
confirming my impression.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Ebooks with ConTeXt?

2019-12-10 Thread Nicola
On 2019-12-10, Henning Hraban Ramm  wrote:
>
>> Am 2019-12-10 um 16:53 schrieb Denis Maier :
>>> 
>>> Perhaps this is a silly question (excuse my ignorance about the
>>> topic): what if you want to add some stylistic touches to your
>>> ebooks, such as initials? Or Non-breaking spaces? How about adding,
>>> say, a text box with a different background and a smaller font?
>>> 
>>> Or fine control page numbering, headers, footnotes, ligatures, or
>>> the spacing between paragraphs, or center a separator as above? Do
>>> you need to modify the generated CSS for that, or would ConTeXt (or
>>> Pandoc) allow you to take care of (some of) those things?
>>> 
>>> Nicola
>> 
>> For Pandoc: Some things can be tweaked with pandoc, but for anything
>> that is a bit more advanced you'll probably need a custom CSS. For
>> special content you can use spans and divs. In your custom CSS you
>> can define how those elements should be rendered. Sounds pretty
>> similar to what Hans wrote in his response. Probably the main
>> questions are if you prefer to work with pandoc markdown or with
>> ConTeXt sources, and if you need additional output formats.

The current need is only for epub. In any case, I'd like to have
a single source of truth for the content. I have experimented a bit with
Pandoc and, in fact, it can generate an .epub file that can be imported
by iBooks Author and converted with kindlegen. As for the style, it
seems that modifying the CSS gives the most control and can't be avoided
for advanced tweaks, even if I'd use ConTeXt.

As for ConTeXt, I have tried the latest beta with:

context mybook.tex
mtxrun --script epub --make mybook

This, among the rest, creates an .epub file, which unfortunately the
above mentioned tools do not like (maybe, that output is still
experimental?). I'll try to follow the more complex steps at
https://wiki.contextgarden.net/Epub_Sample.

> The problem is that custom CSS must be tuned for every single ePub
> reader (app or device), it’s like the browser wars. Most readers
> interprete only a strange subset of CSS2, it’s completely unreliable
> in my (limited) experience.

That's... sad.

> Have a look at https://wiki.contextgarden.net/ePub WRT ePub ot of
> ConTeXt, also at the old docs; unfortunately I never finished writing
> these pages, but I must review my ePub workflow soon-ish.

Thanks, I'll give it a shot!

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Ebooks with ConTeXt?

2019-12-09 Thread Nicola
On 2019-12-10, Jan U. Hasecke  wrote:
> Am 09.12.19 um 22:13 schrieb Nicola:
>> What is the current status of epub support in ConTeXt?
>> 
>> I have never followed ConTeXt's development on the XML front too
>> closely, but recently I have been asked to help format a text-only
>> manuscript for publishing on platforms such as Kindle or Apple Books
>> Store. Can ConTeXt be used (or perhaps even recommended) for that? Or
>> would I have better luck with the proprietary tools (Kindle Create,
>> iBooks Author)?
>
> Sorry, no info concerning ConTeXT.
>
> You don't have to use proprietary tools. An easy way to create ebooks
> from Markdown files (or other sources) is Pandoc. https://pandoc.org/
>
> I produce all of my ebooks in this way. In most cases they validate
> without errors. If there are some errors though I use Calibre to fix
> them manually.

Thanks, I didn't think of Pandoc, I'll give it a try. In the past,
I have tried to create some simple content (slides) with Markdown, but
my conclusion was that if you know TeX, it doesn't make sense to use
Markdown :)

Perhaps this is a silly question (excuse my ignorance about the topic):
what if you want to add some stylistic touches to your ebooks, such as
initials? Or Non-breaking spaces? How about adding, say, a text box with
a different background and a smaller font?

   ***

Or fine control page numbering, headers, footnotes, ligatures, or the
spacing between paragraphs, or center a separator as above? Do you need
to modify the generated CSS for that, or would ConTeXt (or Pandoc)
allow you to take care of (some of) those things?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Ebooks with ConTeXt?

2019-12-09 Thread Nicola
What is the current status of epub support in ConTeXt?

I have never followed ConTeXt's development on the XML front too
closely, but recently I have been asked to help format a text-only
manuscript for publishing on platforms such as Kindle or Apple Books
Store. Can ConTeXt be used (or perhaps even recommended) for that? Or
would I have better luck with the proprietary tools (Kindle Create,
iBooks Author)?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Fwd: SyncTeX and Skim/TeXShop

2019-04-11 Thread Nicola Vitacolonna
Sorry, forgot to forward to the mailing list:

> Begin forwarded message:
> 
> From: Nicola Vitacolonna 
> Subject: Re: [NTG-context] SyncTeX and Skim/TeXShop
> Date: 10 April 2019 at 17:50:26 CEST
> To: Hans Hagen 
> 
> Hans, OK,
> thanks for the feedback. I was able to get TeXShop to work as explained by 
> OK—that’s already a progress. I prefer to use Vim, so I’ll see whether I can 
> cook something myself using AppleScript and Skim and parsing the 
> ConTeXt-generated .synctex file. Is the synctex format currently used by 
> ConTeXt described anywhere?
> 
> Thanks again,
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] SyncTeX and Skim/TeXShop

2019-04-10 Thread Nicola Vitacolonna
Hi,
is anyone using ConTeXt with Skim, or TeXShop, on macOS?

SyncTeX used to work fine with ConTeXt in both apps. Now, it seems that ConTeXt 
has started to generate a .synctex file rather than a .synctex.gz, and the 
format seems to have changed (?). As I haven’t followed recent (or perhaps not 
so recent) developments in this area, do you have any suggestions to make 
SyncTeX work again?

I am using Skim, but any PDF viewer would be fine if Skim cannot be used for 
the purpose any longer.

Thanks in advance,
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Saving Metafun Graphic for use outside ConTeXt

2018-04-05 Thread Nicola

On 05/04/2018 18:24, Alan Braslau wrote:

On Thu, 5 Apr 2018 15:28:34 +0100
Keith McKay <mckaymeis...@gmail.com> wrote:


I use a mac-mini and it seems that mupdf, of which mutools is part
off, does not have a macOS version, or I would have to build from
source. However it looks like I can use Inkscape with a wee bit
thought to do pretty much the same.


mupdf is available on MacPorts...


...also in Homebrew (mupdf formula, or mupdf-tools if you don't need
the viewer).

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Wrong redirection in contextgarden.net

2017-05-06 Thread Nicola

On 29/04/2017 21:29, Mojca Miklavec wrote:


In case I forget, please remind me about this after the 4th May.


Ping. As requested ;)
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Wrong redirection in contextgarden.net

2017-04-29 Thread Nicola

On 29/04/2017 18:05, Mojca Miklavec wrote:

On 29 April 2017 at 09:47, Nicola wrote:

For a while now, when I connect to contextgarden.net, I get redirected
to wiki.contextgarden.net// (note the double slash). Is it just me, or
something to be fixed in the web site?


The server uses
RedirectMatch permanent ^(.*)$ http://wiki.contextgarden.net/$1

I'm looking for a better suggestion.


Wouldn't just

  Redirect permanent / http://wiki.contextgarden.net/

do? (It may be recursive if the virtual host is the same.)

If not, how about:

RedirectMatch permanent ^/(.*)$ http://wiki.contextgarden.net/$1

As a last resource, mod_rewrite should work:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^contextgarden\.net$ [NC]
RewriteRule ^(.*)$ http://wiki.contextgarden.net/$1 [R=301,L]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Wrong redirection in contextgarden.net

2017-04-29 Thread Nicola

For a while now, when I connect to contextgarden.net, I get redirected
to wiki.contextgarden.net// (note the double slash). Is it just me, or
something to be fixed in the web site?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Linking local resource

2017-04-25 Thread Nicola

I'd like to have links in my PDF to external resources (videos, movies,
or non-embeddable file types) stored locally. Ideally, I'd like to use
relative links, so that I can move the folder containing the PDF and the
resources, and a cross-platform method (I'm on macOS). Is that possible?

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] IPA transcription

2017-03-23 Thread Nicola

On 23/03/2017 18:30, Hans Åberg wrote:



On 23 Mar 2017, at 16:57, Nicola <nvitacolo...@gmail.com> wrote:



Is there a (easy) way to write phonetic
transcriptions using the IPA (International
Phonetic Alphabet) in ConTeXt?  I can't find any
reference to it in the documentation.


I did that some time ago, but I can speak only for macOS. You want to
have:

- fonts supporting phonetic symbols (both in the text editor and for the
 output);
- an IPA keyboard layout;


You might try the text substitutions service: System Preferences >
Keyboard > Text. One chooses replacement text and what it should be
substituted into. See the thread "Input methods" for an automated
approach to generating large substitution sets.


Sure, that's another possibility. A drawback of that approach, as far as
I can see, is that those substitutions are applied globally across the
system.

Btw, Vim has a similar feature, called `iabbrev`: the advantage is that
replacements are editor-specific and the method is cross-platform
(because Vim is). Vim also offers support for inputting “digraphs” and
for defining your own. Even better, for the use case at hand, is that
you may also define your own keymap, e.g.:

https://github.com/bpj/bpj-vim-keymaps/blob/master/keymap/bxs.vim

I guess that other editors (e.g., Emacs) may offer similar
functionality.

Anyway, for me the IPA keyboard layout is what has worked best.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] IPA transcription

2017-03-23 Thread Nicola

On 23/03/2017 16:57, Nicola wrote:

On 23/03/2017 14:49, Angel M Alganza wrote:

Hello:

Is there a (easy) way to write phonetic
transcriptions using the IPA (International
Phonetic Alphabet) in ConTeXt?  I can't find any
reference to it in the documentation.



Hello:

Is there a (easy) way to write phonetic
transcriptions using the IPA (International
Phonetic Alphabet) in ConTeXt?  I can't find any
reference to it in the documentation.


I did that some time ago, but I can speak only for macOS. You want to
have:

- fonts supporting phonetic symbols (both in the text editor and for the
  output);
- an IPA keyboard layout;
- a good text editor;
- good international support from the OS.

I used Charis SIL (for the fonts) and SF Mono (macOS fixed-width font)
in the text editor. Keyboard layouts can be found here:


Sorry, this is the right link:

http://scripts.sil.org/cms/scripts/page.php?item_id=UniIPAKeyboard

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] IPA transcription

2017-03-23 Thread Nicola

On 23/03/2017 14:49, Angel M Alganza wrote:

Hello:

Is there a (easy) way to write phonetic
transcriptions using the IPA (International
Phonetic Alphabet) in ConTeXt?  I can't find any
reference to it in the documentation.


> Hello:
>
> Is there a (easy) way to write phonetic
> transcriptions using the IPA (International
> Phonetic Alphabet) in ConTeXt?  I can't find any
> reference to it in the documentation.

I did that some time ago, but I can speak only for macOS. You want to
have:

- fonts supporting phonetic symbols (both in the text editor and for the
  output);
- an IPA keyboard layout;
- a good text editor;
- good international support from the OS.

I used Charis SIL (for the fonts) and SF Mono (macOS fixed-width font)
in the text editor. Keyboard layouts can be found here:

http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi_id=ipa-sil_keyboard

The text editor I use is (Mac)Vim, which has very good Unicode support.
Finally, you configure the OS to easily switch between keyboards
layouts. In macOS, you go to System Preferences > Keyboard > Input
Sources and select the desired keyboard layout, including the IPA
layout, then check “Show input in menu bar”. Then you go to Shortcuts >
Input Sources and configure your preferred key combo to switch between
keyboard layouts.

In my workflow, I was keeping the keyboard viewer opened and typing the
phonetic symbols directly, switching back and forth between English and
IPA keyboards. After a while, it becomes quite natural and you don't
even need to look at the keyboard viewer any longer.

On the ConTeXt side, nothing special is required. This is a simple
example (your newsreader may not render the phonetic symbols):

\definefontfamily [mainface] [rm] [Charis SIL]
\setupbodyfont[mainface]
\starttext
naujas, -a & [ˈnɑʊjɑs], [nɑʊˈjɑ] & new & \\
draugas (m) & [ˈdrɑʊɡɑs] & friend & \\
susitikimas (m) & [sʊsʲɪtʲɪˈkʲɪmɑs] & meetinɡ & \\
irgi & [ˈɪrɡʲɪ] & also  & aš irgi esu studentas (I'm a student, too) \\
gyventi & [ɡʲiːˈʋʲɛːntʲɪ] & to live & aš gyvenu Italijoje  (I live in 
Italy) \\

butas (m) & [ˈbʊtɑs] & flat, apartment & \\
motina (f) & [ˈmoːtʲɪnaː] & mother & \\
mergaitė (f) & [mʲɛrˈɡɑɪtʲeː] & girl & \\
ruošti & [ˈrʊoːʃʲtʲɪ] & to prepare & \\
dirbti & [ˈdʲɪrbʊ] & to work & \\
norėti & [noˈrʲeːtʲɪ] & to want & \\
rašyti & [rɑˈʃʲiːtʲɪ] & to write &  \\
skaityti & [skɑɪˈtʲiːtʲɪ] & to read & \\
sportuoti & [sporˈtu:otʲɪ] & to go in for sport & \\
keliauti & [kʲɛˈlʲɑʊtʲɪ] & to travel & \\
pasivaikščioti & [pɑsʲɪˈʋɑɪkʃʲtʃʲotʲɪ] & to go for a walk &\\
universitetas (m) & [unʲɪʋʲɛrʲsʲɪˈtʲɛtɑs] &  university & \\
mėgti & [ˈmʲeːɡtʲɪ] & to like & \\
manyti  & [mɑˈnʲiːtʲɪ] & to think & \\
žinoti & [ʒʲɪˈnoːtʲɪ] & to know & \\
\stoptext


Happy TeXing!
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Suddenly, my font is not used any longer

2017-02-21 Thread Nicola

On 20/02/2017 18:16, Aditya Mahajan wrote:

On Mon, 20 Feb 2017, Nicola wrote:


Hello everyone,
I am re-typesetting a mkiv document that uses system fonts for text and
math (through \definefontfamily). Suddenly, it renders Latin Roman for
the text. May it be a cache corruption problem? I recall that there's
a command to clear the font cache, but I cannot remember which.


mtxrun --script fonts --reload --force


Thanks, that did the trick!

I realize that I should have read mtxrun's help more carefully:

1. `mtxrun --help` tells me how to list all the scripts;
2. `mtxrun --script` tells me that there is a `fonts` script;
3. `mtxrun --script fonts --help` tells me the fonts script's options.

It's nearly as fast as posting to this list and getting a reply ;)

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Suddenly, my font is not used any longer

2017-02-20 Thread Nicola

Hello everyone,
I am re-typesetting a mkiv document that uses system fonts for text and
math (through \definefontfamily). Suddenly, it renders Latin Roman for
the text. May it be a cache corruption problem? I recall that there's
a command to clear the font cache, but I cannot remember which.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Vertical space around displayed formulas

2017-01-18 Thread Nicola

On 18/01/2017 17:53, Otared Kavian wrote:

Hi Nicola,

In fact, if you are in a hurry and don’t use subtle things
introduced  since May 2016, you can use the stable version of ConTeXt from 
TeXLive
2016 (the bug noticed by Mikael, and you, is absent from that version of 
ConTeXt).


Thanks, that's what I am doing now. Strangely enough, it fixes the
layout for all the slides, *except* the one I have posted before. But
that one I can easily fix.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Vertical space around displayed formulas

2017-01-18 Thread Nicola

On 18/01/2017 16:53, Otared Kavian wrote:

Hi Nicola,

Indeed there is a recent bug, reported by Mikael Sundqvist a few days ago, and 
Hans is aware of this.
Hans said in the next release of ConTeXt beta the issue will be fixed.


Sorry, I hadn't noticed the other thread. I'll wait for the next beta then.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Vertical space around displayed formulas

2017-01-18 Thread Nicola

Hello,
has something been changed in the last few months in the vertical
spacing of displayed formulas, frames or other environments?

I am re-typesetting some presentations using the latest beta and the
content of slides (especially those containing formulas) now tends to
flow to the next page, while before it used to fit in one page.

I paste below an example, if that helps. I am using a system font,
so you may not be able to reproduce my problem without it.

Is there something I should change in my documents?

Nicola

%%
\setuppapersize[S6][S6]

\setuplayout[
  width=middle,
  height=middle,
  topspace=2mm,
  header=0mm,
  headerdistance=0mm,
  location=singlesided,
  backspace=5mm,
  margin=0mm,
  edgedistance=0mm,
  margindistance=0mm
]

\setupalign[nothyphenated,flushleft]

% Ocean Sunset (color.adobe.com)
\definecolor[colorone][r=0.251, g=0.349, b=0.322]
\definecolor[colortwo][r=0.612, g=0.608, b=0.478]
\definecolor[colorthree]  [r=1.0,   g=0.827, b=0.576]
\definecolor[colorfour]   [r=1.0,   g=0.592, b=0.310]
\definecolor[colorfive]   [r=0.960, g=0.310, b=0.161] %t=0.8 , a=multiply]
\definecolor[nearlywhite] [s=0.996]

% Fonts
\definefontfamily[slidesfont][serif][Avenir] [
  tf=name:Avenir Light,
  it=name:Avenir Light Oblique,
  bf=name:Avenir Heavy,
  bi=name:Avenir Heavy Oblique
]
\definefontfamily[slidesfont][sans][Avenir] [
  tf=name:Avenir Light,
  it=name:Avenir Light Oblique,
  bf=name:Avenir Heavy,
  bi=name:Avenir Heavy Oblique
]
\definefallbackfamily[slidesfont][mono][Xits][range={"0222A,"02229,"02205}] 
% ∪, ∩, ∅

\definefontfamily[slidesfont][mono][Latin Modern Mono Light][features=none]
\definefallbackfamily[slidesfont][math][Xits][range={"025C7,"27D5}] % 
WHITE DIAMOND, left-join, WHITE RIGHT-POINTING TRIANGLE

\definefontfamily[slidesfont][math][TeX Gyre Pagella Math]

\setupbodyfont[slidesfont]

% Foreground/background color
\setupcolors[textcolor=colorone]
\setupbackgrounds[page][background=color, backgroundcolor=nearlywhite]

% Header
\startreusableMPgraphic{header:background}
  fill OverlayBox
leftenlarged BackSpace
rightenlarged CutSpace
topenlarged TopSpace
withcolor OverlayColor ;
  setbounds currentpicture to OverlayBox
enlarged max(BackSpace,CutSpace) ;
\stopreusableMPgraphic

\defineoverlay[header:background][\reuseMPgraphic{header:background}]

\define[2]\MySlide{\framed[
  frame=off,
  background=header:background,
  backgroundcolor=colorfive,
  width=\textwidth,
  align=flushleft
]{#2}}

\definehead[slide][subject]
\setuphead[slide][
  style=\ssb,
  command=\MySlide,
  color=nearlywhite,
  insidesection=\doifnot{\structureuservariable{align}}{top}\vfill,
  aftersection=\doifnot{\structureuservariable{align}}{top}\vfill,
  page=yes,
]

% Footer
\setuppagenumbering[location=]
\setupfooter[style=small, color=colortwo]
\setupfootertexts[][\userpagenumber/\lastuserpage]

% Lists
\startuseMPgraphic{itemize:main}
  save p; path p;
  p := fullcircle scaled 1.5ExHeight;
  fill p withcolor \MPcolor{colorfive};
\stopuseMPgraphic

\startuseMPgraphic{itemize:nested}
  save p; path p;
  p := ((0,-0.5)--(0,0.5)--(0.866,0)--cycle) scaled 1.5ExHeight;
  fill p withcolor \MPcolor{colorfive};
\stopuseMPgraphic

\definesymbol[itemize:main][\useMPgraphic{itemize:main}]
\definesymbol[itemize:nested][\useMPgraphic{itemize:nested}]

\setupitemize[1][symbol=itemize:main]
\setupitemize[2][symbol=itemize:nested, width=1.5ex]
\setupitemize[2][nowhite]

\setupitemize[
  headstyle=\ssa,
  headcolor=colorfive,
  afterhead={\blank[none]},
  inbetween={\blank[big]},
  leftmargin=1em,
  rightmargin=1em,
]

% Tables
\setuptables[rulethickness=0.06em]

\setupinteraction[state=start,  % make hyperlinks active, etc.
  style=\tf,
  color=colortwo,
  title={What Do You Mean, “Null”?},
  author={Nicola Vitacolonna},
  keyword={null}]

% \usebtxdataset[main.bib]
% \usebtxdefinitions[apa]
\setupcombinations[distance=3cm,location=top]
\defineframedcontent[tablebackground][frame=off,background=color,backgroundcolor=colorthree]
\setuptables[rulethickness=0.06em,frame=tablebackground]

\setupalign[nothyphenated,flushleft]

\defineparagraphs[twocol][n=2]
\setupparagraphs[twocol][1][width=.7\textwidth]


\starttext
\switchtobodyfont[17.3pt]

\startslide[title={Which Nulls?}][align=top]
  All of the above may be abstracted into three categories:

  \startitemize[packed]
\item
Exists, but unknown ({\bf missing value})
\startformula
  \exists x\,\hbox{Yalta}(\hbox{Winston},x,\hbox{Churchill})
\stopformula
\item
Nonexistent, not applicable ({\bf inapplicable null})
\startformula
  \neg\exists x\,\hbox{Yalta}(\hbox{Winston},x,\hbox{Churchill}) \land
  \hbox{Yalta}_{-2}(\hbox{Winston},\hbox{Churchill})
\stopformula
\item
Not known to exist ({\bf no-information null})
\startformula
  \hbox{Yalta}_{-2}(\hbox{Winston},\hbox{Churchill})
\stopformula
  \s

Re: [NTG-context] Vim wiki page updated

2016-11-05 Thread Nicola

On 02/11/2016 23:35, Aditya Mahajan wrote:

On Wed, 2 Nov 2016, Nicola wrote:



I could maybe create a GitHub repository, to make it easier to merge
your work.


That will be nice. Then I can also send you pull requests for specific
things.


Here it is: https://github.com/lifepillar/vim-context-metapost

The updates to the above repository will be periodically forwarded
for inclusion in Vim.

You may use the issue tracker at GitHub to suggest improvements or
report bugs (I have already included a syntax highlighting enhancement
suggested by Wolfgang Schuster). Pull requests are welcome, too!

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Vim wiki page updated

2016-11-05 Thread Nicola

On 05/11/2016 15:45, Alan Braslau wrote:

Hans, Nicola,

Being a vim user (and not presently taking much advantage of the syntax 
highlighting), and a MP fan, I will take care of this (in coordination with 
Hans, eventually).

Alan


For what is worth, I attach the Ruby script I am using. It outputs the 
keywords in a format that can be used directly in Vim.


Nicola
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

# Copyright (c) 2016 Lifepillar
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

VERSION = '1.0.0'

def debug title, *info
  return unless $DEBUG
  puts "\033[1;35m[DEBUG]\033[1;39m #{title}\033[0m"
  info.each do |chunk|
chunk.each_line do |l|
  puts "\033[1;35m[DEBUG]\033[0m #{l.chomp!}"
end
  end
end

def help; <<-HELP
Usage: parse_metafun [ ...]
Options:
-h, --help   Show this help message and exit.
--versionPrint version and exit.
--debug  Enable debugging.

Example:
parse_metafun mp-tool.mp mp-step.mp
  HELP
end

# Parse options
paths = []
n = ARGV.length
i = 0
while i < n
  case ARGV[i]
  when /^--version$/
puts VERSION
exit(0)
  when /^--debug$/
$DEBUG = true
  when /^-h|--help$/
puts help
exit(0)
  else # Assume it is a path
paths << ARGV[i]
  end
  i += 1
end

if paths.empty?
  paths << Dir.entries(".")
end

maxlinelen = 52
defs = {}
saved_vars = {}
known_commands = [
]
known_constants = [
]
known_defs = [
]
known_primary_defs = [
]
known_secondary_defs = [
]
known_tertiary_defs = [
]
known_vardefs = [
]
known_num_exps = [
]
known_types = [
]
false_positives = [
  'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', # just to be safe
  'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', # just to be safe
  'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', # just to be safe
]
types = 'boolean|color|cmykcolor|numeric|pair|path|pen|picture|rgbcolor|string|transform'
types += '|' + known_types.join('|')

begin
  paths.each do |p|
name = File.basename(p)
defs[name] = {
  'mpCommand' => [],
  'mpDef' => [],
  'mpVardef' => [],
  'mpPrimaryDef' => [],
  'mpSecondaryDef' => [],
  'mpTertiaryDef' => [],
  'mpNewInternal' => [],
  'mpNumExp' => [],
  'mpType' => [],
  'mpVariable' => [],
  'mpConstant' => [],
  'LET' => []
}
saved_vars[name] = []
File.open(p).each_line do |l|
  next if l =~ /^\s*%/ # skip comments
  /^[^%]*\bdef\s+(\w+)/.match(l) { |m|
if m[1] !~ /^_|_$/
  defs[name]['mpDef'] << m[1]
end
  }
  /^[^%]*\bvardef\s+(\w+)/.match(l) { |m|
if m[1] !~ /^_|_$/
  defs[name]['mpVardef'] << m[1]
end
  }
  /^[^%]*\bprimarydef\s+\w+\s+(\w+)/.match(l) { |m|
if m[1] !~ /^_|_$/
  defs[name]['mpPrimaryDef'] << m[1]
end
  }
  /^[^%]*\bsecondarydef\s+\w+\s+(\w+)/.match(l) { |m|
if m[1] !~ /^_|_$/
  defs[name]['mpSecondaryDef'] << m[1]
end
  }
  /^[^%]*\btertiarydef\s+\w+\s+(\w+)/.match(l) { |m|
if m[1] !~ /^_|_$/
  defs[name]['mpTertiaryDef'] << m[1]
end
  }
  l.scan(/\bnewinternal\b\s+([^;]+);/).each { |m|
m[0].split(/,/).each { |w|
  w.strip!
if w !~ /^_|_$/
defs[name]['mpNewInternal'] << w
  end
}
  }
  /^[^%]*\blet\s+(\w+)/.match(l) { |m|
if m[1] !~ /^_|_$/
  if !false_positives.include?(m[1])
if known_constants.include?(m[1])
  defs[name]['mpConstant'] << m[1]
elsif known_types.include?(m[1])
  defs[name]['mpType'] << m[1]
elsif known_defs.include?(m[1])
  defs[name]['mpDef'] << m[1]
elsif known_vardefs.include?(m[1])
  defs[name]['mpVardef']

Re: [NTG-context] Vim wiki page updated

2016-11-03 Thread Nicola

On 03/11/2016 12:28, Hans Hagen wrote:


if you need a command list .. there are scripts for that (no vim yet,
but for scite we ship simple lists of commands)


Are these scripts available somewhere?


what kind of datafile do you need?


I need the list of all macros, vardefs, internals, and global variables
from all MetaFun files. The format should be Vim's syntax format:

https://github.com/vim/vim/blob/master/runtime/syntax/mp.vim

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Vim wiki page updated

2016-11-03 Thread Nicola

On 03/11/2016 10:45, Hans Hagen wrote:

On 11/2/2016 11:35 PM, Aditya Mahajan wrote:

On Wed, 2 Nov 2016, Nicola wrote:


The syntax scripts in Vim already cover all of MetaFun. MetaFun
keywords are highlighted by default inside ConTeXt documents; for
MetaPost files ('mp' filetype), you must put

  let g:mp_metafun_macros = 1

into your vimrc.


Ah, great!


if you need a command list .. there are scripts for that (no vim yet,
but for scite we ship simple lists of commands)


Are these scripts available somewhere?

I've rolled out my own, but I will happily use/adapt something "more 
official".



> The indent file is adapted from (I think) latex-suite's indent file
with
> modificiations that suit my taste. I am not sure these should go into
> the default vim indent file, but it may be worthwhile for you to
take a
> quick look.

MetaPost indentation is tough. I have rewritten the indent script in
Vim from scratch, and now it works reasonably well. I will try yours,
but you might try the one currently in Vim, too.


I did not change metapost indenting, but defined some rules for
indenting of context files. I believe that your indent file does not
attempt to indent context files (I may be mistaken because I am just
reading the .vim files, not testing it as I don't have vim8 yet).


Correct, no indentation for ConTeXt. This is something that may be worth 
adding.



I could maybe create a GitHub repository, to make it easier to merge
your work.


That will be nice. Then I can also send you pull requests for specific
things.


Ok, I'll let you know when I've done it. Pull requests will make my life 
much easier :)


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Vim wiki page updated

2016-11-02 Thread Nicola

On 02/11/2016 19:39, Aditya Mahajan wrote:
> On Tue, 1 Nov 2016, Nicola wrote:
>
>> I have updated the Vim page at ConTeXt Garden:
>>
>> http://wiki.contextgarden.net/Vim
>>
>> It may be considered as the official documentation of the ConTeXt
>> scripts in Vim, as the only other documentation is the source code
>
> Hi Nicola,
>
> I wonder if you have seen my vim runtime files:
> https://github.com/adityam/vim-context

Unfortunately not, I worked only on those already in Vim.

> The main file to look at is the syntax highlighting file. I haven't
> compared
> carefully with your version (haven't installed vim 8 yet), but there 
are a

> few differences. It may be worthwhile to merge the two syntax files.

Ok, I will take a look. I see that your file does not depend on 
plaintex.vim. It might be a good idea to remove that dependency...


> The metapost syntax highlighting file defines a few keywords that are
> used by
> metafun. Could these be merged to your mp syntax highlighting file?

The syntax scripts in Vim already cover all of MetaFun. MetaFun keywords 
are highlighted by default inside ConTeXt documents; for MetaPost files 
('mp' filetype), you must put


  let g:mp_metafun_macros = 1

into your vimrc.

> The indent file is adapted from (I think) latex-suite's indent file with
> modificiations that suit my taste. I am not sure these should go into
> the default vim indent file, but it may be worthwhile for you to take a
> quick look.

MetaPost indentation is tough. I have rewritten the indent script in Vim 
from scratch, and now it works reasonably well. I will try yours, but 
you might try the one currently in Vim, too.


> The ftplugin file mainly contains shortcuts like `a expand to α, etc;
> again,
> adapted from latex-suite (which in-turn borred the idea from auctex). 
These

> depend on a ftplugin file provided by latex-suite. There were also a few
> macros to reflow text, but your code is more robust and has more 
features.


I will look into those, too. Do you know that Vim has built-in support 
for digraphs (:h digraphs)? For example, α can be obtained by typing 
a* in Insert mode.


> The compiler file is old and I haven't tested it in a few years, so 
please

> ignore it.

OK.

I could maybe create a GitHub repository, to make it easier to merge 
your work.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Vim wiki page updated

2016-11-01 Thread Nicola

I have updated the Vim page at ConTeXt Garden:

http://wiki.contextgarden.net/Vim

It may be considered as the official documentation of the ConTeXt 
scripts in Vim, as the only other documentation is the source code :)


Happy editing!
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] .mp files in non-standard locations

2016-10-26 Thread Nicola

Hello,
I have some documents that contain:

\startMPinclusions
input "mycode";
\stopMPinclusions

where mycode.mp is somewhere in my project's directory. Is there a way 
to tell ConTeXt how to find it?


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Text editors

2016-10-25 Thread Nicola

On 25/10/2016 22:11, Henning Hraban Ramm wrote:

> On OSX, jEdit is no fun.
> LilyPondTool for jEdit is deprecated (if it still works at all, it 
didn’t for me years ago).
> For LilyPond there’s nothing better than Frescobaldi (except Emacs, 
vi and ed, of course).


I didn't know that (I haven't used jEdit for a while). Too bad.

>> - TextWrangler (shameless plug: I wrote decent syntax support for 
MetaPost/MetaFun);

>
> I’m still using that, too (but switching). Where can we find your 
support files?


http://users.dimi.uniud.it/~nicola.vitacolonna/software/metapost-textwrangler/

MetaFun syntax is outdated, though…

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Text editors

2016-10-25 Thread Nicola

> Hi,
>
> You forgot my favorite editor:
>
> cat > file.tex

Mandatory xkcd at this point: https://www.xkcd.com/378/

> More seriously

I mostly use Vim. I don't know of other ConTeXt-aware editors apart from 
those already in the list, but in the other section I would include:


- jEdit (http://www.jedit.org), good for TeX and LilyPond;

- TextWrangler (shameless plug: I wrote decent syntax support for 
MetaPost/MetaFun);


- Atom (https://atom.io): I have not used it much, but it has lots of 
plugins, so chances are that there is some good TeX stuff.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Text editors

2016-10-24 Thread Nicola

On 24/10/2016 13:41, Henning Hraban Ramm wrote:


How about including the vim support files in the distribution (like the SciTE 
support files)?


Updated scripts for ConTeXt have just been included in Vim:

https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08

so there is no need to include anything in the ConTeXt distribution.

I plan to update the Vim wiki page on ConTeXt Garden when I have some 
time: I will post here when I have done it.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] ANN: Updated Vim scripts for ConTeXt

2016-10-20 Thread Nicola

On 21/10/2016 00:22, Sandiford Kevin wrote:

 Hi  Nicola,

Thanks for the vim scripts, I've been looking for something like this
for a while.

Just a minor problem, on windows the :make or :ConTeXt commands fail if
there is a space in the path or file name.

Changing fnameescape() to shellescape() in the definition of l:makeprg
in line 21 of compiler/context.vim seems to fix this


Good catch, thanks! Could you please try the attached version, which 
should fix that and has other changes?


Please note that in the current version, :make does not `cd` any more 
(that was causing other issues), so you have to do it yourself before 
typesetting (using :cd or :lcd). That said, :ConTeXt should be a better 
option under all circumstances.


Nicola



context.tgz
Description: GNU Zip compressed data
___
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] Parsing ConTeXt errors

2016-10-13 Thread Nicola

On 2016-10-13 18:37:38 +, Hans Hagen said:


On 10/12/2016 9:30 AM, Nicola wrote:

On 2016-10-11 22:13:12 +, Hans Hagen said:


On 10/11/2016 9:37 PM, Nicola wrote:

On 2016-10-11 18:52:32 +, Alan Braslau said:


Of course, I *never* make MetaPost errors... ;-)

However, you can search the log file for
metapost> error:


Sure. But there is no line number. Compare with a typical TeX error:


because there are no lines ... the library gets strings


Would it be possible to report at least the location of the enclosing
\...MP... block?


it will always be the line where such a block ends, i adapted the
message a bit

tex error   > mp error on line 51 in file e:/tmp/oeps.tex:

 >> foo
! Isolated expression.

;
<*> ...draw fullcircle scaled (i) ; endfor ; foo ;

I couldn't find an `=' or `:=' after the
expression that is shown above this error message,
so I guess I'll just ignore it and carry on.

(the extra details at the end will be available in the next luatex
binary as it needs an updated mplibrary).


Looks good, looking forward to trying it!

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

Re: [NTG-context] ANN: Updated Vim scripts for ConTeXt

2016-10-12 Thread Nicola

On 2016-10-12 10:18:10 +, DesdeChaves said:


Thanks a lot.

Autocompletation don't works for me. Perhaps I have a wrong .vimrc 
file. Can you share your .vimrc file or a working .vimrc file.


There is nothing to be configured. The mapping to trigger the 
completion is 

(ctrl-x followed by ctrl-o) and it works inside \startMP...\stopMP... blocks.
Doesn't that work for you?

Maybe you expected the suggestions to pop-up without pressing any key? 
For that, you

need a plugin like NeoComplete or AutoComplPop.

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

Re: [NTG-context] Parsing ConTeXt errors

2016-10-12 Thread Nicola

On 2016-10-11 22:13:12 +, Hans Hagen said:


On 10/11/2016 9:37 PM, Nicola wrote:

On 2016-10-11 18:52:32 +, Alan Braslau said:


Of course, I *never* make MetaPost errors... ;-)

However, you can search the log file for
metapost> error:


Sure. But there is no line number. Compare with a typical TeX error:


because there are no lines ... the library gets strings


Would it be possible to report at least the location of the enclosing
\...MP... block?

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

Re: [NTG-context] Parsing ConTeXt errors

2016-10-11 Thread Nicola

On 2016-10-11 18:52:32 +, Alan Braslau said:


Of course, I *never* make MetaPost errors... ;-)

However, you can search the log file for
metapost> error:


Sure. But there is no line number. Compare with a typical TeX error:

tex error   > tex error on line 210 in file /path/to/main.tex: ! 
Undefined control sequence


l.210 \sdkjdkjhkdkkjk

In the same line you see:

1) the type of error (tex error);
2) the line number;
3) the file in which the error occurs;
4) the error message.

For MetaPost errors, only 1) and 4) are given with the error; 3) may be 
inferred

(by tracking `open source`/`close source` lines). But I see no trace of 2).

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

[NTG-context] Parsing ConTeXt errors

2016-10-11 Thread Nicola

Hello,

I'm trying to parse ConTeXt errors. TeX and Lua errors seem easy to parse
(search for 'tex error' and 'lua error', respectively), but I have a couple of
problems with MetaPost messages.

First, when there are MetaPost errors, context/mtxrun exits with a zero exit
code. Is that intentional?

Second, as far as I see, there is no way to locate the error in the source
from the log. I can only retrieve the file causing the error (by searching for
an 'open source' line - very useful, btw), but no line number.

Am I missing something? I think it would be very useful to have at least an
approximate indication of the position of a MetaPost error.

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

Re: [NTG-context] ANN: Updated Vim scripts for ConTeXt

2016-10-11 Thread Nicola

On 2016-10-11 09:33:36 +, Henning Hraban Ramm said:


Am 2016-10-11 um 09:26 schrieb Nicola <nvitacolo...@gmail.com>:


No, everything just works(tm) :) See :help ftplugin-overrule for the details.


No, unfortunately not everything:

Error detected while processing /Users/hraban/.vim/syntax/context.vim:
line   22:
E121: Undefined variable: v:t_list
E15: Invalid expression: type(s:context_include) ==# v:t_list
Error detected while processing /Users/hraban/.vim/ftplugin/context.vim:
line   18:
E539: Illegal character : formatoptions+=tjcroql2


Maybe my vim is too old?
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 23 2016 20:20:57)


Yes, the scripts are meant to be used with Vim 8. You should be able to
work around those errors by replacing v:t_list with 3 and removing 'j'
from formatoptions, but other things, like asynchronous typesetting,
won't work anyway.

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

Re: [NTG-context] ANN: Updated Vim scripts for ConTeXt

2016-10-11 Thread Nicola

On 2016-10-11 07:26:20 +, Nicola said:


No, everything just works(tm) :)


Ehm, nearly. There was an error in setting the compiler. Please use
the files attached below.

You should be able to typeset the current document synchronously with

 :make

or asynchronously with:

 :ConTeXt

This latter command also accepts an optional path, in case you want
to typeset a document different from the current buffer.

In either case, 'mtxrun' must be in your $PATH. If necessary, you may
set the path explicitly with

 let g:context_mtxrun = '/path/to/mtxrun'

Something like

 let g:context_mtxrun = 
'$PATH=$HOME/context-beta/tex/texmf-osx-64/bin:$PATH mtxrun'


should also work.

Finally, you may check the status of the background jobs with

 :ConTeXtJobStatus

and possibly kill all running jobs with

 :ConTeXtStopJobs

Nicola


context.tgz
Description: Binary data
 ___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] ANN: Updated Vim scripts for ConTeXt

2016-10-11 Thread Nicola

On 2016-10-11 06:39:16 +, Jan Willem Flamma said:


Hi Nicola,

I’m relatively new to Vim and currently run it as installed (MacVIm 8.0 
latest).


Where do I have to place these files in order to use them? (~/.vim 
folder or do I have to copy the individual files into the respective 
Vim application subfolders?)


The files must be copied into ~/.vim. The structure should be:

~/.vim/
 autoload/
   context.vim
 compiler/
   context.vim
 ftplugin/
   context.vim
 indent/
   context.vim
 syntax/
   context.vim

By doing so, Vim will pick up your files instead of its own.

After placing the files, is there anything else that needs to be done 
to ensure Vim picks up these files?


No, everything just works(tm) :) See :help ftplugin-overrule for the details.

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

[NTG-context] ANN: Updated Vim scripts for ConTeXt

2016-10-10 Thread Nicola

Hello,
attached you find an update of the Vim scripts for ConTeXt.
A few highlights:

- jump commands ([[, ]], [{, ]}, ...);

- jump to file included with \project, \component, etc... by typing
 gf when the cursor is above the filename;

- tp (TeX paragraph) text object (e.g., use gqap to reflow a paragraph);

- i$ and a$ text objects;

- better integration with MetaPost (indentation and autocompletion
 inside \startMP...\stopMP... works automatically);

- syntax highglighting can be enabled for any nested filetype (MetaPost
 and Lua are enabled by default);

- compiler plugin, supporting mtxrun and Makefiles;

- Asynchronous typesetting with :ConTeXt command.

I plan to submit these changes for inclusion in Vim, but I'd like to
get some feedback, especially re background typesetting and especially
from Windows users.

I recommend to test with Vim 8.0 patch 22 or later.

Nicola


context.tgz
Description: Binary data
 ___
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] Recommendations on presentations

2016-10-05 Thread Nicola

On 2016-10-05 08:25:03 +, Otared Kavian said:


On 5 Oct 2016, at 07:58, Jan U. Hasecke <juh+ntg-cont...@mailbox.org> wrote:

Hi all,

Keynote is the only software that ties me to MacOS X. I would like to
copy some of its presentations styles to ConTeXt (MKIV).

What is the best way to do this?

I read about simpleslides and looked into the code but I am unsure
whether I start from a simpleslides example.

Is it better to simply define the layout from scratch?


For me, yes. I have found this step-by-step guide good to start with:

https://github.com/adityam/context-slides-example

I may send you my current template, adapted from the above, if you want
(some things there are a bit outdated, if I remember correctly).

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] ANN: Updated Vim scripts for METAFONT/MetaPost

2016-09-18 Thread Nicola

On 2016-09-18 12:09:12 +, luigi scarso said:


On Sun, Sep 18, 2016 at 12:46 PM, Nicola <nvitacolo...@gmail.com> wrote:

Hello,
as a Vim user, I was not satisfied with its support for MetaPost
(especially indenting). I have updated the {mf,mp}.vim scripts
in Vim, which you find attached, and which I have forwarded to
the respective maintainers. Hopefully, they will be included in
a future release of Vim. For the time being, just unpack and put
in your .vim folder.


Thank you very much !


Mini ascii-cast: https://asciinema.org/a/9a101ghqmipqqmw3x61erwmx8

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] ANN: Updated Vim scripts for METAFONT/MetaPost

2016-09-18 Thread Nicola

On 2016-09-18 10:46:44 +, Nicola said:


 I have updated the {mf,mp}.vim scripts in Vim



ConTeXt users will benefit from these scripts, too, inside MetaPost
environments.


Put these lines in ./vim/after/ftplugin/context.vim:

setlocal omnifunc=syntaxcomplete#Complete
let g:omni_syntax_group_include_context_mp='mf\w\+,mp\w\+'

(note the ..._context_mp) and set the filetype of your document as
follows:

:set ft=context.mp

The only drawback is that indentation rules are applied throughout the
whole document, not only to the MetaPost parts. Depending on how many
'if' and 'forever' there are in your novel, it might get annoying.

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] Info about MetaPost

2016-09-09 Thread Nicola

On 2016-09-09 13:21:21 +, luigi scarso said:


On Fri, Sep 9, 2016 at 12:47 PM, Nicola <nvitacolo...@gmail.com> wrote:

Hi,
I write to this mailing list because the MetaPost mailing list has been
silent for a while. I hope it is ok.

I am getting to grips with MetaPost after a long hiatus, so I have not
followed recent developments. I see that the version shipped with
TeX Live 2016 is 1.9991 and that the current maintainer is Luigi.
My questions:

- What is the official MetaPost site (if there is any), with the latest
source (superlec.fr does not seem up to date and I cannot find any
code on CTAN)?

svn at supelec
https://foundry.supelec.fr/scm/viewvc.php/?root=metapost


I should have taken a deeper look. I was misled by the main page:

https://foundry.supelec.fr/projects/metapost/

which still reports 1.902 as the latest release.

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] Info about MetaPost

2016-09-09 Thread Nicola

Hi,
I write to this mailing list because the MetaPost mailing list has been
silent for a while. I hope it is ok.

I am getting to grips with MetaPost after a long hiatus, so I have not
followed recent developments. I see that the version shipped with
TeX Live 2016 is 1.9991 and that the current maintainer is Luigi.
My questions:

- What is the official MetaPost site (if there is any), with the latest
 source (superlec.fr does not seem up to date and I cannot find any
 code on CTAN)?

- Are there any release notes to know what has changed since version 1.90x?

- I know that LuaTeX uses an embedded version of MetaPost. Is that aligned
 with the stand-alone executable (mpost)?

Thanks in advance,
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] Equivalent of extras option in new bibliography system?

2016-07-02 Thread Nicola

On 2016-07-02 00:07:56 +, Alan Braslau said:


On Fri, 1 Jul 2016 19:13:26 +0200
Nicola <nvitacolo...@gmail.com> wrote:


It does not seem to work with my example. The output of the MWE below
is:

(Author, 2016 XXX) (Author, 2016)
The comma seems the culprit.


Yes. Consider:

\cite[righttext={{, p.~24},{, p.~xx}}] [Author:2016,Author2:2015]

The comma gets parsed (as always) to separate multiple right texts,
assigned here to each citation reference.

The solution to your problem is:

\cite[righttext={{, p.~24}}][Author:2016]

Alternately (if you find the {{ }} strange), you can type
\cite[righttext={\btxcomma p.~24}] [Author:2016]

The macro \btxcomma also takes care of spacing.


Great! Thanks all for your help!

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] Equivalent of extras option in new bibliography system?

2016-07-01 Thread Nicola

On 2016-07-01 14:53:00 +, Hans Hagen said:


On 7/1/2016 12:17 PM, Nicola wrote:

In the past (MKII) I used citations of the form:

\cite[extras={, p.~24}][Author:2016]

The extras option seems to be ignored by MKIV's bibliography system.
What is the equivalent of the above?


lefttext=
righttext=


It does not seem to work with my example. The output of the MWE below is:

(Author, 2016 XXX) (Author, 2016)
The comma seems the culprit.

Nicola

\setupinteraction [state=start]
\usebtxdefinitions [apa]

\startbuffer [bib]
@article{Author:2016,
 author={Author},
 year=2016,
}
\stopbuffer
\usebtxdataset [bib.buffer]

\starttext

\cite[righttext={ XXX}][Author:2016] % OK
\cite[righttext={, p.~22}][Author:2016] % Not ok

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

[NTG-context] Equivalent of extras option in new bibliography system?

2016-07-01 Thread Nicola

In the past (MKII) I used citations of the form:

\cite[extras={, p.~24}][Author:2016]

The extras option seems to be ignored by MKIV's bibliography system.
What is the equivalent of the above?

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] Execute ConTeXt script from outside a project's directory

2016-06-19 Thread Nicola

Hello,
I am looking for a way to run ConTeXt from an arbitrary (Unix) directory.
I have tried with --path:

cd /
mtxrun --path /My/Project/Directory --script context main.tex

but that just prints a path and exits:

/Applications/ConTeXt-Beta/tex/texmf-context/scripts/context/stubs/unix/context

Is there a way to specify a project's directory?

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

2016-06-13 Thread Nicola

On 2016-06-13 14:29:37 +, Alan BRASLAU said:


On Mon, 13 Jun 2016 12:38:39 +0200
Nicola <nvitacolo...@gmail.com> wrote:


When I use \cite[Author:2016], the (Author, 2016) in the output is
hyperlinked to the reference. But when I use
\cite[Author1:2016,Author2:2015], the resulting
(Author1, 2016 and Author2, 2015) is not hyperlinked. Is it possible
to get hyperlinks in the latter case, too?


I get multiple hyperlinks for equivalent use.


This is your example adapted to reproduce my problem (I do not
know how to use the buffer in this case, so you have to move the
references into main.bib):

\setupinteraction [state=start]
\setupbibtex[database={main}]
\setuppublications[alternative=apa]

\starttext
\cite[Author1:2016,Author2:2015]
\cite[Author1:2016]
\page
\placepublications[criterium=text]
\stoptext   

Amyway, your example works for me (actually, the layout of the references
turns out even better), so I will switch to using the commands you have
suggested.

Btw, I cannot find any documentation about them in the wiki.

Thanks,
Nicola


You need to send a MWE.
In the case of bibliographies, a MWE can include the .bib dataset in a
buffer, as follows:

\setupinteraction [state=start]
\usebtxdefinitions [apa]

\startbuffer [bib]
@article{Author1:2016,
  author={Author1},
  year=2016,
}
@article{Author2:2015,
  author={Author2},
  year=2015,
}
\stopbuffer
\usebtxdataset [bib.buffer]

\starttext

\cite[Author1:2016,Author2:2015]

\page

\placelistofpublications

\stoptext


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
___ 





___
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] Citations and links

2016-06-13 Thread Nicola

When I use \cite[Author:2016], the (Author, 2016) in the output is hyperlinked
to the reference. But when I use \cite[Author1:2016,Author2:2015], the 
resulting

(Author1, 2016 and Author2, 2015) is not hyperlinked. Is it possible to get
hyperlinks in the latter case, too?

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] Set default background color or pattern for tables

2016-05-30 Thread Nicola

On 2016-05-30 16:45:37 +, Wolfgang Schuster said:


Nicola 30. Mai 2016 um 17:45
I'd like to set a default background color for all the tables in my document.
This is what I have tried (using the latest beta):

\setuptables[background=color,backgroundcolor=red]
\starttext
\starttable[|cm|]
   \HL
   \NC \bf R \NC \AR
   \NC A \NC \AR
   \HL
   \NC \bot  \NC \AR
   \NC 1 \NC \AR
 \stoptable
\stoptext

No red background, though. What am I missing?

The next step would be how to use a hatched pattern, but for now I'd
be happy with a flat color.
The table environment does not support backgrounds but you can use the 
tabulate environment.


\starttext

\defineframedcontent[nicola][frame=off,background=color,backgroundcolor=yellow]

\setuptabulate[frame=nicola]


Thanks, it works! And it does with tables, too. From there, I think I 
know how to use a

MetaPost pattern instead.

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] Set default background color or pattern for tables

2016-05-30 Thread Nicola

I'd like to set a default background color for all the tables in my document.
This is what I have tried (using the latest beta):

\setuptables[background=color,backgroundcolor=red]
\starttext
\starttable[|cm|]
   \HL
   \NC \bf R \NC \AR
   \NC A \NC \AR
   \HL
   \NC \bot  \NC \AR
   \NC 1 \NC \AR
 \stoptable
\stoptext

No red background, though. What am I missing?

The next step would be how to use a hatched pattern, but for now I'd
be happy with a flat color.

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] Error: attempt to perform arithmetic on global 'ex' (a nil value)

2016-05-30 Thread Nicola

I have started to get the error in the subject when typesetting
the following document with recent betas:

\starttext
$P\/$)
\stoptext

Removing \/ (or the parenthesis) fixes the error. Is this a regression?

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] Questions about Scite lexers

2016-04-14 Thread Nicola

On 2016-04-14 05:10:18 +, Christoph Reller said:

On Wed, Apr 13, 2016 at 10:39 PM Christoph Reller 
<christoph.rel...@gmail.com> wrote:

Nicola <nvitacolo...@gmail.com> wrote on Wed., 13. Apr. 2016 19:36:

I have found an old document of mine, which uses a
(slightly customized) pret-c.lua, located inside the project's folder.
It compiles, but I don't get syntax highlighting. Is it because pret-c
is not searched in the project's directory? 

Alternatively you can set the TEXMF_LOCAL environment variable to some 
directory where your "private" texmf-tree resides. Note that after this 
you have to run

    context --generate
in order for context to find the modules in your texmf-tree.
Also note that the compilation logfile written by context tells you 
what modules have been found in which locations.


I hope this helps,

Christoph

Sorry, the environment variable should be named TEXMFLOCAL, without the 
underscore


Thanks for all the suggestions. I will experiment a bit, and come back 
to the mailing list for further questions.


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] Questions about Scite lexers

2016-04-13 Thread Nicola

On 2016-04-13 15:39:57 +, Hans Hagen said:



6) It is my understanding that pret-xxx.lua files are obsolete. Is it
correct? (If so, it would be nice to update the wiki to reflect that).


no, they are not obsolete (the scite lexers are often also syntax
checkers so they are more strict) ... the pret files are more or less
working in the same way (they date from before scite got that kind of
lexers)


Thanks for your answers. I'd like to go with \definetyping then, because
I need /BTEX../ETEX. I have found an old document of mine, which uses a
(slightly customized) pret-c.lua, located inside the project's folder.
It compiles, but I don't get syntax highlighting. Is it because pret-c
is not searched in the project's directory? (According to
http://wiki.contextgarden.net/Verbatim#Pretty_printing the file should
be found.) This is a minimal version:

\setupinteraction  [state=start]
\setupcolors   [state=start]
\setuptyping   [option=color]
\definetyping  [C][option=C, tab=4]
\definecolor   [Ccomment][darkblue]
\definetyping  [CPP]
  [option=C,tab=2,
  bodyfont=small]
\starttext
\startC
int main() { return 0; } // Comment
\stopC
\startCPP
int main() { return 0; } // Comment
\stopCPP
\stoptext

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] Questions about Scite lexers

2016-04-13 Thread Nicola
I'm trying to define a custom scite lexer for a toy language I'm using. 
So far, I've copied a lexer from the distribution, changed its name and 
keywords, and it's all fine. I have a few questions, though:


1) my custom scite-context-lexer-.lua is found only if I put it in 
the distribution. It there a way to have it in my project's folder 
instead?


2) How do I customize colors?

3) Is it possible to embed TeX commands in \startscite..\stopscite 
environments, like /BTEX../ETEX in built-in typing?


4) Are scite lexers documented somewhere besides the source code?

5) May I rely on this feature to be stable?

6) It is my understanding that pret-xxx.lua files are obsolete. Is it 
correct? (If so, it would be nice to update the wiki to reflect that).


To be clear, I'm not interested in using the Scite application. I just 
need to typeset formatted verbatim code. The vim module is fantastic 
and I already use it, but there are cases where I need a syntax not 
supported by Vim (and I'd rather avoid defining it on the Vim side) 
and/or need to embed TeX commands (anywhere, not only in comments).


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] Help with t-vim module and math

2016-04-13 Thread Nicola

On 2016-04-13 13:33:27 +, Wolfgang Schuster said:


Nicola 13. April 2016 um 15:28
On 2016-04-13 12:47:56 +, Wolfgang Schuster said:



Nicola 13. April 2016 um 14:17
On 2016-04-13 11:53:51 +, Hans Hagen said:




Thanks, that works. Unfortunately, DejaVu Sans Mono looks too heavy in 
my document:

is there a light variant?


Also, can't the fallback mechanism be used?
Yes it can but you have to enable your custom typeface with 
\setupbodyfont which

wasn’t done in your example.



You're right, but I have done it in my original document.
Even with that, the fallback symbol does not show up:


\usemodule[vim]
\definefontfamily[slidesfont][mono][Latin Modern Mono Light]
\definefallbackfamily[slidesfont][mono][DejaVu Sans Mono][range={"0222A}]
\definevimtyping[pascal][syntax=pascal]
\setupbodyfont[slidesfont]
\starttext
\startpascal
 X := Y ∪ Z;
\stoppascal
\stoptext

You have to move the fallback setting before the font where you want to 
apply the fallback, i.e.


    \definefallbackfamily […] […] […]
    \definefontfamily […] […] […]



Great, it works!

Thanks to ConTeXt and this mailing list, I've cut down the time to 
prepare a presentation dramatically, while improving its quality and 
avoiding frustration (compared to LaTeX Beamer+listings).


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] Help with t-vim module and math

2016-04-13 Thread Nicola

On 2016-04-13 12:47:56 +, Wolfgang Schuster said:

Nicola 13. April 2016 um 14:17 
On 2016-04-13 11:53:51 +, Hans Hagen said: 



Thanks, that works. Unfortunately, DejaVu Sans Mono looks too heavy in 
my document: 
is there a light variant? 

Also, can't the fallback mechanism be used? 
Yes it can but you have to enable your custom typeface with 
\setupbodyfont which

wasn’t done in your example.


You're right, but I have done it in my original document.
Even with that, the fallback symbol does not show up:

\usemodule[vim]
\definefontfamily[slidesfont][mono][Latin Modern Mono Light]
\definefallbackfamily[slidesfont][mono][DejaVu Sans Mono][range={"0222A}]
\definevimtyping[pascal][syntax=pascal]
\setupbodyfont[slidesfont]
\starttext
\startpascal
X := Y ∪ Z;
\stoppascal
\stoptext

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] Help with t-vim module and math

2016-04-13 Thread Nicola

On 2016-04-13 11:53:51 +, Hans Hagen said:


On 4/13/2016 11:19 AM, Nicola wrote:

Hi,
I am using the Vim module to typeset code, and I've found a situation
where I'd like to use some math symbols, but not in comments. I am not sure
whether it can be done. This is what I have tried:

\usemodule[vim]
\definefontfamily[slidesfont][mono][Latin Modern Mono Light]
\definefallbackfamily[slidesfont][mono][Xits][range={"0222A}]
\definevimtyping[pascal][syntax=pascal]
\starttext
\startpascal
X := Y ∪ Z;
\stoppascal
\stoptext

The ∪ symbol does not appear in the output. Am I completely off-track?


use dejavu mono instead of lm mono


Thanks, that works. Unfortunately, DejaVu Sans Mono looks too heavy in 
my document:

is there a light variant?

Also, can't the fallback mechanism be used?

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] Help with t-vim module and math

2016-04-13 Thread Nicola

Hi,
I am using the Vim module to typeset code, and I've found a situation
where I'd like to use some math symbols, but not in comments. I am not sure
whether it can be done. This is what I have tried:

\usemodule[vim]
\definefontfamily[slidesfont][mono][Latin Modern Mono Light]
\definefallbackfamily[slidesfont][mono][Xits][range={"0222A}]
\definevimtyping[pascal][syntax=pascal]
\starttext
\startpascal
X := Y ∪ Z;
\stoppascal
\stoptext

The ∪ symbol does not appear in the output. Am I completely off-track?

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] Diamond, and Unicode math symbols

2016-03-12 Thread Nicola

On 2016-03-11 20:57:28 +, Hans Hagen said:


On 3/11/2016 9:18 PM, Mikael P. Sundqvist wrote:


I could not find a diamond on p. 112 in my version of the
comprehensive symbol list, but maybe:

\definefontfamily[myface][rm][TeX Gyre Pagella]
\definefallbackfamily[myface][mm][Xits][range={"025C7}]
\definefontfamily[myface][mm][TeX Gyre Pagella Math]

\setupbodyfont[myface]

\starttext
You could try $⋄\quad   ⃟ $ from Pagella or $◇$ from Xits.
\stoptext

There is a nice document, unicode-symbols.pdf you can have a look in
for a list of (unicode) math symbols.


there are s-math-*.mkiv files that can generate all kind of lists

you can run s-mkiv-repertoire.mkiv to get a comparison (at the end of
the file you can see how)

% list here (some 8 fonts) that you have on your system:

\showmathcharacterssetbodyfonts{lucidaot,cambria,xits,modern,pagella,termes,bonum,schola,dejavu} 



\starttext

 \setupbodyfont[pagella,   12pt]

 \showmathfontrepertoire

\stoptext

you can click around (on a decent high res screen)



Hans, Mikael, thanks for your suggestions, all of them valuable.
Borrowing the symbol from Xits is a fine solution.
The comparison tables come in very handy, too.

Thanks again,
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] Diamond, and Unicode math symbols

2016-03-11 Thread Nicola

On 2016-03-10 21:00:21 +, Nicola said:


I'm looking for a symbol similar to \lozenge, but squarer […]
Any idea how I may typeset it in ConTeXt (MKIV)?


Unless I am overlooking something, there is no such symbol in
TeX Gyre Pagella Math, so maybe this is not possible.


2) The list shows a Unicode point for each symbol, but not the
corresponding TeX command (if it exists).


Ok, this is not correct: the command is there, for symbols that
have one. But how do I use symbols with no associated TeX command?

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] Diamond, and Unicode math symbols

2016-03-10 Thread Nicola

I'm looking for a symbol similar to \lozenge, but squarer (like
\Diamond in some LaTeX packages, see The Comprehensive Symbol List,
p. 112). Any idea how I may typeset it in ConTeXt (MKIV)? \diamond
is too small. I am using TeX Gyre Pagella Math if that matters.

I also have a couple of questions about \showmathfontcharacters:

1) does that list show all and only the symbols available in the
current font, or a predefined list of symbols?

2) The list shows a Unicode point for each symbol, but not the
corresponding TeX command (if it exists). Say I need U+02B31
(three leftwards arrows), and I don't want to bother searching
TCSL above.  May I use the Unicode code point to define a control
sequence in ConTeXt that prints the symbol? If so, how?

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] How to avoid overriding a control sequence?

2016-03-07 Thread Nicola

On 2016-03-07 20:16:45 +, Hans Hagen said:


On 3/7/2016 7:40 PM, Nicola wrote:

How do I check in ConTeXt whether a control sequence is already
defined (to avoid redefining it by accident)?

Marginally related to the above, I have tried to use \show, only to
discover, to my surprise, that it gives an error. For example:

\show\NL
\end

Does ConTeXt override some of TeX primitives?


yes, like \month ... but in general if you use uppercase or camelcase
you're quite safe (there are some math symbols with uppercase but if you
define your own commands you will probably not use those) ... mechanisms
like tables that use \NC and so define them local


I see. Local commands are a good idea. I usually use camelcase, but
since I wanted to define some two-letter sequences, I thought I'd
better be cautious.

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] How to avoid overriding a control sequence?

2016-03-07 Thread Nicola

On 2016-03-07 18:47:20 +, luigi scarso said:


On Mon, Mar 7, 2016 at 7:40 PM, Nicola <nvitacolo...@gmail.com> wrote:
How do I check in ConTeXt whether a control sequence is already
defined (to avoid redefining it by accident)?


kind of 

\ifdefined\writebanner \else \unexpanded\def\writebanner{\writestring}     \fi
?


That works, 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] How to avoid overriding a control sequence?

2016-03-07 Thread Nicola

How do I check in ConTeXt whether a control sequence is already
defined (to avoid redefining it by accident)?

Marginally related to the above, I have tried to use \show, only to
discover, to my surprise, that it gives an error. For example:

\show\NL
\end

Does ConTeXt override some of TeX primitives?

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

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?

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

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

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
___

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
___

Re: [NTG-context] Custom syntax highlighting

2016-03-01 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


That's a pretty impressive module, thanks! I didn't know about it.

I have a couple of questions:

1) Vim's SQL highlighting is a bit peculiar, in that a user is allowed to set
a SQL dialect (:h sql-dialects) with SQLSetType or by setting
g:sql_type_default or b:sql_type_override. For example, the effect of putting

   let g:sql_type_default='pgsql'

in my vimrc is that, when a sql buffer is created, Vim searches for
syntax/pgsql.vim instead of the default syntax file (sqloracle.vim, I think).
Note that the filetype remains 'sql'. I have tried to set a SQL dialect inside
a \startvimrc/\stopvimrc block, but without success (if that matters, I have
this plugin in my ~/.vim folder: https://github.com/lifepillar/pgsql.vim).
I have also tried \definevimtyping[SQL][syntax=pgsql], but then I don't get
any highlighting, which makes me think that the module does not search my
~/.vim folder. Does the module work only with syntaxes in core Vim?

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.

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

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

2016-03-01 Thread Nicola

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 :)

If I am not wrong, I'd like to write my own syntax file, but
not starting from scratch. I cannot find any pret-* files in
the beta, though. Should they be downloaded separately?

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] Vim snippets

2016-02-29 Thread Nicola

On 2016-02-22 10:23:40 +, David Nebauer said:


Hi,

Newbie question: are there any vim snippets available for context?


I don't know of any (apart from what has already been posted).
Are you using UltiSnips? Here are a few I am using, adapted from
tex.snippets:

snippet "s(tart)?" "start / stop" br
\start${1:something}
${0:${VISUAL}}
\stop$1
endsnippet

snippet enum "Enumerate" b
\startitemize[n]
\item
   $0
\stopitemize
endsnippet

snippet item "Itemize" b
\startitemize
\item
$0
\stopitemize
endsnippet

snippet it "Individual item" b
\item
$0
endsnippet

IMHO, it takes less to write your own snippets perfectly suited to your
writing style (e.g., I like a newline after each \item) than trying to
understand (sometimes overly complicated) snippets written by others.

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] Disappearing \rrbracket

2016-02-24 Thread Nicola

On 2016-02-24 19:19:19 +, Hans Hagen said:


On 2/24/2016 5:48 PM, Nicola wrote:

I have a problem with the symbol in the subject. This is a
minimal document:

\starttext
$\llbracket x\rrbracket$
$\bigl\llbracket x\bigr\rrbracket$
$\Bigl\llbracket x\Bigr\rrbracket$
$\biggl\llbracket x\biggr\rrbracket$
$\Biggl\llbracket x\Biggr\rrbracket$
\stoptext

Using ConTeXt from TeX Live 2015, \rrbracket is rendered only
in the first case (current beta is ok). Can you reproduce
this? Is there a workaround?


use context from the contextgarden (more recent luatex too)


I have followed the instructions at

   http://wiki.contextgarden.net/Mac_Installation

rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .
sh ./first-setup.sh --context=current --modules=all --engine=luatex

It fails with

! Undefined control sequence.
l.1020 \pdfoutput
\zerocount

in syst-ini.mkiv.

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
___

  1   2   >