[NTG-context] typearea
Hi, I'm new to ConTeXt and try to use the module typearea (https://modules.contextgarden.net/cgi-bin/module.cgi/action=find/name=typearea). But the example doesn't work: \usemodule[typearea] \setupTypeArea[bcor=0mm,alphabets=3.1] \setuppagenumbering[alternative=doublesided] \starttext \dorecurse4{\framed[width=\textwidth,height=\textheight]{test}\page} \stoptext I got: texmf-dist/tex/context/third/typearea/t-typearea.tex' loading > Something like KOMA-TypeArea tex error > tex error on line 89 in file /usr/local/texlive/2023/texmf-dist/tex/context/third/typearea/t-typearea.tex: Missing number, treated as zero { \TA@alphabets \par \PageWidth =\dimexpr \paperwidth -\TA@bcor \relax \par \edef \Ratio {\withoutpt { \the \dimexpr 2\paperheight /(\PageWidth /32768)\relax }} \par \setbox \scratchbox \hbox {\dorecurse {26}{\character \recurselevel }} \Width =\dimexpr \TA@alphabet \setupTypeArea[bcor=0pt,oneside=no,alphabets=2.6] 79 height=\the\Height, 80 width=\the\Width, 81 header=2\lineheight, 82 headerdistance=\lineheight, 83 footer=2\lineheight, 84 footerdistance=3\lineheight, 85 topspace=\Top] 86 } 87 \protect 88 89 >> \setupTypeArea[bcor=0pt,oneside=no,alphabets=2.6] 90 91 \doifnotmode{demo}{\endinput} 92 93 %D Usage example: 94 \usemodule[typearea] 95 \setupTypeArea[bcor=0mm,alphabets=3.1] 96 \setuppagenumbering[alternative=doublesided] 97 \starttext 98 \dorecurse4{\framed[width=\textwidth,height=\textheight]{test}\page} 99 \stoptext A number should have been here; I inserted '0'. (If you can't figure out why I needed to see a number, look up 'weird error' in the index to The TeXbook.) mtx-context | fatal error: return code: 1 Line 89 in the module should be the problem. But how can I solve it? I think some lines in the module should be commented out. (An example directly in the module?) I thank you for any hint. Greetings Thomas___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
Re: [NTG-context] Typearea module fails with “Missing number”
Peter Münster via ntg-context schrieb am 31.08.2022 um 23:16: On Mon, Aug 29 2022, Wolfgang Schuster via ntg-context wrote: remove one pair of curly braces Hi Wolfgang, Thanks. Here a new version: http://pmrb.free.fr/tmp/t-typearea.zip Even though the module works now with LMTX it needs a proper update to ensure it can be used in future documents. Another suggestion from myself is to use the \averagecharwidth length for the calculation of the text width because it takes the document language into account. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Typearea module fails with “Missing number”
On Mon, Aug 29 2022, Wolfgang Schuster via ntg-context wrote: > remove one pair of curly braces Hi Wolfgang, Thanks. Here a new version: http://pmrb.free.fr/tmp/t-typearea.zip Unfortunately, I can not upload it to modules.contextgarden.net: "Unknown user or bad password!" Taco, what should I do please? TIA, -- Peter ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Typearea module fails with “Missing number”
Marco Patzer via ntg-context schrieb am 29.08.2022 um 09:49: On Mon, 29 Aug 2022 09:30:34 +0200 Marco Patzer via ntg-context wrote: The typearea module fails on LMTX (runs ok with MkIV): tex error > tex error on line 89 in file /usr/local/share/context-lmtx/tex/texmf-modules/tex/context/third/typearea/t-typearea.tex: Missing number, treated as zero Sorry, forgot the MWE: \usemodule[typearea] \starttext\null\stoptext To fix the module you have to change the line \edef\Ratio{\withoutpt{\the\dimexpr2\paperheight/(\PageWidth/32768)\relax}} with (remove one pair of curly braces) \edef\Ratio{\withoutpt\the\dimexpr2\paperheight/(\PageWidth/32768)\relax} Similar problems can happens with other modules because many of them are outdated and they should be either updated or removed (the files can still be archived). Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Typearea module fails with “Missing number”
On Mon, 29 Aug 2022 09:30:34 +0200 Marco Patzer via ntg-context wrote: > The typearea module fails on LMTX (runs ok with MkIV): > > tex error > tex error on line 89 in file > /usr/local/share/context-lmtx/tex/texmf-modules/tex/context/third/typearea/t-typearea.tex: > Missing number, treated as zero Sorry, forgot the MWE: \usemodule[typearea] \starttext\null\stoptext Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Typearea module fails with “Missing number”
Hi! The typearea module fails on LMTX (runs ok with MkIV): tex error > tex error on line 89 in file /usr/local/share/context-lmtx/tex/texmf-modules/tex/context/third/typearea/t-typearea.tex: Missing number, treated as zero LMTX 2022.08.25 19:21 Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] typearea
At 20:06 19/01/2004, you wrote: \edef\layoutratio{\withoutpt{\the\dimexpr(2\paperheight/(\paperwidth/32768))}} Very strange, it works, but I don't understand how 2 * a / (b / 32768) == a/b one can divide a dimen by a dimen in which case the dimen is cast on a counter (internally a dimen is just a number, with a sp unit); we need to compensate by 64K then; i multiply by two first to get rid of inaccuracy etc etc Do I understand it right, backspace is the inner margin, and cutspace the outer one? Are both needed? no, but it permits width=middle Hans ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] typearea
At 19:33 14/01/2004, you wrote: On Sun, 11 Jan 2004, Peter Münster wrote: %% Here is the problem: dividing one length by another. %% [code skipped] Some days ago Willy Egger sent me a translation/summary of this koma page size adventure. Since I opt for a more contexty solution i want to follow a stepwise approach in getting this done. As a start: (1) the ratio: this is the most efficient and (on average) accurate solution that also handles large paper sizes: %edef\layoutratio{\withoutpt{\the\dimexpr(8\paperheight/\dimexpr(\paperwidth/ 8192))}} %edef\layoutratio{\withoutpt{\the\dimexpr(4\paperheight/\dimexpr(\paperwidth/16384))}} %edef\layoutratio{\withoutpt{\the\dimexpr(2\paperheight/\dimexpr(\paperwidth/32768))}} \edef\layoutratio{\withoutpt{\the\dimexpr(2\paperheight/(\paperwidth/32768))}} (2) for the moment this way, will be handled slightly different (because in context we can mix layouts and layouts can be dynamic \def\layoutwidth {10cm} \unprotected \def\layouthfheight {\dimexpr(\layoutparameter\c!hoofd+\layoutparameter\c!hoofdafstand+ \layoutparameter\c!voet +\layoutparameter\c!voetafstand )} \def\layoutheight {\dimexpr(\layoutratio\dimexpr(\layoutwidth)+\layouthfheight)} (3) this brings us: \definelayout [koma] % actually i want a better name since it's one of a set of calculations [backspace=\dimexpr((\paperwidth-\layoutwidth)/2), width=middle, % less rounding errors than \layoutwidth, cutspace=\dimexpr((\paperwidth-\layoutwidth)/2), header=2\lineheight, headerdistance=\lineheight, height=middle, % less rounding errors than \layoutheight footerdistance=\lineheight, footer=2\lineheight, topspace=\dimexpr(1\dimexpr(\paperheight-(\layoutheight+\layouthfheight))/3), bottomspace=\dimexpr(2\dimexpr(\paperheight-(\layoutheight+\layouthfheight))/3)] \setuplayout [koma] (4) the 'number of chars per line' .. i'll come back to that Hans ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] typearea
Hi Hans, I was surfing the internet looking for Häufigkeitstabelle frequncy and alike for letters. Please have a look at the attached file with some links. Apparently nobody does care about capitals - which is rather strange when considering our purposes. On the other hand it is quite understandable realizing that such info is used in cryptography... Kind regards Willi Hans Hagen wrote: Hi, I need the more or less official character frequency tables of languages other than dutch (for german probably including capitals) http://www.pragma-pod.com/downloads/koma/komacalc.pdf (we may find a few more methods) Hans - Hans Hagen | PRAGMA ADE | [EMAIL PROTECTED] Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com - information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf - ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context http://520046051430-0001.bei.t-online.de/krypt.htm Analyse van tekst over verdeling letter frequentie http://www.informatik.fh-muenchen.de/~schieder/programmieren-1-ws96-97/uebung-lettercount.html Tellen frequentie met perl http://www.ims.uni-stuttgart.de/~zinsmeis/Perl/material/Musterloesung6.pdf Artikel over toetsenborden, bevat tabel met 4 talen http://goebel-consult.de/de-ergo/rohmert/Rohmert.html Duits - Engels vergeleken http://www.blankenburg.de/gat/pages/fach/info/analyse2.htm
Re: [NTG-context] typearea
On Sun, 11 Jan 2004, Peter Münster wrote: %% Here is the problem: dividing one length by another. %% Hello, I've found a solution. Here is now the full environment: % this environment works a little bit like \usepackage[DIVcalc]{typearea} % in LaTeX as explained in detail in scrguien.pdf (KOMA-Script documentation) \startenvironment e-test \def\BCOR{3mm}% eventual binding correction \setbox\scratchbox\hbox{\dorecurse{26}{\character\recurselevel}} \newdimen\PageWidth \PageWidth=\paperwidth \doifmode{BCOR}{\PageWidth=\dimexpr(\PageWidth-\BCOR)} \unprotect \begingroup \catcode`P=12 \catcode`T=12 [EMAIL PROTECTED] [EMAIL PROTECTED] \def\rem@@pt##1.##2PT{##1}}} [EMAIL PROTECTED] [EMAIL PROTECTED]@pt\the} [EMAIL PROTECTED]@@pt\the} [EMAIL PROTECTED](10\paperheight/[EMAIL PROTECTED](10\PageWidth))} \protect \newdimen\Width \newdimen\Height \newdimen\Back \Width=\dimexpr(2.5\wd\scratchbox) \Height=\dimexpr(\Ratio\Width) \headerheight=2.75\baselineskip \edef\Top{\the\dimexpr((\paperheight - \Height) / 3 - \headerheight)} \doifmodeelse{oneside}{% \Back=\dimexpr((\PageWidth - \Width) / 2) }{% \Back=\dimexpr((\PageWidth - \Width) / 3) \setuppagenumbering[alternative=doublesided]} \doifmode{BCOR}{\Back=\dimexpr(\Back + \BCOR)} \Height=\dimexpr(\Height + \headerheight + \footerheight) \setuplayout[header=\the\headerheight,height=\the\Height, width=\the\Width,topspace=\Top,backspace=\the\Back] \stopenvironment Cheers, Peter -- http://pmrb.free.fr/contact/ Film Search site: http://f-s.sf.net/ ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] typearea
On Tue, 6 Jan 2004, Henning Hraban Ramm wrote: Am Dienstag, 06.01.04, um 08:21 Uhr (Europe/Zurich) schrieb Peter Münster: Ok, I'm going to try it, perhaps it'll be my first ConTeXt module ;) It shouldn't be a module, but an environment. All right. Here is my first try, where you can see, that I've still a problem to be solved, so I would be lucky about any help: % this environment works a little bit like \usepackage[DIVcalc]{typearea} % in LaTeX as explained in detail in scrguien.pdf (KOMA-Script documentation) \startenvironment e-test \def\BCOR{3mm}% eventual binding correction \setbox\scratchbox\hbox{\dorecurse{26}{\character\recurselevel}} \newdimen\PageWidth \PageWidth=\paperwidth \doifmode{BCOR}{\PageWidth=\dimexpr(\PageWidth-\BCOR)} %% Here is the problem: dividing one length by another. %% % the following is not working for 2 reasons: % * there is still the pt behind the numbers % * one cannot divide by a real number, only integer %\edef\Ratio{\the\numexpr(\the\paperheight / \the\PageWidth)} \edef\Ratio{1.5}% to make the rest work... \newdimen\Width \newdimen\Height \newdimen\Back \Width=\dimexpr(2.5\wd\scratchbox) \Height=\dimexpr(\Ratio\Width) \headerheight=2.75\baselineskip \edef\Top{\the\dimexpr((\paperheight - \Height) / 3 - \headerheight)} \doifmodeelse{oneside}{% \Back=\dimexpr((\PageWidth - \Width) / 2) }{% \Back=\dimexpr((\PageWidth - \Width) / 3) \setuppagenumbering[alternative=doublesided]} \doifmode{BCOR}{\Back=\dimexpr(\Back + \BCOR)} \Height=\dimexpr(\Height + \headerheight + \footerheight) \setuplayout[header=\the\headerheight,height=\the\Height, width=\the\Width,topspace=\Top,backspace=\the\Back] \stopenvironment Peter -- http://pmrb.free.fr/contact/ Film Search site: http://f-s.sf.net/ ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] typearea
On Sun, 4 Jan 2004, Hans Hagen wrote: I'm just switching from LaTeX to ConTeXt. Is there already a module with similar functionalities as the typearea¹ package that comes with LaTeX? ¹ typearea comes with KOMA-Script and permits to automatically calculate the right margins with respect to some typographic rules. it's not to hard to implement (predefine) a few layout like that, if someone figures out the dimensions and rules ... Ok, I'm going to try it, perhaps it'll be my first ConTeXt module ;) Cheers, Peter -- http://pmrb.free.fr/contact/ Film Search site: http://f-s.sf.net/ ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] typearea
Am Dienstag, 06.01.04, um 08:21 Uhr (Europe/Zurich) schrieb Peter Münster: Ok, I'm going to try it, perhaps it'll be my first ConTeXt module ;) It shouldn't be a module, but an environment. Grüßlis vom Hraban! -- http://www.fiee.net/texnique/ ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] typearea
Hello, I'm just switching from LaTeX to ConTeXt. Is there already a module with similar functionalities as the typearea¹ package that comes with LaTeX? ¹ typearea comes with KOMA-Script and permits to automatically calculate the right margins with respect to some typographic rules. Cheers, Peter -- http://pmrb.free.fr/contact/ Film Search site: http://f-s.sf.net/ ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context