Re: [NTG-context] Forward of moderated message (Why It Is So)

2006-12-30 Thread Taco Hoekwater

Hi Geoff,

(Your messsage was too large, I dropped the attachments)

From: [EMAIL PROTECTED]:
 Thanks
 
 This problem has been with my version of Contex which is running on windows
 XP since I first started maybe 2 years ago and has never bothered me as I
 was doing simple jobs. The version is kept up to date and I have in fact
 downloaded the base distro again on 14 Dec and updated. I am guessing that
 it may be in the parameters given to pdftex which I have just noticed from
 googling for something else.

Like Luigi said: there is no problem. This is absolutely how it
is supposed to look. I do not know what you want precisely, but
apparently you are unhappy with the standard ConTeXt page layout.

That is fine, after all, it is only a default. Just play with
\setuplayout until you are happy (try \showlayout if you want to
see all of the currently used parameter values).  But there is
definately no bug in your installation.

Best,
Taco

 I am happy to test this but I am unsure how
 
 \pdfpagewidth (dimension)
 This dimension parameter specifies the page width of the pdf output (the
 screen, the paper, etc.). pdfTEX reads this parameter
 when it starts shipping out a page. After magnification has been changed by
 the \mag primitive, check that this parameter
 reflects the wished true page width.
 If the value is not given, the page width is calculated as wbox being
 shipped out + 2 × (horigin + \hoffset). When part of the page
 falls off the paper or screen, you can be rather sure that this 
 parameter is
 set wrong.
 
 On 12/30/06, luigi scarso [EMAIL PROTECTED] wrote:

 On 12/29/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Gday
 
  I know there must be a fundamental answer, but I cannot fathom why
  everything is shifted left on the page.
 
 hmm, I don't see anything wrong;this is the standard setup.
 You can play with
 5
 \setuppapersize[A4][A3]
 \setuplayout[location=middle,marking=on]
 \showlayout
 \starttext
 \input tufte
 \stoptext
 %%
 or
 
 \setuppapersize[A4][A4]
 \setuplayout[horoffset=3cm]%%% bang !
 \showlayout
 \starttext
 \input tufte
 \stoptext

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


Re: [NTG-context] Manual (English) Update soon?

2006-12-30 Thread Douglas Philips
On 2006 Dec 29, at 12:38 PM, plink indited:
 Mojca Miklavec wrote:
 Well, the ConTeXt manual is one of the most stable components of  
 ConTeXt indeed ;)

 ;-)

 should be wikified ...

Probably, but it'd be sad to lose the ability to download and print  
it for offline reading (I may be in a small minority of people who  
like to read reference manuals though)... I'm also not familiar  
enough with the wiki being used to know if there is anyway for it to  
agregate a bunch of pages into a reasonably printable form

--Doug



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


Re: [NTG-context] Manual (English) Update soon?

2006-12-30 Thread Douglas Philips
On 2006 Dec 29, at 2:22 PM, andrea valle indited:

 Well, maybe I'm missing something.
 But if you need to use ConTeXt on a mac you can use Gerben's distro,
 which also set up a crontab for you, and when you update it simply  
 does
 all the boring stuff for you (I hate TeX tree structure ...)

Gerben has announced end-of-life for his distro system. Well, end of  
support...
except for ConTeXt because of the automation that ConTeXt provides  
for his
packaging needs.

Perhaps that would play well with TeX Live '06...

--Doug


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


[NTG-context] macro \verticalchineseunicodeglyph may not satisfy the vertical Chinese typeset

2006-12-30 Thread Zhichu Chen

Hi, ConTeXters

I'm playing some Chinese vertical typesetting. Mr. Wolfgang Shuster helps me
a lot about it.

In vertical typesetting, the top of each leading Chinese characters at each
column are aligned horizontally. But if we changed the size of the bodyfont
of some characters and they could wrap to the next column, then the top of
the wrapped texts are not aligned with the other columns. So we can give
them a raise, but it is not so easy to calculate the dimension to be raised,
for ConTeXt will give every Chinese a \strut and makes the original height
and depth unavailable. Since we can aligned the \strut-ed characters
precisely, the real characters are not.

