* Re: [NTG-pdftex] kerning
[not found] ` <429D7FB5.90406@wxs.nl>
@ 2005-06-02 15:31 ` Taco Hoekwater
2005-06-02 20:28 ` Hans Hagen
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Taco Hoekwater @ 2005-06-02 15:31 UTC (permalink / raw)
Cc: ntg-context
Hans Hagen wrote:
> Taco Hoekwater wrote:
>
>> PS. I can create a series of slides that show internals of the
>> font reading process for the ntg meeting, if you are interested.
>
>
> sounds like a good idea to me
For those of you who are interested in this sort of thing, I've posted
an 884-page PDF document that illustrates TeX's loading of a few font
metric files:
nullfont (internal)
cmr10
cmsy10
cmex10
De document, and sources, are available at:
http://tex.aanhet.net/temp/fontreader.pdf
http://tex.aanhet.net/temp/fontreader.zip
Beware, the PDF is pretty large (7.7Mb). MetaPost, Perl and Context
sources are quite small (12kb), but very much a hack.
Taco
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [NTG-pdftex] kerning
2005-06-02 15:31 ` [NTG-pdftex] kerning Taco Hoekwater
@ 2005-06-02 20:28 ` Hans Hagen
2005-06-28 12:10 ` kerning Patrick Gundlach
2005-07-11 15:11 ` TeX trie processing (\pattern loading) details visualisation Taco Hoekwater
2 siblings, 0 replies; 15+ messages in thread
From: Hans Hagen @ 2005-06-02 20:28 UTC (permalink / raw)
Cc: ntg-context, pdfTeX developers list
Taco Hoekwater wrote:
> De document, and sources, are available at:
>
> http://tex.aanhet.net/temp/fontreader.pdf
> http://tex.aanhet.net/temp/fontreader.zip
>
> Beware, the PDF is pretty large (7.7Mb). MetaPost, Perl and Context
> sources are quite small (12kb), but very much a hack.
brilliant, you made my day
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
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: kerning
2005-06-02 15:31 ` [NTG-pdftex] kerning Taco Hoekwater
2005-06-02 20:28 ` Hans Hagen
@ 2005-06-28 12:10 ` Patrick Gundlach
2005-07-11 15:11 ` TeX trie processing (\pattern loading) details visualisation Taco Hoekwater
2 siblings, 0 replies; 15+ messages in thread
From: Patrick Gundlach @ 2005-06-28 12:10 UTC (permalink / raw)
> For those of you who are interested in this sort of thing, I've posted
> an 884-page PDF document that illustrates TeX's loading of a few font
> metric files:
Very nice illustration. Thanks, Taco!
Patrick
--
ConTeXt wiki and more: http://contextgarden.net
^ permalink raw reply [flat|nested] 15+ messages in thread
* TeX trie processing (\pattern loading) details visualisation
2005-06-02 15:31 ` [NTG-pdftex] kerning Taco Hoekwater
2005-06-02 20:28 ` Hans Hagen
2005-06-28 12:10 ` kerning Patrick Gundlach
@ 2005-07-11 15:11 ` Taco Hoekwater
2 siblings, 0 replies; 15+ messages in thread
From: Taco Hoekwater @ 2005-07-11 15:11 UTC (permalink / raw)
Cc: ntg-context, pdfTeX developers list
Hi,
Vaguely connected to the font reader visualisation I posted last
month, I have created a visualisation of the trie (\pattern)
processing source code in initex.
There are files here:
http://tex.aanhet.net/temp/patreader.zip (12.825 bytes)
http://tex.aanhet.net/temp/patreader.pdf (> 36 Megabytes)
Please fetch the zip file and attempt to generate a local
version yourself before downloading the PDF document :)
The process itself is a bit harder to comprehend than the font
reader, so some background knowledge is needed. It also helps
if you have the TeX pascal sources handy.
I should probably write a descriptive text in prose to go along
with the images, but I'm bored with this stuff. It took me much
longer than I had anticipated, because I kept running into
limitations of MP ;-(
Roughly, the execution order <-> pages mapping is as follows:
pages function action
1 - 8 new_patterns() % \patterns for language 0
9 - 23 new_patterns() % \patterns for language 2
24 - 26 new_patterns() % \patterns for language 1
27 - 29 init_trie() % initialization of arrays
30 - 41 init_trie() % reshuffling languages 2 and 1
42 - 42 init_trie() % prepare for compression
43 - 241 compress_trie() % trie compression
242 - 244 init_trie() % prepare for packing
245 - 717 first_fit() % trie packing
718 - 965 init_trie() % finalizations for run-time
The various blue items are used runtime (i.e. during hyphenation),
the other arrays are only used in initex or only for statistics
reporting.
trie_hash is physically the same array as trie_ref, but it is
cleaner to show them separately.
The supplied perl script can in fact demonstrate the hyphenation of
words using TeX's algorithm, but if you want meaningful results you
have to feed it hyphen.tex instead of the three demonstration languages,
and in that case, you have to increase the two limits ($trie_size and
$trie_op_size). Check the top (and bottom) of the perl script for that.
Have fun,
Taco
^ permalink raw reply [flat|nested] 15+ messages in thread
* Kerning
@ 2008-11-12 15:48 Bart C. Wise
2008-11-12 15:54 ` Kerning Wolfgang Schuster
0 siblings, 1 reply; 15+ messages in thread
From: Bart C. Wise @ 2008-11-12 15:48 UTC (permalink / raw)
To: Context Mailing List
I am trying to change the spacing of a chapter title head. I found the
"\kern" command; however, I could not get that to work over a string of text.
Then I found the following code:
\def\dolist{\afterassignment\dodolist\let\next= }
\def\dodolist{\ifx\next\endlist \let\next\relax
\else \\\let\next\dolist \fi
\next}
\def\endlist{\endlist}
\def\track#1\by#2{\def\\{\next\kern#2}%
\leavevmode \hbox{\expandafter\dolist#1\endlist}}
Then I tried:
def\MyChapterCommand#1#2{
\framed[align=center,frame=off,width=\textwidth]{
\vbox{
\track{This is a Test} \by{.2em}
\track #2 \by{.2em}
}
}
\setuphead[chapter][
command=\MyChapterCommand
}
The output from the \track{This is a Test} \by{.2em} works. However, the
second track command (\track #2 \by{0.2em}) fails.
I spent many hours last night trying to change the kerning. What I want is
something like: \kern{TEXT}{KERNING AMOUNT}.
What's available, or how do I fix the track command above. By the way,I'm
running mkii.
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Kerning
2008-11-12 15:48 Kerning Bart C. Wise
@ 2008-11-12 15:54 ` Wolfgang Schuster
2008-11-12 16:28 ` Kerning Bart C. Wise
0 siblings, 1 reply; 15+ messages in thread
From: Wolfgang Schuster @ 2008-11-12 15:54 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 12.11.2008 um 16:48 schrieb Bart C. Wise:
> I am trying to change the spacing of a chapter title head. I found
> the
> "\kern" command; however, I could not get that to work over a string
> of text.
>
> Then I found the following code:
> \def\dolist{\afterassignment\dodolist\let\next= }
> \def\dodolist{\ifx\next\endlist \let\next\relax
> \else \\\let\next\dolist \fi
> \next}
> \def\endlist{\endlist}
> \def\track#1\by#2{\def\\{\next\kern#2}%
> \leavevmode \hbox{\expandafter\dolist#1\endlist}}
>
> Then I tried:
>
> def\MyChapterCommand#1#2{
> \framed[align=center,frame=off,width=\textwidth]{
> \vbox{
> \track{This is a Test} \by{.2em}
> \track #2 \by{.2em}
> }
> }
> \setuphead[chapter][
> command=\MyChapterCommand
> }
>
> The output from the \track{This is a Test} \by{.2em} works.
> However, the
> second track command (\track #2 \by{0.2em}) fails.
>
> I spent many hours last night trying to change the kerning. What I
> want is
> something like: \kern{TEXT}{KERNING AMOUNT}.
>
> What's available, or how do I fix the track command above. By the
> way,I'm
> running mkii.
Search for \stretched and \stretchednormalcase.
http://archive.contextgarden.net/message/20080815.074940.ae67f770.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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Kerning
2008-11-12 15:54 ` Kerning Wolfgang Schuster
@ 2008-11-12 16:28 ` Bart C. Wise
2008-11-12 17:03 ` Kerning Bart C. Wise
0 siblings, 1 reply; 15+ messages in thread
From: Bart C. Wise @ 2008-11-12 16:28 UTC (permalink / raw)
To: ntg-context
Wolfgang,
It works!
Thanks,
Bart
On Wednesday 12 November 2008 08:54:49 am Wolfgang Schuster wrote:
> Am 12.11.2008 um 16:48 schrieb Bart C. Wise:
> > I am trying to change the spacing of a chapter title head. I found
> > the
> > "\kern" command; however, I could not get that to work over a string
> > of text.
> >
> > Then I found the following code:
> > \def\dolist{\afterassignment\dodolist\let\next= }
> > \def\dodolist{\ifx\next\endlist \let\next\relax
> > \else \\\let\next\dolist \fi
> > \next}
> > \def\endlist{\endlist}
> > \def\track#1\by#2{\def\\{\next\kern#2}%
> > \leavevmode \hbox{\expandafter\dolist#1\endlist}}
> >
> > Then I tried:
> >
> > def\MyChapterCommand#1#2{
> > \framed[align=center,frame=off,width=\textwidth]{
> > \vbox{
> > \track{This is a Test} \by{.2em}
> > \track #2 \by{.2em}
> > }
> > }
> > \setuphead[chapter][
> > command=\MyChapterCommand
> > }
> >
> > The output from the \track{This is a Test} \by{.2em} works.
> > However, the
> > second track command (\track #2 \by{0.2em}) fails.
> >
> > I spent many hours last night trying to change the kerning. What I
> > want is
> > something like: \kern{TEXT}{KERNING AMOUNT}.
> >
> > What's available, or how do I fix the track command above. By the
> > way,I'm
> > running mkii.
>
> Search for \stretched and \stretchednormalcase.
>
> http://archive.contextgarden.net/message/20080815.074940.ae67f770.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
> ___________________________________________________________________________
>________
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Kerning
2008-11-12 16:28 ` Kerning Bart C. Wise
@ 2008-11-12 17:03 ` Bart C. Wise
2008-11-12 17:17 ` Kerning Wolfgang Schuster
0 siblings, 1 reply; 15+ messages in thread
From: Bart C. Wise @ 2008-11-12 17:03 UTC (permalink / raw)
To: ntg-context
Okay, it works until I place an an argument in the stretched command.
def\MyChapterCommand#1#2{
\framed[align=center,frame=off,width=\textwidth]{
\vbox{
fails--> \stretched{#2}
works--> \stretched{This is a Test}
}
}
\setuphead[chapter][
command=\MyChapterCommand
}
I get the following error when I run texexec:
! Missing \endcsname inserted.
<to be read again>
\let
\nextprocessedtoken ...oup \ifincolor \ifcsname #1
#3\endcsname \let
\dostopa...
\dodoprocesstokens ...token \let \before \between
\fi \let \nextprocessedtok...
<argument> This is a test: \dostartattributes
{\??ko \v!title }\c!style
\c!c...
\processtokens ...fore \before \doprocesstokens #5
\lastcharacter \endgroup
\stretched ... \relax \hss \relax {\hss \hss }{#1}
\egroup
...
How can I use the #1 & #2 arguments in the stretched command?
On Wednesday 12 November 2008 09:28:39 am Bart C. Wise wrote:
> Wolfgang,
>
> It works!
>
> Thanks,
> Bart
>
> On Wednesday 12 November 2008 08:54:49 am Wolfgang Schuster wrote:
> > Am 12.11.2008 um 16:48 schrieb Bart C. Wise:
> > > I am trying to change the spacing of a chapter title head. I found
> > > the
> > > "\kern" command; however, I could not get that to work over a string
> > > of text.
> > >
> > > Then I found the following code:
> > > \def\dolist{\afterassignment\dodolist\let\next= }
> > > \def\dodolist{\ifx\next\endlist \let\next\relax
> > > \else \\\let\next\dolist \fi
> > > \next}
> > > \def\endlist{\endlist}
> > > \def\track#1\by#2{\def\\{\next\kern#2}%
> > > \leavevmode \hbox{\expandafter\dolist#1\endlist}}
> > >
> > > Then I tried:
> > >
> > > def\MyChapterCommand#1#2{
> > > \framed[align=center,frame=off,width=\textwidth]{
> > > \vbox{
> > > \track{This is a Test} \by{.2em}
> > > \track #2 \by{.2em}
> > > }
> > > }
> > > \setuphead[chapter][
> > > command=\MyChapterCommand
> > > }
> > >
> > > The output from the \track{This is a Test} \by{.2em} works.
> > > However, the
> > > second track command (\track #2 \by{0.2em}) fails.
> > >
> > > I spent many hours last night trying to change the kerning. What I
> > > want is
> > > something like: \kern{TEXT}{KERNING AMOUNT}.
> > >
> > > What's available, or how do I fix the track command above. By the
> > > way,I'm
> > > running mkii.
> >
> > Search for \stretched and \stretchednormalcase.
> >
> > http://archive.contextgarden.net/message/20080815.074940.ae67f770.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
> > _________________________________________________________________________
> >__ ________
>
> ___________________________________________________________________________
>________ 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Kerning
2008-11-12 17:03 ` Kerning Bart C. Wise
@ 2008-11-12 17:17 ` Wolfgang Schuster
2008-11-13 6:18 ` Kerning Bart C. Wise
0 siblings, 1 reply; 15+ messages in thread
From: Wolfgang Schuster @ 2008-11-12 17:17 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 12.11.2008 um 18:03 schrieb Bart C. Wise:
> Okay, it works until I place an an argument in the stretched command.
>
> def\MyChapterCommand#1#2{
> \framed[align=center,frame=off,width=\textwidth]{
> \vbox{
> fails--> \stretched{#2}
> works--> \stretched{This is a Test}
> }
> }
> \setuphead[chapter][
> command=\MyChapterCommand
> }
>
>
> I get the following error when I run texexec:
>
> ! Missing \endcsname inserted.
> <to be read again>
> \let
> \nextprocessedtoken ...oup \ifincolor \ifcsname #1
> #3\endcsname \let
> \dostopa...
>
> \dodoprocesstokens ...token \let \before \between
> \fi \let
> \nextprocessedtok...
> <argument> This is a test: \dostartattributes
> {\??ko \v!title }\c!style
> \c!c...
>
> \processtokens ...fore \before \doprocesstokens #5
> \lastcharacter
> \endgroup
> \stretched ... \relax \hss \relax {\hss \hss }{#1}
> \egroup
> ...
>
> How can I use the #1 & #2 arguments in the stretched command?
You could use it only with \deeptextcommand, here is a old mail
with a example from Hans (you could ignore the other code).
http://archive.contextgarden.net/message/20060113.102321.bf24d7ca.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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Kerning
2008-11-12 17:17 ` Kerning Wolfgang Schuster
@ 2008-11-13 6:18 ` Bart C. Wise
2008-11-13 7:46 ` Kerning Hans Hagen
2008-11-13 8:36 ` Kerning Wolfgang Schuster
0 siblings, 2 replies; 15+ messages in thread
From: Bart C. Wise @ 2008-11-13 6:18 UTC (permalink / raw)
To: ntg-context
Wolfgang, thanks so much for your help so far.
I was able to take the code and make it work correctly to stretch the chapter
title. What I want is two lines for a chapter head. For example,
Line 1: "Chapter One"
Line 2: "Title for Chap 1"
I want line 1 to be stretched. Everything I have tried does not work. I can
get the "Chapter" word to stretch, but not the whole line (and it should
probably be treated as a whole line when stretching). I was never able to get
the chapter number (now a word) to stretch.
So how do I grab the output for line 1 and then stretch it?
Here's a sample of what I have without any stretching:
\def\Myheader#1#2{%
\framedtext[width=0.60\textwidth, frame=off, align=middle]{%
\vbox{\headtext{chapter}~#1 \blank #2}}}
\def\englishnumbers#1{
\ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}
\defineconversion[englishnumbers][\englishnumbers]
\setupsection[chapter][conversion=englishnumbers]
\setuphead [chapter][
command=\Myheader,
textcommand=\bfd,
]
\setupheadtext[chapter=CHAPTER] % used by \headtext
\starttext
\chapter{Title for Chap 1}
\processfile{tufte}
\stoptext
P.S. If there's a better way to do the number->word conversion, let me know.
On Wednesday 12 November 2008 10:17:35 am Wolfgang Schuster wrote:
> Am 12.11.2008 um 18:03 schrieb Bart C. Wise:
> > Okay, it works until I place an an argument in the stretched command.
> >
> > def\MyChapterCommand#1#2{
> > \framed[align=center,frame=off,width=\textwidth]{
> > \vbox{
> > fails--> \stretched{#2}
> > works--> \stretched{This is a Test}
> > }
> > }
> > \setuphead[chapter][
> > command=\MyChapterCommand
> > }
> >
> >
> > I get the following error when I run texexec:
> >
> > ! Missing \endcsname inserted.
> > <to be read again>
> > \let
> > \nextprocessedtoken ...oup \ifincolor \ifcsname #1
> > #3\endcsname \let
> > \dostopa...
> >
> > \dodoprocesstokens ...token \let \before \between
> > \fi \let
> > \nextprocessedtok...
> > <argument> This is a test: \dostartattributes
> > {\??ko \v!title }\c!style
> > \c!c...
> >
> > \processtokens ...fore \before \doprocesstokens #5
> > \lastcharacter
> > \endgroup
> > \stretched ... \relax \hss \relax {\hss \hss }{#1}
> > \egroup
> > ...
> >
> > How can I use the #1 & #2 arguments in the stretched command?
>
> You could use it only with \deeptextcommand, here is a old mail
> with a example from Hans (you could ignore the other code).
>
> http://archive.contextgarden.net/message/20060113.102321.bf24d7ca.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
> ___________________________________________________________________________
>________
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Kerning
2008-11-13 6:18 ` Kerning Bart C. Wise
@ 2008-11-13 7:46 ` Hans Hagen
2008-11-13 16:20 ` Kerning Bart C. Wise
2008-11-13 8:36 ` Kerning Wolfgang Schuster
1 sibling, 1 reply; 15+ messages in thread
From: Hans Hagen @ 2008-11-13 7:46 UTC (permalink / raw)
To: mailing list for ConTeXt users
Bart C. Wise wrote:
> Wolfgang, thanks so much for your help so far.
>
> I was able to take the code and make it work correctly to stretch the chapter
> title. What I want is two lines for a chapter head. For example,
> Line 1: "Chapter One"
> Line 2: "Title for Chap 1"
>
> I want line 1 to be stretched. Everything I have tried does not work. I can
> get the "Chapter" word to stretch, but not the whole line (and it should
> probably be treated as a whole line when stretching). I was never able to get
> the chapter number (now a word) to stretch.
>
> So how do I grab the output for line 1 and then stretch it?
>
> Here's a sample of what I have without any stretching:
>
> \def\Myheader#1#2{%
> \framedtext[width=0.60\textwidth, frame=off, align=middle]{%
> \vbox{\headtext{chapter}~#1 \blank #2}}}
>
> \def\englishnumbers#1{
> \ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}
> \defineconversion[englishnumbers][\englishnumbers]
>
> \setupsection[chapter][conversion=englishnumbers]
> \setuphead [chapter][
> command=\Myheader,
> textcommand=\bfd,
> ]
> \setupheadtext[chapter=CHAPTER] % used by \headtext
> \starttext
> \chapter{Title for Chap 1}
> \processfile{tufte}
> \stoptext
>
>
> P.S. If there's a better way to do the number->word conversion, let me know.
>
>
> On Wednesday 12 November 2008 10:17:35 am Wolfgang Schuster wrote:
>> Am 12.11.2008 um 18:03 schrieb Bart C. Wise:
>>> Okay, it works until I place an an argument in the stretched command.
>>>
>>> def\MyChapterCommand#1#2{
>>> \framed[align=center,frame=off,width=\textwidth]{
>>> \vbox{
>>> fails--> \stretched{#2}
>>> works--> \stretched{This is a Test}
>>> }
>>> }
>>> \setuphead[chapter][
>>> command=\MyChapterCommand
>>> }
>>>
>>>
>>> I get the following error when I run texexec:
>>>
>>> ! Missing \endcsname inserted.
>>> <to be read again>
>>> \let
>>> \nextprocessedtoken ...oup \ifincolor \ifcsname #1
>>> #3\endcsname \let
>>> \dostopa...
>>>
>>> \dodoprocesstokens ...token \let \before \between
>>> \fi \let
>>> \nextprocessedtok...
>>> <argument> This is a test: \dostartattributes
>>> {\??ko \v!title }\c!style
>>> \c!c...
>>>
>>> \processtokens ...fore \before \doprocesstokens #5
>>> \lastcharacter
>>> \endgroup
>>> \stretched ... \relax \hss \relax {\hss \hss }{#1}
>>> \egroup
>>> ...
>>>
>>> How can I use the #1 & #2 arguments in the stretched command?
>> You could use it only with \deeptextcommand, here is a old mail
>> with a example from Hans (you could ignore the other code).
>>
>> http://archive.contextgarden.net/message/20060113.102321.bf24d7ca.en.html
look for the property mechanism
\startproperty[stretch]stretched\stopproperty
token processing is always tricky since the parser does not know what to
expect; properties use a pdf trick; in mkiv we have more clever stretching
-----------------------------------------------------------------
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Kerning
2008-11-13 7:46 ` Kerning Hans Hagen
@ 2008-11-13 16:20 ` Bart C. Wise
2008-11-14 15:00 ` Kerning Hans Hagen
0 siblings, 1 reply; 15+ messages in thread
From: Bart C. Wise @ 2008-11-13 16:20 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Thursday 13 November 2008 12:46:27 am Hans Hagen wrote:
> Bart C. Wise wrote:
> > Wolfgang, thanks so much for your help so far.
> >
> > I was able to take the code and make it work correctly to stretch the
> > chapter title. What I want is two lines for a chapter head. For
> > example, Line 1: "Chapter One"
> > Line 2: "Title for Chap 1"
> >
> > I want line 1 to be stretched. Everything I have tried does not work. I
> > can get the "Chapter" word to stretch, but not the whole line (and it
> > should probably be treated as a whole line when stretching). I was never
> > able to get the chapter number (now a word) to stretch.
> >
> > So how do I grab the output for line 1 and then stretch it?
> >
> > Here's a sample of what I have without any stretching:
> >
> > \def\Myheader#1#2{%
> > \framedtext[width=0.60\textwidth, frame=off, align=middle]{%
> > \vbox{\headtext{chapter}~#1 \blank #2}}}
> >
> > \def\englishnumbers#1{
> > \ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}
> > \defineconversion[englishnumbers][\englishnumbers]
> >
> > \setupsection[chapter][conversion=englishnumbers]
> > \setuphead [chapter][
> > command=\Myheader,
> > textcommand=\bfd,
> > ]
> > \setupheadtext[chapter=CHAPTER] % used by \headtext
> > \starttext
> > \chapter{Title for Chap 1}
> > \processfile{tufte}
> > \stoptext
> >
> >
> > P.S. If there's a better way to do the number->word conversion, let me
> > know.
> >
> > On Wednesday 12 November 2008 10:17:35 am Wolfgang Schuster wrote:
> >> Am 12.11.2008 um 18:03 schrieb Bart C. Wise:
> >>> Okay, it works until I place an an argument in the stretched command.
> >>>
> >>> def\MyChapterCommand#1#2{
> >>> \framed[align=center,frame=off,width=\textwidth]{
> >>> \vbox{
> >>> fails--> \stretched{#2}
> >>> works--> \stretched{This is a Test}
> >>> }
> >>> }
> >>> \setuphead[chapter][
> >>> command=\MyChapterCommand
> >>> }
> >>>
> >>>
> >>> I get the following error when I run texexec:
> >>>
> >>> ! Missing \endcsname inserted.
> >>> <to be read again>
> >>> \let
> >>> \nextprocessedtoken ...oup \ifincolor \ifcsname #1
> >>> #3\endcsname \let
> >>> \dostopa...
> >>>
> >>> \dodoprocesstokens ...token \let \before \between
> >>> \fi \let
> >>> \nextprocessedtok...
> >>> <argument> This is a test: \dostartattributes
> >>> {\??ko \v!title }\c!style
> >>> \c!c...
> >>>
> >>> \processtokens ...fore \before \doprocesstokens #5
> >>> \lastcharacter
> >>> \endgroup
> >>> \stretched ... \relax \hss \relax {\hss \hss }{#1}
> >>> \egroup
> >>> ...
> >>>
> >>> How can I use the #1 & #2 arguments in the stretched command?
> >>
> >> You could use it only with \deeptextcommand, here is a old mail
> >> with a example from Hans (you could ignore the other code).
> >>
> >> http://archive.contextgarden.net/message/20060113.102321.bf24d7ca.en.htm
> >>l
>
> look for the property mechanism
>
> \startproperty[stretch]stretched\stopproperty
>
> token processing is always tricky since the parser does not know what to
> expect; properties use a pdf trick; in mkiv we have more clever stretching
>
>
Hans,
I tried the above code and it failed. I looked around on the ConTeXt site and
the web in general. It seems like a \defineproperty[stretch] needs to be
declared, but I can't find it anywhere. You'll have to excuse my ignorance,
but will you be explicit on how to use the \startproperty[stretch] stretch
\stopproperty.
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Kerning
2008-11-13 16:20 ` Kerning Bart C. Wise
@ 2008-11-14 15:00 ` Hans Hagen
0 siblings, 0 replies; 15+ messages in thread
From: Hans Hagen @ 2008-11-14 15:00 UTC (permalink / raw)
To: mailing list for ConTeXt users
Bart C. Wise wrote:
> I tried the above code and it failed. I looked around on the ConTeXt site and
> the web in general. It seems like a \defineproperty[stretch] needs to be
> declared, but I can't find it anywhere. You'll have to excuse my ignorance,
> but will you be explicit on how to use the \startproperty[stretch] stretch
> \stopproperty.
hm, something is missing in the mkii file
\unprotect \definepropertyhandler \v!stretch{0} \protect
(you can also tune the 'normal effect')
consider all this a hack, since tex does not know about the right
dimensions
in mkiv there's
\start \dosetstretch{.25em} \setuptolerance[tolerant,stretch] \input
tufte \endgraf \stop
\start \dosetstretch{.5em} effe flink doorfietsen \stop
(not yet interfaced but it should work)
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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Kerning
2008-11-13 6:18 ` Kerning Bart C. Wise
2008-11-13 7:46 ` Kerning Hans Hagen
@ 2008-11-13 8:36 ` Wolfgang Schuster
2008-11-13 15:26 ` Kerning Bart C. Wise
1 sibling, 1 reply; 15+ messages in thread
From: Wolfgang Schuster @ 2008-11-13 8:36 UTC (permalink / raw)
To: Bart C. Wise; +Cc: ntg-context
On Thu, Nov 13, 2008 at 7:18 AM, Bart C. Wise
<bntgcontext@wiseguysweb.com> wrote:
> Wolfgang, thanks so much for your help so far.
>
> I was able to take the code and make it work correctly to stretch the chapter
> title. What I want is two lines for a chapter head. For example,
> Line 1: "Chapter One"
> Line 2: "Title for Chap 1"
>
> I want line 1 to be stretched. Everything I have tried does not work. I can
> get the "Chapter" word to stretch, but not the whole line (and it should
> probably be treated as a whole line when stretching). I was never able to get
> the chapter number (now a word) to stretch.
>
> So how do I grab the output for line 1 and then stretch it?
>
> Here's a sample of what I have without any stretching:
>
> \def\Myheader#1#2{%
> \framedtext[width=0.60\textwidth, frame=off, align=middle]{%
> \vbox{\headtext{chapter}~#1 \blank #2}}}
>
> \def\englishnumbers#1{
> \ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}
> \defineconversion[englishnumbers][\englishnumbers]
>
> \setupsection[chapter][conversion=englishnumbers]
> \setuphead [chapter][
> command=\Myheader,
> textcommand=\bfd,
> ]
> \setupheadtext[chapter=CHAPTER] % used by \headtext
> \starttext
> \chapter{Title for Chap 1}
> \processfile{tufte}
> \stoptext
\def\Myheader#1#2%
{\framed
[width=0.60\textwidth,
frame=off,
align=middle]
{\determineheadnumber[chapter]
\expanded{\stretchednormalcase{CHAPTER~\convertnumber{englishnumbers}{\currentheadnumber}}}
\blank#2}}
\def\englishnumbers#1{
\ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}
\defineconversion[englishnumbers][\englishnumbers]
\setuphead
[chapter]
[command=\Myheader,
deeptextcommand=\stretchednormalcase,
textstyle=\bfd]
> P.S. If there's a better way to do the number->word conversion, let me know.
Search for \numprint in the list archive.
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Kerning
2008-11-13 8:36 ` Kerning Wolfgang Schuster
@ 2008-11-13 15:26 ` Bart C. Wise
0 siblings, 0 replies; 15+ messages in thread
From: Bart C. Wise @ 2008-11-13 15:26 UTC (permalink / raw)
To: Wolfgang Schuster; +Cc: ntg-context
Wolfgang,
Thanks so much for your help! It works exactly as I desire.
Bart
On Thursday 13 November 2008 01:36:11 am Wolfgang Schuster wrote:
> On Thu, Nov 13, 2008 at 7:18 AM, Bart C. Wise
>
> <bntgcontext@wiseguysweb.com> wrote:
> > Wolfgang, thanks so much for your help so far.
> >
> > I was able to take the code and make it work correctly to stretch the
> > chapter title. What I want is two lines for a chapter head. For
> > example, Line 1: "Chapter One"
> > Line 2: "Title for Chap 1"
> >
> > I want line 1 to be stretched. Everything I have tried does not work. I
> > can get the "Chapter" word to stretch, but not the whole line (and it
> > should probably be treated as a whole line when stretching). I was never
> > able to get the chapter number (now a word) to stretch.
> >
> > So how do I grab the output for line 1 and then stretch it?
> >
> > Here's a sample of what I have without any stretching:
> >
> > \def\Myheader#1#2{%
> > \framedtext[width=0.60\textwidth, frame=off, align=middle]{%
> > \vbox{\headtext{chapter}~#1 \blank #2}}}
> >
> > \def\englishnumbers#1{
> > \ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}
> > \defineconversion[englishnumbers][\englishnumbers]
> >
> > \setupsection[chapter][conversion=englishnumbers]
> > \setuphead [chapter][
> > command=\Myheader,
> > textcommand=\bfd,
> > ]
> > \setupheadtext[chapter=CHAPTER] % used by \headtext
> > \starttext
> > \chapter{Title for Chap 1}
> > \processfile{tufte}
> > \stoptext
>
> \def\Myheader#1#2%
> {\framed
> [width=0.60\textwidth,
> frame=off,
> align=middle]
> {\determineheadnumber[chapter]
>
> \expanded{\stretchednormalcase{CHAPTER~\convertnumber{englishnumbers}{\curr
>entheadnumber}}} \blank#2}}
>
> \def\englishnumbers#1{
> \ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}
>
> \defineconversion[englishnumbers][\englishnumbers]
>
> \setuphead
> [chapter]
> [command=\Myheader,
> deeptextcommand=\stretchednormalcase,
> textstyle=\bfd]
>
> > P.S. If there's a better way to do the number->word conversion, let me
> > know.
>
> Search for \numprint in the list archive.
>
> 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2008-11-14 15:00 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <429D6DD1.2040005@wxs.nl>
[not found] ` <429D734F.7040203@elvenkind.com>
[not found] ` <429D7FB5.90406@wxs.nl>
2005-06-02 15:31 ` [NTG-pdftex] kerning Taco Hoekwater
2005-06-02 20:28 ` Hans Hagen
2005-06-28 12:10 ` kerning Patrick Gundlach
2005-07-11 15:11 ` TeX trie processing (\pattern loading) details visualisation Taco Hoekwater
2008-11-12 15:48 Kerning Bart C. Wise
2008-11-12 15:54 ` Kerning Wolfgang Schuster
2008-11-12 16:28 ` Kerning Bart C. Wise
2008-11-12 17:03 ` Kerning Bart C. Wise
2008-11-12 17:17 ` Kerning Wolfgang Schuster
2008-11-13 6:18 ` Kerning Bart C. Wise
2008-11-13 7:46 ` Kerning Hans Hagen
2008-11-13 16:20 ` Kerning Bart C. Wise
2008-11-14 15:00 ` Kerning Hans Hagen
2008-11-13 8:36 ` Kerning Wolfgang Schuster
2008-11-13 15:26 ` Kerning Bart C. Wise
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).