[NTG-context] Uppercase headings

2006-03-31 Thread Ville Voipio
Title: Uppercase headings







I started to edit an old document with capitalized headings. Making the headings was rather difficult (as can be seen on this list about a year ago), and now it seems to have broken again.

I have:

\setuphead[title]
 [page=yes,
 before={\strut\blank[5*big]},
 after={\textrule\blank},
 align=middle,
 style=\tfb,
 textcommand=\WORD
 ]

This worked fine in the past. Not anymore:

8---


! You can't use `\relax' after \the.
recently read [EMAIL PROTECTED]@\@@pnstate

\pushmacro ...ame [EMAIL PROTECTED]@ \@@pushedmacro \endcsname
 \@@pushedmacro \endcsname #1
\makesectionformat ...macro \@@shortsectionnumber
 \let \@@shortsectionnumber...

\rawreference ...veryreference \makesectionformat
 \writereference {#2} {\sec...
argument ...\finalsectionnumber }{\asciititle }}
 }\fi \executeifdefi! Missing \endcsname inserted.
to be read again
 \let
\@@shortsectionnumber [EMAIL PROTECTED] \ifx \csname \??se #1
 \c!ownnumber \endcsname \r...

\makesectionformat ... \@@shortsectionnumber \let
 \@@shortsectionnumber \@@s...