Can Hans or other TeXperts give me a nice solution?

In fact, I think in vertical Chinese, we should move the baseline to the top
of the character. and make it with height=0pt and depth=width

--
Sincerely yours,
Chen


 Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
  | www.sinap.ac.cn

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


Re: [NTG-context] Manual (English) Update soon?

2006-12-30 Thread Douglas Philips
On 2006 Dec 29, at 10:04 PM, Mojca Miklavec indited:
 On 12/29/06, Douglas Philips wrote:
 The undocumented features are documented in My Ways? :-)

 Esp. the two MyWay's written by the author who mentioned that ;)

:-)

I see you also have one... all of which are next up on my Sunday  
afternoon reading!

 See http://wiki.contextgarden.net/My_Way

Thanks!

 Most other MyWay's deal with fonts.

Arg. My bane. Fonts. The one thing that pulls me ever so slightly to  
using Pages...
Not because I want a garish mix of goofball junk fonts, but because I  
love Palatino for newletters
and Papyrus for cards and short notes...
I figured out how to get Palatino into LaTeX, but use other programs  
(so far) to get Papyrus...


 I found a few of those also, and it is very confusing to a newbie
 (such as myself) to figure out what is old and valid and what is old
 and not-so-valid...

 I don't have a good overview, but I don't know that many
 not-so-valid things.

Thanks, that is good to know...


 Old things are still valid, there might only be some new
 things that you might not know about once you've read the manual.
 (plain) TeX is about 25 and still valid. Only that there are a few
 commands available out there which can simplify things.

The more I look into it, the more I feel that ConTeXt is going in a  
direction more helpful to me than LaTeX. No comment intended on the  
correctness of either direction, just on the harmony with where I  
am going.

--Doug

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


Re: [NTG-context] Manual (English) Update soon?

2006-12-30 Thread Douglas Philips
On 2006 Dec 30, at 12:47 AM, Sanjoy Mahajan indited:
 So, I've been contemplating whether I should move up the
 abstraction ladder to ConTeXt or down to plain TeX and really
 learn to build the world from boxes and glue. :-)

 I wrote my dissertation using plain TeX plus eplain,
 ...
 I got tired of maintaining and improving the macro hackery, so I  
 decided to leap over LaTeX to ConTeXt.

Yes, that is an issue. As was pointed out earlier in this thread,  
'packages' tend to lose support once they're released, so ConTeXt at  
least has a coherent architecture which, gathering from what I've  
read on this list, counteracts that.

 Here is a hello-world template that I just wrote.  It contains many of
 the ConTeXt commands that I use most frequently.

Cool, thank you! Another sunday after noon (as in 18 hours from now)  
project!

--Doug


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


Re: [NTG-context] Making a verbatim file for another language

2006-12-30 Thread Jarimatti Valkonen
Aditya Mahajan kirjoitti 28.12.2006 kello 19.09:

[About ConTeXt and Vim module for syntax highlighting.]
 Let us know if you come across any problems.

Works fine here. System: Mac OS 10.4.8, using default Vim (6.2:  
yikes, thats old!).
ConTeXt  ver: 2006.08.08 21:51  fmt: 2006.11.1

-- 
Jarimatti Valkonen
[EMAIL PROTECTED]


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


Re: [NTG-context] Manual (English) Update soon?

2006-12-30 Thread Rolf Marvin Bøe Lindgren
On 30. des. 2006, at 6:47, Sanjoy Mahajan wrote:

 \setupindenting[medium, yes]

ConTeXt seems to choke on the yes here.

-- 
Rolf Lindgren
[EMAIL PROTECTED]


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


Re: [NTG-context] Week number

2006-12-30 Thread Taco Hoekwater

Hi all,


I just posted this (the result of a rainy morning in Dordrecht, NL)
to comp.text.tex. Someone here might be interested as well.

Best, Taco

-

Mads Munch Hansen wrote:
 Hi all, and merry Christmas :)
 
 Is there a way to have LaTeX print the current week number, like the
 \date command?

I was feeling a bit bored today, so I came up with this. It is a
plain e-TeX input file instead of a LaTeX package, but it should
run without problems.

