Re: [NTG-context] Call for papers (pracjourn mkiv)

2009-12-15 Thread Alan BRASLAU
On Tuesday 15 December 2009 13:05:48 Martin Schröder wrote:
 
 Do you propose to flood the issue with articles on ConTeXt? :-)
 

There is a problem with the module pracjourn;
compiles fine under mkii, fails under mkiv.

Minimal example:

\usemodule[pracjourn]

\setvariables
  [pracjourn]
  [
 title=My \PRACTEX\ article,
 author=Your Name,
 address={Your Address\\ Can be multiline},
 revision={d=1,m=11,y=2006}, % The editors ask you to update
 % this for each revision submitted
 copyright= , % May be used if you want a
% copyright notice at the bottom right of the first page
  ]

\useURL [email]   [mailto:your-email-address] []  [your-email-address]
\useURL [website] [your website]

% address, revision, copyright, email and website are optional and can be 
omitted.

\startbuffer[abstract]
Your Abstract
\stopbuffer

\starttext \setups{title}

% Article Text

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

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


Re: [NTG-context] Call for papers (pracjourn mkiv)

2009-12-15 Thread Aditya Mahajan

On Tue, 15 Dec 2009, Alan BRASLAU wrote:


On Tuesday 15 December 2009 13:05:48 Martin Schröder wrote:


Do you propose to flood the issue with articles on ConTeXt? :-)



There is a problem with the module pracjourn;
compiles fine under mkii, fails under mkiv.

Minimal example:

\usemodule[pracjourn]

\setvariables
 [pracjourn]
 [
title=My \PRACTEX\ article,
author=Your Name,
address={Your Address\\ Can be multiline},
revision={d=1,m=11,y=2006}, % The editors ask you to update
% this for each revision submitted
copyright= , % May be used if you want a
   % copyright notice at the bottom right of the first page
 ]

\useURL [email]   [mailto:your-email-address] []  [your-email-address]
\useURL [website] [your website]

% address, revision, copyright, email and website are optional and can be
omitted.

\startbuffer[abstract]
Your Abstract
\stopbuffer

\starttext \setups{title}


  Add some actual text here


\stoptext


Email and Website do not work. But other than that, the document compiles 
fine.


I will update the module so that email and website work with mkiv.

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

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


Re: [NTG-context] Call for papers (pracjourn mkiv)

2009-12-15 Thread Aditya Mahajan

On Tue, 15 Dec 2009, Aditya Mahajan wrote:


I will update the module so that email and website work with mkiv.


Attached is a corrected version.

Hans, can something like \doifdefinedurl be added to the core? I am 
currently using


%D We need a macro to check if a url is defined using \type{\useURL} or not.

\def\doifdefinedurl#1{\doifdefined{\v!file:::#1}}

%D \MKIV\ uses a different internal structure to store urls, so we use a
%D different method.
\startmode[*mkiv]
\startluacode
  ptj = ptj or {}
  function ptj.doifdefinedurl(name, action)
if jobreferences.urls.data[name] and name ~=  then
  tex.sprint(tex.ctxcatcodes, action)
end
  end
\stopluacode

