Re: [NTG-context] Weird print(\n...) error

2012-11-03 Thread Peter Münster
On Fri, Nov 02 2012, Procházka Lukáš wrote:

 print(\nT)

  print(\n .. T)


 Any explanation?

\nT is an unknown command.

-- 
   Peter
___
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] RFC: path relative to current file.

2012-11-03 Thread Sietse Brouwer
Andreas wrote:
 It would be REALLY NICE if the functionality of pathrelativetome was
 provided by ConTeXt.

Hans wrote:
 in file-job.lua add around the function 'process':

 local function toppath()
 [...]

 \component toppath:/subpath/somefile.tex

Andreas wrote:
 Works like a charm, Hans! Sorry I took so long to test...
 I copied file-job.lua from the GIT repository, and changed my tex
 files to use toppath:/path/to/file.

Will this be in the core, or is it just a fix for Andreas? I.e: should
we document toppath() as a core command, or as a snippet?
(Not that we have a general space on the wiki for snippets yet, but we
need one and we will have one. Somethine in the next two weeks I'll
write a State of the Wiki laying out what we have, what we don't
have, and what we want next.)

--Sietse
___
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] System variable HOME

2012-11-03 Thread Sietse Brouwer
 it seems that Ctx [re]defines the system variable HOME on its run;

This is not an answer, but a guess: Could it be that your interactive
shell uses one setting, and the non-interactive shell uses another?
I'm only guessing here, I don't know much about Windows
administration; I just remember being driven to despair by a similar
'these settings are not used if the shell is not interactive' problem
under Linux.

--Sietse
___
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] RFC: path relative to current file.

2012-11-03 Thread Hans Hagen

On 11/3/2012 10:13 AM, Sietse Brouwer wrote:

Andreas wrote:

It would be REALLY NICE if the functionality of pathrelativetome was
provided by ConTeXt.


Hans wrote:

in file-job.lua add around the function 'process':

local function toppath()
[...]

 \component toppath:/subpath/somefile.tex


Andreas wrote:

Works like a charm, Hans! Sorry I took so long to test...
I copied file-job.lua from the GIT repository, and changed my tex
files to use toppath:/path/to/file.


Will this be in the core, or is it just a fix for Andreas? I.e: should
we document toppath() as a core command, or as a snippet?
(Not that we have a general space on the wiki for snippets yet, but we
need one and we will have one. Somethine in the next two weeks I'll
write a State of the Wiki laying out what we have, what we don't
have, and what we want next.)


in the core .. it's a prefix

just look in data-pre.lua for some more of them

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Weird print(\n...) error

2012-11-03 Thread luigi scarso
On Fri, Nov 2, 2012 at 10:12 PM, Procházka Lukáš l...@pontex.cz wrote:

 Hello,

 I encountered a weird error.

 The following code prints correctly to the console:

 
 \starttext
   \startluacode
 print(\n@T)
   \stopluacode

   Abc
 \stoptext
 

 Gives correct:

 
 ...
 fontsvirtual math  unable to resolve name mapsfromchar
 fontsfallback modern rm 12pt is loaded

 @T
 backend  xmp  using file 'c:/ConTeXt/tex/texmf-context/**
 tex/context/base/lpdf-pdx.xml'
 ...
 

 But the following code fails (?!):

 
 \starttext
   \startluacode
 print(\nT)
   \stopluacode

   Abc
 \stoptext
 

 With:

 
 ...
 fontsfallback modern rm 12pt is loaded
 ! Undefined control sequence.

 system   tex  error on line 4 in file D:/Lukas/ConTeXt/Test/Env3/
 **Test.mkiv: Undefined control sequence ...

 1 \starttext
 2   \startluacode
 3 print(\nT)
 4 \stopluacode
 5
 6   Abc
 7 \stoptext
 8

 print(\nT
)
 \luat_start_lua_code_indeed ...tlua \zerocount {#1
   }}
 l.4   \stopluacode
 ...
 

 Any explanation?

