Re: [NTG-context] is it possible to have first and last line numbers from page?

2012-03-06 Thread Pablo Rodríguez
On 05/03/12 11:39, Hans Hagen wrote:
 On 4-3-2012 11:20, Pablo Rodríguez wrote:
 \starttext
 \startlinenumbering
 \dorecurse{10}{\input zapf\par\input knuth}
 \stoplinenumbering
 \stoptext
 
 currently it's not possible but it's no big deal to add that feature at 
 some point as it's a matter of keeping track of first/last numbers; for 
 the page it's trivial but as we also support numbering in columns and 
 other places some housekeeping is needed (read: a quick hack is possible 
 but I will only do a proper solution)

Many thanks for your reply, Hans.

I think that implemented a proper ConTeXt solution would be useful for
other users.

I would really appreciate it, if a solution could be implemented.

Many thanks again for your help,


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] is it possible to have first and last line numbers from page?

2012-03-06 Thread Pablo Rodríguez
On 06/03/12 19:48, luigi scarso wrote:
 2012/3/6 Pablo Rodríguez
 
 Luigi, I'm afraid it doesn't work as expected in the real file
 
 I'm not surprised 

My fault, because I didn' realize that numbers only appeared on each
fifth line.

 Lines are numbered there with [step=5]. So I get in headers only
 actually numbered lines, although it header should contain the real line
 numbers (even with the line number isn't shown on that line).
 
 How would it the the code in that case? (Sorry for asking this, but I'm
 afraid I cannot code in lua [or in any other language].)
 
 Do you have an example ?

Adapting from your code:

\startluacode
document.my_name_space = document.my_name_space or {}
document.my_name_space.pages = document.my_name_space.pages or {}
local f =  io.open(file.addsuffix(tex.jobname,tuc) )
print(' ',f)
if f==nil then
 --[=[ do nothin ]=]
else
 f:close()
 local tuc = dofile(file.addsuffix(tex.jobname,tuc))
 local data =  tuc.structures.references.collected[]
 local  w
 local pages = document.my_name_space.pages
 local realpage,ref
 for k, v in  pairs(data) do
   w=string.gmatch(k,'LIN:(\%d+):\%d+')
   ref = tonumber(w())
   realpage = tostring(v.references.realpage)
   pages[realpage]= pages[realpage] or {}
   table.insert(pages[realpage],ref)
 end
 for page,array in pairs(pages) do
   table.sort(array)
 end
end
\stopluacode

\definemarking[linenumber]
\define\LinenumberCommand
 
{\normalexpanded{\setmarking[linenumber]{\linenumber}}\pagereference[LIN:\linenumber:\currentpage]}

\setuplinenumbering[command=\LinenumberCommand,step=5]

\startsetups linenumber
 \startluacode
 local l=0;
 if document.my_name_space == nil then return end;
 if document.my_name_space.pages == nil then return end;
 local pages = document.my_name_space.pages;
 for _,_ in  pairs(pages) do l=l+1 end;
 if l== 0 then return end;
 --[=[ OK, we have some data to print ]=]
 local array = pages[tostring(tex.count.realpageno)]
 l=0;
 if array ==nil then return end;
 for _,_ in  pairs(array) do l=l+1 end;
 if l0 then context(array[1].. -- ..array[l]) end;
 \stopluacode
\stopsetups

\setupheadertexts[\texsetup{linenumber}]

\starttext

\dorecurse{6}{\input tufte\par}

\startlinenumbering
\dorecurse{20}{\input knuth\par}
\stoplinenumbering

\startlinenumbering
\dorecurse{20}{\input knuth\par}
\stoplinenumbering

\stoptext

On page 7 lines are numbered from lowest to highest values. A purist
might consider this wrong, but this is unlikely to happen on a real
book, since (I guess) line numbers on headers only make sense when they
two different series cannot be on the same page.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] is it possible to have first and last line numbers from page?

2012-03-05 Thread Hans Hagen

On 4-3-2012 11:20, Pablo Rodríguez wrote:

\starttext
\startlinenumbering
\dorecurse{10}{\input zapf\par\input knuth}
\stoplinenumbering
\stoptext


currently it's not possible but it's no big deal to add that feature at 
some point as it's a matter of keeping track of first/last numbers; for 
the page it's trivial but as we also support numbering in columns and 
other places some housekeeping is needed (read: a quick hack is possible 
but I will only do a proper solution)


Hans

-
  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] is it possible to have first and last line numbers from page?

2012-03-05 Thread luigi scarso
2012/3/4 Pablo Rodríguez oi...@web.de

 On 03/04/2012 12:04 PM, Wolfgang Schuster wrote:
  Am 04.03.2012 um 11:20 schrieb Pablo Rodríguez:
 
  I wanted to be able to have in the headers the first and last line
  number from page. This feature is extremely useful when typesetting some
  kinds of poetry.
  [...]
  Is that possible to achieve with ConTeXt?
 
  Yes but it’s not usable because the numbers are always shown on the next
 page.

 Many thanks for your reply, Wolfgang.

 If you allow me one more question: is showing the numbers on the same
 page they refer to beyond the limits of TeX/LuaTeX?


Absolutely no. As Hans said, a quick/dirty trick is possible: just mark the
object
with \pagereference[unique id]. The data is stored into the *tuc file,
which can be read
from  the second pass.
Then always run with
$context --purgeall ; context yourfile.mkiv
Of course, it's possible  doesn't mean it's the right context way.

\startluacode
document.my_name_space = document.my_name_space or {}
document.my_name_space.pages = document.my_name_space.pages or {}
local f =  io.open(file.addsuffix(tex.jobname,tuc) )
print(' ',f)
if f==nil then
 --[=[ do nothin ]=]
else
 f:close()
 local tuc = dofile(file.addsuffix(tex.jobname,tuc))
 local data =  tuc.structures.references.collected[]
 local  w
 local pages = document.my_name_space.pages
 local realpage,ref
 for k, v in  pairs(data) do
   w=string.gmatch(k,'LIN:(\%d+):\%d+')
   ref = tonumber(w())
   realpage = tostring(v.references.realpage)
   pages[realpage]= pages[realpage] or {}
   table.insert(pages[realpage],ref)
 end
 for page,array in pairs(pages) do
   table.sort(array)
 end
end
\stopluacode


\definemarking[linenumber]
\define\LinenumberCommand
 
{\normalexpanded{\setmarking[linenumber]{\linenumber}}\pagereference[LIN:\linenumber:\currentpage]}

\setuplinenumbering[command=\LinenumberCommand]

\startsetups linenumber
%   \doiftext {
%   \getmarking[linenumber]
%   }
%   {
%   \getmarking[linenumber][first] –
\getmarking[linenumber][last]
%   }
 \startluacode
 local l=0;
 if document.my_name_space == nil then return end;
 if document.my_name_space.pages == nil then return end;
 local pages = document.my_name_space.pages;
 for _,_ in  pairs(pages) do l=l+1 end;
 if l== 0 then return end;
 --[=[ OK, we have some data to print ]=]
 local array = pages[tostring(tex.count.realpageno)]
 l=0;
 if array ==nil then return end;
 for _,_ in  pairs(array) do l=l+1 end;
 if l0 then context( nr. ..array[1].. --- ..array[l]) end;
 \stopluacode
\stopsetups

\setupheadertexts[\texsetup{linenumber}]

\starttext

\dorecurse{6}{\input tufte\par}

\startlinenumbering
\dorecurse{20}{\input knuth\par}
\stoplinenumbering

\resetmarking[linenumber]

\dorecurse{6}{\input tufte\par}

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

[NTG-context] is it possible to have first and last line numbers from page?

2012-03-04 Thread Pablo Rodríguez
I have asked this question before (more than twice), after I found no
answer in the ConTeXt reference manual, the wiki or the mailing list.

I wanted to be able to have in the headers the first and last line
number from page. This feature is extremely useful when typesetting some
kinds of poetry.

The most basic sample would be:

\starttext
\startlinenumbering
\dorecurse{10}{\input zapf\par\input knuth}
\stoplinenumbering
\stoptext

Is that possible to achieve with ConTeXt?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] is it possible to have first and last line numbers from page?

2012-03-04 Thread Wolfgang Schuster

Am 04.03.2012 um 11:20 schrieb Pablo Rodríguez:

 I have asked this question before (more than twice), after I found no
 answer in the ConTeXt reference manual, the wiki or the mailing list.
 
 I wanted to be able to have in the headers the first and last line
 number from page. This feature is extremely useful when typesetting some
 kinds of poetry.
 
 The most basic sample would be:
 
 \starttext
 \startlinenumbering
 \dorecurse{10}{\input zapf\par\input knuth}
 \stoplinenumbering
 \stoptext
 
 Is that possible to achieve with ConTeXt?


Yes but it’s not usable because the numbers are always shown on the next page.

\definemarking[linenumber]

\define\LinenumberCommand
  {\normalexpanded{\setmarking[linenumber]{\linenumber}}}

\setuplinenumbering[command=\LinenumberCommand]

\startsetups linenumber

\doiftext {
\getmarking[linenumber]
}
{
\getmarking[linenumber][first] – \getmarking[linenumber][last]
}

\stopsetups

\setupheadertexts[\texsetup{linenumber}]

\starttext

\dorecurse{6}{\input tufte\par}

\startlinenumbering
\dorecurse{20}{\input knuth\par}
\stoplinenumbering

\resetmarking[linenumber]

\dorecurse{6}{\input tufte\par}

\stoptext

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
___


[NTG-context] first and last line number on page

2012-03-03 Thread Pablo Rodríguez
Hi there,

with the following sample:

\starttext
\startlinenumbering
\dorecurse{10}{\input zapf\par\input knuth}
\stoplinenumbering
\stoptext

I would like to have a header that contains the first and last line
number on the page.

Is there any way to do that? (The ConTeXt reference manual and the wiki
seem not to have an answer to this question.)

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] problem with \getparameters

2012-02-23 Thread Thomas A. Schmitz

Hi all,

I'm trying to use \getparameters, but I'm doing it wrong. What I want to 
do is: define an environment which starts linenumbering and takes a 
key=value argument to define the start of the numbers. Here's what I 
tried (I also tried a few other things, such as \setvariables, but 
wasn't any more successful):


\definestartstop[mynumberedblockquote]
[before={\blank[line]
\setupindenting[no]

\setuplinenumbering[width=1cm,start=\getvalue{testsetupsstart}]
\startlinenumbering},
  after={\stoplinenumbering
\setupindenting[yes]
{\blank[line]}
\par}]

\def\startnumberedblockquote#1[#2]%
  {\getparameters[testsetups][start=1,#2]%
   \startmynumberedblockquote}

\define\stopnumberedblockquote%
   {\stopmynumberedblockquote}

\starttext

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy 
eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
voluptua. At

vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

\startnumberedblockquote [start=9]
Lorem

ipsum

dolor

sit

amet
\stopnumberedblockquote

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy 
eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
voluptua. At

vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren,

\startnumberedblockquote[start=19]
consetetur

sadipscing

elitr

sed

diam
\stopnumberedblockquote

\stoptext

But for some reason, the numbers are not local for each block. Can 
anybody shed some light into these (for me) dark an mysterious corners 
of ConTeXt?


Thanks a lot!

Thomas
___
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] problem with \getparameters

2012-02-23 Thread Wolfgang Schuster

Am 23.02.2012 um 09:05 schrieb Thomas A. Schmitz:

 Hi all,
 
 I'm trying to use \getparameters, but I'm doing it wrong. What I want to do 
 is: define an environment which starts linenumbering and takes a key=value 
 argument to define the start of the numbers. Here's what I tried (I also 
 tried a few other things, such as \setvariables, but wasn't any more 
 successful):
 
 \definestartstop[mynumberedblockquote]
   [before={\blank[line]
   \setupindenting[no]
   
 \setuplinenumbering[width=1cm,start=\getvalue{testsetupsstart}]
   \startlinenumbering},
 after={\stoplinenumbering
   \setupindenting[yes]
   {\blank[line]}
   \par}]
 
 \def\startnumberedblockquote#1[#2]%
  {\getparameters[testsetups][start=1,#2]%
   \startmynumberedblockquote}
 
 \define\stopnumberedblockquote%
   {\stopmynumberedblockquote}

\usemodule[annotation]

\define[2]\NumberedblockquoteCommand
  {\setupindenting[no]
   \startlinenumbering[width=1cm][\annotationparameter{start}]%
   #2%
   \stoplinenumbering}

\defineannotation
  [numberedblockquote]
  [alternative=command,
  %indenting=no,
   command=\NumberedblockquoteCommand]

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] problem with \getparameters

2012-02-23 Thread Thomas A. Schmitz

On 02/23/2012 12:27 PM, Wolfgang Schuster wrote:

\usemodule[annotation]

\define[2]\NumberedblockquoteCommand
   {\setupindenting[no]
\startlinenumbering[width=1cm][\annotationparameter{start}]%
#2%
\stoplinenumbering}

\defineannotation
   [numberedblockquote]
   [alternative=command,
   %indenting=no,
command=\NumberedblockquoteCommand]


Wolfgang,

thanks a lot for your solution. It works beautifully with the minimal 
example, but I can't use it in my project: it only works with a recent 
beta, but since footnotes are so badly broken, I need to use an older 
beta for typesetting this book project. Any chance of having a more 
generic solution without the annotation module?


Thomas
___
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] problem with \getparameters

2012-02-23 Thread Wolfgang Schuster

Am 23.02.2012 um 12:42 schrieb Thomas A. Schmitz:

 On 02/23/2012 12:27 PM, Wolfgang Schuster wrote:
 \usemodule[annotation]
 
 \define[2]\NumberedblockquoteCommand
   {\setupindenting[no]
\startlinenumbering[width=1cm][\annotationparameter{start}]%
#2%
\stoplinenumbering}
 
 \defineannotation
   [numberedblockquote]
   [alternative=command,
   %indenting=no,
command=\NumberedblockquoteCommand]
 
 Wolfgang,
 
 thanks a lot for your solution. It works beautifully with the minimal 
 example, but I can't use it in my project: it only works with a recent beta, 
 but since footnotes are so badly broken, I need to use an older beta for 
 typesetting this book project. Any chance of having a more generic solution 
 without the annotation module?

\def\startnumberedblockquote
  {\dosingleempty\dostartnumberedblockquote}

\def\dostartnumberedblockquote[#1]%
  {\getrawparameters[numberedblockquote][start=1,#1]%
   \blank[line]%
   \begingroup
   \setupindenting[no]%
   \startlinenumbering[width=1cm][\numberedblockquotestart]}

\def\stopnumberedblockquote
  {\stoplinenumbering
   \endgroup
   \blank[line]}

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] problem with \getparameters

2012-02-23 Thread luigi scarso
On Thu, Feb 23, 2012 at 12:42 PM, Thomas A. Schmitz
thomas.schm...@uni-bonn.de wrote:
 On 02/23/2012 12:27 PM, Wolfgang Schuster wrote:

 \usemodule[annotation]

 \define[2]\NumberedblockquoteCommand
   {\setupindenting[no]
    \startlinenumbering[width=1cm][\annotationparameter{start}]%
    #2%
    \stoplinenumbering}

 \defineannotation
   [numberedblockquote]
   [alternative=command,
   %indenting=no,
    command=\NumberedblockquoteCommand]


 Wolfgang,

 thanks a lot for your solution. It works beautifully with the minimal
 example, but I can't use it in my project: it only works with a recent beta,
 but since footnotes are so badly broken, I need to use an older beta for
 typesetting this book project. Any chance of having a more generic solution
 without the annotation module?

 Thomas

 ___
 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
 ___
Hm global  effect.. you can use a namespaced one

\enabletrackers[lines.numbers]
\starttext
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\vrule width\textwidth height 1pt\par
\setuplinenumbering[Mine1][width=1cm,start=1]
\startlinenumbering[Mine1]
consetetur

sadipscing

elitr

sed

diam
\stoplinenumbering

\vrule width\textwidth height 1pt\par
\setuplinenumbering[Mine2][width=1cm,start=19]
\startlinenumbering[Mine2]
consetetur

sadipscing

elitr

sed

diam
\stoplinenumbering
\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] problem with \getparameters

2012-02-23 Thread Thomas A. Schmitz

On 02/23/2012 01:29 PM, Wolfgang Schuster wrote:

\def\startnumberedblockquote
   {\dosingleempty\dostartnumberedblockquote}

\def\dostartnumberedblockquote[#1]%
   {\getrawparameters[numberedblockquote][start=1,#1]%
\blank[line]%
\begingroup
\setupindenting[no]%
\startlinenumbering[width=1cm][\numberedblockquotestart]}

\def\stopnumberedblockquote
   {\stoplinenumbering
\endgroup
\blank[line]}

Wolfgang


Many thanks, Wolfgang, that does exactly what I need!

Thomas
___
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] line numbers or margin data in headers

2012-02-19 Thread Pablo Rodríguez
Hi there,

I'm trying to get a feature similar to those headers that display the
first and last entry on a give page.

I would like to do the same with line numbers on pages, which is
especially useful for poetry.

How could i change this in the following sample?

\setupheadertexts[line--numbers]
\starttext
\startlinenumbering
\dorecurse{50}{\input knuth\par}
\stoplinenumbering
\stoptext

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] margin data prevent line numbering (latest beta)