Watch out: Dec 29 can be week 1 of the next year; and Jan 3 can be
week 53 of the previous year.

Best wishes, Taco


%% calendarweek.tex
%% 2006 (C) Taco Hoekwater, public domain
%%
%%  Usage:
%%   \calendarweek{30}{12}{2006}
%%

\def\Expr#1{\the\numexpr #1\relax}

\def\Modulonumber#1#2{\Expr{#2-#2+(#1/2))/#1)-1)*#1)}}
\def\Divisionnumber#1#2{\Expr{(2*#2-#1)/(2*#1)}}

\def\Mod#1#2{\Modulonumber{\Expr{#2}}{\Expr{#1}}}
\def\Div#1#2{\Divisionnumber{\Expr{#2}}{\Expr{#1}}}

\def\Jday#1#2#3%
{\Expr{#1+\Div{((153*(\Expr{#2+(12*(\Div{14-#2}{12}))-3}))+2)}
 {5}+365*(\Expr{#3+4800-(\Div{14-#2}{12})})+
  (\Div{\Expr{#3+4800-(\Div{14-#2}{12})}}{4})-
  (\Div{\Expr{#3+4800-(\Div{14-#2}{12})}}{100})+
  (\Div{\Expr{#3+4800-(\Div{14-#2}{12})}}{400})-32045 }}

\def\cwhlp#1#2#3%
{\Expr{\Mod {\Mod {\Mod {\Expr
 {\Jday{#1}{#2}{#3}+31741-\Mod{\Jday{#1}{#2}{#3}}{7}}}%
 {146097}}{36524}}{1461}}}

\def\calendarweek#1#2#3%
  {\Expr{\Expr{\Div{\Expr{\Mod{\cwhlp{#1}{#2}{#3}-
\Expr{\Div{\cwhlp{#1}{#2}{#3}}{1460}}}{365}+
 \Expr{\Div{\cwhlp{#1}{#2}{#3}}{1460{7} +1}}}

\endinput



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


Re: [NTG-context] Making a verbatim file for another language

2006-12-30 Thread cormullion

On 2006-12-30, at 09:22.0, Jarimatti Valkonen wrote:

 Aditya Mahajan kirjoitti 28.12.2006 kello 19.09:

 [About ConTeXt and Vim module for syntax highlighting.]
 Let us know if you come across any problems.

 Works fine here. System: Mac OS 10.4.8, using default Vim (6.2:
 yikes, thats old!).
 ConTeXt  ver: 2006.08.08 21:51  fmt: 2006.11.1

Thanks Jarimatti for sharing that. It suggests that my week-old  
installation isn't the most up to date one:

 ConTeXt  ver: 2005.01.31  fmt: 2006.7.23  int: english  mes: english

I obviously chose a suboptimal option when I started i-Installer.  
(Not difficult, really - it felt like a first attempt to hot-wire a  
Boing 747... :-)

I'm reluctant to re-install the whole thing, when ConTeXt is  
currently working so well. Perhaps next week.



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


[NTG-context] store counter or variable and reread again

2006-12-30 Thread Thomas Engel
Hello,

i just playing a little bit with macros.
For adding points to a total sum i use this macros

\global\newcount\summeP \summeP=0
%   ad the points of each question
\def\getPunkte[#1]{\global\advance\summeP by \number#1}
%   show the points on the right side
\def\showP[#1]{\inright{\hskip 10mm \framed{#1} }}
%   handle the points
\def\pkt[#1]%
{\showP[#1]%
 \getPunkte[#1] }

this is working well but my problem is I want to use \summeP on the
first page to show the total amount of points for the whole exam.

I know that this needs a second run of texexec, but I don't know how to
store the value at the end of the file and reread this stored value in a
second run the get the right value.

Any hints are welcome!

Thanks and a Happy New Year!

Thomas

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


Re: [NTG-context] store counter or variable and reread again

2006-12-30 Thread Aditya Mahajan
On Sat, 30 Dec 2006, Thomas Engel wrote:

 Hello,
 
 i just playing a little bit with macros.
 For adding points to a total sum i use this macros
 
 \global\newcount\summeP \summeP=0
 %   ad the points of each question
 \def\getPunkte[#1]{\global\advance\summeP by \number#1}
 %   show the points on the right side
 \def\showP[#1]{\inright{\hskip 10mm \framed{#1} }}
 %   handle the points
 \def\pkt[#1]%
 {\showP[#1]%
  \getPunkte[#1] }
 
 this is working well but my problem is I want to use \summeP on the
 first page to show the total amount of points for the whole exam.
 
 I know that this needs a second run of texexec, but I don't know how to
 store the value at the end of the file and reread this stored value in a
 second run the get the right value.

Here is how to do the second run. I also use ConTeXt macros 
(\makecounter etc) instead of plain TeX. Be careful of spurious 
linebreaks.

% It may be better to use \setcounter series of macros for managing counters.
% First let us define a general macro for adding arbitrary number to a counter

\unprotect
\def\addtocounter#1#2% #1 name #2 value
[EMAIL PROTECTED]
\protect
% To Hans and Taco: Should the above macro be added to syst-ext?

% Now lets define everything in terms of ConTeXt's counter macros

% \global\newcount\summeP

\makecounter{Points}
% I changed summeP to Points just to be consistent

% \summeP=0
% \makecounter sets the value of counter to 0.


% %   ad the points of each question
% \def\getPunkte[#1]{\global\advance\summeP by \number#1}
% This macro is already been defined using numexpr above.

% %   show the points on the right side
\def\showP[#1]{\inright{\hskip 10mm \framed{#1} }}
% %   handle the points
\def\pkt[#1]%
 {\showP[#1]%
%  \getPunkte[#1] }
  \addtocounter{Points}{#1}}
%

% Now lets set up the two pass mechanism

\def\nofPoints{0} % Number of points from previous run

\definetwopasslist {Points} % variable where two pass data is stored

% Need to execute this at the start of each file
\def\checkPoints
   {\gettwopassdata{Points} % Retreive the two pass data
 \iftwopassdatafound
  \xdef \nofPoints {\twopassdata}
 \fi
 \global\let\checkproblems\relax}



% An example usage

\starttext
\checkPoints

\title{This exam is of \nofPoints\ Points}

% Lets set 10 problems with different points

\dorecurse{10}
   {\pkt[\recurselevel] \input tufte \endgraf}

% Now the rest of the magic to take care of the two pass run
% Basically this says that rerun if \nofPoints != 
% \countervalue{Points}. In the next run we set \nofPoints to the
% previous value of \countervalue{Points} (the \checkPoints macro in 
% the beginning), so things should be stable after two runs.
\savetwopassdata {Points} {\nofPoints} {\countervalue{Points}}

\stoptext


HTH,
Aditya

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


[NTG-context] texfont doesn't refresh MiKTeX database

2006-12-30 Thread Vyatcheslav Yatskovsky
Hello,

I use MikTeX. When I run texfont script, it always fails to do FNDB refresh at 
the end, saying

generating : ls-r databases
initexmf: This utility does not accept non-option arguments.

It seems like a bug in the script.

-- 
Best regards
 Vyatcheslav

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


Re: [NTG-context] Manual (English) Update soon?

2006-12-30 Thread Sanjoy Mahajan
Rolf Lindgren writes:
  \setupindenting[medium, yes]
 
 ConTeXt seems to choke on the yes here.

Hmm, texshow says lists 'yes' and 'medium' as valid keywords.  What
ConTeXt version are you using?  Can you post the error log?  I had no
problems running the whole hello-world file through the 2006.12.27
ConTeXt (Linux, i386).

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] store counter or variable and reread again

2006-12-30 Thread Peter Münster
On Sat, 30 Dec 2006, Aditya Mahajan wrote:

 % Now the rest of the magic to take care of the two pass run
 % Basically this says that rerun if \nofPoints != 
 % \countervalue{Points}. In the next run we set \nofPoints to the
 % previous value of \countervalue{Points} (the \checkPoints macro in 
 % the beginning), so things should be stable after two runs.
 \savetwopassdata {Points} {\nofPoints} {\countervalue{Points}}

Hello Aditya,

with the following example, I get always 2 runs:

\definetwopasslist{test}
\starttext
bla
\savetwopassdata{test}{1}{2}
\stoptext

Is this normal or a bug?

Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] store counter or variable and reread again

2006-12-30 Thread Aditya Mahajan
On Sat, 30 Dec 2006, Peter Münster wrote:

 On Sat, 30 Dec 2006, Aditya Mahajan wrote:
 
  % Now the rest of the magic to take care of the two pass run
  % Basically this says that rerun if \nofPoints != 
  % \countervalue{Points}. In the next run we set \nofPoints to the
  % previous value of \countervalue{Points} (the \checkPoints macro in 
  % the beginning), so things should be stable after two runs.
  \savetwopassdata {Points} {\nofPoints} {\countervalue{Points}}
 
 Hello Aditya,
 
 with the following example, I get always 2 runs:
 
 \definetwopasslist{test}
 \starttext
 bla
 \savetwopassdata{test}{1}{2}
 \stoptext
 
 Is this normal or a bug?

Hmm... I would have guessed that you will keep on getting infinite 
runs, but apparently texexec decides that two are enough. I need to 
look deeper to see if this is the intended behaviour. I would call it 
a bug, since there can be cases which need more than two runs to 
converge.

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


Re: [NTG-context] Week number

2006-12-30 Thread Aditya Mahajan
On Sat, 30 Dec 2006, Taco Hoekwater wrote:

 
 Hi all,
 
 
 I just posted this (the result of a rainy morning in Dordrecht, NL)
 to comp.text.tex. Someone here might be interested as well.

 [...]

 I was feeling a bit bored today, so I came up with this. It is a
 plain e-TeX input file instead of a LaTeX package, but it should
 run without problems.

If you are still bored, how about adding this to ConTeXt, so that one 
can say

Today is \currentdate[weekday] of the \currentdate[week] week of 
\currentday[year]

I do not know if someone will find it useful or not, but it seems like 
a nice feature to have :)

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


Re: [NTG-context] Week number

2006-12-30 Thread Hans Hagen
Aditya Mahajan wrote:
 On Sat, 30 Dec 2006, Taco Hoekwater wrote:

   
 Hi all,


 I just posted this (the result of a rainy morning in Dordrecht, NL)
 to comp.text.tex. Someone here might be interested as well.

 [...]

 I was feeling a bit bored today, so I came up with this. It is a
 plain e-TeX input file instead of a LaTeX package, but it should
 run without problems.
 

 If you are still bored, how about adding this to ConTeXt, so that one 
 can say

 Today is \currentdate[weekday] of the \currentdate[week] week of 
 \currentday[year]

 I do not know if someone will find it useful or not, but it seems like 
 a nice feature to have :)
   
see core-con.tex, such things have been there for years now  -) 

(not sure if it does the same as what taco code does) 

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] ConTeXt upgrade blues

2006-12-30 Thread Rolf Marvin Bøe Lindgren
OK, so the ConTeXt that comes with the TeX distribution I use (until  
eariler today, MacPorts, and as from later today, fink) is ancient.

now, with good old LaTeX that's not much of a problem - just put the  
most recent release in the few relevant places in texmf-local,  
rebuild the formats, and off you go.  with ConTeXt, that's, er, not  
so simple.

the first attempt I made was to pull dowm the most recent version of  
the base files and then run

sudo texmfstart ctxtools --update

which seemingly worked, pulled the updates to texmf-local, and  
complied with no error messages.  however, the new ConTeXt failed to  
compile documents, giving lots of error messages about undefined  
commands.

texexec test.tex (which used to work) gives

mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode;  
input ec-lmr12' failed to make ec-lmr12.tfm.
kpathsea: Appending font creation commands to missfont.log.
! Font \*12ptrmtfrm*=ec-lmr12 not loadable: Metric (TFM) file not found.

ruby `kpsewhich --format=texmfscripts texmfstart.rb` texexec test  
(which is in essence what the recommended shell script does) gives

ConTeXt  ver: 2005.01.31  fmt: 2006.12.30  int: english  mes: english

language: language en is active
protectionstate 0
system  : cont-new loaded
(/sw/share/texmf-local/tex/context/base/cont-new.tex
! Undefined control sequence.
l.16 \newcontextversion
{2006.12.27 11:34}


now, according to several web pages, ec-lmr12 can be found on  
pragma's web, but it's not there.

any suggestions?

-- 
Rolf Lindgren
[EMAIL PROTECTED]


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


Re: [NTG-context] store counter or variable and reread again

2006-12-30 Thread Hans Hagen
Aditya Mahajan wrote:
 On Sat, 30 Dec 2006, Peter M�nster wrote:

   
 On Sat, 30 Dec 2006, Aditya Mahajan wrote:

 
 % Now the rest of the magic to take care of the two pass run
 % Basically this says that rerun if \nofPoints != 
 % \countervalue{Points}. In the next run we set \nofPoints to the
 % previous value of \countervalue{Points} (the \checkPoints macro in 
 % the beginning), so things should be stable after two runs.
 \savetwopassdata {Points} {\nofPoints} {\countervalue{Points}}
   
 Hello Aditya,

 with the following example, I get always 2 runs:

 \definetwopasslist{test}
 \starttext
 bla
 \savetwopassdata{test}{1}{2}
 \stoptext

 Is this normal or a bug?
 

 Hmm... I would have guessed that you will keep on getting infinite 
 runs, but apparently texexec decides that two are enough. I need to 
 look deeper to see if this is the intended behaviour. I would call it 
 a bug, since there can be cases which need more than two runs to 
 converge.

   
how about

\savecurrentvalue\SomeVar{someval}




-- 

-
  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] store counter or variable and reread again

2006-12-30 Thread Aditya Mahajan
On Sat, 30 Dec 2006, Hans Hagen wrote:

 Aditya Mahajan wrote:
  On Sat, 30 Dec 2006, Peter M???nster wrote:
 
  
  On Sat, 30 Dec 2006, Aditya Mahajan wrote:
 
  
  % Now the rest of the magic to take care of the two pass run
  % Basically this says that rerun if \nofPoints != 
  % \countervalue{Points}. In the next run we set \nofPoints to the
  % previous value of \countervalue{Points} (the \checkPoints macro in 
  % the beginning), so things should be stable after two runs.
  \savetwopassdata {Points} {\nofPoints} {\countervalue{Points}}
  
  Hello Aditya,
 
  with the following example, I get always 2 runs:
 
  \definetwopasslist{test}
  \starttext
  bla
  \savetwopassdata{test}{1}{2}
  \stoptext
 
  Is this normal or a bug?
  
 
  Hmm... I would have guessed that you will keep on getting infinite 
  runs, but apparently texexec decides that two are enough. I need to 
  look deeper to see if this is the intended behaviour. I would call it 
  a bug, since there can be cases which need more than two runs to 
  converge.
 
  
 how about
 
 \savecurrentvalue\SomeVar{someval}

I was just copying the way it is done with other macros \lastpage, 
etc. I will look at \savecurrentvalue also. However, something seems 
to be wrong in tex.rb

Change

def processfile

  while ! stoprunning  (texruns  nofruns)  ok do

  end
...
end

to

def processfile

  while ! stoprunning  (texruns  nofruns)  ok do

  report(stoprunning #{stoprunning})
  report(texruns=#{texruns}, nofruns=#{nofruns})
  report(ok=#{ok})
  report(while=#{! stoprunning  (texruns  nofruns)  ok})
  end
...
end

so that we can see what takes us out of the while loop.

Take Petar's test file and run it through texexec. I get

TeXExec | stoprunning true
TeXExec | texruns=2, nofruns=8
TeXExec | ok=counter.tex
TeXExec | while=counter.tex

Notice that ok=\jobname. Shouldn't ok be a boolean. And the condition 
for while is a string rather than a boolean. I am not too sure on what 
ruby does for non boolean conditionals, but the present implementation 
can break (under some crazy conditions, maybe). How about if in

def runtexutil(...)

there is a return ok in the end, for example

  begin
  logger = Logger.new('TeXUtil')
  if tu = TeXUtil::Converter.new(logger) and tu.loaded(fname) then
  ok = tu.processed  tu.saved  tu.finalized
  end
  rescue
  Kpse.runscript('texutil',fname,options)
  else
return ok #- added.
  end



Back to Peter's question, I gave a wrong explaination earlier. texexec 
just checks if the tui file has changed. If the file did not change 
from the last run, then it stops processing. So with

\savetwopassdata{test}{1}{2}

you will get two runs the first time you process the file, and a 
single run if you reprocess the file. By default, the maximum number 
of runs that you can have is 8, but you can change this by passing
--runs= to texexec


Aditya


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


Re: [NTG-context] store counter or variable and reread again

2006-12-30 Thread Aditya Mahajan
On Sat, 30 Dec 2006, Aditya Mahajan wrote:

 On Sat, 30 Dec 2006, Hans Hagen wrote:
 
  how about
  
  \savecurrentvalue\SomeVar{someval}
 
 I was just copying the way it is done with other macros \lastpage, 
 etc. I will look at \savecurrentvalue also.

Ahh, \lastpage uses \savecurrentvalue. I was pretty sure that I copied 
the twopass some time back from \lastpage. Maybe I was dreaming, maybe 
you are changing the internals too fast for me to keep up. Anyways, to 
make ammends, here is the solution using \savecurrentvalue

% It may be better to use \setcounter series of macros.
% First let us define a general macro for adding arbitrary number to a counter

\unprotect
\def\addtocounter#1#2% #1 name #2 value
   [EMAIL PROTECTED]
\protect

% To Hans and Taco: Should the above macro be added to syst-ext?

% Now lets define everything in terms of ConTeXt's counter macros

\makecounter{Points}

% %   show the points on the right side
\def\showP[#1]{\inright{\hskip 10mm \framed{#1} }}

\def\pkt[#1]%
 {\showP[#1]%
  \addtocounter{Points}{#1}}
%

\def\nofPoints{0} % Number of points from previous run

\def\savenofPoints
   {\savecurrentvalue\nofPoints{\countervalue{Points}}}

% It is a bit boring to type \savenofPoints everytime

\appendtoks \savenofPoints \to \everystoptext

% An example usage

\starttext

\title{This exam is of \nofPoints\ Points}

% Lets set 10 problems with different points
\dorecurse{10}
   {\pkt[\recurselevel] \input tufte \endgraf}

\stoptext

The whole things is much shorter :)

Hans, I just noticed that \everystarttext is executed at the start of 
components and products, while \everystoptext is not. Does it make 
sense to define \stopcomponet and \stopproduct so that \everystoptext 
is executed?

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


Re: [NTG-context] ConTeXt upgrade blues

2006-12-30 Thread Mojca Miklavec
On 12/30/06, Rolf Marvin Bøe Lindgren wrote:

 now, according to several web pages, ec-lmr12 can be found on
 pragma's web, but it's not there.

It's not there any more since it was considered that they should
either be present on the system already or that it would make sense to
update the system anyway.

http://www.ctan.org/tex-archive/fonts/lm/

gwTeX is based on a more modern TeX distribution (TeX Live 2006), but
is going to be supported for just another 22 hours. (tetex isn't
supported any more anyway.)

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


Re: [NTG-context] ConTeXt upgrade blues

2006-12-30 Thread Rolf Marvin Bøe Lindgren

On 30. des. 2006, at 11:27, Rolf Marvin Bøe Lindgren wrote:

 OK, so the ConTeXt that comes with the TeX distribution I use (until
 eariler today, MacPorts, and as from later today, fink) is ancient.

 now, with good old LaTeX that's not much of a problem - just put the
 most recent release in the few relevant places in texmf-local,
 rebuild the formats, and off you go.  with ConTeXt, that's, er, not
 so simple.


OK, the problem was solvable and I now have an up-to-date ConTeXt.   
the only remaining issue is that of hyphenation - the previous  
version, apparently had Norwegian hyphenation on by default.  I  
managed to coerce ConTeXt into handeling it, but what is the  
canonical way to edit which hyphenation patterns ConTeXt loads when  
building formats?

-- 
Rolf Lindgren
[EMAIL PROTECTED]


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