It's about catcode. You can the difference with
\loggingall
\startluacode
 context(\n@T)
  \stopluacode
\stoptext

and
\loggingall
\startluacode
 context(\nT)
  \stopluacode
\stoptext


-- 
luigi
___
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] A problem with autopunctuation

2012-11-03 Thread Andres Conrado
In dont't really know why you think it should render differently.
Everything TeX is supposed to ignore white spaces in math, AFAIK.
If you want a space in math, you need to force it, like this:

\setupmathematics[autopunctuation=yes]

\starttext

$(2,\ 5)$ versus $(2,\ 5)$

\stoptext

Best,

Andrés Conrado Montoya
El Andi
andresconr...@gmail.com
http://chiquitico.org

Los fines no justifican los medios, porque la medida verdadera de nuestro
carácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.

Por favor, evite enviarme documentos adjuntos en formato Word o PowerPoint.
Lea http://www.gnu.org/philosophy/no-word-attachments.es.html

Naturalmente, la gente normal no desea la guerra, pero al final son los
líderes de una nación quienes determinan su política, y resulta muy
sencillo doblegar a la gente, sea una democracia, una dictadura fascista,
un parlamento o una dictadura comunista. Con voz o sin voz, la gente
siempre podrá entregarse a la voluntad de sus líderes. Es fácil. Lo único
que hay que hacer es decirles que están siendo atacados, y denunciar a los
pacifistas por su falta de patriotismo y exponer el país al peligro.
Funciona igual en todos los países.
---Hermann Goering, en los juicios de Nuremberg.


2012/11/3 ntg-context-requ...@ntg.nl

 Send ntg-context mailing list submissions to
 ntg-context@ntg.nl

 To subscribe or unsubscribe via the World Wide Web, visit
 http://www.ntg.nl/mailman/listinfo/ntg-context
 or, via email, send a message with subject or body 'help' to
 ntg-context-requ...@ntg.nl

 You can reach the person managing the list at
 ntg-context-ow...@ntg.nl

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of ntg-context digest...


 Today's Topics:

1. Re: RFC: path relative to current file. (Andre Caldas)
2. A problem with autopunctuation (Marcin Borkowski)
3. Re: Weird print(\n...) error (Peter M?nster)
4. Re: RFC: path relative to current file. (Sietse Brouwer)


 --

 Message: 1
 Date: Fri, 2 Nov 2012 22:35:29 -0200
 From: Andre Caldas andre.em.cal...@gmail.com
 To: Hans Hagen pra...@wxs.nl
 Cc: mailing list for ConTeXt users ntg-context@ntg.nl
 Subject: Re: [NTG-context] RFC: path relative to current file.
 Message-ID:
 CADVh14X0wb-2f7uRzb8Jo5jDE9n3ha0iyTLYBPB=vRf=
 dwn...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8

 Hello!

  It would be REALLY NICE if the functionality of pathrelativetome was
  provided by ConTeXt.
 
  in file-job.lua add around the function 'process':
 
  local function toppath()
  [...]
 
  \component toppath:/subpath/somefile.tex

 Works like a charm, Hans! Sorry I took so long to test...
 I copied file-job.lua from the GIT repository, and changed my tex
 files to use toppath:/path/to/file.

 For example:

 https://bitbucket.org/andrecaldas/math-video-classes/src/b743f22e4f567662ac55c1ac7dc1b6d13362e11d/src/products/assorted.tex?at=default

 Really nice! Thanks!! :-)


 Cheers,
 Andr? Caldas.


 --

 Message: 2
 Date: Sat, 3 Nov 2012 01:45:45 +0100
 From: Marcin Borkowski mb...@wmi.amu.edu.pl
 To: ConTeXt mailing list ntg-context@ntg.nl
 Subject: [NTG-context] A problem with autopunctuation
 Message-ID: 20121103014545.02b8dd5f@aga-netbook
 Content-Type: text/plain; charset=US-ASCII

 If I get it correctly, the following two formulae should render
 differently - and they don't.  What is going on?

 \setupmathematics[autopunctuation=yes]

 \starttext

 $(2,5)$ versus $(2, 5)$

 \stoptext

 Best,

 --
 Marcin Borkowski
 http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
 Adam Mickiewicz University


 --

 Message: 3
 Date: Sat, 03 Nov 2012 08:47:33 +0100
 From: Peter M?nster pmli...@free.fr
 To: mailing list for ConTeXt users ntg-context@ntg.nl
 Subject: Re: [NTG-context] Weird print(\n...) error
 Message-ID: 877gq33z6y@micropit.couberia.selfip.net
 Content-Type: text/plain; charset=utf-8

 On Fri, Nov 02 2012, Proch?zka Luk?? wrote:

  print(\nT)

   print(\n .. T)


  Any explanation?

 \nT is an unknown command.

 --