\rawreference ...veryreference \makesectionformat
 \writereference {#2} {\sec...
argument ...\finalsectionnumber }{\asciititle }}
 }\fi \executeifdefined {\?...

\douppercase ...rstoftwoarguments \edef \ascii {#1
 }\edef \ascii {\expandafte...
...

8---

Using the trivial solution (\uppercase) does not work because with a non-il1 regime it does not handle the accented characters (A umlat, O umlaut) correctly. I use UTF, as it contains all the characters I need.

So, what has changed in the \WORD? It works \WORD{fine} within text but not in the headings.

TIA,

- Ville



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


Re: [NTG-context] Uppercase headings

2006-03-31 Thread Ville Voipio
 it's nearly impossible to get this working for all features 
 (keep in mind that tex has no real feature to map font chars 
 to other font chars)  esp those with special chars. 

I know this is not a trivial question due to the number
of encodings and languages. However, what makes me a bit
puzzled is that the following works fine:

  \title{\WORD{Text with åäö etc.} }

So, the mechanism behind \WORD works well. It is just that
I cannot figure out how to use it. I emphasize that it used
to work fine even in the \setuphead definition, but that
was with an old version (April '05).

---

 works ok here (can you try the latest version - beta?) 

The version I am trying to use is rather a fresh one:

 TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

   texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
   texutil : TeXUtil 9.0.1 - ConTeXt / PRAGMA ADE 1992-2006
   tex : unknown
   context : ver: 2006.03.25 13:21
   cont-en : unknown
   cont-nl : unknown

Has there been any change after that? If not, I could brew up a
minimal example to illustrate the problem.

BR,

- Ville

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


Re: [NTG-context] Uppercase headings

2006-03-31 Thread Ville Voipio
  \setuphead[title]
[deeptextcommand=\WORD]

 Does that work?

It does, it does

You just saved my night. Can I send you a pint of beer somewhere?

---

I tried finding more information about deeptextcommand, but all I found was a 
brief comment about deep hooks in the release notes (19-Jan-06). I can write 
something about this into Wiki, but that requires me to understand a bit more. 
Where do I start looking for?

Thanks again,

- Ville
winmail.dat___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Typesetting chemical reaction equations

2006-01-27 Thread Ville Voipio
I would need to typeset some rather simple reaction equations. I do not 
need the structural capabilities of PPCHTeX, just something simpler. The 
thing I am writing has something to do with physical chemistry, so I 
need mathematical equations, as well.

Of course, the natural way to do this:

\placeformula
\startformula
   \rm
   NH_3(g) + H^+(aq.) + Cl^-(aq.) \rightarrow NH_4^+(aq.) + Cl^-(aq.)
\stopformula

This gives rather pleasant-looking results. However, is this the right 
(i.e. kosher) way of doing things, or do I run into trouble at some 
later point with this? What are you chemists using?

And how do I switch off the equation numbering for the chemical 
reactions (I'd like to have the mathematical formulae still numbered)?

TIA,

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


Re: [NTG-context] Typesetting chemical reaction equations

2006-01-27 Thread Ville Voipio
 And how do I switch off the equation numbering for the chemical 
 reactions (I'd like to have the mathematical formulae still numbered)?

Stupid me. Just by leaving the \placeformula out. (Maybe I should go and 
get something to eat, my brain seems to be in some sort of energy-saving 
mode.)

By the way, is there a simple way to have two separate numbering 
schemes? If I wanted to have chemical formulae numbered with 1,2,3,4... 
and maths with i, ii, iii, iv, ... , how should I do it? It must be 
documented with \placeformula, but is \placeformula documented anywhere 
apart from the code itself? (Yes, I am lazy.)

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


Re: [NTG-context] Typesetting chemical reaction equations

2006-01-27 Thread Ville Voipio
 \usemodule[chemic]
 
 \placeformula[-]
 \startformula
\chemical{NH_3(g),+,H^+(aq.),+,Cl^-(aq.),-,NH_4^+(aq.),+,Cl^-(aq.)}
 \stopformula

Dank u!

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


[NTG-context] SVG images

2006-01-26 Thread Ville Voipio
I would need to embed some SVG images into a ConTeXt document. I have 
done some research on the topic, and the seemingly trivial task seems 
all but impossible.

I found a few solutions, but none of them fits my needs:

- I want to have my vector images in vector format (i.e., no 
Inkscape-to-PNG)

- alpha-channel transparency is used in the images, and it should be 
present in the PDF file, as well (i.e., no Inkscape-to-EPS)

- if I used commercial products, I would not use SVG (i.e., the 
converter should be open source)


The images have been (will be) created with Inkscape. While being 
otherwise a surprisingly nice piece of software, Inkscape does not seem 
to export PDF for some reason or another (licencing, time, etc.).

I have the impression I just ran out of luck. Did I?

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


Re: [NTG-context] SVG images

2006-01-26 Thread Ville Voipio
 Skencil http://www.skencil.org can open and save SVG and exports to PDF via 
 reportlab. As I have not worked with transparency yet I do not know if that 
 works all the way from SVG to PDF. Could you post me a little sample image to 
 run it through Skencil?

All right. I sent some files to Tobias (above), and he very kindly made 
some experiments. Skencil could not do this (alas!) but Scribus did it 
almost correctly. Scribus seems to have some problem with alpha channel 
gradients, but the problem looks like a problem with some color 
correction/conversion, not a real SVG/PDF issue.

I will go on experimenting and report here if I find out something more.

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


[NTG-context] \startalignment etc. require text immediately after

2006-01-24 Thread Ville Voipio
One phenomenon I have repeatedly come accross but not quite 
understood... If I have \startalignment, \startnarrower, etc., then 
there has to be text immediately after the start command.

As small example:

\startalignment[center]
\bTABLE
\bTR \bTD something \eTD \eTR
\eTABLE
\stopalignment

This should create a single-cell table in the middle of the page. It 
does not, the text is in the left.

If I add something small (a strut), then everything works fine:

\startalignment[center]
\strut
\bTABLE
\bTR \bTD something \eTD \eTR
\eTABLE
\stopalignment

Any text has the same effect as the strut. If the text is added to the 
end, it does not have any effect, i.e. the start has no effect. After 
some quick experimenting it seems evident that there has to be text 
after the start command. A figure or a table won't do. Why? And does 
this occur with any start-stop pair (sounds odd) or just with a few? And 
what is the kosher way of solving this problem?

This must be a FAQ, but I could not find the search terms to find an answer.

TIA,

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


Re: [NTG-context] Text wrapping in SciTE

2006-01-20 Thread Ville Voipio

I was wondering what is the correct way of wrapping text while typing in
SciTE. SciTE can wrap the text, but it is basically a virtual wrap, it is
a long line tailored to the view of your editing window. On the other hand
you can wrap the lines yourself by pressing enter wherever you think it is
necessary. Which one of these methods is better? Or maybe there are better
alternatives? 


I use the one long line per paragraph approach. The reason is simple: 
it is fairly simple to wrap the lines afterwards. It is far from simple 
to unwrap them if you have the hard line breaks. Also, with soft (or 
virtual) wrapping you can add or remove text without any hassle.


So, I cannot figure out any common situation where hard formatting would 
be significantly better.


Just my two eurocents.

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


[NTG-context] Units -- a few things

2006-01-20 Thread Ville Voipio
There seems to be a small glitch in m-units.tex. The unit \Bit typesets 
Bit. This is wrong, as bits are always in lowercase first letter:


  a single bit: bit
  a byte: B

It is also possible to use b (for bit) and Byte (for B). However, bits 
are always small and Bytes large. The best practice seems to be to spell 
bits out (bit) and use abbreviation for Bytes (B). This minimizes confusion.


I fixed this problem in my ConTeXt installation by tweaking rows 664 and 
666.


For more discussion, see:

  http://en.wikipedia.org/wiki/Byte

It might be worth it to implement the octet (o), as well. It is a good 
unit (more precise and descriptive than byte) but the abbreviation is 
horrible.


---

Another related thing is whether ConTeXt should implement IEC 60027-2 
binary prefices (Ki, Mi, Gi, Ti). More info on this:


  http://www.iec.ch/zone/si/si_bytes.htm

---

Well, then to a more practical thing... This is a very trivial question, 
but still. When writing a number and the unit, it would be nice to have 
automatic formatting. What I mean is that when I have a million two 
hundred thousand kilograms, I would like it to be typeset:


 1(small space)200(small space)000(small space)kg

Everything on a single row despite where it is. Now I write:

 1\,200\,000\,\Kilo\Gram

It would be more legible, if I could just write:

 \unit{120}{\Kilo\Gram}

Taking care of all the fancy small spaces should be computer's problem. 
not mine... (Or does this mechanism already exist?)


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


Re: [NTG-context] A font problem with the stand-alone Windows distribution

2006-01-19 Thread Ville Voipio

Try the next two lines instead of those three lines:

   \usetypescript[postscript][\defaultencoding]
   \setupbodyfont[postscript,11pt]


Thank you, thank you, thank you!

The problem was not the difference between pos and postscript (they seem 
to be synonyms, both work) but the magic row:


  \usetypescript[adobekb][\defaultencoding]

This one seems to instruct ConTeXt to use the real Adobe fonts. I tried 
almost every other combination but did not remove the row which says 
Adobe. Stupid me.


However, the magic row with adobekb is present in almost all examples 
I've seen. And yet very few people have the real Adobe fonts. So, 
possibly this should be noted somewhere. (Anyway, what is the 
\usetypescript[adobekb] supposed to do?)


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


Re: [NTG-context] Stand alone Context editing environment

2006-01-19 Thread Ville Voipio

Henning Hraban Ramm wrote:

Thank you, I'm wikifying that.
see http://wiki.contextgarden.net/Windows_Installation


Oh, great if you do it (then I don't need to). Thanks.


Greetlings from Lake Constance!


Greetings from slightly cool (-22 'C at the moment) Finland.

- Ville

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


[NTG-context] A font problem with the stand-alone Windows distribution

2006-01-18 Thread Ville Voipio

A font problem -- again. I am so sorry.

I try to use the URW postscript fonts with the stand-alone 
mswincontext.zip distribution. Everything else seems to work fine, but 
when I say:


  \usetypescript[adobekb][\defaultencoding]
  \usetypescript[pos][\defaultencoding]
  \setupbodyfont[pos,11pt]

I get a bunch of complaints from Acroread, and it uses Helvetica 
everywhere. (The same happens with Postscript instead of pos.)


The reason is rather clear, the log has the following rows:

  Warning: pdfetex.exe (file ptmb8y): Font ptmb8y at 79 not found
  Warning: pdfetex.exe (file pcrr8y): Font pcrr8y at 55 not found
  Warning: pdfetex.exe (file pcrr8y): Font pcrr8y at 86 not found
  etc.

So, the system tries to find the Adobe fonts which I do not have. Their 
URW counterparts are included in the stand-alone distribution, but the 
system does not seem to look for the u* fonts.


I do not claim to understand the complete font mess, but ConTeXt seems 
to get the right map files:


  fonts   : resetting map file list
  fonts   : using map file: original-base
  fonts   : using map file: ec-public-lm
  fonts   : using map file: ec-base
  fonts   : using map file: original-ams-base
  fonts   : using map file: original-public-lm
  fonts   : using map file: texnansi-base
  fonts   : using map file: texnansi-urw-times
  fonts   : using map file: original-youngryu-tx
  fonts   : using map file: texnansi-urw-helvetica
  fonts   : using map file: texnansi-urw-courier

What goes wrong? I am using the newest mswincontext.zip downloaded just 
a half an hour ago, the log says:


  ConTeXt  ver: 2006.01.09  fmt: 2006.1.9  int: english  mes: english

Thanks for all hints. And once again, sorry for spamming the list with 
YAFP (Yet Another Font Problem).


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


Re: [NTG-context] PSNFSS in new ConTeXt?

2005-06-03 Thread Ville Voipio

\usetypescript [adobekb][\defaultencoding]
\setupbodyfont[pos]


which used to work before doesn't work neither on my Mac nor at live @ 
contextgarden.net.

How does one access these fonts?

(And sorry for blaming gwTeX for this!)


It is really not Gerben's fault! At some point the pos-typescript has 
been deprecated (at least according to the comments in 
tex/context/base/type-pre.tex).


However, the typescript file is now enclosed in

\starttypescriptcollection[previous]
  ...
\stoptypescriptcollection

These might give you some hint about how to proceed.

---

The more modern way of solving this problem is to forget about the old 
pos collection and leverage the user value by embracing the novel 
typescript paradigm. (Oops, sorry, my marketing-bs-generator seems to be 
breaking in.)


The modern way to get to use the free URW fonts is to run 
context/data/type-tmf.dat (or, rather, run texfont and give type-tmf.dat 
as a batch file). This will enable using a lot of nice fonts in the URW 
collection.


However, there are two gotchas:

1. With gwTeX, running the command

  texfont --encoding=ec --batch type-tmf.dat

at least previously resulted in some errors about unknown files. They 
may be fixed with an ugly hack: replace all occurences of TEXMFMAIN by 
TEXMFTE in type-tmf.dat.



2. After the fonts are installed, you have the fonts. Nice. But no 
typescripts. Not so nice. I have made some typescripts for 
Palatino/Helvetica/Courier and SchoolBook/Helvetica/Courier 
combinations. There might be something already done in the ConTeXt 
distribution, but I have not found anything that useful. (I can Wiki 
them if someone finds it useful.)



Good luck!

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


Re: [NTG-context] Context, LaTeX, or an XML for academic writing?

2005-05-12 Thread Ville Voipio
Actually your comment here might suggest how far we have to go then, as 
I'd consider my wishlist a very roughly stated but really quite minimal 
set of requirements for academic writing.
Well, if you drop the RTF part, then your wishlist is not that 
difficult. However, there are some requirements which look trivial at 
first but are rather difficult to make well. The most important of these 
is the difference between HTML and a printed book.

As long as you use only running text (no illustrations, graphs, images, 
formulae, tables), there is no problem. By making suitable templates the 
text may be typeset well and it works as a web page (or a collection of 
web pages). In HTML you have less control over the layout, but as the 
user has the control, everything is well.

Some problems arise when you add any special elements to the text. 
Formulae are a good example. Even though you might in principle use 
MathML or equivalent, the browser support is not built-in, so most users 
cannot read the formulae. You'll need to use images, but then the best 
resolution is hard to find. The same goes with images, SVG is not ready 
yet, so resolution problems are really difficult. Illustrations which 
print well at high resolution do not necessarily look good at screen 
resolution.

But the real problems start with floats. Where do you put a picture with 
its captions on a web page? Or a footnote? One common solution is to put 
them behind a link. However, some people (yours truly included) find 
that following the links back and forth is clumsy. Another solution 
would be to place the figures within the text, but then we have all 
sorts of typesetting problems without having a typesetting engine.

Of course, you can make miracles with XHTML/CSS. You can make something 
that looks laike pages from a book, for example. But then, why not 
really use PDF instead? Because then you can be sure of the layout.

The hyperlink navigation paradigm of HTML is a good one for many 
purposes. It is not a good one for a book. If I have a book (or a PDF), 
I can easily verify I've read it to the last comma. With a more 
complicated (even a simple tree without loops) HTML document trying the 
same reminds me of the Maze all different in the old Adventure game 
(Colossal Cave Adventure by Will Growther).

I am not saying HTML is bad and PDF good. HTML is extremely good for 
many purposes. Wiki is a good example of this, and so are many web 
pages. But as HTML is not necessarily a good form for a book, 
concentrating on PDF is probably a better idea.

---
Since posting I've thought a bit more about why I wanted RTF, and 
realised it wouldn't do what I wanted anyway. The 'inter-operation with 
Word users' I was referring to is primarily this: it's common amongst 
academics I know here in Australia to use some of the collaboration 
features of Word (marginal comments and revision control, particularly). 
RTF wouldn't actually help with those anyway. So there's really no way 
around this without using Word, which I will only do at gunpoint.
Well, if everyone around you is using Word and requires you to 
collaborate by using Word, you are up to your lower back in alligators. 
On the other hand, there are ways around this. What I use when 
commenting on other people's texts, I want to have the texts as PDF. 
Then I just simply write a mail with my comments:

p. 123, paragraph 2: Not so. Dr. Frankenstein proved this to be wrong 
in 1974, see Journal of Unlikely Science, 1865, pp. 1456-1505

p.127, figure 2.13: I don't get it.
Exactly same thing as scribbling things into the margin. This method is 
independent of the programs used and does not really take any more time. 
I have found only two shortcomings with this method: 1. it is difficult 
to combine comments from several reviewers, 2. you cannot edit the text 
yourself even if you wanted to. The first one is a problem with Word 
documents, as well, and the second one is not always so desirable, anyway.

Really, I hate it when people send me their Word files. I am quite 
convinced I am not the only one. The annotation mechanism in Word is 
similar to almost everything else in the program: looks easy, feels easy 
at first, makes you run circles on the walls in the end.

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


Re: [NTG-context] Context, LaTeX, or an XML for academic writing?

2005-05-09 Thread Ville Voipio
or an XML dtd (tbook or DocBook?) plus appropriate tools. I'm ruling out 
Word (having wrestled with it at work), and am reluctant to use anything 
similar like OpenOffice. I have used LaTeX for some things in the past. 
I was in a similar situation a few years ago (writing my PhD thesis). I 
think you are absolutely right when you avoid Word and everything 
Wordish. Making a big document with Word requires a lot of knowledge 
about what you should avoid. And in the end you'll still spend your 
nights wondering why the  the crossreferences or page numbers go wrong.

I ended up using LaTeX. I didn't know much about ConTeXt by that time,
and also had a lot of maths in the book. I am not sure which one I'd 
take, if I could choose right now. I think your choice is one of the 
following: LaTeX, DocBook, ConTeXt, ConTeXt+XML.

However, your wishlist looks a bit difficult. A few comments:
1) future-proofing.
LaTeX is more common. On the other hand, you can (and should) take a 
snapshot of your working environment when you've finished what you're doing.

All TeX variants (and XML stuff) are future-proof in the sense that all 
text and images are easy to recover if needed. Use only PDF, JPG, and 
PNG for images to be on the safe side. Reproducing the same layout 
depends on many other issues, even small changes in font metrics may 
change things. It is also well possible that 30 years from now nobody 
remembers ConTeXt (or DocBook or LaTeX or TeX).

XML is in a way a safe bet, but even there you're up to some programming 
if the tools disappear.

2) semantic rather than layout-oriented markup as much as possible.
I think this is something you can do with all alternatives. In a typical 
ConTeXt (and LaTeX) file there is a lot of layout stuff in the 
beginning, but in the document itself the tagging is really independent 
from layout, if you've done the preliminary work right. At least I 
consider it bad style, if you use explicit font switches or equivalent 
in a document.

However, even if you think the layout is not that important, you'll need 
to do a lot of things with it before having a printable book. In this 
sense ConTeXt seems to give a lot of possibilities, but the 
documentation is not very complete. LaTeX is a bit more difficult, and 
you need to do more TeXing, but in practice you don't as someone else 
has done it before (packages). Fonts are difficult in any case :)

I am not a DocBook specialist, but my impression is that it is really 
not so much geared towards printable layout. This, of course, makes the 
markup separate from the layout.

This is the key in making successful documents with any system: The 
content and the layout are two different layers. Word processing 
programs mix them into a sorry mess, but for the smoothest workflow they 
should be separated. It should even be possible for different people do 
do carry out the two different tasks.

3) relatively easy integration with some form of bibliographic 
database(ish) system (bibtex would do).
(.*)TeX will do.
4) ability to produce pdf's, html, and rtf versions (for interoperation 
with Word-users) at least.
PDF is a must. HTML can be reproduced from (.*)TeX, but DocBook is the 
only one designed with HTML in mind. On the other hand this may reflect 
to the print quality; TeX is a real typesetting system. There are ways 
to make TeX out of DocBook (e.g. passiveTeX), but the quality is not 
always as good as with other alternatives.

HTML is more a matter of taste. A nicely working PDF is -- IMHO -- much 
easier to use. It is easy to search from the complete document, and 
links from the index and ToC make the use straightforward. Modern 
displays are sufficiently high-res for PDF to be read on-screen. Also, 
printing a complete PDF document is easy.

The situation becomes much more complicated if you need RTF. It is a 
completely different story, a word processor editable format. I guess 
you don't really want to distribute your work in editable format, and 
PDF can be read with virtually any computer.

So, I'd concentrate on making a visually pleasing high-quality PDF with 
working links in it. That will make most readers happy.

5) no need for me to write any code. I used to be a programmer, and when 
I left, promised myself, my wife, and my cat that I would never write a 
line of code again. I don't mind a bit of TeXish fiddling if 
*absolutely* necessary.
All alternatives are equivalent in this sense. Of course, if you plan on 
doing something with ConTeXt/XML, that requires some work, but not 
really programming. And all layout stuff with (.*)TeX requires some 
serious head scratching in the beginning, anyway.

