Re: [NTG-context] coloring the logfile

2019-08-29 Thread Hans Hagen

On 8/30/2019 1:37 AM, Hans Hagen wrote:

On 8/29/2019 10:58 AM, Taco Hoekwater wrote:

Hi,

FWIW: ConTeXt can already do colours on the terminal:

    context —ansi myfile.tex

(but that currently results in an empty log, I think because there is no
separation)

ok, in next beta:

--ansilog

pipes ansi to console and log and strips ansi from the log afterwards 
which is quite efficient (more than some complex and slower dual code 
path for a fancy feature)


Hans


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

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


Re: [NTG-context] coloring the logfile

2019-08-29 Thread Hans Hagen

On 8/29/2019 10:58 AM, Taco Hoekwater wrote:

Hi,

FWIW: ConTeXt can already do colours on the terminal:

context —ansi myfile.tex

(but that currently results in an empty log, I think because there is no
separation)

btw, i always run in the editor and there is no ansi in the log pane

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

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


Re: [NTG-context] coloring the logfile

2019-08-29 Thread Hans Hagen

On 8/29/2019 10:58 AM, Taco Hoekwater wrote:

Hi,

FWIW: ConTeXt can already do colours on the terminal:

context —ansi myfile.tex

(but that currently results in an empty log, I think because there is no
separation)


probably, i forgot the details (in the middle of somethign else so it 
has to wait) and i have disabled ansi in the console so i need to set 
that up



Since the engine internals know and expose the difference between terminal
and log file already, it is quite possible to split the lua messaging code
into separate 'log' and 'term’ cases, if desired. There is no need to patch
the engine for that, just some extra lua code that Hans has to be willing to
write/include.

However, if support for redirect of stdout is needed (because in that case
the ’term’ in internal TeX speak is not really a terminal), then isatty()
needs to be exposed to Lua in one way or another.


sure btu the problem is that it adds a some overhead as we then have to 
'generate' two messages, one for the console an done for the log



If you want color in the actual log, then someone has to rewrite the log
reporting lua code to generate RTF or HTML. Should technically be doable
as well...


that was actually one of the first things done (decade old code), i.e. 
context can launch a browser on an error or after a run but i gave up on 
using it because there is no way to update automatically so one ends up 
with numerous tabs



BTW, it is not safe to assume that all ttys actually support ansi colours
(remote terminals quite often do not), so a command-line switch would still
be needed.

i did the ansi as a gimmick and never use it (it is also slower)

Hans

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

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


Re: [NTG-context] context --autopdf=auto/default

2019-08-29 Thread Hans Hagen

On 8/29/2019 3:04 PM, Henning Hraban Ramm wrote:


I’d be surprised if there wasn’t a distinction of systems in mtxrun. (Is it in 
mtx-context.lua? I didn’t understand the code.)

it's in l-pdfview.luabut currently we only have a windows / unix split

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

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


Re: [NTG-context] standardmakeup and pages

2019-08-29 Thread Henning Hraban Ramm

> Am 2019-08-29 um 16:58 schrieb mf :
> 
> \setuppagenumbering[
>alternative=doublesided,
> ]
> 
> % use pagestate=start on both makeups only if you want the title page
> % to be the page 1 of the book
> \definemakeup[title-page][align=middle,doublesided=no]

Thank you!

I don’t know why I didn’t look into the command reference myself, sorry. I’m 
probably too tired.

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

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

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


Re: [NTG-context] standardmakeup and pages

2019-08-29 Thread mf

\setuppagenumbering[
alternative=doublesided,
]

% use pagestate=start on both makeups only if you want the title page
% to be the page 1 of the book
\definemakeup[title-page][align=middle,doublesided=no]
\definemakeup[imprint][align=top,page=no]

\starttext

\startmakeup[title-page]
bastard title
\stopmakeup

\startmakeup[imprint]
\vfill
imprint
\stopmakeup

This is the beginning of the book...

\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] standardmakeup and pages

2019-08-29 Thread mf

Il 29/08/19 16:33, Henning Hraban Ramm ha scritto:

\setuppagenumbering[
 alternative=doublesided,
]

\starttext

\startstandardmakeup[align=center]
bastard title
\stopstandardmakeup

\startstandardmakeup[page=left]
\vfill
imprint
\stopstandardmakeup

\stoptext


\setuppagenumbering[
alternative=doublesided,
]

\definemakeup[title-page][align=middle,doublesided=no,pagestate=start]
\definemakeup[imprint][align=top,page=no,pagestate=start]

\starttext

\startmakeup[title-page]
bastard title
\stopmakeup

\startmakeup[imprint]
\vfill
imprint
\stopmakeup

\stoptext

Best wishes,
Massimiliano
___
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] standardmakeup and pages

2019-08-29 Thread Henning Hraban Ramm
Hi again,
in my books I often use \startstandardmakeup for the initial pages.
A typical use case is a bastard title (half-title) on the first page and the 
copyright information (imprint) on the second, like in this MWE:

\setuppagenumbering[
alternative=doublesided,
]

\starttext

\startstandardmakeup[align=center]
bastard title
\stopstandardmakeup