2012-02-17 Thread Pablo Rodríguez
Hi Hans,

many thanks for the new beta.

I have noticed that margin data prevent the lines in which they are
located to be numbered.

Here you have a minimal example:

\definemargindata[mgch]
\setupmargindata[mgch][location=outer]
\starttext
\startlinenumbering
\dorecurse{10}{\mgch{0}unnumbered lines }
\dorecurse{10}{numbered lines }
\stoplinenumbering
\stoptext

Many thanks hanks for your help,


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] questions on linenotes/notes

2012-02-11 Thread Pablo Rodríguez
Hi there,

I'm trying to typeset the following kind of document:

\setuppapersize[A6]
\definelinenote[significa]
\setupnote[significa][rule=off,paragraph=yes,numbercommand=,inbetween=\quad]
\setupdescriptions[significa][display=yes,location=serried,distance=.5em]
\definelinenote[contextualiza]
\setupnote[contextualiza][rule=off,paragraph=yes,numbercommand=,inbetween=\quad]
\setupdescriptions[contextualiza][display=yes,location=serried,distance=.5em,]
\starttext
\startlinenumbering
En un lugar\significa{lugar: place} de la Mancha\contextualiza{La
Mancha: Spanish region}, de cuyo nombre\significa{nombre: name} no
quiero\significa{querer: want} acordarme\significa{acordarse:
remember}\contextualiza{acordarme: Cervantes wants to forget his past}...
\stoplinenumbering
\stoptext

It contains to kinds of line notes. I need them to have line numbers in
the notes, but this doesn't work with latest beta (adding
\setupnotation[significa][number=yes] doesn't work either). How can I
have line numbers in the line notes?

In both line notes groups, there can be many notes that come from the
same line. Would it be possible that the number is only printed on the
first note from each line? I mean, instead of having:

1 lugar: place  1 nombre: name  2 querer:want  2 acordarse: remember

it would be extremely helpful to have the following option:

1 lugar: place  nombre: name  2 querer:want  acordarse: remember

How could this be achieved?

In the sample above, \significa is a kind of dictionary in each page. I
wonder whether it would be possible for these notes to be displayed in
two columns and alphabetically ordered.

According to the ConTeXt Reference Manual, items can be displayed in
columns and there is a sorting mechanism for lists, but I don't know how
this could be applied to notes. Is this possible?

Thanks for your help,


Pablo
-- 
http://www.oudeis.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] line numbering and margin data

2012-02-10 Thread Pablo Rodríguez
Hi there,

in the following sample, all lines are in a line numbering environment,
but only those without margin data get actually numbered.

\definemargindata[mgch]
\setupmargindata[mgch][location=outer]
\starttext
\startlinenumbering
\dorecurse{10}{\mgch[margin]unnumbered lines }
\dorecurse{10}{numbered lines }
\stoplinenumbering
\stoptext

It doesn't work either with latest stable or beta versions.

Am I missing something here?

Thanks for your help,


Pablo
-- 
http://www.oudeis.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] bug with footnotes in latest beta?

2012-02-09 Thread Pablo Rodríguez
Hi there,

I have the following sample:

\definelinenote[dict]
\setupnote[dict][rule=off,paragraph=yes,numbercommand=,inbetween=\quad]
\setupdescriptions[dict][display=yes,location=serried,distance=.5em]
\definemargindata[mgch][outer][hoffset=0.3em]
\starttext
\startlinenumbering
\dorecurse{10}{\mgch{1}not so long anyway\dict{not}}
\stoplinenumbering
\stoptext

And if I compile it using the beta version, no line numbering is shown
in footnotes.

It seems like the beta version doesn't understand \setupdescriptions.
This works fine with the stable. Has the command been replaced with
another one?

Thanks for your help,


Pablo
-- 
http://www.oudeis.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] bug on margin data and line numbering?

2012-01-26 Thread Pablo Rodríguez
Hi there,

when I try to add margin data to a line numbered text, this line is not
counted or numbered.

See the sample with note referring to line 0:

\definelinenote[dict]
\setupnote[dict][numbercommand=,]
\definemargindata[mgch][outer][hoffset=0.3em]
\starttext
\startlinenumbering
\mgch{1}not so\dict{not}
\stoplinenumbering
\stoptext

I'm using ConTeXt stable from TL 2011.

Am I doing something wrong or have I hit a bug?

Thanks for your help,


Pablo
-- 
http://www.oudeis.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] line numbers in header

2012-01-23 Thread Pablo Rodríguez
Hi there,

I'm trying to get a header that contains the numbers of first numbered
line on each page and the number of the last numbered line on that page.
This is especially useful for poetry.

Here is a minimal sample of what I'm trying to do:

\setupheadertexts[line--numbers]
\starttext
\startlinenumbering
\dorecurse{50}{\input knuth\par}
\stoplinenumbering
\stoptext

What should I add instead of line--numbers?

I have tried to search in the reference on the reference manual and the
wiki, but I didn't find anything that could help.

Many thanks for your help,


Pablo
-- 
http://www.oudeis.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] three issues with streams

2011-12-29 Thread Pablo Rodríguez
Hi there,

after tweaking with the example provided by Wolfgang
(http://www.ntg.nl/pipermail/ntg-context/2011/063353.html), I tried to
generate a bilingual poetry document with original Greek text and facing
Spanish translation (using ConTeXt stable as provided by TL2011).

Here is the basic structure:

\enabletrackers[streams.flushing]
\def\itit#1{{\language[it]\em#1}}
\starttext
\completecontent

\startoutputstream[agr]

Spanish poems including many chapters

\enableoutputstream[es]

Spanish poems including many chapters

\disableoutputstream
\stopoutputstream
\synchronizestreams[agr,es]
\page \flushoutputstream[agr]
\page \flushoutputstream[es]
\stoptext

My questions are:

I include the whole Greek text and the Spanish text after it. I expect
ConTeXt to synchonize both streams in titles and paragraphs, but all I
get is the Greek stream typeset before the Spanish stream. Is there no
way to get ConTeXt synchronizing both streams automatically?

How can I enable \startlinenumbering ... \stoplinenumbering in the poems
themselves? It doesn't seem to work, since it gives an error
(\startlines ... \stoplines works fine).

How can I get that elements on the left page (or outputstream[agr]) are
independent from the right page [or outputstream[es])? I mean that
sectioning numbers and footnote numbers are independent in each stream,
i.e, chapter 1 on left page has a chapter 1 on facing page.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Two questions about sort lists

2011-12-24 Thread Vyatcheslav Yatskovsky

Hi!

I have two questions about sort lists.


1) Is there a way to reset (empty) the sorting list, to reuse it several 
times?



\definesorting[song][songs]

\unexpanded\def\SongEntry#1#2#3%
  {#2 \crlf}

\starttext
\startlinenumbering
\startlines
\setupinterlinespace[big]

\song{Sway}
\song{Hit The Road Jack}
\song{Fly Me To The Moon}

\placelistofsongs[criterium=all,command=\SongEntry]

% (Here I want to reset the list)

\song{Girl From Ipanema}

\placelistofsongs[criterium=all,command=\SongEntry]

\stoplines
\stoplinenumbering

\stoptext


2) Why any formatting tags like

\song{\it Fly Me To The Moon}

cause the error?


Regards,
Vyatcheslav Yatskovsky
___
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] images and linenumbering

2011-11-15 Thread Martin Fechner

Hi all,

I posted this bug some time ago, but it still seems there. The 
combination between linenumbering and images isn't working. I use mkiv 
with the latest beta.

Look at this short example:

--
\setuplayout[width=120mm]
\setuppagenumbering[alternative=doublesided]
\setuplinenumbering[location=outer,method=page]

\starttext

\placefigure[left,4*hang,none]{}
{\externalfigure[cow][width=0.2\textwidth]}
\startlinenumbering
\input tufte

\stoplinenumbering
\placefigure[right,2*hang,none]{}
{\externalfigure[cow][width=0.2\textwidth]}
\startlinenumbering[continue]
\input tufte

\stoplinenumbering
\stoptext
--

Is there any workaround to this?

Best regards,

Martin

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

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


Re: [NTG-context] footnotes and linenumbering

2011-11-14 Thread Martin Fechner

Am 12.11.2011 13:59, schrieb Hans Hagen:

On 11-11-2011 12:24, Martin Fechner wrote:

Hi all,

is it possible to have a linenumbering also in the footnotes? I tried it
with

--
\setuplinenumbering[method=page]
\setupfootnotedefinition[location=serried]
\setupfootnotes[before={\startlinenumbering[continue]},after={\stoplinenumbering}]



\starttext
\startlinenumbering
\input knuth

some text\footnote{the first footnote}
more text\footnote{\dorecurse{10}{a very long footnote }}
\stoplinenumbering
\stoptext
--

but only the whole footnotefigure has one linenumber and it doesn't
continue right if method=page is set.
Is there any solution to this?


This is not supported. I can imagine it becoming part of one of the
critical edition ctx projects. There is no quick hack and it would be a
specific option to for notes.

Hans



That is what I assumed. Is it possible to say which amount of work is 
necessary to implement this feature and what period of time you have in 
mind (three months, one year, five years)?


Thanks,

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

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


Re: [NTG-context] footnotes and linenumbering

2011-11-12 Thread Hans Hagen

On 11-11-2011 12:24, Martin Fechner wrote:

Hi all,

is it possible to have a linenumbering also in the footnotes? I tried it
with

--
\setuplinenumbering[method=page]
\setupfootnotedefinition[location=serried]
\setupfootnotes[before={\startlinenumbering[continue]},after={\stoplinenumbering}]


\starttext
\startlinenumbering
\input knuth

some text\footnote{the first footnote}
more text\footnote{\dorecurse{10}{a very long footnote }}
\stoplinenumbering
\stoptext
--

but only the whole footnotefigure has one linenumber and it doesn't
continue right if method=page is set.
Is there any solution to this?


This is not supported. I can imagine it becoming part of one of the 
critical edition ctx projects. There is no quick hack and it would be a 
specific option to for notes.


Hans


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


[NTG-context] footnotes and linenumbering

2011-11-11 Thread Martin Fechner

Hi all,

is it possible to have a linenumbering also in the footnotes? I tried it 
with


--
\setuplinenumbering[method=page]
\setupfootnotedefinition[location=serried]
\setupfootnotes[before={\startlinenumbering[continue]},after={\stoplinenumbering}]

\starttext
\startlinenumbering
\input knuth

some text\footnote{the first footnote}
more text\footnote{\dorecurse{10}{a very long footnote }}
\stoplinenumbering
\stoptext
--

but only the whole footnotefigure has one linenumber and it doesn't 
continue right if method=page is set.

Is there any solution to this?

Greetings, Martin
___
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] bug with floats and linenumbering (mkiv) ?

2011-09-28 Thread Martin Fechner

Hi all,

I use mkiv and have a text which combines floats and also has a 
linenumbering in a doublesided document. If the float is placed inside a 
paragraph the linenumbering  jumps to the left or right. But this 
happens only on right-hand pages. Here is a short example:


\setuplayout[width=120mm]
\setuppagenumbering[alternative=doublesided]
\setuplinenumbering[location=outer,method=page]

\starttext

\startlinenumbering
\placefigure[left,1*hang,none]{}
{\externalfigure[cow][width=0.2\textwidth]}

\input tufte

\placefigure[right,1*hang,none]{}
{\externalfigure[cow][width=0.2\textwidth]}

\input tufte
\stoplinenumbering

\stoptext

It seems to me that it is a bug.

Best regards,

Martin
___
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] endnotes/critical apparatus

2011-05-20 Thread Daniel Schopper

Great! Thanks a lot, Wolfgang!
Yet… I have some other questions:

- What about a simplified \page inside the lemma (not really common, but 
anyway…)? Adding

