[NTG-context] Copy Paste chinese in PDF files
hi, I'm thinking now whether change from latex to context. As I know, both latex and context support the chinese language, but like in Latex, there is a problem with generated PDF, that is, the chinese words can not be copied and pasted correctly as the english words, how about this function in context? Anyway, this does not work in the provided manuals and examples! appreciate for any tips! Yu Yi ___ 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] Copy Paste chinese in PDF files
Nihao Yi, 2008/12/10 Yu Yi [EMAIL PROTECTED] hi, I'm thinking now whether change from latex to context. As I know, both latex and context support the chinese language, but like in Latex, there is a problem with generated PDF, that is, the chinese words can not be copied and pasted correctly as the english words, how about this function in context? Anyway, this does not work in the provided manuals and examples! appreciate for any tips! Using luatex there should be no problem. My file: % engine=luatex \font\kaiti=name:kaiti at 140pt\kaiti \starttext 人之初,\par 性本善。\par 性相近,\par 习相远。 \stoptext After running luatex i can copy and paste all characters into for instance Babelpad. Greetings Lutz Yu Yi ___ 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 ___
Re: [NTG-context] mptopdf
David Arnold wrote: All, I sent this to OS X TeX list, but perhaps I can get some guidance here? All, After installing MacTeX (textlve2008), mptopdf fails: pstricks $ mptopdf bruce This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7) %-line parsing enabled. [MP to PDF] (./bruce.0{/Users/darnold/Library/texmf/fonts/map/pdftex/updmap/pdf tex.map}) [1] kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 rm-lmr12 mktexpk: don't know how to create bitmap font for rm-lmr12. Looks like you should install or update the Latin Modern font package. Best wishes, Taco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] startconstants broken
Upgrading seems to have broken \startconstants (and probably also \startvariables). The code below worked in cont-tmf version 2008-08-05 but no longer in 2008-10-31: \startconstants all spine:spine % etcetera \stopconstants \startvariables all % etcetera \stopvariables The error is: ! Undefined control sequence. argument \c!spine =\v!none \xprocesscommaitem #1,#2-\if ,#1 ,[EMAIL PROTECTED] \xprocesscommaitem \else \if [EMAIL PROTECTED] argument ...=\v!cd ,\c!spine =\v!none ,\c!state =\v!draft ,\c! output =\v!p... \xdogetparameters #1]-\xprocesscommaitem #1 ,],[EMAIL PROTECTED]@ l.162 ] Addition of \def\c!spine{} makes the error go away. So definitely something is broken in the latter release for the start- macro(s). Could there be given a quick fix sothat I can avoid reverting back to the earlier version or adding changes all ver the place? Hans van der Meer ___ 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] startconstants broken
Hans van der Meer wrote: Upgrading seems to have broken \startconstants (and probably also \startvariables). The code below worked in cont-tmf version 2008-08-05 but no longer in 2008-10-31: See http://wiki.contextgarden.net/Release_Notes#Context_2008.10.31 Have a look at the included t-bib.tex for the new format. Best wishes, Taco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] trick
The next trick is dedicated to Aditya ... % engine=luatex \unprotect \def\Hack#1#2% {\pdfliteral{/Span /ActualText \ctxlua{pdf.hexify(\!!bs\detokenize{#1}\!!es)} BDC}#2\pdfliteral{EMC}} \protect \def\Formula#1{\Hack{#1}{$#1$}} \startTEXpage[offset=3pt] test \Formula{e + a = mc^2 + \alpha} test \blank[2*big] \Formula{e + a = mc^2 + \alpha} \blank[2*big] $e + a = mc^2 + \alpha$ \stopTEXpage \stoptext try to cut and paste the math ... (only acrobat and actually acrobat is a bit bugged in this respect but the idea is there) - 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 ___
[NTG-context] inconsistent TABLE and figure top-placement
Hi, I just go mad with a grid based document that contains several naturalTABLEs and figures. When I want to place those at the top of the page, their top edge is sometimes higher, sometimes lower than expected. Experimenting with different figure height (and different heights of the first row of the tables) showed that these values move the float up or down!! The result looks very bad (jumping up, jumping down) ... Thus, two urgent questions: 1) How can I force that the top edge is always exactly (!) at the same vertical position, same for ALL tables and figures? 2) If 1) is impossible: How can I manually move a textwidth table/figure the should be placed top a little bit vertically (like +/- 2pt)? Thanks, 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 ___
Re: [NTG-context] Copy Paste chinese in PDF files
2008/12/10 Yu Yi [EMAIL PROTECTED]: hi, I'm thinking now whether change from latex to context. As I know, both latex and context support the chinese language, but like in Latex, there is a problem with generated PDF, that is, the chinese words can not be copied and pasted correctly as the english words, how about this function in context? Anyway, this does not work in the provided manuals and examples! I have written a simple note of ConTeXt MkIV in Chinese, which maybe is helpful for you . You can download it from http://code.google.com/p/way2ctx/downloads/list I would plan to write new one and try my best to make it as a tutorial of MkIV. I hope I can finishe it in spring of next year. -- Best wishes, Li Yanrui ___ 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] Copy Paste chinese in PDF files
Am Wed, 10 Dec 2008 13:28:51 +0100 schrieb Yu Yi: hi, I'm thinking now whether change from latex to context. As I know, both latex and context support the chinese language, but like in Latex, there is a problem with generated PDF, that is, the chinese words can not be copied and pasted correctly as the english words, how about this function in context? This is not so much a question of the format (LaTeX or context) but of the underlying engines and the fonts. E.g. dvidpfmx seems to do it fine, but pdftex needs special map files: http://www.mail-archive.com/[EMAIL PROTECTED]/msg00221.html The unicode orientated engines xetex (with latex or context) or luatex (for which adequate support exists currently only in context) will probably work out of the box. -- Ulrike Fischer ___ 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] ! Extra \else error
Hi Bart On Thu, Dec 11, 2008 at 9:50 PM, Bart C. Wise [EMAIL PROTECTED] wrote: When I run the code below (via minimals), I get the following error, why? enter loop ! Extra \else. \@@plniterate ...\expandafter \@@plniterate \else \fi \myloop ...by 1 \ifnum \tempcnta #1\else \repeat I think the loop structure should be: \loop ... \if... ... \repeat \fi \message {exit} l.16 \myloop{2008} Code: \newcount\startcnt \newcount\tempcnta \def\myloop#1{% \message{enter} \tempcnta=\the\startcnt% \loop \message{loop} \advance \tempcnta by 1 \ifnum\tempcnta#1\else \repeat\fi \message{exit} } \starttext \startcnt=1800 \myloop{2008} \stoptext Thanks, Bart ___ 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 ___ -- Best Regards 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 ___ 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] ! Extra \else error
When I run the code below (via minimals), I get the following error, why? enter loop ! Extra \else. \@@plniterate ...\expandafter \@@plniterate \else \fi \myloop ...by 1 \ifnum \tempcnta #1\else \repeat \fi \message {exit} l.16 \myloop{2008} Code: \newcount\startcnt \newcount\tempcnta \def\myloop#1{% \message{enter} \tempcnta=\the\startcnt% \loop \message{loop} \advance \tempcnta by 1 \ifnum\tempcnta#1\else \repeat\fi \message{exit} } \starttext \startcnt=1800 \myloop{2008} \stoptext Thanks, Bart ___ 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] ! Extra \else error
Zhichu Chen wrote: Hi Bart On Thu, Dec 11, 2008 at 9:50 PM, Bart C. Wise [EMAIL PROTECTED] wrote: When I run the code below (via minimals), I get the following error, why? enter loop ! Extra \else. \@@plniterate ...\expandafter \@@plniterate \else \fi \myloop ...by 1 \ifnum \tempcnta #1\else \repeat I think the loop structure should be: \loop ... \if... ... \repeat just use: \doloop { \ifwhateveryoulike \exitloop \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 - ___ 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] ! Extra \else error
On Thursday 11 December 2008 07:17:51 am Hans Hagen wrote: Zhichu Chen wrote: Hi Bart On Thu, Dec 11, 2008 at 9:50 PM, Bart C. Wise [EMAIL PROTECTED] wrote: When I run the code below (via minimals), I get the following error, why? enter loop ! Extra \else. \@@plniterate ...\expandafter \@@plniterate \else \fi \myloop ...by 1 \ifnum \tempcnta #1\else \repeat I think the loop structure should be: \loop ... \if... ... \repeat just use: \doloop { \ifwhateveryoulike \exitloop \fi Hans, Thanks, that works. But shouldn't the other one work as well? Is there something wrong with the syntax? Bart ___ 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] ! Extra \else error
Bart C. Wise wrote: On Thursday 11 December 2008 07:17:51 am Hans Hagen wrote: Zhichu Chen wrote: Hi Bart On Thu, Dec 11, 2008 at 9:50 PM, Bart C. Wise [EMAIL PROTECTED] wrote: When I run the code below (via minimals), I get the following error, why? enter loop ! Extra \else. \@@plniterate ...\expandafter \@@plniterate \else \fi \myloop ...by 1 \ifnum \tempcnta #1\else \repeat I think the loop structure should be: \loop ... \if... ... \repeat just use: \doloop { \ifwhateveryoulike \exitloop \fi Hans, Thanks, that works. But shouldn't the other one work as well? Is there something wrong with the syntax? you cannot use else in plain's loop macro; nor can you use it nested; it's just the way the plain loop macro is defined - 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] ! Extra \else error
On Thursday 11 December 2008 07:29:15 am Zhichu Chen wrote: Hi Bart, On Thu, Dec 11, 2008 at 10:21 PM, Bart C. Wise [EMAIL PROTECTED] wrote: If I change the loop to be the following, I still get the same error: \def\myloop#1{% \tempcnta=\the\startcnt% \loop \advance \tempcnta by 1 \if\tempcnta=#1\else \repeat\fi } Bart No, you should define like: \def\myloop#1{% \tempcnta=\the\startcnt% \loop \advance \tempcnta by 1 \if\tempcnta#1\repeat } No \else before \repeat in this case and no \fi outside the loop. Taking a look at the definition, you could find the following code (something like that, I can't remember clearly): \def\loop#1\repeat{\def\body{#1}\iterate} \def\iterate{something to do with \body} You can see there should not be an extra \else in the \body, and you don't need the \fi to enclose it. I don't know whether I've made my point clear. Chen, Thanks. That makes sense now. However, when I take your code and run it, it only goes through 1 iteration of the loop and exits. I'm puzzled. Bart ___ 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] ! Extra \else error
On Thu, 11 Dec 2008, Aditya Mahajan wrote: On Thu, 11 Dec 2008, Bart C. Wise wrote: When I run the code below (via minimals), I get the following error, why? \newcount\startcnt \newcount\tempcnta \def\myloop#1{% \message{enter} \tempcnta=\the\startcnt% \loop \message{loop} \advance \tempcnta by 1 \ifnum\tempcnta#1\else \repeat\fi \message{exit} } \starttext \startcnt=1800 \myloop{2008} \stoptext Do you know of \dostepwiserecurse{from}{to}{step}{body}. For example, \starttext \dostepwiserecurse{1800}{2008}{1}{We are at \recurselevel \endgraf} \stoptext There is also doloop. Documentations from syst-ext.tex %D \macros %D {doloop,exitloop} %D %D Sometimes loops are not determined by counters, but by %D (a combinations of) conditions. We therefore implement a %D straightforward loop, which can only be left when we %D explictly exit it. Nesting is supported. First we present %D a more extensive alternative. %D %D \starttyping %D \doloop %D {Some kind of typesetting punishment \par %D\ifnum\pageno100 \exitloop \fi} %D \stoptyping %D %D When needed, one can call for \type{\looplevel} and %D \type{\loopdepth}. [...] %D We don't have to declare new counters for \type{\looplevel} %D and \type{\loopdepth} because we can use \type{\recurselevel} %D and \type{\recursedepth}. (although I could not get recurselevel or looplevel to work) [...] %D The loop is executed at least once, so beware of situations %D like: %D %D \starttyping %D \doloop {\exitloop some commands} %D \stoptyping %D %D It's just a matter of putting the text into the \type{\if} %D statement that should be there anyway, like in: %D %D \starttyping %D \doloop {\ifwhatever \exitloop \else some commands\fi} %D \stoptyping %D %D You can also quit a loop immediately, by using \type %D {\exitloopnow} instead. Beware, this is more sensitive %D for conditional errors. So, you can write your example as (changed the stopping condition to add \else, just to illustrate that it works) \newcount\startcnt \newcount\tempcnta \def\myloop#1{% \message{enter} \tempcnta=\the\startcnt% \doloop{ \message{loop \the\tempcnta} \advance \tempcnta by 1 \ifnum\tempcnta#1 \else \exitloop \fi} \message{exit} } \starttext \startcnt=1800 \myloop{2009} \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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ! Extra \else error
On Thursday 11 December 2008 08:28:40 am Zhichu Chen wrote: Hi Bart, On Thu, Dec 11, 2008 at 11:05 PM, Bart C. Wise [EMAIL PROTECTED] wrote: Chen, Thanks. That makes sense now. However, when I take your code and run it, it only goes through 1 iteration of the loop and exits. I'm puzzled. Bart Really? 'cause when I run the following code === \newcount\startcnt \newcount\tempcnta \def\myloop#1{% \message{enter} \tempcnta=\the\startcnt% \loop \message{loop} \advance \tempcnta by 1 \ifnum\tempcnta#1 \repeat \message{exit}} \starttext \startcnt=1800 \myloop{2008} \stoptext === I got === systems: begin file test2 at line 14 enter loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop exit systems: end file test2 at line 20 ) === which infers it works for me. Anyway, I recommand you take the advanced interface as Hans has suggested. It's easier to use, makes more sense and is more ConTeXt-like. Chen, Just to make sure I wasn't going too insane, I took your code and ran it. It worked. The difference is that in the previous email you sent, you had the code like this: \if\tempcnta#1\repeat instead of this newer one: \ifnum\tempcnta#1\repeat That's why it didn't work. Thanks to all! Bart ___ 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] ! Extra \else error
On Thu, 11 Dec 2008, Bart C. Wise wrote: When I run the code below (via minimals), I get the following error, why? \newcount\startcnt \newcount\tempcnta \def\myloop#1{% \message{enter} \tempcnta=\the\startcnt% \loop \message{loop} \advance \tempcnta by 1 \ifnum\tempcnta#1\else \repeat\fi \message{exit} } \starttext \startcnt=1800 \myloop{2008} \stoptext Do you know of \dostepwiserecurse{from}{to}{step}{body}. For example, \starttext \dostepwiserecurse{1800}{2008}{1}{We are at \recurselevel \endgraf} \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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ! Extra \else error
Am Thu, 11 Dec 2008 07:21:56 -0700 schrieb Bart C. Wise: If I change the loop to be the following, I still get the same error: \def\myloop#1{% \tempcnta=\the\startcnt% \loop \advance \tempcnta by 1 \if\tempcnta=#1\else \repeat\fi } No, the \repeat take the place of the \fi. Also you should always end numbers with a space or a \relax to avoid trouble due to tex trying to expand the following commands in search for more numbers. \newcount\startcnt \newcount\tempcnta \def\myloop#1{% \tempcnta=\the\startcnt\relax% \loop \the\tempcnta, \advance \tempcnta by 1 \ifnum\tempcnta#1 \repeat } \myloop{10} -- Ulrike Fischer ___ 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] ! Extra \else error
On Thursday 11 December 2008 08:10:38 am Ulrike Fischer wrote: Am Thu, 11 Dec 2008 07:21:56 -0700 schrieb Bart C. Wise: If I change the loop to be the following, I still get the same error: \def\myloop#1{% \tempcnta=\the\startcnt% \loop \advance \tempcnta by 1 \if\tempcnta=#1\else \repeat\fi } No, the \repeat take the place of the \fi. Also you should always end numbers with a space or a \relax to avoid trouble due to tex trying to expand the following commands in search for more numbers. \newcount\startcnt \newcount\tempcnta \def\myloop#1{% \tempcnta=\the\startcnt\relax% \loop \the\tempcnta, \advance \tempcnta by 1 \ifnum\tempcnta#1 \repeat } \myloop{10} Excellent. Thanks Ulrike. This fixes the original problem! Bart ___ 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] ! Extra \else error
Hi Bart, On Thu, Dec 11, 2008 at 11:05 PM, Bart C. Wise [EMAIL PROTECTED] wrote: Chen, Thanks. That makes sense now. However, when I take your code and run it, it only goes through 1 iteration of the loop and exits. I'm puzzled. Bart Really? 'cause when I run the following code === \newcount\startcnt \newcount\tempcnta \def\myloop#1{% \message{enter} \tempcnta=\the\startcnt% \loop \message{loop} \advance \tempcnta by 1 \ifnum\tempcnta#1 \repeat \message{exit}} \starttext \startcnt=1800 \myloop{2008} \stoptext === I got === systems: begin file test2 at line 14 enter loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop loop exit systems: end file test2 at line 20 ) === which infers it works for me. Anyway, I recommand you take the advanced interface as Hans has suggested. It's easier to use, makes more sense and is more ConTeXt-like. -- Best Regards 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 ___ 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] how to get thick and thin borders working in tables (ConTeXt)
On 12/10/2008 4:05 AM, Wolfgang Schuster wrote: On Wed, Dec 10, 2008 at 7:07 AM, Lars Huttar [EMAIL PROTECTED] wrote: ... However, when I try to mix double frames with single frames, I'm having trouble. Here is what I tried, in order to get a cell with double frame on the left, and single frame everywhere else: \startuseMPgraphic{table:frame:Lrtb} % left border is double draw leftboundary OverlayBox enlarged \the\dimexpr\linewidth*1\relax ; % outer frame draw leftboundary OverlayBox enlarged -\the\dimexpr\linewidth*2\relax ; % inner frame draw rightboundary OverlayBox enlarged -\the\dimexpr\linewidth/2\relax ; draw topboundary OverlayBox enlarged -\the\dimexpr\linewidth/2\relax ; draw bottomboundary OverlayBox enlarged -\the\dimexpr\linewidth/2\relax ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic Now the graphic has double line on the left and a single line elsewhere. However, the lines are thicker than in the previous one... about twice as thick, too heavy for our requirements. And I can't tell why. This is true on all four sides. See http://www.huttar.net/lars-kathy/tmp/test-mp-tableframe.pdf, second table. Also, on the side that has double lines, the double lines don't go all the way to the top and bottom (see same pdf, second table), so that the double line is not continuous across multiple rows. Any suggestions? The above graphic is used as follows... \start \setupTABLE[c][first][background={table:frame:Lrtb}] \getbuffer \stop \startuseMPgraphic{table:frame:all} draw OverlayBox enlarged -0.2 ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \startuseMPgraphic{table:frame:leftdouble} draw OverlayBox leftenlarged 2 topenlarged -0.2 bottomenlarged -0.2 rightenlarged -0.2 ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \defineoverlay[table:frame:all][\useMPgraphic{table:frame:all}] \defineoverlay[table:frame:leftdouble][\useMPgraphic{table:frame:leftdouble}] \starttext \startbuffer \bTABLE[frame=off,offset=2ex] \bTR \bTD One \eTD \bTD Two \eTD \bTD Three \eTD \eTR \bTR \bTD Four \eTD \bTD Five \eTD \bTD Six \eTD \eTR \bTR \bTD Seven \eTD \bTD Eight \eTD \bTD Nine \eTD \eTR \eTABLE \stopbuffer \start \setupTABLE[background={table:frame:all}] \setupTABLE[c][first][background={table:frame:all,table:frame:leftdouble}] \getbuffer \stop \stoptext Wolfgang This fixes the problems I mentioned in my previous email. Thanks again for that! Unfortunately, when I generalize it, it takes us back to producing triple borders between adjacent cells. I think this is inevitable when overlaying a double frame (for certain sides) on top of a single frame for all sides, because a double side overlaid on a single side cannot be centered (or else the single line shows through separately from the double line). So my fix... which I'm posting here in hopes that someone may refine it, and for the benefit of others who may attempt similar things... is to center the double frames between the cells and avoid overlaying a double frame side over a single frame side. We center borders between the cells by using enlarged values -0.2 +/- k, i.e. center around -0.2. I'm not sure why -0.2 works better than zero, but it does... Doing this makes coincident border lines from adjacent cells look like ordinary single lines instead of being extra thick. We settled on k = 0.6 to get the desired distance between our double lines. Incidentally, I wish I knew how to put -0.2, 0.2-k, and -0.2+k into variables or something so that they could all be changed in one place, instead of hard-coded in many places. Maybe somebody can help me there. A cost of this single-overlay-per-cell approach is that we have to specify individually the 16 possible overlays (combinations of single and double edges) for any possible cell. But that's not too bad, as we only have to define them once. (In practice, we also had to define a couple of special cases where we needed some cells with open edges for a faked rowspan. We haven't completely got those working yet.) An unexpected and potentially large benefit of this approach is that for each cell, we only generate one MPgraphic (apparently because we only use one overlay per cell), which should make the TeX run much faster, and avoid running over the maxnumMPgraphics limit. With the multiple-overlay-per-cell approach, we ended up using about 13,000 MPgraphics for our document, far beyond the default limit of 4000, and taking 15 minutes to run compared to 37 seconds for a similar document without the tables. Here is our working system... hope it's helpful to somebody: define MPgraphics for double-ruled tables % Lars Huttar, 2008-12-09 % Thanks to Wolfgang Schuster on NTG-list % Each MPgraph (and overlay) is named lrtb, with capitalized letters indicating which sides are double-ruled. % Adjacent
Re: [NTG-context] how to get thick and thin borders working in tables (ConTeXt)
On 12/11/2008 3:24 PM, Wolfgang Schuster wrote: Am 11.12.2008 um 18:05 schrieb Lars Huttar: We center borders between the cells by using enlarged values -0.2 +/- k, i.e. center around -0.2. I'm not sure why -0.2 works better than zero, but it does... Doing this makes coincident border lines from adjacent cells look like ordinary single lines instead of being extra thick. We settled on k = 0.6 to get the desired distance between our double lines. Incidentally, I wish I knew how to put -0.2, 0.2-k, and -0.2+k into variables or something so that they could all be changed in one place, instead of hard-coded in many places. Maybe somebody can help me there. \startMPinitializations numeric InnerFrame, MiddleFrame, OuterFrame ; InnerFrame := 0.2 ; MiddleFrame := 0.4 ; OuterFrame := 0.8 ; \stopMPinitializations Makes sense. Thanks... this will make the code clearer and more maintainable. % 1 double side \startuseMPgraphic{table:frame:Lrtb} % left double draw OverlayBox leftenlarged MiddleFrame topenlarged -InnerFrame bottomenlarged -InnerFrame rightenlarged -InnerFrame ; draw OverlayBox leftenlarged -OuterFrame topenlarged -InnerFrame bottomenlarged -InnerFrame rightenlarged -InnerFrame ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic An unexpected and potentially large benefit of this approach is that for each cell, we only generate one MPgraphic (apparently because we only use one overlay per cell), which should make the TeX run much faster, and avoid running over the maxnumMPgraphics limit. With the multiple-overlay-per-cell approach, we ended up using about 13,000 MPgraphics for our document, far beyond the default limit of 4000, and taking 15 minutes to run compared to 37 seconds for a similar document without the tables. Use the 'nomprun' switch for texexec texexec --nomprun --xtx file ConTeXt collects now all graphics and process them after the TeX run. Hmm... we tried this, but it doesn't seem to make any obvious difference. Is this supposed to give a speed improvement? or get around the maxnumMPgraphics limit? Thanks again for your help. Lars ___ 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] [OT] context mascot
Have we a mascot ? http://chl.be/mascots/ -- 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] [OT] context mascot
On Fri, 12 Dec 2008, luigi scarso wrote: Have we a mascot ? http://chl.be/mascots/ Yes we do. Its the dutch cow :-) ___ 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] [OT] context mascot
Am 12.12.2008 um 00:29 schrieb Aditya Mahajan: On Fri, 12 Dec 2008, luigi scarso wrote: Have we a mascot ? http://chl.be/mascots/ Yes we do. Its the dutch cow :-) http://archive.contextgarden.net/message/20080331.202358.73e0f8dc.en.html 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] [OT] context mascot
On Fri, Dec 12, 2008 at 12:29 AM, Aditya Mahajan adit...@umich.edu wrote: On Fri, 12 Dec 2008, luigi scarso wrote: Have we a mascot ? http://chl.be/mascots/ Yes we do. Its the dutch cow :-) right, damn, I'm getting old BTW I think we should put on the wiki something like this http://melusine.eu.org/syracuse/metapost/animations/poulain/?swf=2 under the logo -- 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Typography
Dear helpful list, for the first time my work goes at typography and I'm a little worried. There is something I should know/make? Regards -- Diego Depaoli ___ 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] Typography
On Fri, Dec 12, 2008 at 8:53 AM, Diego Depaoli trebes...@gmail.com wrote: Dear helpful list, for the first time my work goes at typography and I'm a little worried. There is something I should know/make? Read R.B.'s The Elements of Typography Style. Though it did not touch color issue:) Regards -- Diego Depaoli ___ 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 ___
Re: [NTG-context] Copy Paste chinese in PDF files
Hi, Yanrui, Are you sure we should proceed the bibtex manually? (page38 of your version 2) since I run pdfTeX and bibtex, the process can be done automatically using texexec (after the 2006 release, of course). Yue Wang On Thu, Dec 11, 2008 at 8:51 PM, Yanrui Li liyanrui...@gmail.com wrote: 2008/12/10 Yu Yi y...@mathematik.uni-marburg.de: hi, I'm thinking now whether change from latex to context. As I know, both latex and context support the chinese language, but like in Latex, there is a problem with generated PDF, that is, the chinese words can not be copied and pasted correctly as the english words, how about this function in context? Anyway, this does not work in the provided manuals and examples! I have written a simple note of ConTeXt MkIV in Chinese, which maybe is helpful for you . You can download it from http://code.google.com/p/way2ctx/downloads/list I would plan to write new one and try my best to make it as a tutorial of MkIV. I hope I can finishe it in spring of next year. -- Best wishes, Li Yanrui ___ 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 ___
Re: [NTG-context] Copy Paste chinese in PDF files
This is not so much a question of the format (LaTeX or context) but of the underlying engines and the fonts. E.g. dvidpfmx seems to do it fine, but pdftex needs special map files: http://www.mail-archive.com/c...@ffii.org/msg00221.html The unicode orientated engines xetex (with latex or context) or luatex (for which adequate support exists currently only in context) will probably work out of the box. also needs to be supported by macros. For example, hyperlink in chinese will broke in XeLaTeX/pdfLaTeX/dvipdfmx with hyperref(even we choose the proper driver). but works fine in XeConTeXt and LuaTeX MKIV. -- Ulrike Fischer ___ 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 ___
Re: [NTG-context] Copy Paste chinese in PDF files
2008/12/12 Yue Wang yuleo...@gmail.com: Hi, Yanrui, Are you sure we should proceed the bibtex manually? (page38 of your version 2) since I run pdfTeX and bibtex, the process can be done automatically using texexec (after the 2006 release, of course). Yes, If we use 'context' as compiling command, I'm sure that. -- Best wishes, Li Yanrui ___ 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] Copy Paste chinese in PDF files
On Fri, 12 Dec 2008, Yanrui Li wrote: 2008/12/12 Yue Wang yuleo...@gmail.com: Hi, Yanrui, Are you sure we should proceed the bibtex manually? (page38 of your version 2) since I run pdfTeX and bibtex, the process can be done automatically using texexec (after the 2006 release, of course). Yes, If we use 'context' as compiling command, I'm sure that. The new version of t-bib (2008.12.01) runs bibtex automatically even with 'context' command. 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] help with a latex - context conversion
On Wed, 10 Dec 2008, Zoho Vignochi wrote: Hello: I am intending to write my masters thesis using context. My university publishes a style guide in addition to a latex cls file. I am trying to reproduce the titlepage. I have been using the wiki (specifically http://wiki.contextgarden.net/Document_Titles#In_ConTeXt:_A_more_ advanced_solution). But I have not been able to add addition fields beyond the present title, author, date. Here is the relevant portion on the latex file. [latex code snipped] Any hints? Thank you for your time, Here is how I would do it. Most of it is literal translation of latex commands, using a contextish style. % Put this in your environment file. \unprotect \def\setupthesis {\dosingleargument\dosetupthesis} \def\dosetupthesis[#1]% {\setvariables[thesis][#1]} \def\setupthesistext {\dosingleargument\dosetupthesistext} \def\dosetupthesistext[#1]% {\setvariables[thesis:text][#1]} \definefont[ThesisTitleFont][SerifBold sa 1.4] \setupthesistext [ submitted={A THESIS SUBMITTED IN PARTIAL FULFILLMENT% OF THE REQUIREMENTS FOR THE DEGREE OF}, note={by}, academicunit={In the Graduate Academic Unit of}, accepted={This thesis is accepted}, dean={Dean of Graduate Studies}, school={THE UNIVERSITY OF NEW BRUNSWICK}, copyright={Copyright}, ] \setupthesis [ title=, author=, prevdegree=, academicunit=, degree=, supervisor=, board=, external=, year=, ] \def\placethesistitle {\startstandardmakeup[top=,bottom=] \startalignment[middle,broad] {\ThesisTitleFont\setupinterlinespace \getvariable{thesis}{title}\endgraf} \blank[1em] \getvariable{thesis:text}{note} \blank[1em] \getvariable{thesis}{author} \blank[1em] \bold{\getvariable{thesis}{prevdegree}} \blank[2em] \bold{\getvariable{thesis:text}{submitted}} \blank[2em] \bold{\getvariable{thesis}{degree}} \blank[1em] \getvariable{thesis}{text:academicunit}\space \getvariable{thesis}{academicunit} \blank[1em] \stopalignment \starttabulate[|l|l|] \NC Supervisor(s): \NC \getvariable{thesis}{supervisor} \NC \NR \NC Examining Board: \NC \getvariable{thesis}{board} \NC \NR \NC External Examiner: \NC \getvariable{thesis}{external} \NC \NR \stoptabulate \startalignment[middle,broad] \getvariable{thesis:text}{accepted} \blank[2em] \getvariable{thesis:text}{dean} \blank[1em] \bold{\getvariable{thesis:text}{school}} \blank[0.5em] \bold{\getvariable{thesis}{date}} \blank[0.5em] \getvariable{thesis}{copyright}\space \getvariable{thesis}{author},\space\getvariable{thesis}{year} \stopalignment \stopstandardmakeup} \protect % The main file \starttext \setupthesis [ title={Thesis Title}, author={Joe Doe}, prevdegree={Previous degree}, academicunit={Academic Unit}, degree={Full name of degree}, supervisor={Name of supervisor}, board={Board}, external={External}, year={year}, ] \placethesistitle \dorecurse{10}{\input knuth \endgraf} \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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___