\startstandardmakeup[page=left]
\vfill
imprint
\stopstandardmakeup

\stoptext

With a doublesided layout, the second (left) page is preceded by two empty 
pages.
How can I avoid that?


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

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

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


Re: [NTG-context] context --autopdf=auto/default

2019-08-29 Thread Henning Hraban Ramm
> Am 2019-08-29 um 11:51 schrieb Taco Hoekwater :
>> On 29 Aug 2019, at 11:40, Henning Hraban Ramm  wrote:
>> 
>> Hans, could you use "xdg-open" for "—autopdf=auto" on Linux?
>> That’s more or less the same as "open" on MacOS.
>> 
>> On Windows it’s 'start "" ""' (empty quotes for default program), 
>> don’t know if that’s implemented.
>> 
>> 
>> "default" is apparently "pdfopen", that doesn’t work on MacOS, at least on 
>> my system I get:
>> 
>> dyld: Library not loaded: /usr/X11/lib/libX11.6.dylib
>> Referenced from: /Users/hraban/Library/texmf/tex/texmf-osx-64/bin/pdfopen
>> Reason: image not found
>> Abort trap: 6
> 
> You need XQuartz installed for pdfopen to even start on MacOS. But it would 
> still
> likely fail with ‘acroread startup failed’, because it is seriously outdated 
> by now.

I have XQuartz, of course, but not the outdated Apple version or any other in 
/usr/X11/lib, but the MacPorts version in /opt/local/lib (and a few within some 
Apps).

Adobe Acrobat Reader DC doesn’t use X11 and isn’t callable as acroread, but 
only as /Applications/Adobe\ Acrobat\ Reader\ DC.app/Contents/MacOS/AdobeReader 
*if* you installed it in /Applications.

I guess you meant acroread on Linux, and there "default" still works.

> Am 2019-08-29 um 11:51 schrieb Floris van Manen :
> 
> On 29-08-19 11:40, Henning Hraban Ramm wrote:
>> Hans, could you use "xdg-open" for "—autopdf=auto" on Linux?
>> That’s more or less the same as "open" on MacOS.
> 
> you could also create an alias for in your .bashrc
> 
> alias open=xdg-open

Right. And also an alias for acroread and/or pdfopen on my Mac.

But since I think it’s useful for a lot of users, I suggest including at least 
xdg-open for "auto" on Linux.

I’d be surprised if there wasn’t a distinction of systems in mtxrun. (Is it in 
mtx-context.lua? I didn’t understand the code.)


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


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

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


Re: [NTG-context] context --autopdf=auto/default

2019-08-29 Thread Floris van Manen


On 29-08-19 11:40, Henning Hraban Ramm wrote:
> Hans, could you use "xdg-open" for "—autopdf=auto" on Linux?
> That’s more or less the same as "open" on MacOS.


you could also create an alias for in your .bashrc

alias open=xdg-open



pEpkey.asc
Description: application/pgp-keys
___
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 --autopdf=auto/default

2019-08-29 Thread Taco Hoekwater
Hi,

> On 29 Aug 2019, at 11:40, Henning Hraban Ramm  wrote:
> 
> Hello again!
> 
> Hans, could you use "xdg-open" for "—autopdf=auto" on Linux?
> That’s more or less the same as "open" on MacOS.
> 
> On Windows it’s 'start "" ""' (empty quotes for default program), don’t 
> know if that’s implemented.
> 
> 
> "default" is apparently "pdfopen", that doesn’t work on MacOS, at least on my 
> system I get:
> 
> dyld: Library not loaded: /usr/X11/lib/libX11.6.dylib
>  Referenced from: /Users/hraban/Library/texmf/tex/texmf-osx-64/bin/pdfopen
>  Reason: image not found
> Abort trap: 6

You need XQuartz installed for pdfopen to even start on MacOS. But it would 
still
likely fail with ‘acroread startup failed’, because it is seriously outdated by 
now.

Best wishes,
Taco

___
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] context --autopdf=auto/default

2019-08-29 Thread Henning Hraban Ramm
Hello again!

Hans, could you use "xdg-open" for "—autopdf=auto" on Linux?
That’s more or less the same as "open" on MacOS.

On Windows it’s 'start "" ""' (empty quotes for default program), don’t 
know if that’s implemented.


"default" is apparently "pdfopen", that doesn’t work on MacOS, at least on my 
system I get:

dyld: Library not loaded: /usr/X11/lib/libX11.6.dylib
  Referenced from: /Users/hraban/Library/texmf/tex/texmf-osx-64/bin/pdfopen
  Reason: image not found
Abort trap: 6


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

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

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


Re: [NTG-context] coloring the logfile

2019-08-29 Thread Taco Hoekwater
Hi,

FWIW: ConTeXt can already do colours on the terminal:

   context —ansi myfile.tex

(but that currently results in an empty log, I think because there is no
separation)

Since the engine internals know and expose the difference between terminal 
and log file already, it is quite possible to split the lua messaging code 
into separate 'log' and 'term’ cases, if desired. There is no need to patch 
the engine for that, just some extra lua code that Hans has to be willing to 
write/include.