\appendtoks\def\page[#1]{}\to\simplifiedcommands
is ignored.

- How can I tweak the note mechanism to put the apparatus notes inside 
one single paragraph, concatenated by some arbitrary separator (\quad or 
-- or something similar)? (Eventually I‘d like the lemmatas which appear 
on the same page to be grouped in a paragraph) - I guess it should be 
somewhere in strc-not.mkiv but must have missed it…


Thanks again for the effort!
Daniel


minimal example:
\def\doifelsesamepagereference#1#2%
  {\doifelse
 {\doifreferencefoundelse{#1}{\currentreferencepage}{-}}
 {\doifreferencefoundelse{#2}{\currentreferencepage}{+}}
  }
\define[2]\Apparatus
  {\ifdefined\ApparatusCounter
 \doglobal\increment\ApparatusCounter
   \else
 \doglobal\newcounter\ApparatusCounter
   \fi
   \pagereference[apparatus:startpage:\ApparatusCounter]%

\startline[apparatus:line:\ApparatusCounter]{#1}\stopline[apparatus:line:\ApparatusCounter]%
   \pagereference[apparatus:stoppage:\ApparatusCounter]
   \expanded{
\endnote{
{\bf\at[apparatus:startpage:\ApparatusCounter]%
		 
\noexpand\doifelsesamepagereference{apparatus:startpage:\ApparatusCounter}{apparatus:stoppage:\ApparatusCounter}{}{-\at[apparatus:stoppage:\ApparatusCounter]}}%


/\noexpand\inline{{}}[apparatus:line:\ApparatusCounter]~%
{\noexpand\simplifycommands #1}]~{#2}
}
}%
  }
\setuplinenumbering[
method=page,
distance=0.3em
]

\appendtoks\def\blackrule[#1]{}\to\simplifiedcommands
\appendtoks \def\crlf{/}\to\simplifiedcommands
\appendtoks   \def\bf{}\to\simplifiedcommands
\appendtoks\def\page[#1]{\textbar\textbar}\to\simplifiedcommands

%\setuplabeltext[en][lines=,line=]

\setupnote
  [endnote]
  [textcommand=\gobbleoneargument,
   command=\gobbleoneargument,
 n=2]

\starttext

\startlinenumbering
That’s a \Apparatus{\bf qui\crlf te \page long lemma}{That’s a variant 
reading…}.\crlf

And here comes \Apparatus{another one}{the second one}.
\stoplinenumbering
\placenotes[endnote]

\stoptext

Am 19.05.11 23:23, schrieb Wolfgang Schuster:

Am 19.05.2011 um 17:42 schrieb Daniel Schopper:


  Dear list,
  I’m fiddling around with a simple apparatus for critical editions with 
endnotes. For now this is working ok - but I’m wondering if somebody could advise 
me on some aspects of it (see below). Here’s a minimal example:

  […]

  Now, this is obviously a really primitive approach (I’m still learning…) 
which I’d like to improve in some ways:

  - How can I get rid of the blackrule in the apparatus?
\noexpand\let\blackrule[#1]=\noexpand\relax
  throws an error (You can't use `macro parameter character #' in vertical 
mode.) while
\noexpand\let\blackrule=\noexpand\relax
  eliminates the rule but simply prints the arguments in the square brackets. 
(Same holds true for every macro with arguments.)

You can use \simplifycommands, see my example below.


  - What to do if I’d want to gobble \crlf or \par in the lemma while using 
them as separators after each apparatus entry? I tried to \let them to \relax, 
which ends in luatex getting stuck when it tries to import the .en-file.

  - How could I reset gobbled commands like \bf to their original meaning (I’d 
like to ignore \bf inside a lemma but still be able to have bold page numbers at 
the beginning of the apparatus entry)?

  I’m sure there are much more elegant ways to do this (probably in lua?), 
maybe someone could provide me with a hint where to start from?

You can use contexts own note mechanism to collect the data and place them 
later in your document.

\define[2]\Apparatus
   {\ifdefined\ApparatusCounter
  \doglobal\increment\ApparatusCounter
\else
  \doglobal\newcounter\ApparatusCounter
\fi
\pagereference[apparatus:page:\ApparatusCounter]%

\startline[apparatus:line:\ApparatusCounter]{#1}\stopline[apparatus:line:\ApparatusCounter]%
\begingroup\simplifycommands

\expanded{\endnote{\at[apparatus:page:\ApparatusCounter]/\noexpand\inline[apparatus:line:\ApparatusCounter]~{#1}]~{#2}}}%
\endgroup}

\appendtoks\def\blackrule[#1]{}\to\simplifiedcommands
\appendtoks \def\crlf{}\to\simplifiedcommands
\appendtoks   \def\bf{}\to\simplifiedcommands

\setuplabeltext[en][lines=,line=]

\setupnote
   [endnote]
   [textcommand=\gobbleoneargument,
command=\gobbleoneargument]

\starttext

\startlinenumbering
That’s a \Apparatus{\bf lemma}{That’s a variant reading…}. \input tufte

But then there’s a blackrule \Apparatus{\blackrule[width=5cm]\crlf and a 
linebreak}{-- which we don’t want to repeat in the apparatus.}.
\stoplinenumbering

\placenotes[endnote]

\stoptext

Wolfgang

[NTG-context] endnotes/critical apparatus

2011-05-19 Thread Daniel Schopper

Dear list,
I’m fiddling around with a simple apparatus for critical editions with 
endnotes. For now this is working ok - but I’m wondering if somebody 
could advise me on some aspects of it (see below). Here’s a minimal example:



\newwrite\enotes
\newread\readenotes
\immediate\openout\enotes = \jobname.en
\immediate\write\enotes{ %
\noexpand\let\noexpand\stretchednormalcase=\noexpand\relax
\noexpand\let\noexpand\tfc=\noexpand\relax
\noexpand\let\noexpand\bf=\noexpand\relax
%   \noexpand\let\par=\noexpand\relax % seems to make luatex hang?
}

\newcount\entrycounter \entrycounter=0

\setuplabeltext[en][lines=,line=]
\def\enseparator{\crlf}
\long\def\appEntry#1#2{
\expandafter\startline[line:\the\entrycounter]%
\expandafter\pagereference[page:\the\entrycounter]%
{#1}
\expandafter\stopline[line:\the\entrycounter]%
\immediate\write\enotes{%
		{\expandafter\at[page:\the\entrycounter]}/{\noexpand\csname 
inline\expandafter\endcsname[line:\the\entrycounter]}~{#1}] 
{#2}\enseparator%

}%
\global\advance\entrycounter by 1\relax
}

\def\printendnotes{
\immediate\closeout\enotes
\page[right]
\expandafter\input\jobname.en
}


\starttext
\startlinenumbering
That’s a \appEntry{\bf lemma}{That’s a variant reading…}. \input tufte\crlf
But then there’s a blackrule \appEntry{\blackrule[width=5cm]\crlf and a 
linebreak}{-- which we don’t want to repeat in the apparatus.}.

\stoplinenumbering
\printendnotes
\stoptext


Now, this is obviously a really primitive approach (I’m still learning…) 
which I’d like to improve in some ways:


- How can I get rid of the blackrule in the apparatus?
\noexpand\let\blackrule[#1]=\noexpand\relax
throws an error (You can't use `macro parameter character #' in vertical 
mode.) while

\noexpand\let\blackrule=\noexpand\relax
eliminates the rule but simply prints the arguments in the square 
brackets. (Same holds true for every macro with arguments.)


- What to do if I’d want to gobble \crlf or \par in the lemma while 
using them as separators after each apparatus entry? I tried to \let 
them to \relax, which ends in luatex getting stuck when it tries to 
import the .en-file.


- How could I reset gobbled commands like \bf to their original meaning 
(I’d like to ignore \bf inside a lemma but still be able to have bold 
page numbers at the beginning of the apparatus entry)?


I’m sure there are much more elegant ways to do this (probably in lua?), 
maybe someone could provide me with a hint where to start from?


Thanks in advance,
Daniel
___
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] endnotes/critical apparatus

2011-05-19 Thread Wolfgang Schuster

Am 19.05.2011 um 17:42 schrieb Daniel Schopper:

 Dear list,
 I’m fiddling around with a simple apparatus for critical editions with 
 endnotes. For now this is working ok - but I’m wondering if somebody could 
 advise me on some aspects of it (see below). Here’s a minimal example:
 
 […]
 
 Now, this is obviously a really primitive approach (I’m still learning…) 
 which I’d like to improve in some ways:
 
 - How can I get rid of the blackrule in the apparatus?
   \noexpand\let\blackrule[#1]=\noexpand\relax
 throws an error (You can't use `macro parameter character #' in vertical 
 mode.) while
   \noexpand\let\blackrule=\noexpand\relax
 eliminates the rule but simply prints the arguments in the square brackets. 
 (Same holds true for every macro with arguments.)

You can use \simplifycommands, see my example below.

 - What to do if I’d want to gobble \crlf or \par in the lemma while using 
 them as separators after each apparatus entry? I tried to \let them to 
 \relax, which ends in luatex getting stuck when it tries to import the 
 .en-file.
 
 - How could I reset gobbled commands like \bf to their original meaning (I’d 
 like to ignore \bf inside a lemma but still be able to have bold page numbers 
 at the beginning of the apparatus entry)?
 
 I’m sure there are much more elegant ways to do this (probably in lua?), 
 maybe someone could provide me with a hint where to start from?

You can use contexts own note mechanism to collect the data and place them 
later in your document.

\define[2]\Apparatus
  {\ifdefined\ApparatusCounter
 \doglobal\increment\ApparatusCounter
   \else
 \doglobal\newcounter\ApparatusCounter
   \fi
   \pagereference[apparatus:page:\ApparatusCounter]%
   
\startline[apparatus:line:\ApparatusCounter]{#1}\stopline[apparatus:line:\ApparatusCounter]%
   \begingroup\simplifycommands
   
\expanded{\endnote{\at[apparatus:page:\ApparatusCounter]/\noexpand\inline[apparatus:line:\ApparatusCounter]~{#1}]~{#2}}}%
   \endgroup}

\appendtoks\def\blackrule[#1]{}\to\simplifiedcommands
\appendtoks \def\crlf{}\to\simplifiedcommands
\appendtoks   \def\bf{}\to\simplifiedcommands

\setuplabeltext[en][lines=,line=]

\setupnote
  [endnote]
  [textcommand=\gobbleoneargument,
   command=\gobbleoneargument]

\starttext

\startlinenumbering
That’s a \Apparatus{\bf lemma}{That’s a variant reading…}. \input tufte

But then there’s a blackrule \Apparatus{\blackrule[width=5cm]\crlf and a 
linebreak}{-- which we don’t want to repeat in the apparatus.}.
\stoplinenumbering

\placenotes[endnote]

\stoptext

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] Fastcolor and linenumbering in MkII

2011-04-20 Thread Hans Hagen

On 20-4-2011 6:32, Aditya Mahajan wrote:

Hi,

In MkII, linenumbering stops working if \dostartattributes with a color
is used inside; for example:

\setupcolors[state=start]
\getparameters[test][color=red,style=]

\starttext
\startlinenumbering
\dostartattributes{test}{style}{color}
Why no number?
\dostopattributes
\stoplinenumbering
\stoptext

The output of the above does not have a line number. I have been able to
reduce it to the following minimal example.

\setupcolors[state=start]
\starttext
\startlinenumbering
\faststartcolor[red]
Why no number?
\faststopcolor
\stoplinenumbering
\stoptext

It works if I add any text before \faststartcolor

\setupcolors[state=start]
\starttext
\startlinenumbering
Got it now!
% or \strut
\faststartcolor[red]
Why no number?
\faststopcolor
\stoplinenumbering
\stoptext

What is going on here?


probably some side effect of grouping and/or colors being pdfliterals 
(you can find out by putting a \tracingall someplace clever and compere 
the outputs ... taco is a real master in that art of comparison


Hans

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


[NTG-context] Fastcolor and linenumbering in MkII

2011-04-19 Thread Aditya Mahajan

Hi,

In MkII, linenumbering stops working if \dostartattributes with a color is 
used inside; for example:


\setupcolors[state=start]
\getparameters[test][color=red,style=]

\starttext
\startlinenumbering
\dostartattributes{test}{style}{color}
Why no number?
\dostopattributes
\stoplinenumbering
\stoptext

The output of the above does not have a line number. I have been able to 
reduce it to the following minimal example.


\setupcolors[state=start]
\starttext
\startlinenumbering
\faststartcolor[red]
Why no number?
\faststopcolor
\stoplinenumbering
\stoptext

It works if I add any text before \faststartcolor

\setupcolors[state=start]
\starttext
\startlinenumbering
Got it now!
% or \strut
\faststartcolor[red]
Why no number?
\faststopcolor
\stoplinenumbering
\stoptext

What is going on here?

Of course, everything works correctly in 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] counter values as label names

2011-01-04 Thread Daniel Schopper
Thomas and Aditya, thank you both for your replies! As Thomas already 
suspected it was a mere typo that \advance\entrycounter lied outside of 
the macro definition - sorry for the unnecessary confusion.
I tried to compile Aditya's attempt (MKIV  ver: 2010.12.31) but receive 
the following errors:


references  : unknown reference [][lr:b:line:0]
! Missing control sequence inserted.
inserted text \inaccessible

 I am not sure what you want to do,
My simple idea - being a total newbie to macro programming - was to 
create an automation of the following, in which the unique numbers in 
the label names would be inserted by a counter:


\starttext
\startlinenumbering
This is a sample %
% wrapper macro would start here
\startline[line:1]\pagereference[page:1]lemma\stopline[line:1]
\footnote{\at[page:1] \inline[line:1] some comment}%
% and end here
. \crlf
And this is another 
\startline[line:2]\pagereference[page:2]one\stopline[line:2]\footnote{\at[page:2] 
\inline[line:2] another comment}. \crlf

\stoplinenumbering
\bigskip
Endnotes
\placefootnotes
\stoptext

But probably my whole approach is completely out of the (Con)TeXt-Way of 
thinking… (May it be possible to collect the endnotes into various 
buffers and recurse over them at the end?)

Thanks for the hints,
Daniel



Am 03.01.11 23:23, schrieb Aditya Mahajan:

On Mon, 3 Jan 2011, Daniel Schopper wrote:


First of all thanks for the advice and sorry for my naïve posting!
Here's a test file for what I try to do. The problem is that the page-
and linenumbers printed by \placefootnotes all take the values of the
last reference.

\setupfootnotes[
location=text,
numberconversion=empty,
paragraph=,
]
\newcount\entrycounter
\entrycounter=0
\def\appentry#1#2{%
\startline[line:\the\entrycounter]%
\pagereference[page:\the\entrycounter]%
#1%
\stopline[line:\the\entrycounter]%
\footnote{{\bf \at[page:\the\entrycounter]}
\inline[line:\the\entrycounter] #1] #2}}%
\advance\entrycounter by1%
\starttext\startlinenumbering
This is a sample \appentry{paragraph}{om. h1}.\\
An this is another \appentry{one}{sentence}.
\stoplinenumbering
\bigskip
Endnotes
\placefootnotes
\stoptext


Finally: is the format of your apparatus (endnotes) a requirement?

Yes, unfortunately it is.


I am not sure what you want to do, but the following at least increments
the references (in MKIV)

\setupfootnotes
[
location=text,
numberconversion=empty,
paragraph=,
]

\newcount\entrycounter \entrycounter=0
\def\appentry#1#2%
{\expanded
{\startline[line:\the\entrycounter]%
\noexpand\pagereference[page:\the\entrycounter]%
#1%
\noexpand\stopline[line:\the\entrycounter]%
\noexpand\footnote{{\bf \at[page:\the\entrycounter]}
\inline[line:\the\entrycounter]
#1 #2}}%
\advance\entrycounter by 1\relax}

\starttext
\startlinenumbering
This is a sample \appentry{paragraph}{om. h1}. \crlf
An this is another \appentry{one}{sentence}.
\stoplinenumbering
\bigskip
Endnotes
\placefootnotes
\stoptext


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
___

___
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] counter values as label names

2011-01-03 Thread Daniel Schopper

First of all thanks for the advice and sorry for my naïve posting!
Here's a test file for what I try to do. The problem is that the page- 
and linenumbers printed by \placefootnotes all take the values of the 
last reference.


\setupfootnotes[
location=text,
numberconversion=empty,
paragraph=,
]
\newcount\entrycounter
\entrycounter=0
\def\appentry#1#2{%
\startline[line:\the\entrycounter]%
\pagereference[page:\the\entrycounter]%
#1%
\stopline[line:\the\entrycounter]%
	\footnote{{\bf \at[page:\the\entrycounter]} 
\inline[line:\the\entrycounter] #1] #2}}%

\advance\entrycounter by1%
\starttext\startlinenumbering
This is a sample \appentry{paragraph}{om. h1}.\\
An this is another \appentry{one}{sentence}.
\stoplinenumbering
\bigskip
Endnotes
\placefootnotes
\stoptext


Finally: is the format of your apparatus (endnotes) a requirement?

Yes, unfortunately it is.

Thanks again,
Daniel
___
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] counter values as label names

2011-01-03 Thread Thomas A. Schmitz

On Jan 3, 2011, at 7:09 PM, Daniel Schopper wrote:

 \setupfootnotes[
   location=text,
   numberconversion=empty,
   paragraph=,
   ]
 \newcount\entrycounter
 \entrycounter=0
 \def\appentry#1#2{%
   \startline[line:\the\entrycounter]%
   \pagereference[page:\the\entrycounter]%
   #1%
   \stopline[line:\the\entrycounter]%
   \footnote{{\bf \at[page:\the\entrycounter]} 
 \inline[line:\the\entrycounter] #1] #2}}%
   \advance\entrycounter by1%
 \starttext\startlinenumbering
 This is a sample \appentry{paragraph}{om. h1}.\\
 An this is another \appentry{one}{sentence}.
 \stoplinenumbering
 \bigskip
 Endnotes
 \placefootnotes
 \stoptext

Tricky. I can't figure out how to do it. First, the code you write can never 
work. You define a \newcount and set it to 0. Before your text starts, you 
increase this count, so now its value is 1. Then, you never touch this value 
again, so effectively, all your references expand to page:1 and line:1. (And, 
on top of it all, your file has only one line since \\ doesn't start a new 
line.) But even if you try to increment your counter within the definition of 
your macro, it won't work because it will be advanced and frozen by the time 
your footnotes are typeset. So this approach will not work, I'm afraid. I'm not 
sure this can be done in ConTeXt.

Thomas
___
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] counter values as label names

2011-01-03 Thread Aditya Mahajan

On Mon, 3 Jan 2011, Daniel Schopper wrote:


First of all thanks for the advice and sorry for my naïve posting!
Here's a test file for what I try to do. The problem is that the page- and 
linenumbers printed by \placefootnotes all take the values of the last 
reference.


\setupfootnotes[
location=text,
numberconversion=empty,
paragraph=,
]
\newcount\entrycounter
\entrycounter=0
\def\appentry#1#2{%
\startline[line:\the\entrycounter]%
\pagereference[page:\the\entrycounter]%
#1%
\stopline[line:\the\entrycounter]%
	\footnote{{\bf \at[page:\the\entrycounter]} 
\inline[line:\the\entrycounter] #1] #2}}%

\advance\entrycounter by1%
\starttext\startlinenumbering
This is a sample \appentry{paragraph}{om. h1}.\\
An this is another \appentry{one}{sentence}.
\stoplinenumbering
\bigskip
Endnotes
\placefootnotes
\stoptext


Finally: is the format of your apparatus (endnotes) a requirement?

Yes, unfortunately it is.


I am not sure what you want to do, but the following at least increments 
the references (in MKIV)


\setupfootnotes
[
 location=text,
 numberconversion=empty,
 paragraph=,
]

\newcount\entrycounter \entrycounter=0
\def\appentry#1#2%
  {\expanded
{\startline[line:\the\entrycounter]%
\noexpand\pagereference[page:\the\entrycounter]%
#1%
 \noexpand\stopline[line:\the\entrycounter]%
 \noexpand\footnote{{\bf \at[page:\the\entrycounter]}
 \inline[line:\the\entrycounter]
 #1 #2}}%
 \advance\entrycounter by 1\relax}

\starttext
\startlinenumbering
This is a sample \appentry{paragraph}{om. h1}. \crlf
An this is another \appentry{one}{sentence}.
\stoplinenumbering
\bigskip
Endnotes
\placefootnotes
\stoptext


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
___


[NTG-context] Hook environment into head/structure setup

2010-11-15 Thread Andreas Harder
Hi all,

I don't think it is yet possible, but it would be nice if there was something 
like:

\setuphead % or perhaps \setupstructure
  [chapter]
  [beforestructure=\startlinenumbering,
afterstructure=\stoplinenumbering]

Which should result in:

\startlinenumbering
  \startchapter[title=test]
Text
  \stopchapter
\stoplinenumbering

Is there already a way to achieve this? I've consequently used 
\start-\stopchapter, maybe one can append \start-\stoplinenumbering to them?

I would appreciate any help

Andreas
___
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] Verbatim typing with numbers inside float

2010-10-06 Thread Hans Hagen

On 6-10-2010 4:26, Stefan Müller wrote:

Hi list,

I defined a float for typesetting algorithms, so I can reference them at
other places in the document.

\definefloat[algorithm][algorithms]

When I now place such a figure with

\placealgorithm[here][alg:myalgorithm]{Very neat algorithm.}{
\starttyping
some source code
\stoptyping
}

then the numbering I set up with

\setuptyping[numbering=line]
\setuplinenumbering[location=text]

is gone. Is there a way to get around this? I try to not use itemize for
this (although it seems to work with itemize), because I'd rather use
the more semantically correct approach. Any help appreciated.


this sort of works

\startbuffer
some source code
some source code
some source code
\stopbuffer

\setuplinenumbering[style=\ttx,distance=0em,width=1em]

\startsetups algorithm
\startlinenumbering
\setuptyping[file][before=,after=]
\framed[strut=no,align=normal,frame=off]{\typebuffer}
\stoplinenumbering
\stopsetups

\placealgorithm
  [here][alg:myalgorithm]
  {Very neat algorithm.}
  {\directsetup{algorithm}}



-
  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] present state of critical editions with ConTeXt MKIV ?

2010-10-04 Thread Hans Hagen

On 4-10-2010 3:12, Talal Al-Azem wrote:

Dear Hans,

Thank you once again for your response. I have attached a sample file showing 
examples of each of the matters discussed below which you requested. It was 
produced using LaTeX and Uwe Lück's excellent ednotes package. Of course, I 
couldn't produce an example of parallel texts, because to the best of my 
knowledge there is no robust system for that anywhere (my definition of 
'robust' means it can handle RtL languages, like Arabic, as easily as ConTeXt 
does).


\starttext

\definedescription[lemma]
\setupdescriptions[lemma][before=,after=,location=serried,width=fit]

% ln: will disappear when this is stable

\setupnote 
[ln:linenote][paragraph=yes,numbercommand=,inbetween=\hskip.5em\vl\hskip.5em]
\setupdescriptions[ln:linenote][display=no,location=serried,distance=.5em] 
% before=,after=


\setuplinenumbering[align=flushleft]

\startlinenumbering[100]
test \linenote {\startlemma{oeps 1} \input tufte\stoplemma} test test 
test test test test

test \startlinenote [well] {oeps X} test test test test test test
test \linenote {oeps 2} test test test test test test
test \linenote {oeps 3} test test test test test test
test \linenote {oeps 4} test test test test test test
test \linenote {oeps 5} test test test test test test
test \stoplinenote [well] test test test test test test
\stoplinenumbering

\stoptext

not entirely but somewhat similar

best is to team with Idris and Thomas in writing down specs for what 
more needed


Hans

-
  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] Problems with Mark IV (MacTeX 2009)

2010-06-25 Thread David Abdurachmanov

I had earlier problems with line numbering, after cleaning MacTeX from my Mac 
and fully reinstalling and updating (I even updated ConTeXt to the latest 
version as described in wiki and regenerated everything) and again have 
problems. The good sign is that ConTeXt works without problems, but behavior is 
different. All my line numberings are gone.
Looks like \startlinenumbering only numbers that lines that are longer and does 
not fit to the page. If the line is shorter it's not numbered. Mostly all lines 
at the end of paragraph are not numbered and source code examples too.
Is that default behavior in latest version?
I am still new in TeX world, but ConTeXt looks quite good compared to LaTeX, 
but I keep bumping into problems.
That ConTeXt minimals give full support of ConTeXt?
BTW, any good syntax highlighters for ConTeXt (C#, F#, etc.)? Looks at 
http://www.pragma-ade.com/general/manuals/cont-enp.pdf 100th page I see, that 
you have minimal support for some languages. 
david

 Date: Fri, 25 Jun 2010 11:38:55 +0200
 From: mojca.miklavec.li...@gmail.com
 To: ntg-context@ntg.nl
 Subject: Re: [NTG-context] Problems with Mark IV (MacTeX 2009)
 
 2010/6/25 David Abdurachmanov wrote:
  Hi,
  After finding out that line numbering works different in Mark IV I tried
  using this version on Mac OS X via MacTeX 2009.
 
 Don't. MacTeX 2009 doesn't work with Mark IV, and even if it would,
 it's way too old.
 
 If you want to install and use MacTeX, download it from one of the
 servers mentioned in
 http://tug.org/texlive/pretest.html
 
 For example this one:
 http://ftp.cstug.cz/pub/tex/local/tlpretest/
 
 But it's probably better to also try to install ConTeXt minimals (you
 can easily switch between both - you just need to set PATH in
 .bash_profile or on the fly).
 
 I didn't install MacTeX this time, but rather a normal TeX Live with
 ConTeXt scheme (2GB was a lot).
 
 Mojca
 ___
 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
 ___
  
_
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969___
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] Problems with Mark IV (MacTeX 2009)

2010-06-25 Thread Hans Hagen

On 25-6-2010 12:09, David Abdurachmanov wrote:


I had earlier problems with line numbering, after cleaning MacTeX from my Mac 
and fully reinstalling and updating (I even updated ConTeXt to the latest 
version as described in wiki and regenerated everything) and again have 
problems. The good sign is that ConTeXt works without problems, but behavior is 
different. All my line numberings are gone.
Looks like \startlinenumbering only numbers that lines that are longer and does 
not fit to the page. If the line is shorter it's not numbered. Mostly all lines 
at the end of paragraph are not numbered and source code examples too.
Is that default behavior in latest version?
I am still new in TeX world, but ConTeXt looks quite good compared to LaTeX, 
but I keep bumping into problems.
That ConTeXt minimals give full support of ConTeXt?


example code needed

-
  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] Problems with Mark IV (MacTeX 2009)

2010-06-25 Thread David Abdurachmanov

No more needed. I removed MacTeX 2009 completely again and installed ConTeXt 
minimal distribution. Installation was flawless and it worked fine again. Maybe 
updating ConTeXt under MacTeX 2009 using this guide 
http://wiki.contextgarden.net/Running_Mark_IV (Update ConTeXt section) did 
something wrong?
 Date: Fri, 25 Jun 2010 12:55:21 +0200
 From: pra...@wxs.nl
 To: ntg-context@ntg.nl
 CC: cyba...@hotmail.com
 Subject: Re: [NTG-context] Problems with Mark IV (MacTeX 2009)
 
 On 25-6-2010 12:09, David Abdurachmanov wrote:
 
  I had earlier problems with line numbering, after cleaning MacTeX from my 
  Mac and fully reinstalling and updating (I even updated ConTeXt to the 
  latest version as described in wiki and regenerated everything) and again 
  have problems. The good sign is that ConTeXt works without problems, but 
  behavior is different. All my line numberings are gone.
  Looks like \startlinenumbering only numbers that lines that are longer and 
  does not fit to the page. If the line is shorter it's not numbered. Mostly 
  all lines at the end of paragraph are not numbered and source code examples 
  too.
  Is that default behavior in latest version?
  I am still new in TeX world, but ConTeXt looks quite good compared to 
  LaTeX, but I keep bumping into problems.
  That ConTeXt minimals give full support of ConTeXt?
 
 example code needed
 
 -
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
 -
  
_
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969___
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] Sorting the content of \startlines

2010-04-24 Thread Vyatcheslav Yatskovsky

Hello,

Is there a way to sort the content of \startlines envinroment by the 
alphabet? I have a list of songs in arbitrary order, and what to output 
it in alphabetical one.


ex.:

\starttext
\subject{My set-list}
\startcolumns\startlinenumbering\startlines
Fly me to the moon
Hit the road jack
Sway
Libertango
Sunny
% and more titles
\stoplines\stoplinenumbering\stopcolumns
\stoptext

--
Best Regards,
Vyatcheslav Yatskovsky
___
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] page-break

2010-04-23 Thread Jörg Hagmann
No reaction to this question so far. I realise that, without a minimal 
example, it is difficult to know what is happening. But I don't believe 
that the problem never occurs to others. Maybe you have some general 
suggestions as what to try? The page breaks as soon as the paragraph 
starting with S. 33 Zwergammer... contains more than one line.


An additional information:
\adaptlayout[43][lines=+1] (or height=+ something] gives an error (on 
any page in the document):


-snip
verfull \hbox (40.14098pt too wide) in paragraph at lines 345--345
[][]\*jhgentium10.5ptrmbf* Som-m-er-gold-hähn-chen 
\*jhgentium10.5ptrmtf* -- \*jhgentium10.5ptrmit* Roi-te-let à triple 
ban-deau \*jhgentium10.5ptrmtf* -- Regu-lus igni-ca-pilla: 
Januar/Februar-Beob-

!pages  : flushing realpage 38, userpage 40
!pages  : flushing realpage 39, userpage 41
!pages  : flushing realpage 40, userpage 42
!pages  : flushing realpage 41, userpage 43
!pages  : flushing realpage 42, userpage 44
layout  : textheight adapted with +2 lines at page 43
! Extra \else.
\handlestreamoutput ...aultstreamoutput \fi \else
  \the 
\normalstreamoutput \fi

\invokenormaloutputroutine ...\OTRcommand \output
  \fi
output ...e \everybeforeoutput \the \mainoutput
  \the \everyafteroutput }
\obeyedline -\par
   \futurelet \next \dobetweenthelines
l.399 ...htung eines Ind. am 20.9. bei Seltisberg.

?
---snip--

Please have a look at the pdf-files (http://www.ogbasel.ch/version-1.pdf 
and http://www.ogbasel.ch/version-page-no.pdf) and tell me what you think.

Thank you, Jörg

On 4/20/10 10:05 AM, Jörg Hagmann wrote:

Dear list members,

My biggest problem have always been seemingly arbitrary page breaks 
occuring every now and then in larger documents; and because I don't 
see a pattern, I can't create a minimal example.  But maybe you can 
make a suggestion based on the following:


The section below produces a page break seen in 
http://www.ogbasel.ch/version-1.pdf.
If the line \page[no] is inserted, the page break occurs as shown in 
http://www.ogbasel.ch/version-page-no.pdf


Mark IV, on linux and Leopard
Context version 2010.03.02 12:34
The font is Gentium at 10.5

Thanks, Jörg


-snip--
{\bf Grauammer} -- {\it Bruant proyer} -- Emberiza calandra: Am 28.2. 
konnte LEU einen Sänger in der PCA feststellen. Am 29.3. sah und hörte 
KEL 3 Ind. in Iselisboden bei Hésingue und 1 Ind. bei der Neudörfler 
Lache bei Village-Neuf. AMA meldet die Beobachtung eines Ind. am 8.6. 
in der PCA und KEL eines Ind. am 21.6. in Iselisboden bei Hésingue. 
OES sah am 3.7. 1 Ind. in einer Buntbrache zwischen Reinach und Aesch.


\stoplines
%\stoplinenumbering

\section{Nachträge zum Jahresbericht 2007}

%\startlinenumbering

S. 29 Goldhähnchenlaubsänger -- Pouillot de Pallas -- Phylloscopus 
proregulus: Am 15.12. sah M. Solari 1 Ind. bei St-Louis. Die 
Beobachtung wurde vom Comité National de Homologation angenommen 
(mitgeteilt durch BLA).


\page[no]  %%%  without this line in version-1.pdf, with the 
line in version-page-no.pdf


S. 33 Zwergammer -- Bruant nain -- Emberiza pusilla: Am 5.10. wurde in 
der PCA 1 Ind. von M.Baumann, B. Scaar et al. gefangen. Die Bestimmung 
wurde vom Comité National de Homologation angenommen (mitgeteilt durch 
BLA).


%\stoplinenumbering

\section{Zitierte Literatur}

%\startlinenumbering

Volet, B. 2006: Liste der Vogelarten der Schweiz. Ornithol. Beobachter 
103: 271-294


%\stoplinenumbering

\section[title:abbrev]{Abkürzungen -- Abbréviations}
\subsubsubject{Abkürzungen der erwähnten Einsenderinnen und Einsender 
von Beobachtungen}

snip-

___
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] page-break

2010-04-20 Thread Jörg Hagmann

Dear list members,

My biggest problem have always been seemingly arbitrary page breaks 
occuring every now and then in larger documents; and because I don't see 
a pattern, I can't create a minimal example.  But maybe you can make a 
suggestion based on the following:


The section below produces a page break seen in 
http://www.ogbasel.ch/version-1.pdf.
If the line \page[no] is inserted, the page break occurs as shown in 
http://www.ogbasel.ch/version-page-no.pdf


Mark IV, on linux and Leopard
Context version 2010.03.02 12:34
The font is Gentium at 10.5

Thanks, Jörg


-snip--
{\bf Grauammer} -- {\it Bruant proyer} -- Emberiza calandra: Am 28.2. 
konnte LEU einen Sänger in der PCA feststellen. Am 29.3. sah und hörte 
KEL 3 Ind. in Iselisboden bei Hésingue und 1 Ind. bei der Neudörfler 
Lache bei Village-Neuf. AMA meldet die Beobachtung eines Ind. am 8.6. in 
der PCA und KEL eines Ind. am 21.6. in Iselisboden bei Hésingue. OES sah 
am 3.7. 1 Ind. in einer Buntbrache zwischen Reinach und Aesch.


\stoplines
%\stoplinenumbering

\section{Nachträge zum Jahresbericht 2007}

%\startlinenumbering

S. 29 Goldhähnchenlaubsänger -- Pouillot de Pallas -- Phylloscopus 
proregulus: Am 15.12. sah M. Solari 1 Ind. bei St-Louis. Die Beobachtung 
wurde vom Comité National de Homologation angenommen (mitgeteilt durch BLA).


\page[no]  %%%  without this line in version-1.pdf, with the 
line in version-page-no.pdf


S. 33 Zwergammer -- Bruant nain -- Emberiza pusilla: Am 5.10. wurde in 
der PCA 1 Ind. von M.Baumann, B. Scaar et al. gefangen. Die Bestimmung 
wurde vom Comité National de Homologation angenommen (mitgeteilt durch 
BLA).


%\stoplinenumbering

\section{Zitierte Literatur}

%\startlinenumbering

Volet, B. 2006: Liste der Vogelarten der Schweiz. Ornithol. Beobachter 
103: 271-294


%\stoplinenumbering

\section[title:abbrev]{Abkürzungen -- Abbréviations}
\subsubsubject{Abkürzungen der erwähnten Einsenderinnen und Einsender 
von Beobachtungen}

snip-

___
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] Line numbering in columns

2010-03-31 Thread Vyatcheslav Yatskovsky

Hello,

I'm just curious, why line mumbers appear mirrored (on the right side of 
text) in the rightmost column?


\starttext
\startcolumns\startlinenumbering\startlines
Fly me to the moon
Hit the road jack
Sway
Libertango
Sunny
Besame mucho (Em)
La Bamba
Hey-na-na-na
Venus (Dm)
El Talisman
Oye Como Va
Chatanooga choocho (capo II)
Beautiful
Agua de beber + Masquenada
Kiss Me
Ain't it Funny
Pasadena
Don’t Want To Miss A Thing (capo II)
Old Devil Moon (capo II)
Got My Mind Set On You
Baila Morena
\stoplines\stoplinenumbering\stopcolumns
\stoptext

Another question is options of linenumbering command. Context 2006.03.20 
introduced A few extra options for \startlinenumbering, but texshow 
show only [continue] option.


Vyatcheslav

___
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] Indent after \startline[… ]

2009-12-16 Thread Andreas Harder
Hi all,

how can I prevent the indent after a \startline[…]-construct. Here is an 
example:

\setupindenting[medium,next,yes]

\def\NoIndent{\noindentation{\red\bf Indent?}\enspace} 

\startbuffer
  \dorecurse{3}{\dorecurse{10}{some text, } \par }
\stopbuffer


\starttext  \showframe
\getbuffer \blank

\startlinenumbering
  \startline[lin:1]
\NoIndent \getbuffer
  \stopline[lin:1]
  
  \NoIndent \getbuffer
\stoplinenumbering

\blank \getbuffer
\stoptext

To make myself clear, I want indenting but not inside the 
linenumbering-environment. I tried already to play with \setuplinenumbering but 
there is no ‘before’-key in the setup and ‘command’ only applies to the numbers.

I appreciate any help

Andreas
___
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] Indent after \startline[…]

2009-12-16 Thread Wolfgang Schuster

Am 16.12.2009 um 11:43 schrieb Andreas Harder:

 Hi all,
 
 how can I prevent the indent after a \startline[…]-construct. Here is an 
 example:
 
 \setupindenting[medium,next,yes]
 
 \def\NoIndent{\noindentation{\red\bf Indent?}\enspace} 
 
 \startbuffer
  \dorecurse{3}{\dorecurse{10}{some text, } \par }
 \stopbuffer
 
 
 \starttext  \showframe
 \getbuffer \blank
 
 \startlinenumbering
  \startline[lin:1]
\NoIndent \getbuffer
  \stopline[lin:1]
 
  \NoIndent \getbuffer
 \stoplinenumbering
 
 \blank \getbuffer
 \stoptext
 
 To make myself clear, I want indenting but not inside the 
 linenumbering-environment. I tried already to play with \setuplinenumbering 
 but there is no ‘before’-key in the setup and ‘command’ only applies to the 
 numbers.

Define your own environment.

\definestartstop
  [Linenumbering]
  [before={\setupindenting[no]\startlinenumbering},
   after=\stoplinenumbering]

\starttext

...

\startLinenumbering
...
\stopLinenumbering

...

\stoptext

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] Indent after \startline[…]

2009-12-16 Thread Andreas Harder

Am 16.12.2009 um 18:40 schrieb Wolfgang Schuster:

 
 Am 16.12.2009 um 11:43 schrieb Andreas Harder:
 
 Hi all,
 
 how can I prevent the indent after a \startline[…]-construct. Here is an 
 example:
 
 \setupindenting[medium,next,yes]
 
 \def\NoIndent{\noindentation{\red\bf Indent?}\enspace} 
 
 \startbuffer
 \dorecurse{3}{\dorecurse{10}{some text, } \par }
 \stopbuffer
 
 
 \starttext  \showframe
 \getbuffer \blank
 
 \startlinenumbering
 \startline[lin:1]
   \NoIndent \getbuffer
 \stopline[lin:1]
 
 \NoIndent \getbuffer
 \stoplinenumbering
 
 \blank \getbuffer
 \stoptext
 
 To make myself clear, I want indenting but not inside the 
 linenumbering-environment. I tried already to play with \setuplinenumbering 
 but there is no ‘before’-key in the setup and ‘command’ only applies to the 
 numbers.
 
 Define your own environment.
 
 \definestartstop
  [Linenumbering]
  [before={\setupindenting[no]\startlinenumbering},
   after=\stoplinenumbering]

Thank you! It works if I put  \setupindenting[no] after \startlinenumbering. 

Andreas___
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] \inline[…]

2009-11-07 Thread Hans Hagen

Andreas Harder wrote:

Hello Hans!

If referencing to the same line, the line will be displayed twice. I 
tried Wolfgangs 
patch: http://archive.contextgarden.net/message/20091018.091419.18877aa9..en.html 
http://archive.contextgarden.net/message/20091018.091419.18877aa9.en.html but 
it did not help.


\starttext
\startlinenumbering
  \someline[a]We thrive in information--thick worlds because of our
  marvelous and everyday ca-pacity to select, …\someline[b] 
\stoplinenumbering


\inline[a] or \inline[b]
\stoptext


should work ok 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
___


[NTG-context] Error with the new luatex

2009-10-30 Thread Alain Delmotte

Hi!

I could compile the following document (part of it givne here):

==
\starttext

\startlinenumbering
Thus, I came to the conclusion that the designer of a new system
must not only be the implementer and first large--scale user;\someline[here]
the designer should also write the first user manual.

.../...

\stoplinenumbering

see at \inline{line}[here], \inline{line}[there] and also at 
\inline{line}[range]


\stoptext
==
Now, version 0.44, I get an error:
==
! LuaTeX error no string to print
stack traceback:
   [C]: in function 'texsprint'
   ...TeXt/tex/texmf-context/tex/context/base/strc-ref.lua:840: in 
function 'get_current_prefixspec'

   main ctx instance:1: in main chunk.
\currentreferencecontent ...ixspec(\v!default )}
 )}
argument ...freference \currentreferencecontent
 \rightofreference
\doifelsenothing #1-\edef \!!stringa {#1
}\ifx \!!stringa \empty 
\expandafte...

argument ...referencecontent \rightofreference }
 \dosymbolreference 
\dowant...

\firstoftwoarguments #1#2-#1
   
\dodoinatreferenceindeed ...eference {#1}{#2}[#4]}

 \endgroup
...
l.20 see at \inline{line}[here]
  , \inline{line}[there] and also at 
\inline{li...

?
=
So the label to the line is not known?!

Alain

___
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 with \inline[…]

2009-10-29 Thread Andreas Harder

Hello Hans.

With the current beta referencing lines is broken again. It used to  
work yesterday.


Here is a test file and the error message:

\starttext
\startlinenumbering
  \input tufte \someline[lin:b]
  \startline[lin:a]
\input tufte
  \stopline[lin:a]
\stoplinenumbering
\inline[lin:b]
\stoptext

! LuaTeX error no string to print
stack traceback:
[C]: in function 'texsprint'
	...text/tex/texmf-context/tex/context/base/strc-ref.lua:840: in  
function 'get_current_prefixspec'

main ctx instance:1: in main chunk.
\currentreferencecontent ...ixspec(\v!default )}
  )}
argument ...freference \currentreferencecontent
  \the  
\rightreferencetoks \...

\doifelsenothing #1-\edef \!!stringa {#1
 }\ifx \!!stringa \empty  
\expandafte...

argument ...ghtreferencetoks \rightofreference }
  \dosymbolreference  
\dowant...

\firstoftwoarguments #1#2-#1

\dodoinatreferenceindeed ...eference {#1}{#2}[#4]}
  \endgroup
...
l.9 \inline[lin:b]


Thanks in advance!

Andreas
___
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] \starbuffer in own macros

2009-10-18 Thread Wolfgang Schuster


Am 18.10.2009 um 12:02 schrieb Andreas Harder:

Before I help you provide us with more information, e.g. should the  
text in the buffer

appear also in the complete text or do you it only in the snippet?


Sorry, that I did not make myself clear. The real setup is: I've a  
lot of line numbered text in the appendix of the document. In the  
body I'd like to cite out of it (with the same line numbers as in  
the source/appendix). The appendix should stay unchanged.


For the beginning you can play with this code, it has to be changed
in a few parts (e.g. make \setuplines local) but it's what I can read
from your description above and the code you showed in the previous  
message.


\def\doifelsesamelinereference#1#2#3%
  {\doifreferencefoundelse{lr:b:#1}
 {\edef\fline{\currentreferencedefault}% was \currentreferencetext
  \doifreferencefoundelse{lr:e:#1}
{\edef\tline{\currentreferencedefault}% was  
\currentreferencetext

 \ifx\fline\tline#2\else#3\fi}
{\unknownreference{#1}#2}}
 {\unknownreference{#1}#2}}

\def\startMyCite[#1]%
  {\def\stopMyCite
 {\setuplines[before=,after=]%
  \startlines\startline[#1]\getbuffer[#1]\stopline[#1]\stoplines
  \savebuffer[#1]}%
   \dostartbuffer[#1][startMyCite][stopMyCite]}

\def\getMyCite[#1]%
  {\doifreferencefoundelse{lr:b:#1}
 {\startlinenumbering[\currentreferencedefault]}
  \startlinenumbering
   \startlines\readfile{\jobname-#1.tmp}{}{}\stoplines
   \stoplinenumbering}

\starttext

\startbodymatter
  test text test text test text test text test text test text test
  text test text test text test text test text test text test text

  she told: \getMyCite[test] % perhaps better \getMyCite[test]

  test text test text test text test text test text test text test
  text test text test text test text test text test text test text
\stopbodymatter


\startappendices
  \startlinenumbering
We thrive in information--thick worlds because of our marvelous
and everyday ca- pacity to select, edit, single out, structure,
highlight, group, pair, merge, harmo- nize, synthesize, focus,
\startMyCite[test]
  organize, condense, reduce, boil down, choose, categorize,
  catalog, classify, list, abstract, scan, look into, idealize,
  isolate, discriminate, dis- tinguish, screen, pigeonhole, pick
  over, sort, integrate, blend, inspect, filter, lump, skip,
  smooth, chunk, average, approximate, cluster, aggregate,
  outline, summarize, itemize, review, dip into, flip through,
  browse, glance into, leaf through,
\stopMyCite
skim, re- fine, enumerate, glean, synopsize, winnow the wheat from
the chaff and separate the sheep from the goats.
  \stoplinenumbering
\stopappendices

\stoptext

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
___


[NTG-context] Line Numbering and References

2009-10-14 Thread Andreas Harder

Hello all,

I have a problem with referencing from a line numbered text.

In page-lin.mkiv I've found the \inline-command, but I can't make use  
of it:


\starttext
\startlinenumbering
  Hello \textreference[ref]{} World!
\stoplinenumbering
\inline[ref] % output: line ??
\stoptext

What I really want to achieve is something like the following:

\starttext

\startlinenumbering
  This ist a long transcription from an interview with line  
numbers.   % #1

  \startMyCite[test]
This ist a long transcription from an interview with line  
numbers. % #2
This ist a long transcription from an interview with line  
numbers. % #3

  \stopMyCite
  This ist a long transcription from an interview with line  
numbers.   % #4

\stoplinenumbering

And now \getMyCite[test] should output:

\startblockquote
  This ist a long transcription from an interview with line numbers.  
% #2
  This ist a long transcription from an interview with line numbers.  
% #3

\stopblockquote (lines 2--3)

\stoptext

Is something like this possible in ConTeXt and if yes how?

Thanks for your help!

Greetings,
Andreas

___
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] Line Numbering and References

2009-10-14 Thread Wolfgang Schuster


Am 14.10.2009 um 11:54 schrieb Andreas Harder:


Hello all,

I have a problem with referencing from a line numbered text.

In page-lin.mkiv I've found the \inline-command, but I can't make  
use of it:


When I interpret the source correct this should be the correct form
but there is something wrong with the \mksomelinereference command
and 'ctxlua' with it's argument appears in the text.

\starttext

\startlinenumbering
Thus, I came to the conclusion that the designer of a new system
must not only be the implementer and first large--scale user;\someline 
[here]

the designer should also write the first user manual.

The separation of any of these four components would have hurt
\TeX\ significantly. If I had not participated fully in all these
activities, literally hundreds of improvements would never have 
\someline[there]

been made, because I would never have thought of them or perceived
why they were important.

But a system \startline[range] cannot be successful if it is too  
strongly influenced

by a single person. Once the initial design is complete and fairly
robust, the real test begins as people with many different \stopline 
[range] viewpoints

undertake their own experiments.
\stoplinenumbering

see at \inline{line}[here], \inline{line}[there] and also at \inline 
[range]


\stoptext

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] paragraph question

2009-03-06 Thread Hans Hagen

Alan Stone wrote:

Another idea...

How do you make this line counter work ?

\newcount\parnumber
\newcount\linenumber
\def\myCounters{%
   \EveryPar{%
  \advance\parnumber by 1
  (P\the\parnumber)
  \EveryLine{%
% (L\the\prevgraf)}}
  \advance\linenumber by 1
  (L\the\linenumber)}
  \linenumber=0\relax}
   \parnumber=0\relax}

\setuphead[chapter][page=,after={\myCounters}]

\starttext

\chapter{Chapter 0}

Only one line.

\dorecurse{2}{\chapter{Chapter #1}\input knuth}

\stoptext



\startlinenumbering

\input tufte

\stoplinenumbering

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


Re: [NTG-context] paragraph question

2009-03-06 Thread Alan Stone
On Fri, Mar 6, 2009 at 3:05 PM, Hans Hagen pra...@wxs.nl wrote:
[...]
 \startlinenumbering

 \input tufte

 \stoplinenumbering

Ok, my question was a bit ambiguous...

I was not looking to number lines, but to count lines using EveryLine
within EveryPar, aka the paragraph counter \parnumber in the provided
code.

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


Re: [NTG-context] footnote and linenumbering

2009-01-04 Thread Wolfgang Schuster


Am 02.01.2009 um 16:58 schrieb Thomas Engel:


Hello,

I have problems with footnote in an area with \startlinenumbering --
\stoplinenumbering. No footnote will be generated. Is this an error?
Or it is not possible to use footnote within linenumbering?


It's a side effect of the MkII code but it works in MkIV.

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


[NTG-context] footnote and linenumbering

2009-01-03 Thread Thomas Engel
Hello,

I have problems with footnote in an area with \startlinenumbering --
\stoplinenumbering. No footnote will be generated. Is this an error?
Or it is not possible to use footnote within linenumbering?
I'm working with Context 2008.05.21

Thanks

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


[NTG-context] Reset linenumbers on each page

2008-12-17 Thread Wolfgang Schuster

Hi,

How can I reset the linenumber on each new page.

\starttext

\startlinenumbering
\dorecurse{10}{\input knuth\par}
\stoplinenumbering

\stoptext

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


Re: [NTG-context] looking for equivalence to LaTeX algorithm package

2008-12-01 Thread Richard Rascher-Friesenhausen

Zhaopeng Xing schrieb:

Hi,

Does anyone know how to describe algorithm procedures in similar way 
as LaTeX algorithmic and algorithm packages? I tried to search it on 
wiki but found nothing. Thanks.


--
Zhaopeng XING

Tinbergen Institute


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

Hello,

I once tried to copy the LaTeX environment to ConTeXt. And this is, what 
came out of it: *t-algorithmic.tex* It works for me, but i'm open to new 
and better implementations...


richard rascher-friesenhausen

--

==
Dr. Richard Rascher-Friesenhausen
Hochschule Bremerhaven, Studiengang Medizintechnik
An der Karlstadt 8
27568 Bremerhaven

und

MeVis Research GmbH
Universitaetsallee 29
D-28359 Bremen

Amtsgericht Bremen, HRB 16222
Geschäftsführer: Prof. Dr. Heinz-Otto Peitgen

email: [EMAIL PROTECTED], [EMAIL PROTECTED]
www  : http://www.mevis-research.de/, http://www.hs-bremerhaven.de/
fon  : +49 - 421 - 218 7707 (mevis)
fax  : +49 - 421 - 218 4236 (mevis)
==

% output=pdf
%===
% begin of file *t-algorithmic.tex*
%===
% [EMAIL PROTECTED] (c) 2003, 2004, 2005

%D \module
%D   [   file=algorithmic.tex,
%Dversion=2005.02.12,
%D  title=Environments for algorithms,
%D author=richard rascher friesenhausen,
%D   date=\currentdate,
%D  [EMAIL PROTECTED]

%D algorithmic defs
\definefloat[algorithm][algorithms]
\setupfloat[algorithm][location=middle]
\setuplabeltext[de][algorithm={Algorithmus\,}]

\define[1]\Algorithm{%
\startframedtext[frame=off,%leftframe=on,%bottomframe=on,
 framecolor=darkyellow,
 background=screen,offset=none]
%  \setuplinenumbering[location=intext]
%  \startlinenumbering 
#1 
%  \stoplinenumbering
\stopframedtext
}

%D names
\def\algorithmicend{{\bf end}}
\def\algorithmicif{{\bf if}}
\def\algorithmicthen{{\bf then}}
\def\algorithmicelse{{\bf else}}
\def\algorithmicelseif{\algorithmicelse\algorithmicif}
\def\algorithmicendif{\algorithmicend{\bf.}\algorithmicif}

\def\algorithmicfor{{\bf for}}
\def\algorithmicendfor{\algorithmicend{\bf.}\algorithmicfor}
\def\algorithmicforall{{\bf for all}}
\def\algorithmicdo{{\bf do}}

\def\algorithmicwhile{{\bf while}}
\def\algorithmicendwhile{\algorithmicend{\bf.}\algorithmicwhile}

\def\algorithmicrepeat{{\bf repeat}}
\def\algorithmicuntil{{\bf until}}

%D macros
\newdimen\algorithmicindent \algorithmicindent=0cm
\newdimen\algorithmicskip   \algorithmicskip=.5cm
\newcount\algorithmicline   \algorithmicline=0
\def\startIF{\advance\algorithmicindent by  \algorithmicskip}
\def\stopIF {\advance\algorithmicindent by -\algorithmicskip}

\let\startFOR=\startIF
\let\stopFOR =\stopIF

\let\startWHILE=\startIF
\let\stopWHILE =\stopIF

\let\startREPEAT=\startIF
\let\stopREPEAT =\stopIF

\def\algorithmiclineintro{%
  \inframed[width=.5cm,frame=off,offset=none,
background=color,backgroundcolor=darkyellow]
{\strut\hfill\color[black]{\the\algorithmicline}\,}\quad
  \hskip\algorithmicindent%
}
%D if then elseif else endif
\def\IF#1{%
  \advance\algorithmicline by 1
  \hbox{%
\algorithmiclineintro
\algorithmicif\ #1\ \algorithmicthen
  }\par
  \startIF
}
\def\ENDIF{%
  \stopIF
  \advance\algorithmicline by 1
  \hbox{%
\algorithmiclineintro
%  \the\algorithmicline\ \hskip\algorithmicindent%
\algorithmicendif
  }\par
}
\def\ELSE{%
  \stopIF
  \advance\algorithmicline by 1
  \hbox{%
\algorithmiclineintro
%  \the\algorithmicline\ \hskip\algorithmicindent%
\algorithmicelse
  }\par
  \startIF
}

\def\ELSEIF#1{%
  \stopIF
  \advance\algorithmicline by 1
  \hbox{%
\algorithmiclineintro  
\algorithmicelseif\ #1\ \algorithmicthen
  }\par
  \startIF
}

%D for forall do endfor
\def\FOR#1{%
  \advance\algorithmicline by 1
  \hbox{%
\algorithmiclineintro
\algorithmicfor\ #1\ \algorithmicdo
  }\par
  \startFOR
}
\def\FORALL#1{%
  \advance\algorithmicline by 1
  \hbox{%
\algorithmiclineintro
\algorithmicforall\ #1\ \algorithmicdo
  }\par
  \startFOR
}
\def\ENDFOR{%
  \stopFOR
  \advance\algorithmicline by 1
  \hbox{%
\algorithmiclineintro
\algorithmicendfor
  }\par
}

%D while do endwhile
\def\WHILE#1{%
  \advance\algorithmicline by 1
  \the\algorithmicline

Re: [NTG-context] Listings

2008-09-28 Thread Wolfgang Schuster

Am 28.09.2008 um 22:42 schrieb Mohamed Bana:

 Wolfgang Schuster wrote:
 Am 28.09.2008 um 19:34 schrieb Mohamed Bana:

 Aditya Mahajan wrote:
 Hi everyone,

 I finished my thesis, writing both my thesis and my presentation
 using
 ConTeXt.

 Aditya
 :).  But there's a still something missing that I need before I even
 thinking of typesetting an msc thesis in ConTeXt.   I'd like to have
 something equivelant to the *listings.sty* package;
 http://thread.gmane.org/gmane.comp.tex.context/15591/focus=15592 or
 http://vega.soi.city.ac.uk/~abbg770/listing-sample.pdf.


 I setup listing first;

 \lstset{breaklines=true,
 showlines=true, % showing line numbers
 numbers=left,   % where to show line numbers
 numberstyle=\tiny\color{gray},  
 numbersep=10pt, %
 stepnumber=1,   % how often to show the line number on the left
 language=Java,  % specifiy the language
 basicstyle=\ttfamily\small,  % print whole listing small
 keywordstyle=\color{eclipsekeyword}\ttfamily\underbar, % underlined
 bold
 black keywords
 identifierstyle=,   % nothing happens
 commentstyle=\color{eclipsecomment}, % white comments, if you use
 commentstyle=\color{white},
 stringstyle=\ttfamily,  % typewriter type for strings
 showstringspaces=false, % no special string spaces
 frame=single,
 backgroundcolor=\color{white},
 tabsize=4,
 showspaces=false,
 showstringspaces=false} 

 \lstset{morecomment=[s][\color{eclipsejavadoc}]{/**}{*/}}


 Includes a file, look at Listing B.2 on the pdf I posted.  This  
 should
 be self explanatory;

 \lstinputlisting[
 caption={SpreadsheetParser.java},
 label=lst:SpreadsheetParser.java]
 {source/SpreadsheetParser.java}



 I can also list inline using the same settings defined in \lstset -
 but
 it doesn't break across lines.  The choice of charater is arbitrary
 i.e., I could have chosen to use | instead of !;

 \lstinline!matcher(CharSequence input)!



 Similar to preceeding, with line breaking.  Also I can refer to it
 using; \ref{lst:freeformlogfile}

 \begin{lstlisting}[frame=,label={lst:freeformlogfile},caption={Log
 File}]
 import java.util.Arrays;

 public class ArrayReallocationDemo {

  public static void main(String[] args) {
int[] data1 = new int[] { 1, 3, 5, 7, 9 };

printArray(data1);
int[] data2 = Arrays.copyOf(data1, 6);
data2[5] = 11;
printArray(data2);

int[] data3 = Arrays.copyOfRange(data1, 2, 10);
printArray(data3);
  }

  // print array elements
  private static void printArray(int[] data) {
StringBuilder stringBuilder = new StringBuilder([);
for (int i = 0; i  data.length; i++) {
  stringBuilder.append(data[i]);
  if (i  data.length - 1)
stringBuilder.append(, );
}
stringBuilder.append(]);
System.out.println(stringBuilder);
  }
 }
 \end{lstlisting}

 \setupcolors[state=start]

 \definetyping[JAVA][option=JV]

 \setuptyping
   [JAVA]
   [numbering=line]

 \starttext

 \startJAVA
 ...
 \stopJAVA

 \stoptext

 or

 same preamble as above plus

 \definefloat[listing][listings]

 \starttext

 \placelisting
[split]
[lst:freeformlogfile]
{Log File}
{\startJAVA
 ...
 \stopJAVA}

 \stoptext

 Wolfgang


 Thanks Wolfgang.

 Source; http://pastebin.com/m40986857
 Pdf; http://filebin.ca/kceezh/listing.pdf or http://filebin.ca/kceezh

 I've still got some issues with it :(.  I think I'll just wait till
 verbatim supports improves.

 1.  Lines protude into the margin and sometime even go past the end of
 the page.

\setuptyping
[JAVA]
[numbering=line,
 lines=yes]

\setuplinenumbering[location=text]

 2.  Why doesn't it show the line numbers for the empty lines?

Could be a MkII bug because it works with MkIV but here appears
a new problem, location=text for line numbering is not working.

Test file for Hans:

% engine=luatex

\setuplinenumbering[location=text]

\showframe

\starttext

\startlinenumbering
A line of text with the line number.
\stoplinenumbering

\stoptext


 3.  Is there a way to supress the 'there is nothing to split' warning?

It's a bug, I will look for a solution (the caption has to be fixed  
too).

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


Re: [NTG-context] Listings

2008-09-28 Thread Wolfgang Schuster

Am 28.09.2008 um 23:23 schrieb Wolfgang Schuster:


 Am 28.09.2008 um 22:42 schrieb Mohamed Bana:

 Wolfgang Schuster wrote:
 Am 28.09.2008 um 19:34 schrieb Mohamed Bana:

 Aditya Mahajan wrote:
 Hi everyone,

 I finished my thesis, writing both my thesis and my presentation
 using
 ConTeXt.

 Aditya
 :).  But there's a still something missing that I need before I  
 even
 thinking of typesetting an msc thesis in ConTeXt.   I'd like to  
 have
 something equivelant to the *listings.sty* package;
 http://thread.gmane.org/gmane.comp.tex.context/15591/focus=15592 or
 http://vega.soi.city.ac.uk/~abbg770/listing-sample.pdf.


 I setup listing first;

 \lstset{breaklines=true,
 showlines=true,% showing line numbers
 numbers=left,  % where to show line numbers
 numberstyle=\tiny\color{gray}, 
 numbersep=10pt,%
 stepnumber=1,  % how often to show the line number on the left
 language=Java, % specifiy the language
 basicstyle=\ttfamily\small,  % print whole listing small
 keywordstyle=\color{eclipsekeyword}\ttfamily\underbar, % underlined
 bold
 black keywords
 identifierstyle=,   % nothing happens
 commentstyle=\color{eclipsecomment}, % white comments, if you use
 commentstyle=\color{white},
 stringstyle=\ttfamily,  % typewriter type for strings
 showstringspaces=false,% no special string spaces
 frame=single,
 backgroundcolor=\color{white},
 tabsize=4,
 showspaces=false,
 showstringspaces=false}

 \lstset{morecomment=[s][\color{eclipsejavadoc}]{/**}{*/}}


 Includes a file, look at Listing B.2 on the pdf I posted.  This  
 should
 be self explanatory;

 \lstinputlisting[
 caption={SpreadsheetParser.java},
 label=lst:SpreadsheetParser.java]
 {source/SpreadsheetParser.java}



 I can also list inline using the same settings defined in \lstset -
 but
 it doesn't break across lines.  The choice of charater is arbitrary
 i.e., I could have chosen to use | instead of !;

 \lstinline!matcher(CharSequence input)!



 Similar to preceeding, with line breaking.  Also I can refer to it
 using; \ref{lst:freeformlogfile}

 \begin{lstlisting}[frame=,label={lst:freeformlogfile},caption={Log
 File}]
 import java.util.Arrays;

 public class ArrayReallocationDemo {

 public static void main(String[] args) {
   int[] data1 = new int[] { 1, 3, 5, 7, 9 };

   printArray(data1);
   int[] data2 = Arrays.copyOf(data1, 6);
   data2[5] = 11;
   printArray(data2);

   int[] data3 = Arrays.copyOfRange(data1, 2, 10);
   printArray(data3);
 }

 // print array elements
 private static void printArray(int[] data) {
   StringBuilder stringBuilder = new StringBuilder([);
   for (int i = 0; i  data.length; i++) {
 stringBuilder.append(data[i]);
 if (i  data.length - 1)
   stringBuilder.append(, );
   }
   stringBuilder.append(]);
   System.out.println(stringBuilder);
 }
 }
 \end{lstlisting}

 \setupcolors[state=start]

 \definetyping[JAVA][option=JV]

 \setuptyping
  [JAVA]
  [numbering=line]

 \starttext

 \startJAVA
 ...
 \stopJAVA

 \stoptext

 or

 same preamble as above plus

 \definefloat[listing][listings]

 \starttext

 \placelisting
   [split]
   [lst:freeformlogfile]
   {Log File}
   {\startJAVA
...
\stopJAVA}

 \stoptext

 Wolfgang


 Thanks Wolfgang.

 Source; http://pastebin.com/m40986857
 Pdf; http://filebin.ca/kceezh/listing.pdf or http://filebin.ca/kceezh

 I've still got some issues with it :(.  I think I'll just wait till
 verbatim supports improves.

 1.  Lines protude into the margin and sometime even go past the end  
 of
 the page.

 \setuptyping
   [JAVA]
   [numbering=line,
lines=yes]

 \setuplinenumbering[location=text]

 2.  Why doesn't it show the line numbers for the empty lines?

 Could be a MkII bug because it works with MkIV but here appears
 a new problem, location=text for line numbering is not working.

 Test file for Hans:

 % engine=luatex

 \setuplinenumbering[location=text]

 \showframe

 \starttext

 \startlinenumbering
 A line of text with the line number.
 \stoplinenumbering

 \stoptext


 3.  Is there a way to supress the 'there is nothing to split'  
 warning?

 It's a bug, I will look for a solution (the caption has to be fixed  
 too).

Here is a quick and dirty solution, alisghtly modified version of
something I wrote two years ago [1]. The code is not ready for
documents because the spacing between the lines is wrong.

\unprotect

\def\dododostarttyping[#1]%
   {\typingparameter\c!before
\ifinsidesplitfloat
  \setbox\tablecontentbox\vbox\bgroup % added
\fi
\startpacked % includes \bgroup
\dosetuptypelinenumbering{#1}%
\initializetyping
\startverbatimcolor
\expanded{\mktypeblockverbatim{\s!start\currenttyping}{\s!stop 
\currenttyping}}}

\def\dostoptyping#1% hm, currenttyping
   {\stopverbatimcolor
\stoppacked  % includes \egroup
\ifinsidesplitfloat
  \egroup % added
  \dosplitverbatimbox\tablecontentbox
\fi

Re: [NTG-context] ConTeXt-ifying Kile

2008-01-02 Thread Matija Šuklje
]
# \setuptextbackground
\setuptextposition[name][settings]
\setuptextrules[options]
\setuptexttexts[text|margin|edge][text|section|date|mark|pagenumber][text|section|date|mark|pagenumber]
\setuptextvariable[name][options]
\setupthinrules[options]
\setuptolerance[options]
\setuptop[text|margin|edge][options]
\setuptoptexts[text|margin|edge][text|section|date|mark|pagenumber][text|section|date|mark|pagenumber]
\setuptype[options]
\setuptyping[file|typing|name][options]
\setupunderbar[options]
\setupurl[options]
\setupversions[options]
\setupwhitespace[none|small|medium|big|line|fixed|fix|dimension]
# \setvalue
# \setvariables
# \setxvalue
# \setxvariables
# \showaccents
\showbodyfont[settings]
\showbodyfontenvironment[settings]
# \showcharacters
\showcolor[name]
\showcolorgroup[name][horizontal|vertical|name|value|number]
\showexternalfigures[alternative=a|b|c]
\showfields[names]
# \showfont
\showframe[text|margin|edge]
\showgrid
# \showgridboxes
# \showgridsnapping
\showlayout
# \showlayoutcomponents
\showmakeup
\showpalet[name][horizontal|vertical|name|value]
\showprint[typesetting papersize][printing papersize][settings]
\showsetups
\showstruts
# \showstruts
\showsymbolset[name]
# \snaptogrid
\someline[reference]
\somewhere{text}{text}[reference]
\sort[text]{text}
\space
\splitfloat[settings]{text}{text}
# \splitstring
# \SR
# \start \stop
# \start \stop
\startalignment[width|left|right|middle|inner|outer|wide|broad|height|bottom|line|reset|hanging|nothanging|hyphenated|nothyphenated]
 \stopalignment
# \startarabicpar \stoparabicpar
# \startarabictext \stoparabictext
# \startappendices \stopappendices
\startbackground \stopbackground
# \startbackmatter \stopbackmatter
# \startbaselinecorrection \stopbaselinecorrection
# \startblockquote \stopblockquote
# \startbodymatter \stopbodymatter
\startbuffer[name] \stopbuffer
\startcolor[name] \stopcolor
\startcolumns[settings] \stopcolumns
\startcombination[matrix] \stopcombination
\startcomment[name][settings] \stopcomment
\startcomponent file \stopcomponent
\startdescription{text} \stopdescription
\startdocument[name] \stopdocument
\startenumeration \stopenumeration
\startenvironment file \stopenvironment
\startfact\fact text \\ text \\ text \\\fact text \stopfact
\startfigure[name][file][factor=number][frame=on|off] \stopfigure
\startfloattext[left|right|high|middle|low|offset|tall][reference]{text}{text} 
\stopfloattext
# \startFLOWcell \stopFLOWcell
# \startFLOWchart \stopFLOWchart
\startformula \stopformula
# \startframedcontent \stopframedcontent
\startframedtext[left|right|middle|none][settings] \stopframedtext
# \startfrontmatter \stopfrontmatter
# \starthanging \stophanging
\starthiding \stophiding
\startinteractionmenu[name] \stopinteractionmenu
\startitemgroup[name][options][settings] \stopitemigroup
# \startitemize \stopitemize
# \startitemize \stopitemize
# \startJScode \stopJScode
# \startJSpreamble \stopJSpreamble
# \startJSscripts \stopJSscripts
\startlegend[two]\leg text \\ text \\ text \\\leg \stoplegend
\startline[reference] \stopline
\startlinecorrection \stoplinecorrection
\startlinenumbering[continue] \stoplinenumbering
\startlines \stoplines
\startlocal \stoplocal
\startlocalenvironment \stoplocalenvironment
\startlocalfootnotes \stoplocalfootnotes
# \startlocalsetups \stoplocalsetups
\startmakeup[name][settings] \stopmakeup
\startmarginblock \stopmarginblock
\startmarginrule[number] \stopmarginrule
# \startmode \stopmode
# \startMPpage \stopMPpage
\startnamemakeup \stopnamemakeup
\startnarrower[left|middle|right] \stopnarrower
# \startnointerference \stopnointerference
# \startnotmode \stopnotmode
\startopposite \stopopposite
\startoverlay{text}{text} \stopoverlay
\startoverview[names] \stopoverview
\startpacked[blank] \stoppacked
\startparagraph \stopparagraph
\startpositioning \stoppositioning
\startpostponing \stoppostponing
\startproduct file \stopproduct
\startprofile[names] \stopprofile
\startproject file \stopproject
\startquotation[left|middle|right] \stopquotation
\startregister[text]{text+text+text} \stopregister
# \startsetups \stopsetups
# \startstandardmakeup \stopstandardmakeup
\startsymbolset[name] \stopsymbolset
\startsynchronization \stopsynchronization
\starttable[text|name] \stoptable
\starttables[text|name] \stoptables
\starttabulate[text][settings] \stoptabulate
# \startTEXpage \stopTEXpage
# \starttext \stoptext
# \starttextbackground \stoptextbackground
# \starttextdata \stoptextdata
\starttextrule[top|bottom]{text} \stoptextrule
\starttyping \stoptyping
\startunpacked \stopunpacked
\startversion[numbers] \stopversion
# \startXMLdata \stopXMLdata
# \startXMLignore \stopXMLignore
# \startXMLmapping \stopXMLmapping
\stretched{text}
# \strut
# \strutdepth
# \strutheight
# \struttedbox
\sub[references]
\subject[references]{text}
\subsection[references]{text}
\subsubject[references]{text}
\subsubsection[references]{text}
\subsubsubject[references]{text}
\switchtobodyfont[font settings]
\switchtorawfont[name]
\sym{text}
\symbol[name][name

Re: [NTG-context] Quickie about Line Numbering

2007-11-23 Thread Thomas A. Schmitz

On Fri, 2007-11-23 at 21:46 +0100, Matthias Wächter wrote:
 Hi!
 
 Just wondering how I can manage to number all the lines of my document.
 Thought that this would work but it actually doesn't.
 
 \starttext
 \startlinenumbering
 
 \chapter{First}
 
 A paragraph
 
 Another paragraph.
 
 \chapter{Second}
 
 Wait and see---nothing.
 
 \stoplinenumbering
 \stoptext
 
 
 Is there a better/smarter way for doing this than typing a lot of
 \(start|stop)linenumbering around paragraphs of text? We need line
 numbers as part of our document review process for clearly referencing
 error spots.
 
 - Matthias

I have some dim recollection that I asked a similar question some time
ago, and the answer was: you can't (but I can't find a reference in the
archive, so I may be wrong). You'll have to explicitly tell ConTeXt to
start line numbering after headings:

\starttext

\chapter{First}

\startlinenumbering
A paragraph

Another paragraph.
\stoplinenumbering

\chapter{Second}

\startlinenumbering
Wait and see---nothing.
\stoplinenumbering

\stoptext

Thomas

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


[NTG-context] Quickie about Line Numbering

2007-11-23 Thread Matthias Wächter
Hi!

Just wondering how I can manage to number all the lines of my document.
Thought that this would work but it actually doesn't.

\starttext
\startlinenumbering

\chapter{First}

A paragraph

Another paragraph.

\chapter{Second}

Wait and see---nothing.

\stoplinenumbering
\stoptext


Is there a better/smarter way for doing this than typing a lot of
\(start|stop)linenumbering around paragraphs of text? We need line
numbers as part of our document review process for clearly referencing
error spots.

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


Re: [NTG-context] Law/Jurisdiction typesetting

2007-07-06 Thread Steffen Wolfrum
Intensive googling brought me these solutions for paragraph enumeration:

1)

% Enumerate paragraphs
\newcounter\ParNum
\def\GuyPar{\doglobal\increment\ParNum\inleft{\ParNum}}

\setupbodyfont[ber,10pt]
\setupwhitespace[big]

\starttext

\section[sec-language]{How this Book Teaches You The Language}

\GuyPar Java is an object oriented programming language.  When you use
an object oriented programming language, your program consists of
class definitions.

\stoptext


2)

\starttext
\showframe
\setupcolors[state=start]
\setupparagraphnumbering[state=start,style=italic,distance=0pt]
%\startlinenumbering
\section{bloo}
\input knuth 
\section{blah}
\input knuth \par 
\setupparagraphnumbering[state=stop]
\input tufte \par \blank \dorecurse{2}{\input tufte \par} \blank \par
\setupparagraphnumbering[state=start,color=red]
\dorecurse{4}{\input tufte \par}
\stoptext



Does anybody now have an idea how to re-use these paragraph numbers (in one of 
these examples) for linking in a TOC and/or a seperate index register (as 
described below)?

Steffen







On Thu, 5 Jul 2007 17:41:43 +0200, Steffen Wolfrum wrote:
 Hi,
 
 using ConTeXt more and more for typesetting books from the field of 
 law/jurisdiction I came across some specifics that I just don't know 
 how to do in our beloved application:
 
 1) Paragraphs (not all) are labeled with numbers in the margin.
 These paragraph numbers are used in the table of contents in such 
 way: you have the content's entry (eg the section heading), then the 
 dots,  then the corresponding paragraph number, then the 
 corresponding page number.
 
 2) Paragraphs (not all) are labeled with numbers in the margin.
 These paragraph numbers are used in a  separate paragraph 
 register in such way: you have the index entry (a law's number), 
 space, then you have the corresponding paragraph number (the text 
 paragraph where the index was used). [But of course there is also a 
 regular register afterwards, containing alphabetical listed keyword 
 index entries pointing to page numbers.]
 
 
 So, how can that be done??
 
 
 Yours,
 
 Steffen
 ___
 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  : https://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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] question about linenotes

2006-11-05 Thread Thomas A. Schmitz
I'm playing with (and happy about) linenotes; I'm just running into  
one small (?) problem. Here's a testfile:


\starttext

% \setuplinenumbering[location=intext,step=2]

\startlinenumbering
   Long and boring text that has \linenote{note one} no other sense than
   demonstrating a problem with the linenote command in ConTeXt.
\stoplinenumbering

\stoptext

Run it, then comment out the \setuplinenumbering command. Is there a  
way of having linenotes displayed correctly even when the numbers are  
not displayed because of the step= setting?

Thanks

Thomas
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] question about linenotes

2006-11-05 Thread Hans Hagen
Thomas A. Schmitz wrote:
 I'm playing with (and happy about) linenotes; I'm just running into  
 one small (?) problem. Here's a testfile:


 \starttext

 % \setuplinenumbering[location=intext,step=2]

 \startlinenumbering
Long and boring text that has \linenote{note one} no other sense than
demonstrating a problem with the linenote command in ConTeXt.
 \stoplinenumbering

 \stoptext

 Run it, then comment out the \setuplinenumbering command. Is there a  
 way of having linenotes displayed correctly even when the numbers are  
 not displayed because of the step= setting?
   
\unprotect

\def\donoplacelinenumber
  {\the\everylinenumber}

\def\doplacelinenumber
  {\ifnum\linenumber\@@rnstart\relax
 \donoplacelinenumber
   \else
 \ifnum\numexpr(\linenumber/\@@rnstep)*\@@rnstep\relax=\linenumber
   \doattributes\??rn\c!style\c!color\dodoplacelinenumber
 \else
   \donoplacelinenumber
 \fi
   \fi}

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

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] [Fwd: Line numbering]

2006-09-07 Thread Hans Hagen
Aditya Mahajan wrote:
 Hi CVR,

   
 From: CV Radhakrishnan [EMAIL PROTECTED]
 Reply-To: mailing list for ConTeXt users ntg-context@ntg.nl
 To: Mailing list for ConTeXt users ntg-context@ntg.nl
 Subject: [NTG-context] Line numbering
 Date: Sat, 02 Sep 2006 10:13:31 +0530

 Dear all,

 Forgive me if I sound naive.  I searched the archives, but could not
 find the solution for my following problem:

 I need to have line numbers for the text formatted in two columns.  The
 numbers for left column shall appear in the left side and that for right
 column shall appear in the right side of the page.  location=inmargin
 option to the \setuplinenumbering doesn't help much.  Please take a look
 at the following image:

  http://www.river-valley.com/cvr/one.png

 which will give you an idea of my requirement.  Any help in this matter
 will be highly apprecaited and thanks in advance.
 

 I do not know how to automate what you want. An ugly solution is to 
 specify the column breaks yourself, something like

 \unprotect
 \def\dosetuplinenumbering[#1]%
{\getparameters[\??rn][\c!start=1,\c!step=1,#1]%
 %\global\linenumber\plusone
 %Do not reset linenumber. Why is this here?
}
 \protect


 \starttext
 \startcolumns
 \setuplinenumbering[location=inleft]
\startlinenumbering
  \input knuth
\stoplinenumbering
\column
\setuplinenumbering[location=inright]
\startlinenumbering[continue]
  \input knuth
\stoplinenumbering
 \stopcolumns
 \stoptext
   

proof of concept:

\newcounter\TestNumber

\let\normaldodoplacelinenumber\dodoplacelinenumber

\def\dodoplacelinenumber
  {\doglobal\increment\TestNumber
   \xypos{lnm:\TestNumber}%
   \ifdim\MPx{lnm:\TestNumber}.5\makeupwidth
  \swapmacros\inleftmargin\inrightmargin
   \fi
   \normaldodoplacelinenumber}

\setuplinenumbering[location=inleft]

\startcolumns
\startlinenumbering
\input tufte \endgraf
\input tufte \endgraf
\input tufte \endgraf
\stoplinenumbering
\stopcolumns

\stoptext

in order to let this work ok (spacing) we need to write a nice patch (and also 
use the opportunity to clean up some code) which will take a couple of hours, 
so not today .. 

Hans  



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

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] [Fwd: Line numbering]

2006-09-06 Thread Aditya Mahajan
Hi CVR,

 From: CV Radhakrishnan [EMAIL PROTECTED]
 Reply-To: mailing list for ConTeXt users ntg-context@ntg.nl
 To: Mailing list for ConTeXt users ntg-context@ntg.nl
 Subject: [NTG-context] Line numbering
 Date: Sat, 02 Sep 2006 10:13:31 +0530

 Dear all,

 Forgive me if I sound naive.  I searched the archives, but could not
 find the solution for my following problem:

 I need to have line numbers for the text formatted in two columns.  The
 numbers for left column shall appear in the left side and that for right
 column shall appear in the right side of the page.  location=inmargin
 option to the \setuplinenumbering doesn't help much.  Please take a look
 at the following image:

  http://www.river-valley.com/cvr/one.png

 which will give you an idea of my requirement.  Any help in this matter
 will be highly apprecaited and thanks in advance.

I do not know how to automate what you want. An ugly solution is to 
specify the column breaks yourself, something like

\unprotect
\def\dosetuplinenumbering[#1]%
   {\getparameters[\??rn][\c!start=1,\c!step=1,#1]%
%\global\linenumber\plusone
%Do not reset linenumber. Why is this here?
   }
\protect


\starttext
\startcolumns
\setuplinenumbering[location=inleft]
   \startlinenumbering
 \input knuth
   \stoplinenumbering
   \column
   \setuplinenumbering[location=inright]
   \startlinenumbering[continue]
 \input knuth
   \stoplinenumbering
\stopcolumns
\stoptext

Aditya
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] typing and linenumbering

2006-03-16 Thread Taco Hoekwater


nico wrote:
 Hello,

 The output is pretty as I wish, but unfortunately the line numbers are  
 *not* the numbers of the listing lines, but the numbers of the lines once  
 wrapped in the frame. In the example below the first line is very long  
 (the blah blah line), but in the output it is shown as 4 lines (with 4  
 line numbers).

I've tried this with a method trick, but that does not work too well
with 'location=intext'. Anyway, here is what I did:

\setuptyping[prog]
  [bodyfont=small,
   before={\begingroup\setuplinenumbering[style=small,%
   step=2,start=3,location=inmargin,method=type]
   \startframelisting \obeylines 

   \startlinenumbering},
   after={\stoplinenumbering\stopframelisting\endgroup}]

 Is there a way to achieve this in a more integrated way with the typing  
 environment? 

Probably, but I do not know.

 The other side effect of the method used is that it changes  
 the linenumbering behaviour outside the typing environment. I tried the  
 reset option, but it doesn't change the intext location. Is there a  
 possibility to come back to default settings?

The setup obeys normal grouping rules (hence the \begingroup ...
\endgroup in the code above)

 Last but not least, is it possible to customize the wrapping behaviour so  
 that an arbitrary command can be called before the cut, and another  
 command after the cut? What I would like to have is {\space\wrapsign}  
 before the cut and an indentation after the cut to show that the line is  
 wrapped.

That should be possible in typing environments. I even think there was
a wiki page on that. But in non-verbatim environments, the breaking is
simply TeX's paragraph builder, and I do not think context allows
tinkering with that (I could be proven wrong, of course)

Cheers, Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] typing and linenumbering

2006-03-16 Thread nico
On Thu, 16 Mar 2006 10:02:46 +0100, Taco Hoekwater [EMAIL PROTECTED]  
wrote:

 The output is pretty as I wish, but unfortunately the line numbers are
 *not* the numbers of the listing lines, but the numbers of the lines  
 once
 wrapped in the frame. [...]

 I've tried this with a method trick, but that does not work too well
 with 'location=intext'. Anyway, here is what I did:

 \setuptyping[prog]
   [bodyfont=small,
before={\begingroup\setuplinenumbering[style=small,%
step=2,start=3,location=inmargin,method=type]
\startframelisting \obeylines

\startlinenumbering},
after={\stoplinenumbering\stopframelisting\endgroup}]

Ah, yes, the method=type option helps much. The behaviour is quite strange  
with intext. Is it an official option?

 The other side effect of the method used is that it changes
 the linenumbering behaviour outside the typing environment. I tried the
 reset option, but it doesn't change the intext location. Is there a
 possibility to come back to default settings?

 The setup obeys normal grouping rules (hence the \begingroup ...
 \endgroup in the code above)

Yes, right. Thanks much for your help.

Regards,
BG
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] typing and linenumbering

2006-03-16 Thread Hans Hagen
nico wrote:
 On Thu, 16 Mar 2006 10:02:46 +0100, Taco Hoekwater [EMAIL PROTECTED]  
 wrote:

   
 The output is pretty as I wish, but unfortunately the line numbers are
 *not* the numbers of the listing lines, but the numbers of the lines  
 once
 wrapped in the frame. [...]
   
 I've tried this with a method trick, but that does not work too well
 with 'location=intext'. Anyway, here is what I did:

 \setuptyping[prog]
   [bodyfont=small,
before={\begingroup\setuplinenumbering[style=small,%
step=2,start=3,location=inmargin,method=type]
\startframelisting \obeylines

\startlinenumbering},
after={\stoplinenumbering\stopframelisting\endgroup}]
 

 Ah, yes, the method=type option helps much. The behaviour is quite strange  
 with intext. Is it an official option?

   
 The other side effect of the method used is that it changes
 the linenumbering behaviour outside the typing environment. I tried the
 reset option, but it doesn't change the intext location. Is there a
 possibility to come back to default settings?
   
 The setup obeys normal grouping rules (hence the \begingroup ...
 \endgroup in the code above)
 

 Yes, right. Thanks much for your help.
   
actually, this verbatim specific numbering is not hooked into the typing 
environments (only in the typefile stuff); so what you observe are side 
effects

i'll send you a test patch off list (and to taco because we need to 
trace a spurious space)

Hans

-- 

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

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] typing and linenumbering

2006-03-15 Thread nico
Hello,

I would like to print some listings, with their line numbers. To achieve  
this I use the following combination on framedtext, typing and  
linenumbering stuff.

The output is pretty as I wish, but unfortunately the line numbers are  
*not* the numbers of the listing lines, but the numbers of the lines once  
wrapped in the frame. In the example below the first line is very long  
(the blah blah line), but in the output it is shown as 4 lines (with 4  
line numbers).

Is there a way to achieve this in a more integrated way with the typing  
environment? The other side effect of the method used is that it changes  
the linenumbering behaviour outside the typing environment. I tried the  
reset option, but it doesn't change the intext location. Is there a  
possibility to come back to default settings?

Last but not least, is it possible to customize the wrapping behaviour so  
that an arbitrary command can be called before the cut, and another  
command after the cut? What I would like to have is {\space\wrapsign}  
before the cut and an indentation after the cut to show that the line is  
wrapped.

Thanks for any hints.


% listing frame
\defineframedtext
   [framelisting]
   [background=screen,
frame=off,
strut=yes,
offset=2mm,
width=broad,
framecolor=black,
align=right]

\definetyping[prog]

\setuptyping[prog]
 [bodyfont=small,
  
before={\setuplinenumbering[style=small,step=2,start=3,location=intext]
  \startframelisting\startlinenumbering},
  after={\stoplinenumbering\stopframelisting}]
% after={\stoplinenumbering\setuplinenumbering[reset]}]

\startprog
first line: blah blah blah blah blah blah blah blah blah blah blah blah  
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah  
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah  
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah  
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah  
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah  
blah
second line
third line
last line
\stopprog


Regards,
BG
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] linenumbering

2006-01-14 Thread Thomas A. Schmitz

All,

I have a document with several sections and would like to have lines  
numbered consecutively across all sections. However, when the  
\startlinenumbering ... stoplinenumbering spans a \section command,  
it doesn't work any longer; lines are not numbered. Is there a  
solution or a workaround?


Thanks, and best

Thomas
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Lettrine Problems

2005-09-30 Thread Marcus Vinicius Mesquita de So
Problems occur with Lettrine when used with the
linenumbering
environment, the dropped cap stays outside the margin.
Minimal
example below.


A zipped file (129 Kb) with the pdf generated and a
corrected one
with Pitstop can be downloaded from the following
link:

http://rapidshare.de/files/5707655/test.zip.html


Marcus Vinicius

%***

\enableregime   [win]

\usemodule[t-lettri]

\unexpanded\def\myfonthook{\definefontsynonym[LettrineFont][Serif]}

\setuplettrine[Lines=2,TextFont=\sc,FontHook=\myfonthook,Findent=2pt,Nindent=0pt]

\setupspacing[packed]

\setuplinenumbering[start=1,step=5,style=\tfx]

\setupindenting[medium] \setupindenting[medium]

\starttext

\language[pt]



\startlinenumbering


\lettrine{N}{aquele dia}, --- já lá vão dez anos! ---
o Dr. Félix levantou-se tarde, abriu a janela e
cumprimentou o sol.
O~dia estava esplêndido; uma fresca bafagem do mar
vinha quebrar um
pouco os ardores do estio; algumas raras nuvenzinhas
brancas, finas
e transparentes se destacavam no azul do céu.
Chilreavam na chácara
vizinha à casa do doutor algumas aves afeitas à vida
semi-urbana,
semi-silvestre que lhes pode oferecer uma chácara nas
Laranjeiras.
Parecia que toda a natureza colaborava na inauguração
do ano.
Aqueles para quem a idade já desfez o viço dos
primeiros tempos, não
se terão esquecido do fervor com que esse dia é
saudado na meninice
e na adolescência. Tudo nos parece melhor e mais belo,
--- fruto da
nossa ilusão, e alegres com vermos o ano que desponta,
não reparamos
que ele é também um passo para a morte.

Teria esta última idéia entrado no espírito de Félix,
ao contemplar
a magnificência do céu e os esplendores da luz? Certo
é que uma
nuvem ligeira pareceu toldar-lhe a fronte. Félix
embebeu os olhos no
horizonte e ficou largo tempo imóvel e absorto, como
se interrogasse
o futuro ou revolvesse o passado. Depois, fez um gesto
de tédio, e
parecendo envergonhado de se ter entregue à
contemplação interior de
alguma quimera, desceu rapidamente à prosa, acendeu um
charuto, e
esperou tranqüilamente a hora do almoço.

Félix entrava então nos seus trinta e seis anos, idade
em que muitos
já são pais de família, e alguns homens de Estado.
Aquele era apenas
um rapaz vadio e desambicioso. A~sua vida tinha sido
uma singular
mistura de elegia e melodrama; passara os primeiros
anos da mocidade
a suspirar por cousas fugitivas, e na ocasião em que
parecia
esquecido de Deus e dos homens, caiu-lhe nas mãos uma
inesperada
herança, que o levantou da pobreza. Só a Providência
possui o
segredo de não aborrecer com esses lances tão
estafados no teatro.

Félix conhecera o trabalho no tempo em que precisava
dele para
viver; mas desde que alcançou os meios de não pensar
no dia
seguinte, entregou-se corpo e alma à serenidade do
repouso. Mas
entenda-se --- que não era esse repouso aquela
existência apática e
vegetativa dos ânimos indolentes; era, se assim me
posso exprimir,
um repouso ativo, composto de toda a espécie de
ocupações elegantes
e intelectuais que um homem na posição dele podia ter.

Não direi que fosse bonito, na significação mais ampla
da palavra;
mas tinha as feições corretas, a presença simpática, e
reunia a
graça natural a apurada elegância com que vestia.
A~cor do rosto era
um tanto pálida, a pele lisa e fina. A~fisionomia era
plácida e
indiferente, mal alumiada por um olhar de ordinário
frio, e não
poucas vezes morto.

Do seu caráter e espírito melhor se conhecerá lendo
estas páginas e
acompanhando o herói por entre as peripécias da
singelíssima ação
que empreendo narrar. Não se trata aqui de um caráter
inteiriço nem
de um espírito lógico e igual a si mesmo; trata-se de
um homem
complexo, incoerente e caprichoso, em quem se reuniam
opostos
elementos, qualidades exclusivas, e defeitos
inconciliáveis.


\stoplinenumbering


\stoptext

%



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] how to number poetry?

2005-07-18 Thread Hans Hagen

Mojca Miklavec wrote:


Paul Tremblay wrote:
 


What is the best way to number lines of poetry?

1  This is the first line
  This is the second line
  ...

5  this is the fifth
  ...

10 this is the tenth.
   



This is a solution, written in plain TeX. I hope it is commented well
enough so that you can change it if necessary. You have to surrond the
code with \start...\stop..., but I hope you can do it, otherwise ask
again on the list.

You can change the current line number any time by simply typing
\lineno=999. You probably have to set \lineno to 0 every time you
start typesetting a poem and restore \everypar={} after you are done
with the current poem (in the definition of \startnumberedpoem ...
\stopnumberedpoem of course, not manually).

The code attaches some stuff before every paragraph and there's a
macro that checks if the current paragraph number is divisible by
five. It is a macro with square complexity, so if you want to typeset
Iliad or Odyssey :), please let me know so that I'll change it to be
more efficient :)

The code has a small drawback: you have to write \\ for blank lines.
After I wrote the maco I noticed some comments about redefining the
\par command in Appendix D of the TeXBOOK, typesetting verbatim. If I
manage to fix that too, I'll post it here.

%%

% new counter for counting lines
% it is set to 0 at the beginning,
% but you can redefine it any time by saying \lineno=7 or similar
\newcount\lineno
% if 0, nothing happens, if 1, no line number will be printed
% and the line number won't advance for one
\newcount\isemptyline


%  templineno = lineno + 5
%  do {
% templineno = templineno - 5
%  } while (templineno  5);
%
%  if (templineno == 0) {
% print lineno
%  }

% only prints \the\lineno if it is divisible by 5
\def\printonlyfives{%
% define a new counter 'templineno'
\newcount\templineno
% set the temporary counter to the line counter
\templineno=\lineno
% subtract 5 from the temporary counter as long as the counter is 
positive
\advance\templineno by5
\loop\advance\templineno by-5\ifnum\templineno5\repeat
% if the line number is divisible by 5, the temporary counter is 0
% and the line number will be printed out
\ifnum\templineno=0{\the\lineno}\fi}

% add this before every paragraph:
% - if this is not an empty line
%- add one to the line number
%- print the line number (if divisible by five)
% - hfill (for right alignment)
\everypar={\ifnum\isemptyline=0 \advance\lineno by1 \printonlyfives\fi\hfill}

% (if '\\' is already defined for something else,
% you can use some other command name here)
% this will switch off line numbering, make a new line
% and switch line numbering on again
\def\\{\isemptyline=1\crlf\isemptyline=0}

\obeylines
\dorecurse{30}{the text goes here\par}
 


\setuplinenumbering
 [start=2,
  step=2,
  distance=-1em]

\startlinenumbering
\startlines
\fakewords{5}{8}
\fakewords{5}{8}
\fakewords{5}{8}
\fakewords{5}{8}

\fakewords{5}{8}
\fakewords{5}{8}
\fakewords{5}{8}
\fakewords{5}{8}
\stoplines
\stoplinenumbering

\setupparagraphnumbering[state=start,distance=-1em]

\fakewords{5}{8} \par
\fakewords{5}{8} \par
\fakewords{5}{8} \par
\fakewords{5}{8} \par

\fakewords{5}{8} \par
\fakewords{5}{8} \par
\fakewords{5}{8} \par
\fakewords{5}{8} \par


--

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

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] paragraph enumeration

2005-04-27 Thread Adam Lindsay
Taco Hoekwater said this at Tue, 26 Apr 2005 12:42:05 +0200:

piskala upendran wrote:
 The paragraph enumeration is useful for only for

You mean that hack with \startParagraphs I posted a week
or so ago on this list?

I'm seeing this thread, and think about \setupparagraphnumbering. It
doesn't have the configuration options that allow the numbers to be set
in the text, but it strikes me as a good departure. You don't have to
turn it off for headings, either:

\starttext
\showframe
\setupcolors[state=start]
\setupparagraphnumbering[state=start,style=italic,distance=0pt]
%\startlinenumbering
\section{bloo}
\input knuth 
\section{blah}
\input knuth \par 
\setupparagraphnumbering[state=stop]
\input tufte \par
\setupparagraphnumbering[state=start,color=red]
\dorecurse{4}{\input tufte \par}
\stoptext

 
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept. [EMAIL PROTECTED]
 Lancaster University, InfoLab21+44(0)1524/510.514
 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Line numbering and drop caps

2005-04-06 Thread Marcus Vinicius Mesquita de Sousa
It seems that the two don't go well together.
If I use:

%
% interface=en tex=pdfetex output=pdf language=pt
\enableregime   [win]

\def\MyDroppedCaps%
{\DroppedCaps{}{Serif}{2\baselineskip}{0pt}{1\baselineskip}{2}}

\setuplinenumbering[start=1,step=5]

\starttext

\startlinenumbering

\MyDroppedCaps Text test prestou—se às expansões do
parasita. Lívia contemplava o noivo
com adoração. Para ambos eles o mundo inteiro havia
desaparecido.
Inteiro não; Viana fez casualmente alusão a Raquel, e
essa
intempestiva recordação entristeceu a moça. Ela via
que a sua
felicidade era causa da desventura da amiga, e agora
que a tinha
quase realizado, sentia morder—lhe um piedoso remorso.

\stoplinenumbering

\stoptext


then the dropped cap doesn't stay where it should.
Any suggestions?

Thanks in advance

Marcus Vinicius




__ 
Yahoo! Messenger 
Show us what our next emoticon should look like. Join the fun. 
http://www.advision.webevents.yahoo.com/emoticontest
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] critical editions in context

2005-03-16 Thread h h extern
Thomas A.Schmitz wrote:
Sorry, hit the send button by accident.
OK, I feel guilty resurrecting this stale thread, but I can't resist 
asking again.

I found this in m-arabtex.tex:
%\pushmacro\edmacloaded   \let \edmacloaded   \undefined
and later
%\popmacro\edmacloaded
Both lines are commented out, so I'm still wondering if edmac will work 
with ConTeXt out of the box.

The absolute basics that are needed for critical editions are:
1. Capability to have footnotes with reference to line-number instead of 
counter. These notes must not end with a newline character (see 
ASCII-art at end of post), but must provide the possibility to have 
several on one line. These notes must not flow, they have to stay on the 
same page as the reference. Horizontal tolerance can be set to very 
sloppy to achieve this

2. Must be possible to apply a format like \bf vel. sim. to the reference.
3. Within these notes, it should be possible to refer to other line 
numbers.

4. Nice, but not quite essential: possibility to have notes in more than 
one column.

5. Not absolutely basic, but important for serious work: have more than 
one set of notes referring to the same passage.

Is this possible in ConTeXt out of the box? If not, I'd be willing to 
roll up my sleeves and help, but would like to know which would be a 
good starting point.

I looked at core-ltn.tex. I'm not sure if core-nnt and page-nnt refer to 
core-not and page-not; I couldn't find anything appropriate in these files.
the files are in the main distribution for some time; i'm still waiting for 
idris to test them; following is my test file (seems that it has a patch -)

% interface=en
\unprotect
\def\dohandlelinenote#1#2#3%
  {\bgroup
   \expanded{\beforesplitstring#2}\at--\to\linenotelinenumber
   \ifnum\linenotelinenumber=\linenumber\relax
  \def\linenotelinenumber##1{#2}%
  \setupnote[#1]
[\c!numbercommand=\linenotelinenumber,
 \c!textcommand=\gobbleoneargument]%
  \setnote[#1]{#3}%
   \fi
   \egroup}
\protect
\starttext
\tracelinenotestrue
\setuppapersize[S6][S6]
\setuplayout[width=middle,height=middle,margin=1.5cm,footer=0pt,header=1cm]
\setupcolors[state=start]
\setuptyping[option=color]
\definelinenote[extralinenote][rule=off,frame=on,framecolor=darkgreen]
\setuplinenote [linenote] [rule=off,frame=on,framecolor=darkred,n=2]
\showframe
\startbuffer[test]
\doglobal\increment\DummyNumber % else dups due to reuse
\startlinenumbering[100]
test \linenote {oeps} test test test test test test
test \startlinenote [well:\DummyNumber] {oeps} test test test test test test
test \linenote {oeps} test test test test test test
test \extralinenote {oeps} test test test test test test
test \linenote {oeps} test test test test test test
test \extralinenote {oeps} test test test test test test
test \stoplinenote [well] test test test test test test
\stoplinenumbering
\stopbuffer
{\typebuffer[test] \getbuffer[test]} \page
\startbuffer[setup]
\setuplinenumbering
  [align=left]
\stopbuffer
{\typebuffer[setup] \getbuffer[setup,test]} \page
\startbuffer[setup]
\setuplinenumbering
  [width=1em,
   align=left]
\stopbuffer
{\typebuffer[setup] \getbuffer[setup,test]} \page
\startbuffer[setup]
\setuplinenumbering
  [width=2em,
   distance=.5em,
   align=left]
\stopbuffer
{\typebuffer[setup] \getbuffer[setup,test]} \page
\startbuffer[setup]
\setuplinenumbering
  [width=2em,
   align=middle]
\stopbuffer
{\typebuffer[setup] \getbuffer[setup,test]} \page
\startbuffer[setup]
\setuplinenumbering
  [conversion=romannumerals,
   start=1,
   step=1,
   location=text,
   style=slanted,
   color=blue,
   width=1.5em]
\stopbuffer
{\typebuffer[setup] \startnarrower\getbuffer[setup,test]\stopnarrower} \page
\startbuffer[setup]
\setuplinenumbering
  [width=4em,
   left=--,
   right=--,
   align=middle]
\stopbuffer
{\typebuffer[setup] \getbuffer[setup,test]} \page
\startbuffer[setup-1]
\setuplinenumbering
  [style=\bfxx,
   command=\WatchThis]
\stopbuffer
\startbuffer[setup-2]
\def\WatchThis#1%
  {\ifodd\linenumber
 \definecolor[linecolor][red]%
   \else
 \definecolor[linecolor][green]%
   \fi
   \inframed
 [offset=1pt,frame=off,background=color,backgroundcolor=linecolor]
 {#1}}
\stopbuffer
{\typebuffer[setup-1,setup-2] \getbuffer[setup-1,setup-2,test]} \page
\startbuffer[setup-1]
\setuplinenumbering
  [location=inright,
   style=\bfxx,
   command=\WatchThis]
\stopbuffer
{\typebuffer[setup-1] \getbuffer[setup-1,setup-2,test]} \page
\stoptext

Best
Thomas
Example what should be possible:
1 This manual is about ConTEXt, a system for typesetting documents.
2 Central element in this name is the word TEX because the typographical
3 programming language TEX is the base for ConTEXt. People who are used
4 to TEX will probably identify this manual as a TEX document. They 
recognise
5 the use of \. One may also notice that the way pararaphs are broken 
into lines
6 is often better than in the avarage typesetting system.

1 manual A: handbook B 2 name

Re: [NTG-context] numbering lines

2005-02-21 Thread Thomas A . Schmitz
\setuplinenumbering[step=5,location=inmargin]
\startlinenumbering
[and don't forget the \stoplinenumbering at the end, or ConTeXt will 
complain]

Best
Thomas
On Feb 21, 2005, at 8:49 PM, Ciro A. Soto wrote:
is there a quick way to generate the number of each line
in the margin of the page?
thank you
ciro
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: \startlinenumbering and \starttyping

2004-06-14 Thread Hans Hagen
Nikolai Weibull wrote:
* Patrick Gundlach [EMAIL PROTECTED] [Jun 11, 2004 19:00]:
 

What is your def of \startfiletyping?
   

Argh, should have sticked to the original example - copy and pasted...
Anyway, it is equivalent to
\startlinenumbering
\starttyping
Kenneth Brown recent conduct has been rather
unacceptible in my humble opinion.  It is,
perhaps, not a coincidence that his last name
is the as that of the color of poo.
\stoptyping
\stoplinenumbering
 

this works ok  here
what is startfiletyping supposed to do?
\setuptyping[file][numbering=file] \typefile{test.tex}
Hans
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] \startlinenumbering and \starttyping

2004-06-11 Thread Nikolai Weibull
I hope I'm missing something, because these commands don't seem to
interact flawlessly.  What I do now is

\startlinenumbering
\startfiletyping
Kenneth Brown recent conduct
has been rather unacceptable
in my humble opinion.  It is,
perhaps, not a coincidence that
his last name is the name of
the colour of poo.
\stopfiletyping
\stoplinenumbering

This causes an overfull hbox though:

Overfull \hbox (17.62482pt too wide) in paragraph at lines 196--196
 [] |

\hbox(10.41603+4.05064)x0.0
.\glue(\leftskip) 17.62482
.\hbox(10.41603+4.05064)x0.0
..\rule(10.41603+4.05064)x0.0
..\glue 0.0 plus 1.0fil minus 1.0fil
.\penalty 1
.\glue(\parfillskip) 0.0 plus 1.0fil
.\glue(\rightskip) 0.0
.etc.

The lines don't go beyond even half the width of the normal paragraph.
Am I doing this wrong in some way?
nikolai

--
::: name: Nikolai Weibull:: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA:: loc atm: Gothenburg, Sweden:::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(linux[\021%six\012\0],(linux)[have]+fun-97);}
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: \startlinenumbering and \starttyping

2004-06-11 Thread Patrick Gundlach
Nikolai Weibull [EMAIL PROTECTED] writes:

 I hope I'm missing something, because these commands don't seem to
 interact flawlessly.  What I do now is

 \startlinenumbering


! Undefined control sequence.
recently read \startfiletyping 
 
l.3 \startfiletyping

! Undefined control sequence.
l.10 \stopfiletyping


What is your def of \startfiletyping?

Patrick
-- 
Es wird kein Wunder geschehen
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: \startlinenumbering and \starttyping

2004-06-11 Thread Patrick Gundlach
Hello Nikolai,

 Argh, should have sticked to the original example - copy and pasted...

 Anyway, it is equivalent to


[...]

Sorry, your file works fine here, except that there is no
\starttext...\stoptext pair. No error/overfull box/...

...
systems: begin file test at line 1
[1.1{/opt/texlive/8/texmf/fonts/map/pdftex/updmap/pdftex.map}{/opt/local/texmf/
dvips/config/dolly.map}{/opt/local/texmf/dvips/config/typedesign.map}]
systems: end file test at line 12
...


Please post a minimal file that is *complete* (!!) and shows the error
/warning you get.

Patrick
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: \startlinenumbering and \starttyping

2004-06-11 Thread Nikolai Weibull
* Patrick Gundlach [EMAIL PROTECTED] [Jun 11, 2004 19:30]:
 Please post a minimal file that is *complete* (!!) and shows the error
 /warning you get.

I tried producing one, but it didn't give.  Weird, I can't understand
why it gets messed up.  Oh well, such is life.
nikolai

--
::: name: Nikolai Weibull:: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA:: loc atm: Gothenburg, Sweden:::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(linux[\021%six\012\0],(linux)[have]+fun-97);}
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


<    1   2   3