Peter


 --

 Message: 4
 Date: Sat, 3 Nov 2012 11:13:35 +0100
 From: Sietse Brouwer sbbrou...@gmail.com
 To: mailing list for ConTeXt users ntg-context@ntg.nl
 Cc: Hans Hagen pra...@wxs.nl
 Subject: Re: [NTG-context] RFC: path relative to current file.
 Message-ID:
 CAF=
 dkzy9s5uuxfqv5quq1pybtcgglam9rwk-rtd3iaxekp6...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8

 Andreas wrote:
  It would be REALLY NICE if the functionality of pathrelativetome was
  provided by ConTeXt.

 Hans wrote:
  in file-job.lua add around the function 'process':
 
  local function toppath()
  [...]
 
  

Re: [NTG-context] A problem with autopunctuation

2012-11-03 Thread Marcin Borkowski
Dnia 2012-11-03, o godz. 14:04:30
Andres Conrado ela...@chiquitico.org napisał(a):

 In dont't really know why you think it should render differently.
 Everything TeX is supposed to ignore white spaces in math, AFAIK.

Yep, but that's no TeX!  Take a look at math-ini.mkiv, lines 873nn.

 Best,
 
 Andrés Conrado Montoya
 El Andi
 andresconr...@gmail.com
 http://chiquitico.org

Best,

-- 
Marcin
___
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] Is http://source.contextgarden.net/ down? [EOM]

2012-11-03 Thread Marcin Borkowski


-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
___
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] Pretty-printing ConTeXt sources

2012-11-03 Thread Marcin Borkowski
Hi all,

I asked the very same question some time ago, but back then got an
MkII (texexec-based) answer.  So: how do I typeset ConTeXt MkIV sources?
Is the procedure different for .tex, .mkiv, .mkvi, .lua files?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
___
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] Is http://source.contextgarden.net/ down? [EOM]

2012-11-03 Thread Rogers, Michael K
I cannot get to it….




This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___
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] System variable HOME

2012-11-03 Thread Procházka Lukáš

On Sat, 03 Nov 2012 12:43:26 +0100, Sietse Brouwer sbbrou...@gmail.com wrote:


it seems that Ctx [re]defines the system variable HOME on its run;


This is not an answer, but a guess: Could it be that your interactive
shell uses one setting, and the non-interactive shell uses another?


I'm using the windows default shell - cmd.exe;
it is interactive in the manner that you can type a command on the command 
prompt and the command (or a program) is executed.

In Windows, when a process is created, it inherits current system variables.

If you launch a program from cmd.exe (= command line), the program (process) 
inherits all system variables existing in the moment of launching in the 
environment of the session of that cmd.exe.

(Various instances of cmd.exe don't inter-corporate in the point-of-view of 
system variables.)

Moreover, when the launched program changes a system variable, it changes it 
just in its-own scope;
so values of system variables of the calling cmd.exe are not affected.