ConTeXt seems to fit the bill for 1,3 and 5. I'm not sure about 4 (html? 
rtf?) or 2 (I haven't had a proper look at the nature of the available 
macros yet) .
I'd say it'll fill number 2, as well. But RTF, no. There may be kludges 
to make it kind of, you know, a bit like, errr, RTFish, but nothing 
really good. The 

RE: [NTG-context] Capitalized headings

2005-05-03 Thread Ville Voipio
 However, this is a workaround, another way of attacking it (it can be
 better, too, stylistically, as you can change the font independently):
 \setuphead [title] [textcommand=\uppercase]

And that works, thanks!

---

The bad news is that now I have a lot more questions concerning the
heading formatting.

There are several parameters which can be used:

  style
  textstyle
  textcommand
  numberstyle
  numbercommand

This is how I understand those (please, correct me when I am wrong).
Let us assume we have a chapter heading saying Chapter 1. Title
in the following examples:

  style=\bf   - {\bf Chapter 1.}{\bf Title}
  textstyle=\bf   - {Chapter 1.}{\bf Title}
  numberstyle=\bf - {\bf Chapter 1.}{\bf Title}

If I got it right this far, then I think I get these. The relevant
parts of the heading are prepended with the given commands (whatever
they then may be).

But this mechanism does work only with the commands which change the
style from that point onwards (e.g., \it, \tfx). What about the
commands which take the text as a parameter (such as \cap{text})?