\def\doifdefinedurl#1#2{\ctxlua{ptj.doifdefinedurl(#1, 
\!!bs\detokenize{#2}\!!es)}}

\stopmode


Bookmarks are not working, but that seems to be a bug in current MKIV. 
Minimal example


\setupinteraction[state=start]
\placebookmarks[section,subsection][section]

\starttext
\section{One}
\input tufte
\subsection{two}
\input knuth
\stoptext

In MkIV I do not get any bookmarks.

Aditya%D \module
%D   [  file=s-ptj-01,
%Dversion=2009.12.15
%D  title=\CONTEXT\ Style File,
%D   subtitle=PracTeX Journal Style,
%D author=Aditya Mahajan,
%D  email=adityam at umich dot edu,
%D   date=\currentdate,
%D  copyright=2009 Aditya Mahajan]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%M % These macros are needed to compile the documentation.
%M \def\PracTeX{Prac\kern-0.07em\TeX}
%M \def\PRACTEX{\PracTeX}
%M \def\TPJ{The \PRACTEX\ Journal}
%M \useurl[TPJ][http://www.tug.org/pracjourn/][][\TPJ]
%M \useurl[texgyre][http://www.gust.org.pl/projects/e-foundry/tex-gyre/]

\writestatus  {loading}   {Context Module for the PracTeX Journal}

%D This module is for producing acticles for \from[TPJ]. It merely copies the
%D layout of the the \LATEX\ class \filename{pracjourn.cls} available from
%D \TPJ\ website (\url[TPJ]).  This module has a filename synonym
%D \filename{pracjourn}. So to use this module, you can write:
%D \starttyping
%D \usemodule[pracjourn]
%D \stoptyping
%D A sample document is given at the end of this file. The typeset sample can
%D be obtained by
%D \starttyping
%D texmfstart texexec --mode=demo s-ptj-01.tex
%D \stoptyping
%D The documentation is written as comments. If you want to see a \PDF\ copy
%D \starttyping
%D texmfstart texexec --module s-ptj-01.tex
%D \stoptyping

\startmodule[pracjourn]

\unprotect

%D First let's setup the paper size and layout for \TPJ. I am actually not
%D sure about the \quote{official} layout requirement for \TPJ\ and have
%D reverse engineered the layout from the typeset \LATEX\ examples. If you
%D feel that anything is wrong here, please let me know.

\setuppapersize
  [letter][letter]

\setuplayout
  [  width=middle,
height=middle,
  location=middle,
  topspace=1.25in,
   bottomspace=1in,
 backspace=1in,
  cutspace=1in,
leftmargin=0.25in,
   rightmargin=0.25in,
leftmargindistance=0in,
   rightmargindistance=0in,
header=1in,
footer=.5in,
 headerdistace=0in,
footerdistance=.25in,
  ]

%D Next we do the font setup. \TPJ\ uses mathpazo for roman and math faces and
%D uses latin modern for sans serif and monotype. For the main face, 12pt is
%D used with a 15.5pt baseline skip. Font protrusion is enabled, but font
%D expansion is not. We follow these conventions. \CONTEXT\ uses Pagella fonts
%D from \TEX{gyre} project, so we use them instead. 

\usetypescript  [serif,sans,mono] [hanging] [pure]
\setupalign [hanging]
\usetypescript  [palatino][encoding=texnansi]
\setupbodyfont  [palatino,12pt]

\definefont [titlefont]  [Regular at 20pt]
\definefont [authorfont] [Regular at 14pt]

\setupbodyfontenvironment
  [12pt]
  [interlinespace=15.5pt,em=italic]

\setupbodyfontenvironment
  [11pt]
  [interlinespace=13.6pt,em=italic]

%D The variables for the article are stored in the \mono{pracjourn} namespace.
%D To initialize these variables use
%D \starttyping
%D \setvariables
%D  [pracjourn]
%D  [title=Tile of the Article,
%D  author=Name of Author,
%D address=Write your Address,
%Drevision={d=14,m=11,y=2006},
%D   copyright=Whatever you want,
%D  ]
%D \stoptyping
%D \mono{title} and \mono{author} should always be entered (even though this
%D module does not make them mandatory, it makes little sense to have an
%D article without a title or author. Other variables are optional. If a
%D revision is not written, current date will be used to show the revision.
%D Other variables for the article are the author's email address and website
%D url. Due to catcode problems, it is not always possible to reliably enter
%D these using the variable mechanism. To enter these use \type|\useURL|
%D \starttyping
%D 

Re: [NTG-context] Call for papers (pracjourn mkiv)

2009-12-15 Thread Hans Hagen

Aditya Mahajan wrote:


\setupinteraction[state=start]
\placebookmarks[section,subsection][section]

\starttext
\section{One}
\input tufte
\subsection{two}
\input knuth
\stoptext

In MkIV I do not get any bookmarks.


that was due to a flushung order issue (introduced recently when 
switching to the lua catalog counterpart)


to make you feel-good i added a few more trackers:

\setupinteraction[state=start]

\enabletrackers[references.bookmarks,backend.resources]

\placebookmarks[section,subsection][section]

\starttext
\section{One}
\subsection{alpha}
\subsection{beta}
\section{Two}
\subsection{alpha}
\subsection{beta}
\stoptext

fixed in beta

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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] Call for papers (pracjourn mkiv)

2009-12-15 Thread Hans Hagen

Aditya Mahajan wrote:

On Tue, 15 Dec 2009, Aditya Mahajan wrote:


I will update the module so that email and website work with mkiv.


Attached is a corrected version.

Hans, can something like \doifdefinedurl be added to the core? I am 
currently using


%D We need a macro to check if a url is defined using \type{\useURL} or 
not.


\def\doifdefinedurl#1{\doifdefined{\v!file:::#1}}

%D \MKIV\ uses a different internal structure to store urls, so we use a
%D different method.
\startmode[*mkiv]
\startluacode
  ptj = ptj or {}
  function ptj.doifdefinedurl(name, action)
if jobreferences.urls.data[name] and name ~=  then
  tex.sprint(tex.ctxcatcodes, action)
end
  end
\stopluacode

\def\doifdefinedurl#1#2{\ctxlua{ptj.doifdefinedurl(#1, 
\!!bs\detokenize{#2}\!!es)}}


\stopmode


i'll add:

\def\doifurldefinedelse {\ctxlua{commands.doifurldefinedelse (#1)}}
\def\doiffiledefinedelse{\ctxlua{commands.doiffiledefinedelse(#1)}}

fyi ... you can use constructs like:

function commands.doifurldefinedelse(name)
commands.doifelse(jobreferences.urls.data[name])
end



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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] Call for papers (pracjourn mkiv)

2009-12-15 Thread Wolfgang Schuster

Am 15.12.2009 um 17:16 schrieb Aditya Mahajan:

 On Tue, 15 Dec 2009, Aditya Mahajan wrote:
 
 I will update the module so that email and website work with mkiv.
 
 Attached is a corrected version.

You know the difference between startsetups, startrawsetups and 
startlocalsetups?

Wolfgang

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

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


Re: [NTG-context] Call for papers (pracjourn mkiv)

2009-12-15 Thread Aditya Mahajan

On Tue, 15 Dec 2009, Wolfgang Schuster wrote:



Am 15.12.2009 um 17:16 schrieb Aditya Mahajan:


On Tue, 15 Dec 2009, Aditya Mahajan wrote:


I will update the module so that email and website work with mkiv.


Attached is a corrected version.


You know the difference between startsetups, startrawsetups and 
startlocalsetups?


I wrote this module in 2006 and most of the setup stuff was trial and 
error. IIRC, file reading and wrting did not work with setup and that is 
why I used rawsetup.


I really do not know the difference between localsetup and setup.

Aditya

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

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


Re: [NTG-context] Call for papers (pracjourn mkiv)

2009-12-15 Thread Wolfgang Schuster

Am 15.12.2009 um 19:16 schrieb Aditya Mahajan:

 You know the difference between startsetups, startrawsetups and 
 startlocalsetups?
 
 I wrote this module in 2006 and most of the setup stuff was trial and error. 
 IIRC, file reading and wrting did not work with setup and that is why I used 
 rawsetup.

Right, while startsetups line endings are ignored startrawsetups keeps them as 
they are

 I really do not know the difference between localsetup and setup.

startsetups is a delimited command which grabs everything till the next 
stopsetups
commands and as a result of this nested startsetups environments are not 
possible,
to do this you could use startlocalsetups inside startsetups

Wolfgang

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

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


Re: [NTG-context] Call for papers (pracjourn mkiv)

2009-12-15 Thread Aditya Mahajan

On Tue, 15 Dec 2009, Hans Hagen wrote:


i'll add:

\def\doifurldefinedelse {\ctxlua{commands.doifurldefinedelse (#1)}}
\def\doiffiledefinedelse{\ctxlua{commands.doiffiledefinedelse(#1)}}


Can you also add corresponding commands in MkII. The practex module needs 
to work with both MkII and MkIV.



fyi ... you can use constructs like:

function commands.doifurldefinedelse(name)
   commands.doifelse(jobreferences.urls.data[name])
end


Ah, thanks.

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

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


Re: [NTG-context] Call for papers (pracjourn mkiv)

2009-12-15 Thread Aditya Mahajan

On Tue, 15 Dec 2009, Hans Hagen wrote:


Aditya Mahajan wrote:


\setupinteraction[state=start]
\placebookmarks[section,subsection][section]

\starttext
\section{One}
\input tufte
\subsection{two}
\input knuth
\stoptext

In MkIV I do not get any bookmarks.


that was due to a flushung order issue (introduced recently when switching to 
the lua catalog counterpart)


fixed in beta


Thanks.

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

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


Re: [NTG-context] Call for papers (pracjourn mkiv)

2009-12-15 Thread Hans Hagen

Aditya Mahajan wrote:

On Tue, 15 Dec 2009, Hans Hagen wrote:


i'll add:

\def\doifurldefinedelse {\ctxlua{commands.doifurldefinedelse (#1)}}
\def\doiffiledefinedelse{\ctxlua{commands.doiffiledefinedelse(#1)}}


Can you also add corresponding commands in MkII. The practex module 
needs to work with both MkII and MkIV.


ok

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