BTW: I solved the problem a bit hacky (and hopefully temporarily, if we'll find a 
better solution): I'm calling SET HOME.ORG=%HOME% right before I launch context.exe;
so I can access my previous variable value.

Somewhere inside a Ctx source within a Lua scope I call:


local home = os.getenv(HOME.ORG) or os.getenv(HOME) or MyUsualHomePath


It works but it is not nice enough.

Best regards,

Lukas



I'm only guessing here, I don't know much about Windows
administration; I just remember being driven to despair by a similar
'these settings are not used if the shell is not interactive' problem
under Linux.

--Sietse



___
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] Is http://source.contextgarden.net/ down? [EOM]

2012-11-03 Thread Aditya Mahajan

http://www.downforeveryoneorjustme.com/http://source.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
___


Re: [NTG-context] Weird print(\n...) error

2012-11-03 Thread Procházka Lukáš

On Sat, 03 Nov 2012 08:47:33 +0100, Peter Münster pmli...@free.fr wrote:


On Fri, Nov 02 2012, Procházka Lukáš wrote:


print(\nT)


  print(\n .. T)



Any explanation?


\nT is an unknown command.



Thanks for your advice, I learned some more also at 
http://wiki.contextgarden.net/Programming_in_LuaTeX.

Best regards,

Lukas


___
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] New module: simplebib

2012-11-03 Thread Zenlima
Hallo,

here is my third module for you guys: a simple bibliography without a
database but with items:

http://modules.contextgarden.net/simplebib

http://wiki.contextgarden.net/Simple_Bibliography

Please feel free to comment.

H.
___
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] New module: simplebib

2012-11-03 Thread Aditya Mahajan

On Sun, 4 Nov 2012, Zenlima wrote:


Hallo,

here is my third module for you guys: a simple bibliography without a
database but with items:

http://modules.contextgarden.net/simplebib

http://wiki.contextgarden.net/Simple_Bibliography

Please feel free to comment.


I don't really understand what is the advantage of this module over the 
bib module (The bib module can be used without a bibtex database by 
writing a bibliography in a key-value way. In fact all that when you use a 
bibtex database, the first step is to convert the bib file to a key-value 
file and then proceed by processing it).


Some stylistic comments:

1. Spacing around =

%D \module [
%D  file= t-simplebib,
%D  version = 0.8
%D  title   = \CONTEXT\ User Module,
%D  subtitle= Simple Bibliography,
%D  author  = Zenlima,
%D  date= 2012.11.03
%D  copyright   = Henning Haeske,
%D  license = ''
%D ]

This will fail when you generate the documentation. Use

\module[
 file=t-simplebib,
 version=0.8,
 ...
]

that is, no space around the = sign.

2. Use a internal namespace for macros.

For example, you have

\def\labelspace{\moduleparameter{simplebib}{labelSpace}}

The macro \labelspace is not meant to be used by the user. So, it is 
better to name is \simplebib_labelspace to avoid conflict with other user 
defined macros.


The same applies for \getparameter[tmp]. It may be better to use something 
like \getparamenter[simplebib_tmp_]


3. Don't use camelCase for key-values

Most context keys are not camelCase. So, I would suggest labelspace 
instead of labelSpace, labelleft instead of labelLeft, etc.


4. \doifnot {...} {} vs \doifsomething {...}

You can make the code slightly cleaner by using \doifsomething{...} 
instead of the \doifnot {...} {}.



Some UI comments:

1. Dependence on crossref.

Can the dependence of crossref be optional. In particular, what if a user 
does just wants to link to the bibliography without the funny arrows from 
crossref module?


2. Setting style for labels.

You use

\sym{...\sc{\tmplabel}}

It may be better to define style and color keys for the label rather than 
hardcoding \sc. In fact, all you need to do is set symstyle and symcolor 
for itemgroups.



3. Is it possible to change the format of an bibliographic item based on 
its type (journal paper, conference paper, book, etc.)? Is the current 
default formatting following a particular bibliographic style? If so, 
which one?


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___