However, if support for redirect of stdout is needed (because in that case
the ’term’ in internal TeX speak is not really a terminal), then isatty()
needs to be exposed to Lua in one way or another. 

If you want color in the actual log, then someone has to rewrite the log 
reporting lua code to generate RTF or HTML. Should technically be doable 
as well...

BTW, it is not safe to assume that all ttys actually support ansi colours
(remote terminals quite often do not), so a command-line switch would still 
be needed. 

Best wishes,
Taco


> On 29 Aug 2019, at 10:25, Hans van der Meer  wrote:
> 
>> On 29/08/19 5:35 PM, Henning Hraban Ramm wrote:
>> This will need engine support but is in principle dead easy.
> 
> So it seems doable if someone is willing to provide the engine support. I 
> sincerely hope it will be done. With many thanks, of course.

> 
> dr. Hans van der Meer
> 
> 
>> On 29 Aug 2019, at 09:39, Henri Menke  wrote:
>> 
>> 
>> 
>> On 29/08/19 5:35 PM, Henning Hraban Ramm wrote:
>>> 
 Am 2019-08-28 um 21:54 schrieb Hans van der Meer :
 
 Is it possible to force lines  written in the log with \writestatus to 
 have a specific color? The log can be very substantial and it would be 
 nice to have some lines brought to attention by a different color.
>>> 
>>> As a text file, the log can’t have colors.
>>> 
>>> Only the output to your terminal could have ANSI color codes.
>>> I’d welcome this, too, but then we need additional configuration, color 
>>> breaks easily on some shells, the feature should adhere to the usual shell 
>>> variables etc. Don’t know it it would be worth the effort.
>> 
>> This will need engine support but is in principle dead easy.
>> 
>> #include 
>> 
>> if (isatty(fileno(stdout))) {
>>// color
>> } else {
>>// no color
>> }
>> 
>>> 
>>> Greetlings, Hraban
>>> ---
>>> https://www.fiee.net
>>> http://wiki.contextgarden.net
>>> https://www.dreiviertelhaus.de
>>> GPG Key ID 1C9B22FD
>>> 
>>> ___
>>> If your question is of interest to others as well, please add an entry to 
>>> the Wiki!
>>> 
>>> maillist : ntg-context@ntg.nl / 
>>> http://www.ntg.nl/mailman/listinfo/ntg-context
>>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>> wiki : http://contextgarden.net
>>> ___
>>> 
>> 
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / 
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

Taco Hoekwater
Elvenkind BV




___
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] coloring the logfile

2019-08-29 Thread Hans van der Meer
> On 29/08/19 5:35 PM, Henning Hraban Ramm wrote:
> This will need engine support but is in principle dead easy.

So it seems doable if someone is willing to provide the engine support. I 
sincerely hope it will be done. With many thanks, of course.

dr. Hans van der Meer


> On 29 Aug 2019, at 09:39, Henri Menke  wrote:
> 
> 
> 
> On 29/08/19 5:35 PM, Henning Hraban Ramm wrote:
>> 
>>> Am 2019-08-28 um 21:54 schrieb Hans van der Meer :
>>> 
>>> Is it possible to force lines  written in the log with \writestatus to have 
>>> a specific color? The log can be very substantial and it would be nice to 
>>> have some lines brought to attention by a different color.
>> 
>> As a text file, the log can’t have colors.
>> 
>> Only the output to your terminal could have ANSI color codes.
>> I’d welcome this, too, but then we need additional configuration, color 
>> breaks easily on some shells, the feature should adhere to the usual shell 
>> variables etc. Don’t know it it would be worth the effort.
> 
> This will need engine support but is in principle dead easy.
> 
> #include 
> 
> if (isatty(fileno(stdout))) {
>// color
> } else {
>// no color
> }
> 
>> 
>> Greetlings, Hraban
>> ---
>> https://www.fiee.net
>> http://wiki.contextgarden.net
>> https://www.dreiviertelhaus.de
>> GPG Key ID 1C9B22FD
>> 
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / 
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___
>> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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


Re: [NTG-context] coloring the logfile

2019-08-29 Thread Henri Menke


On 29/08/19 5:35 PM, Henning Hraban Ramm wrote:
> 
>> Am 2019-08-28 um 21:54 schrieb Hans van der Meer :
>>
>> Is it possible to force lines  written in the log with \writestatus to have 
>> a specific color? The log can be very substantial and it would be nice to 
>> have some lines brought to attention by a different color.
> 
> As a text file, the log can’t have colors.
> 
> Only the output to your terminal could have ANSI color codes.
> I’d welcome this, too, but then we need additional configuration, color 
> breaks easily on some shells, the feature should adhere to the usual shell 
> variables etc. Don’t know it it would be worth the effort.

This will need engine support but is in principle dead easy.

#include 

if (isatty(fileno(stdout))) {
// color
} else {
// no color
}

> 
> Greetlings, Hraban
> ---
> https://www.fiee.net
> http://wiki.contextgarden.net
> https://www.dreiviertelhaus.de
> GPG Key ID 1C9B22FD
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___
> 

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