And what are textcommand and numbercommand? I tried playing a bit
with them. For example, \it or \bf can be put either as textstyle=\it
or textcommand=\it. On the other hand, the \uppercase can be used
only with textstyle. So, there is a difference as the name suggests
(my initial guess was that the difference is exactly what I ask above,
but doesn't seem to be so).

Where on Earth is \uppercase explained? I tried looking for it in
the manual -- in vain. I found some references to \uppercased which
seems to be another beast.

Thank you for your patience. If the stuff is not explained in
other places, I can Wiki it once I understand it.

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


RE: [NTG-context] Capitalized headings

2005-05-03 Thread Ville Voipio
 The bad news is that now I have a lot more questions concerning the

It really seems that I do... I played around with the capitalization
commands and got some interesting results.

My test file is (works in live.contextgarden.net if required):

---

\enableregime[il1]
 
\starttext
 
abcABCåäöÅÄÖ
\cap{abcABCåäöÅÄÖ}
\uppercased{abcABCåäöÅÄÖ}
\WORD{abcABCåäöÅÄÖ}
\uppercase{abcABCåäöÅÄÖ}
 
\stoptext
 
---

So, the test string is: abcABC\aumlaut\aring\oumlaut\Aumlaut\Aring\Oumlaut
(just in case it does not display correctly). It gives:

\cap - ABCABCÅÄÖÅÄÖ (in \tfx size), just as expected
\uppercased - ABCABCåäöÅÄÖ (ABC's in \tfx, rest untouched)
\WORD - ABCABCÅÄÖxxx (where xxx's are gibberish)
\uppercase - ABCABCÅÄÖxxx

The plain TeX \uppercase seems to be known for its nasty behaviour
with anything else than US characters. \WORD seems to be a thin
wrapper around it, so similar behaviour is to be expected.

\uppercased makes interesting things, as it does uppercase the
abc's well but does not touch the accented characters in any
way.

Only \cap seems to do exactly what it should.

---

Things become even stranger, when the regime is switched to
UTF-8. Then \WORD and \uppercase give some errors and refuse
to compile. \uppercased and \cap work as described above.

---

As \uppercase is a plain TeX macro, fixing it is not a good
choice, especially because it is known to be bad. However,
if \WORD could be built on \cap but without the font size
changing, it would work fine. The odd behaviour of \uppercased
(and the reasons to use it instead of the other choices) remains
unclear to me.

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


Re: [NTG-context] TEXMFMAIN problem in gwTeX (font installation)

2005-05-02 Thread Ville Voipio
generated fonts metrics are put in a given path:
And this is not the problem.
I have to apologise for the bad wording of my previous message. I am not 
saying there would be anything wrong with the Perl script. The only 
slight annoyance there is the error message, which states:

  unknown subpath ../fonts/afm/$vendor/$collection
At least to my eye this seems to refer to the parent directory (..), 
whereas it really doesn't. It just says that 
something/something/fonts/afm/$vendor/$collection is missing. Full path 
in that message would've gotten me to the goal a bit faster.

The problem is really in the font installation script (type-tmf.dat). 
There the root (i.e. the source tree for the fonts) is explicitly given 
as TEXMFMAIN. And this does not work in gwTeX, because if something is 
given, it has to be TEXMFTE.

As a summary:
- texfont.pl is fine
- gwTeX is fine
- type-tmf.dat is not fine, but I really don't know how to reliably fix 
it (yes, patching is simple, but then it does not work in other distros)

---
But am I doing something stupid (again)?
I think I have some kind of understanding of the ConTeXt font 
mechanisms. However, I am still a bit confused about this mess. So, what 
is the easy, standard, newbie way to install the TeX Live font 
collection to be used with ConTeXt? Is it still using the type-tmf.dat 
batch file?

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


RE: [NTG-context] TEXMFMAIN problem in gwTeX (font installation)

2005-05-02 Thread Ville Voipio
 Just for my understanding. Does texfont.pl only
 read in TEXMFMAIN or does it also write (can it
 be a search path or does it require for TEXMFMAIN
 to be just one directory)?

texfont.pl checks several places. By a very quick look
at the sources, it looks for the following:

  TEXMFMAIN
  TEXMFLOCAL
  TEXMFEXTRA
  TEXMFFONTS

It does not look for TEXMFTE, but by specifying the
switch --rootlist, it can be given a list of trees,
which it then browses through.

Ok, it might be useful to add a few here, such as
TEXMFTE (for us gwTeX users), but maybe that's an
endless road. But the real problem is really in a
font installation script which explicitly overrides
the default settings and gives a wrong tree.

---

The problem is easy to pinpoint into type-tfm.dat.
Unfortunately, just removing the explicit definitions
does not seem to solve the problem. The non-standard
root seems to be difficult to be told to the system.

For encodings, texfont.pl can be force-fed a value
which is passed to all scripts in a batch file (using
a special --en=? switch). However, no such mechanism
exists for other parameters (such as the --ro).

Tweaking the TEXMFFONTS to point to TEXMFTE is one
possibility, but then the fonts will also be installed
into TEXMFFONTS instead of TEXMFLOCAL.

Ideally, it would be nice to be able to tell the
script that the source fonts are in TEXMFWHATEVER
and they are going into TEXMFSOMETHINGELSE. I haven't
been able to figure out how to achieve that without
tailoring the batch file.

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


[NTG-context] Capitalized headings

2005-05-02 Thread Ville Voipio
I've been trying to make capitalized (uppercase) 
headings with little success. I'd like to have
the titles simply capitalized as with \cap or
\WORD.

A minimal example:

---

\setuphead[title][style=WORD]
 
\starttext
\title{This is a title}
 
The title should be \cap{capitalized} or \WORD{capitalized}.

\stoptext

---

What should I give as the style? I have tried the 
following:

  style=WORD - no effect
  style=Caps - no effect
  style=uppercased - no effect
  style=CAP - no effect
  style=Cap - no effect
  style=cap - error
  style=kap - error
  style=smallcaps - small caps (when the font supports)

It is interesting to get an error message for the 
style=cap, because this is one of the listed options
in the definition of \setuphead in the manual.

What did a do wrong?

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


[NTG-context] Two hyphens do not give en dash

2005-05-02 Thread Ville Voipio
I installed a new font (Gentium, TrueType). 
Everything went relatively smoothly except
for one thing: When I type -- I really get
two hyphens instead of the expected en
dash.

I have been able to work around this by
using UTF regime and typing the en dash
into the source file. However, it would
be easier to use -- and ---. What should
I do? (Yeah, I know, forget it and be
happy that the UTF works :)

TIA,

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


RE: [NTG-context] Two hyphens do not give en dash

2005-05-02 Thread Ville Voipio
 Try adding the --afmpl switch to your texfont command. It switches over
 to the afmpl utility, which does better with preserving ligatures and
 kerns.

Thank you! Now it works.

I added this onto the Wiki page, as well. I did a few other changes
there, as well (mostly according to your suggestions).

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


[NTG-context] TEXMFMAIN problem in gwTeX (font installation)

2005-04-29 Thread Ville Voipio
I have spent some very interesting time trying to install the TeXlive 
fonts by using texfont type-tmf.dat. What happened was that a lot of 
complaints about unknown subpath ../afm/public/urw were given even 
though the path should have been there. This is a known problem, has 
been on several mailing lists, as well.

After a lot of thinking it became clear that texfont was really unable 
to find any font files. By browsing through the texfont.pl, the reason 
became evident: In gwTeX the root variables are:

   TEXMFMAIN = /usr/local/teTeX/share/texmf
   TEXMFTE = /usr/local/teTeX/share/texmf.tetex
The problem here is that all the TeXlive fonts (and almost everthing 
else) is really in the TEXMFTE tree.

My quick'n'dirty was to make new file type-tmf-gwtex.dat by replacing 
all occurrences of TEXMFMAIN by TEXMFTE. Running that one in batch mode 
works fine.

Problem solved -- this time. But the solution is not a beautiful one. 
Could someone suggest something cleaner? Or has this been solved already 
(I tried googling after the answer without success)?

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


[NTG-context] Postscript fonts (was: gwTeX and missing PS fonts)

2005-04-27 Thread Ville Voipio
 However, something else broke when I upgraded. I cannot get the 
 Postscript fonts working anymore. Here is what I have in the file:

\usetypescript[adobekb][\defaultencoding]
\setupbodyfont[pos,11pt]

By some grepping into the sources I found the problem. It seems
that the file type-pre.tex has changed between the versions I
have been using. Now there is the extra line:

  \starttypescriptcollection[previous]

which seems to cause the problem of unknown variant: pos. Without
knowing anything more, a simple usetypescriptcollection or
something similar would be my guess.

However, I am a bit afraid of the word previous and the comments
in the beginning of the file.

So, a question follows:

  I want to make documents with Times/Helvetica/Courier
  combination (as was done with pos). I do not have the
  commercial fonts, but I do have the TeX Live (or teTeX)
  distribution. What is the right way to get to use the
  fonts?

I'm sorry but I do not like the Computer Modern in my reports and
brochures. I want to have something else, and that something
should be easy to use in any distribution.

TIA,

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


[NTG-context] Right way to load hyphenation patterns

2005-04-27 Thread Ville Voipio
I want to use a non-standard hyphenation pattern (Finnish)
in some of my documents. I have been able to make it work
by:

  editing cont-usr.tex (removing a % from the \installlanguage)
  remaking formats (texexec --make)
  copying the format wile to the .../web2c directory

This works. However, I read in the Wiki that It is generally 
better to add local settings to a run-time included file like 
cont-sys.tex instead, so unless your stuff does absolutely 
have to become part of the format file, you are better off 
leaving this file well alone.

So, where should I put the \installlanguage directive for
it to be in the right place? Is it something that really has
to be there when the formats are being built, or could it
be loaded afterwards (i.e. at run-time)? Could it be put in
the cont-sys.tex?

TIA,

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


Re: [NTG-context] Figure formats

2005-04-26 Thread Ville Voipio
them to the picture itself. I also turn my CorelDraw pics into pdf 
before adding them to ConTeXt based text, that inserts them nicely and 
makes it easy for me to share any graphics at request (I'm occasionally 
asked to send just graphic 3.1 from manual x, so it is a good thing to 
have all of them as pdf).
An interesting thing is that sometimes some programs make stupid
mistakes when exporting to PDF. For example, I have had some
bounding box problems when exporting to PDF. The bounding box
tends to be the size of a page, which is really not a nice thing.
(This happens with CorelDraw 11 in OS X and with older CDR
versions in other OSes.) Illustrator should be safe, as PDF
is one of its home formats.
A workaround which I've been using for years is to export in EPS.
All graphics programs I've come across have been able to do that
reliably. Then the EPS can be converted into a PDF by using one
of the following: a) Adobe Distiller b) Ghostscript (epstopdf,
eps2pdf, or equivalent) c) Preview in OS X.
I have found it very useful to have all illustrations in PDF
format in the right size (i.e., clipped to the right size,
correct bounding box). Then it is easy to play around with them.
Even though vector graphics is -- in theory -- infinitely scalable,
in practice it is much better to try and draw the pictures 1:1.
If the images are scaled, line widths and annotations are scaled,
too. Especially when there are several similar pictures with
different scale factor, the result looks odd. So, the final size
of the illustration should be known before drawing the actual
picture!
It is also a good idea to scale the bitmaps down (or up) to the
final size and resolution before inserting them. This avoids
a number of strange problems when rendering the images. For
photographs, 200 dpi should be enough almost always, line art
requires 300 dpi. (And a very important exception is that all
screen captures should be taken as is without any operations
on them.)
Too large a resolution makes the files unnecessarily large and
slow, so even that should be gotten rid of. Graphics packages
have different resizeing algorithms, and getting to know all
of them takes some experimenting, but it is well worth the trouble.
What comes to the figure formats, PNG is good for lossless images
(screen captures) or images requiring alpha channel. JPG is best
for photographs and other continuous-tone real-world images
(and some visualizations). But, whenever possible, use PDF, if
there is any choice.
- Ville
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] gwTeX and missing PS fonts

2005-04-26 Thread Ville Voipio
I had a smoothly working gwTeX with the exception of a few hyphenation 
patterns. Before debugging that problem any further, I decided to get 
the newest beta (texexec 5.3.1, context 2005.04.19).

I got the hyphenation problem fixed. It had nothing to do with the 
distribution or version, just my lack of thinking. Editing cont-usr.tex 
and then 'texexec --make --all', and ConTeXt was hyphenating Finnish 
beautifully.

However, something else broke when I upgraded. I cannot get the 
Postscript fonts working anymore. Here is what I have in the file:

   \usetypescript[adobekb][\defaultencoding]
   \setupbodyfont[pos,11pt]
Everything goes relatively smoothly, except for the fact that I get 
everything typeset in Computer Modern. A small error message is in the 
output:

   bodyfont : unknown variant pos
What went wrong? I cannot find the file font-pos.tex on my machine, but 
as I cannot find it in the source tree, either, it seems to have been 
embedded somewhere.

How should I debug this problem? Where is the actual definition for pos?
- Ville
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context