https://wiki.contextgarden.net/api.php?action=feedcontributions&user=134.95.66.63&feedformat=atomWiki - User contributions [en]2024-03-28T14:24:40ZUser contributionsMediaWiki 1.34.1https://wiki.contextgarden.net/index.php?title=Windows_Installation&diff=9016Windows Installation2008-10-28T18:25:23Z<p>134.95.66.63: Really fix TeX-live (not -Live)</p>
<hr />
<div>In order to be able to run ConTeXt under Windows, you will need:<br />
* your favorite [[Text Editors|text editor]] and [[PDF Viewers|PDF viewer]]<br />
* a TeX distribution<br />
** [[ConTeXt Minimals]]<br />
** [[TeX-live]]<br />
** [[MikTeX]] ('''broken!!!''')<br />
* some scripting languages: ruby, perl, GhostScript<br />
<br />
== Updating ==<br />
<br />
You have to bear in mind that ConTeXt is being developed reasonably fast (see [[Release Notes]]), so it's recommended to update it regulary. The command<br />
ctxtools --update<br />
used to work OK, but is '''no more recommended'''. All the three distributions mentioned here have their own way to update. We'll come back to that later (and move this section to a better place).<br />
<br />
= TeX Distributions =<br />
<br />
You first need to choose a TeX distribution. Options are:<br />
* [[ConTeXt Minimals]]<br />
* [[TeX Live]]<br />
* [[MikTeX]] ('''broken''')<br />
<br />
== ConTeXt Minimals ==<br />
<br />
[[ConTeXt Minimals]] | http://minimals.contextgarden.net/<br />
<br />
* the official ConTeXt distribution<br />
* easy to keep up-to-date<br />
* includes (almost) everything that you need for ConTeXt<br />
* no LaTeX<br />
** if you don't need it, that's a rather small & convenient way to use ConTeXt<br />
** if you need it, you can have minimals installed parallel to [[TeX Live|TL]] or [[MikTeX]]<br />
<br />
There are two ways to install it on Windows:<br />
* use GUI intaller by Vyatcheslav [http://minimals.contextgarden.net/setup/context-installer/] (sets environmental variables globally)<br />
* install from command-line (TODO: instructions)<br />
<br />
== TeX Live ==<br />
<br />
[[TeX Live]] 2008 | http://www.tug.org/texlive/<br />
<br />
* reference distribution for (La)TeX for all platforms<br />
* released once per year and sent to members of TeX user groups on DVDs<br />
* used to be gigantic; but since 2008 one can install separate packages and update them<br />
* binaries are compatible with Minimals<br />
* ConTeXt is outdated<br />
** but it's possible to update it manually<br />
** new ConTeXt update mechanism is being prepared<br />
<br />
''Another distribution worth mentioning is [http://www.fsci.fuk.kindai.ac.jp/kakuto/win32-ptex/web2c75-e.html W32TeX] that came to our attention when Akira (its author) was the first one to manage to compile [[XeTeX]] for Windows, and still provides the very latest Windows binaries for [[XeTeX]], [[LuaTeX]], [[pdfTeX]], [[MetaPost]], ... Distribution is a bit specific, but his binaries are great - compatible with [[TeX Live]] and used in [[Minimals]].''<br />
<br />
== MikTeX (broken) ==<br />
<br />
[[MikTeX]] 2.7 | http://www.miktex.org<br />
<br />
* great tool for people typsetting in LaTeX<br />
* updating packages is easy, (font) <b>packages are downloaded automatically</b><br />
* very user friendly<br />
* ConTeXt is often outdated, but currently '''broken'''<br />
** (it's possible to do some tweaking to make it work)<br />
* no [[LuaTeX]] available yet<br />
* binaries incompatible with Minimals and [[TeX Live]]<br />
<br />
See also<br />
* http://www.tug.org/protext/: MikTeX-based distribution, includes TeXnicCenter, GhostScript and WinEdt<br />
<br />
= Text Editor =<br />
<br />
See also [[Text Editors]].<br />
<br />
== For newbies (like Word (ex)users) ==<br />
<br />
* '''[http://scintilla.sourceforge.net/SciTE.html SciTE]''': nicely integrated with Minimals; support written by Hans Hagen ConTeXt commands.<br />
* '''Notepad++'''<br />
* '''[http://www.winedt.com WinEdt]''': rich graphical user-interface, but more support for LaTeX than for ConTeXt<br />
* '''[http://www.textpad.com/ Textpad]'''<br />
* '''[http://www.toolscenter.org TeXnicCenter]'''<br />
<br />
== For gurus (like (La)TeX users or programmers) ==<br />
<br />
These may be a good choice if you're willing to invest some time into learning them (may be worth the effort):<br />
* [[Vim]]<br />
* [http://www.emacswiki.org/cgi-bin/wiki Emacs] <br />
<br />
== Compiling ==<br />
<br />
After you've done all that, you can finally use your favourite editor to write your [[First Document|first document]].<br />
<br />
To compile it, open the command line again (Start -> Run ... -> type '''cmd''' or '''command''') and run<br />
texexec yourfilename<br />
<br />
= PDF Viewer=<br />
<br />
== Adobe Reader ==<br />
<br />
* you can get it [http://www.adobe.com/products/acrobat/readstep2.html here]<br />
<br />
= Tools =<br />
<br />
Ruby is absolutely required (unless you plan to use [[MK IV]] exclusively), Perl and GS are highly recommended, the rest is optional.<br />
<br />
== Ruby and Perl ==<br />
<br />
* http://www.activestate.com/Products/ActivePerl/<br />
* http://www.ruby-lang.org or http://rubyinstaller.rubyforge.org<br />
<br />
You can download ActivePerl [http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl here] and Ruby [http://rubyinstaller.rubyforge.org/wiki/wiki.pl here] (automatic installation) or [http://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ here] (you need to extract files from zip and add ruby to PATH).<br />
<br />
After installing check if these work OK:<br />
perl --version<br />
ruby --version<br />
<br />
== GhostScript ==<br />
<br />
* http://www.cs.wisc.edu/~ghost/<br />
* http://www.ghostscript.com/<br />
<br />
If you already worked with (La)TeX before, you probably already have it installed. Try<br />
gswin32 --version<br />
<br />
You have to download GhostScript (filename '''<code>gs851w32.exe</code>''' or a similar one) and preferrably GSview as well ('''<code>gsv47w32.exe</code>''' or similar). Be sure to include the executables (folder where gswin32.exe is located) into the PATH variable.<br />
<br />
== Other useful software ==<br />
<br />
There is still some software worth mentioning:<br />
* [http://www.pstoedit.net/pstoedit/ PStoEdit] for Windows is only needed in order to be able to use some advanced features such as those mentioned in [[manual:mmakempy.pdf|METAPOST outlines]]<br />
* [http://gnuwin32.sourceforge.net/packages/unzip.htm unzip]<br />
* [[LilyPond]]<br />
* [[Font Tools]]<br />
* ... ?<br />
<br />
= Special Notes =<br />
<br />
== Older versions of Windows ==<br />
<br />
The stand-alone distribution only works for newer versions of Windows that have cmd.exe instead of command.com as command interpreter. Running it on Windows 98 (or earlier) is also possible, but needs some tweaking (hardcoding the paths in .bat script). If you really need that and can't make it work alone, try to ask Taco.<br />
<br />
== TODO - needs revision ==<br />
<br />
===Installation Instructions===<br />
<br />
{{todo|I made an example how to use the stand-alone distr. isolated from an existing distro. I would like to "join" this somehow with the first section and move opening of <code>cdemo.bat</code> to something like <b>testing the installation</b>. Perhaps <tt>pragmatex.bat</tt> can be executed with autorun or something if one is not using another TeX distribution.}}<br />
<br />
''by Ville Voipio on the mailing list, 2006-01-19'' (modified)<br />
<br />
Here is a step by step of how it should go (i.e. what I did with success):<br />
<br />
# Install [[Windows Installation#Installing Perl and Ruby|Perl and Ruby]]<br />
# Download [http://www.pragma-ade.com/context/install/mswincontext.zip mswincontext.zip], unzip it and move/rename the <code>isoimage</code> folder to your favourite destination. The instructions to follow assume that you renamed <code>isoimage</code> to <pre>c:\Programs\context</pre> There should be one folder (<code>usr</code>) and a few files in it.<br />
# Open the folder <code>c:\Programs\context</code> and double-click <code>cdemo.bat</code>.<br />
# Now you should see the editor SciTE open with a few files. Press F7 to compile one of the files.<br />
If everything goes smoothly, you are done. If not, read these instructions again carefully. If you cannot get it work, mail the list.<br />
<br />
{{todo|review these steps: join the information - notes about ruby, Acrobat, ... apply to all windows distributions.}}<br />
<br />
A few notes on the procedure above:<br />
* It is up to you to choose the location where you unzip the file in step #2, no magic there. Just that you know where the files are.<br />
* The actual location of the ConTeXt tree in step #2 does not matter. I use <tt>c:\context</tt>, but you might use something else. However, I would not use anything with a space in the name (e.g. <tt>c:\Program Files\context</tt>), as that may confuse things. [Seems to work with an August 2006 stand-alone distribution.]<br />
* After you have verified everything works in step #3, you can toss <tt>cdemo.bat</tt> away and use <tt>cstart.bat</tt> to start everything. Make a link to it somewhere so that you can start the system by a shortcut or through the Start menu. ''Do not move the batch script anywhere,'' it has to be run in the root directory of the distribution (e.g. <tt>c:\Programs\context</tt>).<br />
* Make sure you have something Acrobatish (any decent PDF viewer) installed, otherwise you won't see the results in step #4.<br />
* A final note: to have it finally running you should build the formats first. To do so there is at least a way:<br />
<br />
(assuming C:\Programs\context)<br />
Start->Run->cmd<br />
cd C:\Programs\context<br />
cdemo.bat<br />
<br />
Then close the SciTe window but remain in the cmd.<br />
<br />
Then, in one line:<br />
C:\Programs\context\usr\local\context\tex\setuptex.bat C:\Programs\context\usr\local\context\tex<br />
<br />
texexec --make --all<br />
<br />
Then, close the cmd, double-click in cdemo.bat<br />
and voila !<br />
<br />
* Another way to do it could be to type: texexec --make --all directly in SciTe console.<br />
<br />
===How to use the stand-alone distr. if you have MikTeX/TeX Live installed===<br />
<br />
# Create a file <code>pragmatex.bat</code> (the name doesn't really matter) with this content: <pre>C:\Programs\context\usr\local\context\tex\setuptex.bat C:\Programs\context\usr\local\context\tex</pre> and make sure that this file is visible by <code>PATH</code>.<br />
# You can safely continue using your old TeX distribution (MikTeX, TeX Live, ...). If you want to invoke the stand-alone distribution, just execute <pre>pragmatex</pre> from the command-line and all the subsequent calls to <code>texexec</code> will use files from the stand-alone tree (you'll notice the difference in file names when running ConTeXt).<br />
<br />
<br />
[[Category:Installation]]</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Windows_Installation&diff=9015Windows Installation2008-10-28T18:24:33Z<p>134.95.66.63: Fix TeX-Live link</p>
<hr />
<div>In order to be able to run ConTeXt under Windows, you will need:<br />
* your favorite [[Text Editors|text editor]] and [[PDF Viewers|PDF viewer]]<br />
* a TeX distribution<br />
** [[ConTeXt Minimals]]<br />
** [[TeX-Live]]<br />
** [[MikTeX]] ('''broken!!!''')<br />
* some scripting languages: ruby, perl, GhostScript<br />
<br />
== Updating ==<br />
<br />
You have to bear in mind that ConTeXt is being developed reasonably fast (see [[Release Notes]]), so it's recommended to update it regulary. The command<br />
ctxtools --update<br />
used to work OK, but is '''no more recommended'''. All the three distributions mentioned here have their own way to update. We'll come back to that later (and move this section to a better place).<br />
<br />
= TeX Distributions =<br />
<br />
You first need to choose a TeX distribution. Options are:<br />
* [[ConTeXt Minimals]]<br />
* [[TeX Live]]<br />
* [[MikTeX]] ('''broken''')<br />
<br />
== ConTeXt Minimals ==<br />
<br />
[[ConTeXt Minimals]] | http://minimals.contextgarden.net/<br />
<br />
* the official ConTeXt distribution<br />
* easy to keep up-to-date<br />
* includes (almost) everything that you need for ConTeXt<br />
* no LaTeX<br />
** if you don't need it, that's a rather small & convenient way to use ConTeXt<br />
** if you need it, you can have minimals installed parallel to [[TeX Live|TL]] or [[MikTeX]]<br />
<br />
There are two ways to install it on Windows:<br />
* use GUI intaller by Vyatcheslav [http://minimals.contextgarden.net/setup/context-installer/] (sets environmental variables globally)<br />
* install from command-line (TODO: instructions)<br />
<br />
== TeX Live ==<br />
<br />
[[TeX Live]] 2008 | http://www.tug.org/texlive/<br />
<br />
* reference distribution for (La)TeX for all platforms<br />
* released once per year and sent to members of TeX user groups on DVDs<br />
* used to be gigantic; but since 2008 one can install separate packages and update them<br />
* binaries are compatible with Minimals<br />
* ConTeXt is outdated<br />
** but it's possible to update it manually<br />
** new ConTeXt update mechanism is being prepared<br />
<br />
''Another distribution worth mentioning is [http://www.fsci.fuk.kindai.ac.jp/kakuto/win32-ptex/web2c75-e.html W32TeX] that came to our attention when Akira (its author) was the first one to manage to compile [[XeTeX]] for Windows, and still provides the very latest Windows binaries for [[XeTeX]], [[LuaTeX]], [[pdfTeX]], [[MetaPost]], ... Distribution is a bit specific, but his binaries are great - compatible with [[TeX Live]] and used in [[Minimals]].''<br />
<br />
== MikTeX (broken) ==<br />
<br />
[[MikTeX]] 2.7 | http://www.miktex.org<br />
<br />
* great tool for people typsetting in LaTeX<br />
* updating packages is easy, (font) <b>packages are downloaded automatically</b><br />
* very user friendly<br />
* ConTeXt is often outdated, but currently '''broken'''<br />
** (it's possible to do some tweaking to make it work)<br />
* no [[LuaTeX]] available yet<br />
* binaries incompatible with Minimals and [[TeX Live]]<br />
<br />
See also<br />
* http://www.tug.org/protext/: MikTeX-based distribution, includes TeXnicCenter, GhostScript and WinEdt<br />
<br />
= Text Editor =<br />
<br />
See also [[Text Editors]].<br />
<br />
== For newbies (like Word (ex)users) ==<br />
<br />
* '''[http://scintilla.sourceforge.net/SciTE.html SciTE]''': nicely integrated with Minimals; support written by Hans Hagen ConTeXt commands.<br />
* '''Notepad++'''<br />
* '''[http://www.winedt.com WinEdt]''': rich graphical user-interface, but more support for LaTeX than for ConTeXt<br />
* '''[http://www.textpad.com/ Textpad]'''<br />
* '''[http://www.toolscenter.org TeXnicCenter]'''<br />
<br />
== For gurus (like (La)TeX users or programmers) ==<br />
<br />
These may be a good choice if you're willing to invest some time into learning them (may be worth the effort):<br />
* [[Vim]]<br />
* [http://www.emacswiki.org/cgi-bin/wiki Emacs] <br />
<br />
== Compiling ==<br />
<br />
After you've done all that, you can finally use your favourite editor to write your [[First Document|first document]].<br />
<br />
To compile it, open the command line again (Start -> Run ... -> type '''cmd''' or '''command''') and run<br />
texexec yourfilename<br />
<br />
= PDF Viewer=<br />
<br />
== Adobe Reader ==<br />
<br />
* you can get it [http://www.adobe.com/products/acrobat/readstep2.html here]<br />
<br />
= Tools =<br />
<br />
Ruby is absolutely required (unless you plan to use [[MK IV]] exclusively), Perl and GS are highly recommended, the rest is optional.<br />
<br />
== Ruby and Perl ==<br />
<br />
* http://www.activestate.com/Products/ActivePerl/<br />
* http://www.ruby-lang.org or http://rubyinstaller.rubyforge.org<br />
<br />
You can download ActivePerl [http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl here] and Ruby [http://rubyinstaller.rubyforge.org/wiki/wiki.pl here] (automatic installation) or [http://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ here] (you need to extract files from zip and add ruby to PATH).<br />
<br />
After installing check if these work OK:<br />
perl --version<br />
ruby --version<br />
<br />
== GhostScript ==<br />
<br />
* http://www.cs.wisc.edu/~ghost/<br />
* http://www.ghostscript.com/<br />
<br />
If you already worked with (La)TeX before, you probably already have it installed. Try<br />
gswin32 --version<br />
<br />
You have to download GhostScript (filename '''<code>gs851w32.exe</code>''' or a similar one) and preferrably GSview as well ('''<code>gsv47w32.exe</code>''' or similar). Be sure to include the executables (folder where gswin32.exe is located) into the PATH variable.<br />
<br />
== Other useful software ==<br />
<br />
There is still some software worth mentioning:<br />
* [http://www.pstoedit.net/pstoedit/ PStoEdit] for Windows is only needed in order to be able to use some advanced features such as those mentioned in [[manual:mmakempy.pdf|METAPOST outlines]]<br />
* [http://gnuwin32.sourceforge.net/packages/unzip.htm unzip]<br />
* [[LilyPond]]<br />
* [[Font Tools]]<br />
* ... ?<br />
<br />
= Special Notes =<br />
<br />
== Older versions of Windows ==<br />
<br />
The stand-alone distribution only works for newer versions of Windows that have cmd.exe instead of command.com as command interpreter. Running it on Windows 98 (or earlier) is also possible, but needs some tweaking (hardcoding the paths in .bat script). If you really need that and can't make it work alone, try to ask Taco.<br />
<br />
== TODO - needs revision ==<br />
<br />
===Installation Instructions===<br />
<br />
{{todo|I made an example how to use the stand-alone distr. isolated from an existing distro. I would like to "join" this somehow with the first section and move opening of <code>cdemo.bat</code> to something like <b>testing the installation</b>. Perhaps <tt>pragmatex.bat</tt> can be executed with autorun or something if one is not using another TeX distribution.}}<br />
<br />
''by Ville Voipio on the mailing list, 2006-01-19'' (modified)<br />
<br />
Here is a step by step of how it should go (i.e. what I did with success):<br />
<br />
# Install [[Windows Installation#Installing Perl and Ruby|Perl and Ruby]]<br />
# Download [http://www.pragma-ade.com/context/install/mswincontext.zip mswincontext.zip], unzip it and move/rename the <code>isoimage</code> folder to your favourite destination. The instructions to follow assume that you renamed <code>isoimage</code> to <pre>c:\Programs\context</pre> There should be one folder (<code>usr</code>) and a few files in it.<br />
# Open the folder <code>c:\Programs\context</code> and double-click <code>cdemo.bat</code>.<br />
# Now you should see the editor SciTE open with a few files. Press F7 to compile one of the files.<br />
If everything goes smoothly, you are done. If not, read these instructions again carefully. If you cannot get it work, mail the list.<br />
<br />
{{todo|review these steps: join the information - notes about ruby, Acrobat, ... apply to all windows distributions.}}<br />
<br />
A few notes on the procedure above:<br />
* It is up to you to choose the location where you unzip the file in step #2, no magic there. Just that you know where the files are.<br />
* The actual location of the ConTeXt tree in step #2 does not matter. I use <tt>c:\context</tt>, but you might use something else. However, I would not use anything with a space in the name (e.g. <tt>c:\Program Files\context</tt>), as that may confuse things. [Seems to work with an August 2006 stand-alone distribution.]<br />
* After you have verified everything works in step #3, you can toss <tt>cdemo.bat</tt> away and use <tt>cstart.bat</tt> to start everything. Make a link to it somewhere so that you can start the system by a shortcut or through the Start menu. ''Do not move the batch script anywhere,'' it has to be run in the root directory of the distribution (e.g. <tt>c:\Programs\context</tt>).<br />
* Make sure you have something Acrobatish (any decent PDF viewer) installed, otherwise you won't see the results in step #4.<br />
* A final note: to have it finally running you should build the formats first. To do so there is at least a way:<br />
<br />
(assuming C:\Programs\context)<br />
Start->Run->cmd<br />
cd C:\Programs\context<br />
cdemo.bat<br />
<br />
Then close the SciTe window but remain in the cmd.<br />
<br />
Then, in one line:<br />
C:\Programs\context\usr\local\context\tex\setuptex.bat C:\Programs\context\usr\local\context\tex<br />
<br />
texexec --make --all<br />
<br />
Then, close the cmd, double-click in cdemo.bat<br />
and voila !<br />
<br />
* Another way to do it could be to type: texexec --make --all directly in SciTe console.<br />
<br />
===How to use the stand-alone distr. if you have MikTeX/TeX Live installed===<br />
<br />
# Create a file <code>pragmatex.bat</code> (the name doesn't really matter) with this content: <pre>C:\Programs\context\usr\local\context\tex\setuptex.bat C:\Programs\context\usr\local\context\tex</pre> and make sure that this file is visible by <code>PATH</code>.<br />
# You can safely continue using your old TeX distribution (MikTeX, TeX Live, ...). If you want to invoke the stand-alone distribution, just execute <pre>pragmatex</pre> from the command-line and all the subsequent calls to <code>texexec</code> will use files from the stand-alone tree (you'll notice the difference in file names when running ConTeXt).<br />
<br />
<br />
[[Category:Installation]]</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Imposition&diff=7557Imposition2007-04-18T07:55:42Z<p>134.95.66.63: Document crop / marking options</p>
<hr />
<div>< [[Structurals]] | [[Visuals]] ><br />
<br />
==What is Imposition?==<br />
<br />
To impose means to order pages on a bigger sheet in a way, that you get a booklet (or something similar) with correct page order after folding.<br />
In the simplest case you impose four A5 pages on both sides of an A4 sheet.<br />
<br />
In a print shop it could be that you've to place 64 inner pages of a book on one printing sheet. For private use you could want to zigzag-fold an A4 sheet as a brochure that fits nicely in a business envelope. You could make two pages with three columns each, or you could make six pages and impose them.<br />
<br />
Another "style" of imposition is to place several identical templates on one sheet, e.g. labels.<br />
<br />
==What can ConTeXt do for me?==<br />
<br />
ConTeXt has some built-in imposition schemas (see "arranging pages" in the manual):<br />
<br />
* 2UP<br />
* 2DOWN<br />
* 2SIDE : 2 pages per form, side by side in pagination order (no real imposition, only paper saving)<br />
* 2*2 : 2 pages per form, for single sheets with front and back<br />
* 2**2 : 2 pages per form, for book ordering<br />
* 2*4 : 4 pages per form, 2x2 pages head to head<br />
* 2*8<br />
* 2*16<br />
* XY ''(not mentioned in the manual)'' : you can control the number with [[cmd:setuppaper|\setuppaper]][nx=...,ny=...,dx=...,dy=...]<br />
<br />
"form" means "one side of a sheet".<br />
<br />
You can access this feature via<br />
* <cmd>setuparranging</cmd><br />
* <tt>texexec --pdfarrange=...</tt><br />
* [http://www.ntg.nl:8061/impose.pdf online interface]<br />
<br />
{{todo|some graphical examples}}<br />
<br />
==More==<br />
<br />
Hraban needed a "3SIDE" schema to fit three "filius" planner pages on one A4 sheet. Willi wrote it:<br />
<texcode><br />
\unprotect<br />
% New page imposition scheme 3SIDE by Willi Egger 2003-07-21<br />
<br />
\installpagearrangement 3SIDE<br />
{\dosetuparrangement{3}{1}{6}{4}{2}%<br />
\pusharrangedpageTHREESIDE\poparrangedpagesAB\relax}<br />
<br />
\def\pusharrangedpageTHREESIDE#1% Willi's approach<br />
{\doglobal\increment\arrangedpageN<br />
\reportarrangedpage\arrangedpageN<br />
\ifcase\arrangedpageN<br />
\or \handlearrangedpageXandY{#1}000\arrangedpageA % 1<br />
\or \handlearrangedpageXandY{#1}010\arrangedpageA % 2<br />
\or \handlearrangedpageXandY{#1}020\arrangedpageA % 3<br />
\or \handlearrangedpageXandY{#1}000\arrangedpageB % 4<br />
\or \handlearrangedpageXandY{#1}010\arrangedpageB % 5<br />
\or \handlearrangedpageXandY{#1}020\arrangedpageB % 6<br />
\poparrangedpages<br />
\fi}<br />
<br />
\protect<br />
</texcode><br />
You can use this code simply in your environment file. The other schemas are in <tt>page-imp.tex</tt>.<br />
<br />
Use it like this:<br />
<texcode><br />
\definepapersize [filius][width=92mm, height=172mm]<br />
\setuppapersize [filius][A4,landscape]<br />
\setuparranging [3SIDE]<br />
\setuplayout [location=middle,<br />
alternative=singlesided,<br />
grid=no, marking=on,<br />
leftmargin=10mm, leftmargindistance=0mm,<br />
topspace=2mm, header=4mm, footer=0mm,<br />
width=77mm, height=166mm]<br />
</texcode><br />
<br />
<br />
ConTeXt is also handy when you need to '''rearrange an existing pdf''' into a booklet. This is a trial-and-error solution by Mari for rearranging an A4 pdf file into 2*8 spreads on A3 sheet (-> A6 pages when printed and cut). The texexec.tex file that was created by the first tries with <tt>texexec --pdfarrange</tt> (which didn't seem to have enough options) was a great help while working towards this solution.<br />
Not sure about the margins on the final A6 pages (the original has equal left and right margins, some extra inside margin might be a good thing), but at least otherwise this seems to do the trick:<br />
<br />
<texcode><br />
\setuppapersize[A6][A3] %individual page A6 size, print size A3<br />
\setuparranging[2*8,rotated] %makes an 8 page gathering when folded (duplex printing!)<br />
\setupoutput[pdf]<br />
\setuplayout<br />
[backspace=0pt,<br />
topspace=0pt,<br />
width=middle,<br />
height=middle,<br />
location=middle,<br />
header=0pt,<br />
footer=0pt]<br />
\setuppagenumbering[alternative=doublesided]<br />
<br />
\starttext<br />
<br />
\insertpages<br />
[original_file.pdf][width=0pt]<br />
<br />
\stoptext<br />
<br />
</texcode><br />
<br />
== Cut marks ==<br />
<br />
ConTeXt also allows to place cut marks. This can be controlled using the <tt>marking</tt> option of [[cmd:setuplayout|\setuplayout]]; possible values are:<br />
<br />
* '''on''' show cut marks and page number<br />
* '''screen''' ditto, but also print a grey-scale colour bar<br />
* '''colour''' ditto, but also print a colour bar<br />
* '''text''' print a text, defaults to `empty`<br />
<br />
The default settings are<br />
<br />
<texcode><br />
\def\pagecutmarksymbol {\the\realpageno}<br />
\def\pagecutmarklength {.5cm}<br />
\let\pagecutmarktoptext \empty<br />
\let\pagecutmarkbottomtext \empty<br />
</texcode><br />
<br />
To obtain register marks (or also called registration marks) you can use the small [http://archive.contextgarden.net/message/20070417.212628.76134ff7.en.html <tt>crop</tt> module] which was posted to the mailing list.</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Scaling_Rotating_Mirroring_Clipping&diff=7477Scaling Rotating Mirroring Clipping2007-03-20T12:19:43Z<p>134.95.66.63: /* \crop */ Add reference to \clip</p>
<hr />
<div>In [http://source.contextgarden.net/tex/context/base/core-mis.tex core-mis.tex] there are some handy command for graphical text manipulation defined.<br />
<br />
== \scale ==<br />
<br />
You can insert symbols at a reduced size in the text flow. This example creates a filled square scaled to .5 ex height<br />
<br />
<texcode><br />
\definefontsynonym[Dingbats][uzdr]<br />
\definesymbol[filledSq][\getglyph{Dingbats}{\char110}]<br />
\def\FilledSquare%<br />
{\dontleavehmode\scale[height=0.5ex]{\symbol[filledSq]}}<br />
</texcode><br />
<br />
In TeX terms, \scale creates a \hbox. If TeX is in vertical <br />
mode (as it is when \startlines is in effect, because every line<br />
is a paragraph by itself in the mode), then a simple \hbox is <br />
not a good enough hint to make it switch to horizontal (paragraph) <br />
mode. <br />
<br />
Hans then posted a simpler way.<br />
<texcode><br />
\getscaledglyph{.5}{Serif}{a}<br />
</texcode><br />
<br />
{{todo|An explanation and example of the <cmd>\scale</cmd> command.}}<br />
<br />
== \mirror ==<br />
<br />
<texcode><br />
There is a \mirror{\sl mirorred} word in this sentence.<br />
</texcode><br />
<br />
<context><br />
There is a \mirror{\sl mirorred} word in this sentence.<br />
</context><br />
<br />
<code>\mirror</code> makes a <code>\hbox</code> and mirrors the contents. If you want to have a longer paragraph mirrored, you have to make a <code>\vbox</code> manually.<br />
<br />
<texcode><br />
\mirror{\vbox{Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: <br />
once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, `and <br />
what is the use of a book,' thought Alice `without pictures or conversation?'}}<br />
</texcode><br />
<br />
<br />
<context><br />
\mirror{\vbox{Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: <br />
once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, `and <br />
what is the use of a book,' thought Alice `without pictures or conversation?'}}<br />
</context><br />
<br />
== \rotate ==<br />
<br />
You can rotate something by an arbitrary angle by saying something like <br />
<texcode><br />
\rotate[rotation=42]{the ultimate answer}<br />
</texcode>.<br />
<context><br />
\rotate[rotation=42]{the ultimate answer}<br />
</context>.<br />
<br />
The rotation angle and the location (which determines around which point the content is rotated) are optional and can also be set by<br />
<texcode><br />
\setuprotate[rotation=42,location=normal] % normal is the default<br />
\rotate{the ultimate answer}<br />
</texcode><br />
<br />
An example by Hans Hagen showing the influence of <code>location=</code> argument at different angles:<br />
<br />
<texcode><br />
\dostepwiserecurse{0}{359}{45}<br />
{\startlinecorrection[blank]<br />
\hbox<br />
{\expanded{\setuprotate[rotation=\recurselevel]}%<br />
\traceboxplacementtrue<br />
\hbox to .2\hsize{\hss\ruledhbox{\rotate[location=depth] {\ruledhbox{\bfb (depth)}}}}%<br />
\hbox to .2\hsize{\hss\ruledhbox{\rotate[location=fit] {\ruledhbox{\bfb (fit)}}}}%<br />
\hbox to .2\hsize{\hss\ruledhbox{\rotate[location=broad] {\ruledhbox{\bfb (broad)}}}}%<br />
\hbox to .2\hsize{\hss\ruledhbox{\rotate[location=normal]{\ruledhbox{\bfb (normal)}}}}%<br />
\hbox to .2\hsize{\hss\ruledhbox{\rotate[location=high] {\ruledhbox{\bfb (high)}}}}}<br />
\stoplinecorrection}<br />
</texcode><br />
<br />
<context><br />
\setuplayout[location=middle,scale=.5]<br />
\dostepwiserecurse{0}{359}{45}<br />
{\startlinecorrection[blank]<br />
\hbox<br />
{\expanded{\setuprotate[rotation=\recurselevel]}%<br />
\traceboxplacementtrue<br />
\hbox to .2\hsize{\hss\ruledhbox{\rotate[location=depth] {\ruledhbox{\bfb (depth)}}}}%<br />
\hbox to .2\hsize{\hss\ruledhbox{\rotate[location=fit] {\ruledhbox{\bfb (fit)}}}}%<br />
\hbox to .2\hsize{\hss\ruledhbox{\rotate[location=broad] {\ruledhbox{\bfb (broad)}}}}%<br />
\hbox to .2\hsize{\hss\ruledhbox{\rotate[location=normal]{\ruledhbox{\bfb (normal)}}}}%<br />
\hbox to .2\hsize{\hss\ruledhbox{\rotate[location=high] {\ruledhbox{\bfb (high)}}}}}<br />
\stoplinecorrection}<br />
</context><br />
<br />
You can rotate a long paragraph as well.<br />
<br />
{{todo|Some more comments, and an example.}}<br />
<br />
Depending on the usage you will sometimes probably want to include the content of what you wish to rotate into a box. Compare the following two examples:<br />
<br />
<texcode><br />
\setuplayout[width=3cm]<br />
\setuprotate[rotation=180,location=broad]<br />
<br />
a\rotate{e}i\par<br />
a\rotate{\hbox{e}}i<br />
</texcode><br />
<br />
<context><br />
\setuplayout[width=3cm]<br />
\setuprotate[rotation=180,location=broad]<br />
<br />
a\rotate{e}i\par<br />
a\rotate{\hbox{e}}i<br />
</context><br />
<br />
== \crop ==<br />
(Cf. also \clip)<br />
<br />
{{todo|(defined in another file)}}</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Chemistry&diff=7476Chemistry2007-03-20T10:52:38Z<p>134.95.66.63: /* Formulae with chemic module */</p>
<hr />
<div>< [[Math]], [[XML]], [[Graphics]], [[MetaPost]] ><br />
<br />
ConTeXt comes with the extensive chemistry module [[PPCHTeX]] which allows the drawing of chemical structures and the typesetting of reactions.<br />
<br />
[[PPCHTeX]] works with plain TeX, LaTeX and - of course - with ConTeXt.<br />
<br />
* [http://www.pragma-ade.com/ppchtex.htm PPCHTeX (general)] by Pragma<br />
* [http://www.pragma-ade.com/document.htm PPCHTeX documentation] by Pragma<br />
* [http://www.ntg.nl/mailman/listinfo/ntg-ppchtex PPCHTeX mailing list]<br />
* [http://www.ntg.nl/pipermail/ntg-ppchtex/ PPCHTeX mailing list archive]<br />
<br />
Some other PPCHTeX links:<br />
* [http://mitglied.lycos.de/ppchtex/00index.html PPCHTeX structure database]<br />
* [http://www.mit.edu/afs/athena/contrib/tex-contrib/Chem2/ppchtex/doc/fh-ch-en.htm PPCHTeX FAQ] and [http://www.pragma-ade.com/general/faqs/ PPCHTeX FAQ in PDF](rather old)<br />
* [http://www.tug.org/TUGboat/Articles/tb17-1/tb50hage.pdf TUG Boat article on PPCHTeX] by Hans Hagen and A.F Otten<br />
<br />
Some other links about chemistry in ConTeXt:<br />
* [[Chromatograms]] macro<br />
* [[manual:xchemml-p.pdf|ChemML]] ([[manual:xchemml-s.pdf|screen]]), [[MathML]] extension for chemistry<br />
<br />
=== Formulae with chemic module ===<br />
<br />
<texcode> <br />
\usemodule[chemic]<br />
\chemical{HSO_4^{-}}<br />
</texcode><br />
<br />
<context> <br />
\usemodule[chemic]<br />
\chemical{HSO_4^{-}}<br />
</context><br />
<br />
* It can also be used to typeset chemical ''reactions''<br />
<br />
<texcode><br />
\usemodule[chemic]<br />
\startformula<br />
\chemical{2H_2,+,O_2,->,2H_2O}<br />
\stopformula<br />
</texcode><br />
<br />
<br />
<context><br />
\usemodule[chemic]<br />
\startformula<br />
\chemical{2H_2,+,O_2,->,2H_2O}<br />
\stopformula<br />
</context><br />
<br />
=== Simple Formulae in Text Mode ===<br />
<br />
An alternative to using the chemistry module or mathmode for typesetting simple formulae are the three ConTeXt commands <cmd>high</cmd>, <cmd>low</cmd> and <cmd>lohi</cmd>. This might be useful if you want to typset the formula with the same font as the surrounding text (in titles or slanted fonts, although that might not be desired in all situations).<br />
<br />
<texcode><br />
\ss H\low{2}O also consists of H\high{+} and OH\high{--}.<br />
There are two main carbon isotopes: \lohi{6}{12}C and \lohi[left]{6}{13}C.<br />
</texcode><br />
<br />
<context><br />
\ss H\low{2}O also consists of H\high{+} and OH\high{--}.\crlf<br />
There are two main carbon isotopes: \lohi{6}{12}C and \lohi[left]{6}{13}C.<br />
</context><br />
<br />
Taco's macros implement this approach [http://archive.contextgarden.net/thread/20060702.084423.a201a280.en.html]:<br />
<br />
<texcode><br />
\newbox\chemlowbox<br />
\def\chemlow#1%<br />
{\setbox\chemlowbox\hbox{{\switchtobodyfont[small]#1}}}<br />
<br />
\def\chemhigh#1%<br />
{\ifvoid\chemlowbox \high{{\switchtobodyfont[small]#1}}%<br />
\else \/\lohi{\box\chemlowbox}{{\switchtobodyfont[small]#1}}\fi }<br />
<br />
\def\finishchem%<br />
{\ifvoid\chemlowbox \else<br />
\iffluor \fluorfalse \kern-.1em \fi\low{\box\chemlowbox}\fi}<br />
<br />
% for "kerning" after F<br />
\newif\iffluor<br />
<br />
\unexpanded\def\molecule%<br />
{\bgroup<br />
\catcode`\_=\active \uccode`\~=`\_ \uppercase{\let~\chemlow}%<br />
\catcode`\^=\active \uccode`\~=`\^ \uppercase{\let~\chemhigh}%<br />
\dostepwiserecurse {65}{90}{1}<br />
{\catcode \recurselevel = \active<br />
\uccode`\~=\recurselevel<br />
\uppercase{\edef~{\noexpand\finishchem<br />
\rawcharacter{\recurselevel}}}}%<br />
\uccode `\~=`\F \uppercase{\def~{\finishchem F\fluortrue}}%<br />
\catcode`\-=\active \uccode`\~=`\- \uppercase{\def~{--}}%<br />
\loggingall<br />
\domolecule }%<br />
<br />
\def\domolecule#1%<br />
{\expandafter\scantokens\expandafter<br />
{\detokenize{#1\finishchem}}\egroup}<br />
</texcode><br />
<br />
<texcode><br />
\bs Bold slanted molecules: \molecule{HSO_4^-} and \molecule{SF_6}<br />
</texcode><br />
<br />
<context><br />
\newbox\chemlowbox<br />
\def\chemlow#1%<br />
{\setbox\chemlowbox\hbox{{\switchtobodyfont[small]#1}}}<br />
<br />
\def\chemhigh#1%<br />
{\ifvoid\chemlowbox \high{{\switchtobodyfont[small]#1}}%<br />
\else \/\lohi{\box\chemlowbox}{{\switchtobodyfont[small]#1}}\fi }<br />
<br />
\def\finishchem%<br />
{\ifvoid\chemlowbox \else<br />
\iffluor \fluorfalse \kern-.1em \fi\low{\box\chemlowbox}\fi}<br />
<br />
% for "kerning" after F<br />
\newif\iffluor<br />
<br />
\unexpanded\def\molecule%<br />
{\bgroup<br />
\catcode`\_=\active \uccode`\~=`\_ \uppercase{\let~\chemlow}%<br />
\catcode`\^=\active \uccode`\~=`\^ \uppercase{\let~\chemhigh}%<br />
\dostepwiserecurse {65}{90}{1}<br />
{\catcode \recurselevel = \active<br />
\uccode`\~=\recurselevel<br />
\uppercase{\edef~{\noexpand\finishchem<br />
\rawcharacter{\recurselevel}}}}%<br />
\uccode `\~=`\F \uppercase{\def~{\finishchem F\fluortrue}}%<br />
\catcode`\-=\active \uccode`\~=`\- \uppercase{\def~{--}}%<br />
\loggingall<br />
\domolecule }%<br />
<br />
\def\domolecule#1%<br />
{\expandafter\scantokens\expandafter<br />
{\detokenize{#1\finishchem}}\egroup}<br />
<br />
{\bsx Bold slanted molecules: \molecule{HSO_4^-} and \molecule{SF_6}}<br />
<br />
</context><br />
<br />
The main difference with the official chemic module is that the <code>\modlecule</code> from this example uses the same font as the one in surrounding text, while the official module always uses roman font (which is probably the proper way if you're writing dozens of formulas). Hans's module is also more powerful (can do much more trickery than a simple conversion of subscripts and superscripts). See the manuals listed above.<br />
<br />
[[Category:Graphics]]<br />
[[Category:Chemistry]]</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Chemistry&diff=7473Chemistry2007-03-20T09:47:12Z<p>134.95.66.63: /* Formulae with chemic module */</p>
<hr />
<div>< [[Math]], [[XML]], [[Graphics]], [[MetaPost]] ><br />
<br />
ConTeXt comes with the extensive chemistry module [[PPCHTeX]] which allows the drawing of chemical structures and the typesetting of reactions.<br />
<br />
[[PPCHTeX]] works with plain TeX, LaTeX and - of course - with ConTeXt.<br />
<br />
* [http://www.pragma-ade.com/ppchtex.htm PPCHTeX (general)] by Pragma<br />
* [http://www.pragma-ade.com/document.htm PPCHTeX documentation] by Pragma<br />
* [http://www.ntg.nl/mailman/listinfo/ntg-ppchtex PPCHTeX mailing list]<br />
* [http://www.ntg.nl/pipermail/ntg-ppchtex/ PPCHTeX mailing list archive]<br />
<br />
Some other PPCHTeX links:<br />
* [http://mitglied.lycos.de/ppchtex/00index.html PPCHTeX structure database]<br />
* [http://www.mit.edu/afs/athena/contrib/tex-contrib/Chem2/ppchtex/doc/fh-ch-en.htm PPCHTeX FAQ] and [http://www.pragma-ade.com/general/faqs/ PPCHTeX FAQ in PDF](rather old)<br />
* [http://www.tug.org/TUGboat/Articles/tb17-1/tb50hage.pdf TUG Boat article on PPCHTeX] by Hans Hagen and A.F Otten<br />
<br />
Some other links about chemistry in ConTeXt:<br />
* [[Chromatograms]] macro<br />
* [[manual:xchemml-p.pdf|ChemML]] ([[manual:xchemml-s.pdf|screen]]), [[MathML]] extension for chemistry<br />
<br />
=== Formulae with chemic module ===<br />
<br />
<texcode><br />
\usemodule[chemic]<br />
\chemical{HSO_4^{-}}<br />
</texcode><br />
<br />
<context><br />
\usemodule[chemic]<br />
\chemical{HSO_4^{-}}<br />
</context><br />
<br />
* It can also be used to typeset chemical ''reactions''<br />
<br />
<texcode><br />
\usemodule[chemic]<br />
\startformula<br />
\chemical{2H_2,+,O_2,->,2H_2O}<br />
\stopformula<br />
</texcode><br />
<br />
<br />
<context><br />
\usemodule[chemic]<br />
\startformula<br />
\chemical{2H_2,+,O_2,->,2H_2O}<br />
\stopformula<br />
</context><br />
<br />
=== Simple Formulae in Text Mode ===<br />
<br />
An alternative to using the chemistry module or mathmode for typesetting simple formulae are the three ConTeXt commands <cmd>high</cmd>, <cmd>low</cmd> and <cmd>lohi</cmd>. This might be useful if you want to typset the formula with the same font as the surrounding text (in titles or slanted fonts, although that might not be desired in all situations).<br />
<br />
<texcode><br />
\ss H\low{2}O also consists of H\high{+} and OH\high{--}.<br />
There are two main carbon isotopes: \lohi{6}{12}C and \lohi[left]{6}{13}C.<br />
</texcode><br />
<br />
<context><br />
\ss H\low{2}O also consists of H\high{+} and OH\high{--}.\crlf<br />
There are two main carbon isotopes: \lohi{6}{12}C and \lohi[left]{6}{13}C.<br />
</context><br />
<br />
Taco's macros implement this approach [http://archive.contextgarden.net/thread/20060702.084423.a201a280.en.html]:<br />
<br />
<texcode><br />
\newbox\chemlowbox<br />
\def\chemlow#1%<br />
{\setbox\chemlowbox\hbox{{\switchtobodyfont[small]#1}}}<br />
<br />
\def\chemhigh#1%<br />
{\ifvoid\chemlowbox \high{{\switchtobodyfont[small]#1}}%<br />
\else \/\lohi{\box\chemlowbox}{{\switchtobodyfont[small]#1}}\fi }<br />
<br />
\def\finishchem%<br />
{\ifvoid\chemlowbox \else<br />
\iffluor \fluorfalse \kern-.1em \fi\low{\box\chemlowbox}\fi}<br />
<br />
% for "kerning" after F<br />
\newif\iffluor<br />
<br />
\unexpanded\def\molecule%<br />
{\bgroup<br />
\catcode`\_=\active \uccode`\~=`\_ \uppercase{\let~\chemlow}%<br />
\catcode`\^=\active \uccode`\~=`\^ \uppercase{\let~\chemhigh}%<br />
\dostepwiserecurse {65}{90}{1}<br />
{\catcode \recurselevel = \active<br />
\uccode`\~=\recurselevel<br />
\uppercase{\edef~{\noexpand\finishchem<br />
\rawcharacter{\recurselevel}}}}%<br />
\uccode `\~=`\F \uppercase{\def~{\finishchem F\fluortrue}}%<br />
\catcode`\-=\active \uccode`\~=`\- \uppercase{\def~{--}}%<br />
\loggingall<br />
\domolecule }%<br />
<br />
\def\domolecule#1%<br />
{\expandafter\scantokens\expandafter<br />
{\detokenize{#1\finishchem}}\egroup}<br />
</texcode><br />
<br />
<texcode><br />
\bs Bold slanted molecules: \molecule{HSO_4^-} and \molecule{SF_6}<br />
</texcode><br />
<br />
<context><br />
\newbox\chemlowbox<br />
\def\chemlow#1%<br />
{\setbox\chemlowbox\hbox{{\switchtobodyfont[small]#1}}}<br />
<br />
\def\chemhigh#1%<br />
{\ifvoid\chemlowbox \high{{\switchtobodyfont[small]#1}}%<br />
\else \/\lohi{\box\chemlowbox}{{\switchtobodyfont[small]#1}}\fi }<br />
<br />
\def\finishchem%<br />
{\ifvoid\chemlowbox \else<br />
\iffluor \fluorfalse \kern-.1em \fi\low{\box\chemlowbox}\fi}<br />
<br />
% for "kerning" after F<br />
\newif\iffluor<br />
<br />
\unexpanded\def\molecule%<br />
{\bgroup<br />
\catcode`\_=\active \uccode`\~=`\_ \uppercase{\let~\chemlow}%<br />
\catcode`\^=\active \uccode`\~=`\^ \uppercase{\let~\chemhigh}%<br />
\dostepwiserecurse {65}{90}{1}<br />
{\catcode \recurselevel = \active<br />
\uccode`\~=\recurselevel<br />
\uppercase{\edef~{\noexpand\finishchem<br />
\rawcharacter{\recurselevel}}}}%<br />
\uccode `\~=`\F \uppercase{\def~{\finishchem F\fluortrue}}%<br />
\catcode`\-=\active \uccode`\~=`\- \uppercase{\def~{--}}%<br />
\loggingall<br />
\domolecule }%<br />
<br />
\def\domolecule#1%<br />
{\expandafter\scantokens\expandafter<br />
{\detokenize{#1\finishchem}}\egroup}<br />
<br />
{\bsx Bold slanted molecules: \molecule{HSO_4^-} and \molecule{SF_6}}<br />
<br />
</context><br />
<br />
The main difference with the official chemic module is that the <code>\modlecule</code> from this example uses the same font as the one in surrounding text, while the official module always uses roman font (which is probably the proper way if you're writing dozens of formulas). Hans's module is also more powerful (can do much more trickery than a simple conversion of subscripts and superscripts). See the manuals listed above.<br />
<br />
[[Category:Graphics]]<br />
[[Category:Chemistry]]</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Bibliography_mkii&diff=5671Bibliography mkii2006-05-09T17:44:28Z<p>134.95.66.63: Add tip: \def\onlinecite#1{\cite[left=,right=][#1]}</p>
<hr />
<div>< [[Modules]] | [[User:Taco/Bib]] ><br />
<br />
The '''bib''' module provides the<br />
<cmd>cite</cmd><br />
and <br />
<cmd>placepublications</cmd><br />
commands, in addition to some setup commands, for collecting and referencing bibliography. Single references can be supplied by special commands, or by using BibTeX databases.<br />
<br />
As of [[Context 2005.01.13]], this module is part of the standard distribution,<br />
but the latest version is not yet included. It can be downloaded from the<br />
[[modules:bib]] site (Hans picks up the zip from that location as well, so from now on <br />
the latest version will always be in the modules section).<br />
<br />
== Example of use with bibtex ==<br />
<br />
Bibtex support is not integrated in texexec (yet), so you have to run bibtex by hand.<br />
<br />
Assuming you have saved this bit of code as bibdemo.tex:<br />
<texcode><br />
\usemodule[bib]<br />
\setupbibtex[database=xampl]<br />
\starttext<br />
As \cite[article-full] already indicated, bibtex is a \LaTeX-centric program.<br />
\completepublications<br />
\stoptext<br />
</texcode><br />
<br />
Then you have to run the following three commands:<br />
<pre><br />
texexec --once bibdemo<br />
bibtex bibdemo<br />
texexec bibdemo<br />
</pre><br />
To get the typeset result. (xampl.bib comes with the bibtex distribution, it should be on your harddisk somewhere already)<br />
<br />
== Changing the way you show the publication list ==<br />
<br />
If you use bibtex and you want to change the way you show the publication list you might want to look<br />
at the following example, it will change the publication list showing <br />
the surname in uppercase. <br />
<br />
(Credits go to Taco Hoekwater)<br />
<br />
<texcode><br />
%D Copied from \invertedshortauthor, with an extra \uppercase<br />
%D \type{#1} = firstnames<br />
%D \type{#2} = von<br />
%D \type{#3} = surname<br />
%D \type{#4} = inits<br />
%D \type{#5} = junior<br />
<br />
\unprotect\def\UCauthor#1#2#3#4#5%<br />
{\bibdoif{#2}{#2\bibalternative\c!vonsep}%<br />
\uppercase{#3}\bibalternative\c!surnamesep <br />
\bibdoif{#5}{#5\bibalternative\c!juniorsep}%<br />
\bibdoif{#4}{#4\unskip}}<br />
\protect<br />
</texcode><br />
<br />
After that, you can do:<br />
<texcode><br />
\setuppublicationlist<br />
[artauthor=\UCauthor,<br />
editor=\UCauthor,<br />
author=\UCauthor]<br />
</texcode><br />
<br />
== Other tips ==<br />
<br />
* To refer directly to a reference number (called inline or online cite), you can do <tt>\cite[left=,right=][myRef]</tt> or simply define<br />
<texcode><br />
\def\onlinecite#1{\cite[left=,right=][#1]}<br />
<br />
\onlinecite[myRef]<br />
</texcode><br />
<br />
[[Category:Modules]]</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Enumerations&diff=4607Enumerations2005-12-21T19:48:00Z<p>134.95.66.63: Crossref to Chinese for Chinese number styles in itemize</p>
<hr />
<div>< [[Structurals]]<br />
<br />
The most basic form of using enumerations in ConTeXt is<br />
<br />
<texcode><br />
\startitemize<br />
\item here we list the points,<br />
\item one after the other.<br />
\stopitemize<br />
</texcode><br />
<br />
The <cmd>startitemize</cmd> command takes optional parameters (see the documentation of <cmd>startitemgroup</cmd> for a complete list), for example a number conversion may be given, with the following predefined types:<br />
<br />
<table><br />
<tr><td><tt>n</tt> or <tt>N</tt></td><td>Usually the default: a numbered list</td></tr><br />
<tr><td><tt>m</tt></td><td>A numbered list, with lowercase (&ldquo;medieval&rdquo;, aka &ldquo;oldstyle&rdquo;) numbers.</td></tr><br />
<tr><td><tt>1</tt> &hellip; <tt>8</tt></td><td>Different kinds of bullets. All items get the same symbol.</td></tr><br />
<tr><td><tt>a</tt></td><td>Items are numbered a., b., c., &hellip;</td></tr><br />
<tr><td><tt>A</tt></td><td>Items are numbered A., B., C., &hellip;</td></tr><br />
<tr><td><tt>AK</tt></td><td>Items are numbered A., B., C., &hellip;, in small caps.</td></tr><br />
<tr><td><tt>r</tt></td><td>Items are numbered in lowercase Roman numerals.</td></tr><br />
<tr><td><tt>R</tt></td><td>Items are numbered in uppercase Roman numerals.</td></tr><br />
<tr><td><tt>KR</tt></td><td>Items are numbered in uppercase Roman numerals, small caps style.</td></tr><br />
</table><br />
<br />
It is also possible to define your own number conversions; see [[User-Defined Enumerations]]. If you have loaded the [[Chinese]] module, you can also use <tt>c</tt> (and some more) for Chinese numbers.<br />
<br />
Additional parameters include<br />
* <tt>continue</tt> (start where the previous itemization was finished, to allow text injections),<br />
* <tt>packed</tt> (less vertical space between items), and<br />
* <tt>inmargin</tt> (place enumeration symbols into the margin).<br />
<br />
To change the general layout of enumerations, there is <cmd>setupitemize</cmd>. It accepts an integer as its first parameter to denote for which level of itemization the subsequent settings should apply. There is an example below.<br />
<br />
For finer control, it is advisable to create new types of itemization, using the command <cmd>defineitemgroup</cmd> (which unfortunately seems undocumented). For example, something similar to the LaTeX <tt>itemize</tt> environment can be defined as follows:<br />
<br />
<texcode><br />
\defineitemgroup[ltxitm][levels=5]<br />
%<br />
\setupitemgroup[ltxitm][1][1]<br />
\setupitemgroup[ltxitm][2][2]<br />
\setupitemgroup[ltxitm][3][3,packed]<br />
\setupitemgroup[ltxitm][4][4,packed]<br />
\setupitemgroup[ltxitm][5][5,packed]<br />
%<br />
\starttext<br />
%<br />
\startltxitm<br />
\item Consider<br />
\startltxitm<br />
\item this part<br />
\item and also these subpoints:<br />
\startltxitm<br />
\item one<br />
\item two<br />
\item three<br />
\startltxitm<br />
\item threeandahalf<br />
\stopltxitm<br />
\item four<br />
\stopltxitm<br />
\stopltxitm<br />
\stopltxitm<br />
%<br />
\stoptext<br />
</texcode><br />
<br />
gives<br />
<br />
<context><br />
\defineitemgroup[ltxitm][levels=5]<br />
%<br />
\setupitemgroup[ltxitm][1][1]<br />
\setupitemgroup[ltxitm][2][2]<br />
\setupitemgroup[ltxitm][3][3,packed]<br />
\setupitemgroup[ltxitm][4][4,packed]<br />
\setupitemgroup[ltxitm][5][5,packed]<br />
%<br />
\starttext<br />
%<br />
\startltxitm<br />
\item Consider<br />
\startltxitm<br />
\item this part<br />
\item and also these subpoints:<br />
\startltxitm<br />
\item one<br />
\item two<br />
\item three<br />
\startltxitm<br />
\item threeandahalf<br />
\stopltxitm<br />
\item four<br />
\stopltxitm<br />
\stopltxitm<br />
\stopltxitm<br />
%<br />
\stoptext<br />
</context><br />
<br />
==Changing the Signs==<br />
<br />
For a enumeration like this:<br />
<br />
<context><br />
\starttext<br />
\setupitemize[left=(, right=), margin=4em, stopper=]<br />
\startitemize[a, packed]<br />
\item one item,<br />
\item next item.<br />
\stopitemize<br />
\stoptext<br />
</context><br />
<br />
you must fill <cmd>setupitemize</cmd> like this:<br />
<br />
* you get parentheses by <tt>left=(, right=)</tt><br />
* <tt>margin</tt> is from left margin to start of item text<br />
* <tt>stopper</tt> is the dot (or whatever) after the "number"<br />
<br />
<texcode><br />
\setupitemize[left=(, right=), margin=4em, stopper=]<br />
\startitemize[a]<br />
\item one item,<br />
\item next item.<br />
\stopitemize<br />
</texcode><br />
<br />
You find more about <cmd>setupitemize</cmd> at <cmd>defineitemgroup</cmd>.<br />
<br />
<br />
==Alternate Multicolumn Format==<br />
Hans posted a solution to the list for a multicolumn enumeration that counts across then down, instead of down then across. When he posted it (Dec 21, 2005), he said the joinedup option does not work, but he would fix that. This is a version without the tufte and zapf text<br />
<br />
<texcode><br />
\starttext<br />
<br />
Some previous sentence before the list<br />
<br />
\startitemize[columns,n,joinedup]<br />
\item one<br />
\item two<br />
\stopitemize<br />
\startitemize[continue,columns,joinedup]<br />
\item one<br />
\item two<br />
\stopitemize<br />
\startitemize[continue,columns,joinedup]<br />
\item one<br />
\item two<br />
\stopitemize<br />
<br />
And the text continues after the list<br />
<br />
\stoptext<br />
</texcode><br />
<br />
<context><br />
\starttext<br />
<br />
Some previous sentence before the list<br />
<br />
\startitemize[columns,n,joinedup]<br />
\item one<br />
\item two<br />
\stopitemize<br />
\startitemize[continue,columns,joinedup]<br />
\item one<br />
\item two<br />
\stopitemize<br />
\startitemize[continue,columns,joinedup]<br />
\item one<br />
\item two<br />
\stopitemize<br />
<br />
And the text continues after the list<br />
<br />
\stoptext<br />
<br />
</context></div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Chinese_Japanese_and_Korean&diff=4601Chinese Japanese and Korean2005-12-20T19:10:38Z<p>134.95.66.63: fix Typo</p>
<hr />
<div>< [[Fonts]] | [[Encodings and Regimes]] ><br />
<br />
* old introduction [[Uptodate]] by Pragma: [http://www.pragma-ade.com/general/uptodate/up-007-s.pdf screen] and [http://www.pragma-ade.com/general/uptodate/up-007-p.pdf paper] version<br />
* manual by Pragma: [http://www.pragma-ade.com/general/manuals/mchinese.pdf Chinese in ConTeXt]<br />
<br />
=Chinese in ConTeXt (ConTeXt 2005.12.19 and newer)=<br />
<br />
If you have [[Context 2005.12.19]], you only have to get the fonts.<br />
<br />
# You need some Chinese (TrueType) fonts; you may want to get [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htfs.ttf FangSong], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/hthei.ttf HeiTi], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htkai.ttf KaiTi] and [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htsong.ttf SongTi]. Put those e.g. into $TEXMF/fonts/truetype/chinese/.<br />
# Use Hans Hagen's experimental [http://www.physik.fu-berlin.de/~tburnus/ttf2uni.rb ttf2uni.rb] script to create .map, .tmf and .enc files. You can then put the files e.g. to $TEXMF/fonts/tfm/chinese/ (*.tmf files), $TEXMF/fonts/enc/chinese/ (*.enc files, they are basically the same for all fonts) and to $TEXMF/fonts/map/chinese/.<br />
# You may now need to update the hash TeX uses to find the files; using teTeX this is done by running <tt>texhash</tt>.<br />
# How you can run your Hello World program:<br />
<texcode><br />
\enableregime[utf]<br />
\usemodule[chi-00]<br />
\starttext<br />
你好!<br />
\stoptext<br />
</texcode><br />
<br />
If you want to typset vertical text, use <tt>\startvertical ... \stopvertical</tt>, if you want to use Chinese numbers, you can use e.g. <tt>\startitemize[c]</tt>; possible options are <tt>c</tt> or <tt>cn</tt> for normal Chinese numbers (一, 二, 三, 四, 无, 六 etc.), <tt>cc</tt> for the capitalized (or financial) Chinese numbers (壹, 貳, 叄 etc.), <tt>ec</tt> for an extended version which uses 廿 and 卅 (instead of 一十 and 二十), and <tt>ac</tt> for using the Chinese numbers zero (零, 〇) to nine (九) in the same way one does with the Arabic digits 0 to 9.<br />
<br />
<br />
=Chinese in ConTeXt (before 2005.12.19)=<br />
[[User:Xiaojf|Xiao Jianfeng]] wrote in a [http://archive.contextgarden.net/message/20050606.080842.5e1c2057.en.html mail to the mailing list on 2005-06-06]:<br />
<br />
Here is my way of Chinese setup in ConTeXt. I hope this can be of any help to some newbies like me who have problems in processing Chinese.<br />
<br />
# Get the truetype fonts <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htfs.ttf htfs.ttf], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/hthei.ttf hthei.ttf], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htkai.ttf htkai.ttf]</tt> and <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htsong.ttf htsong.ttf]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/<br />
# Get corresponding tfm files <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbfs.zip gbfs.zip], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbhei.zip gbhei.zip], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbkai.zip gbkai.zip]</tt> and <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbsong.zip gbsong.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/<br />
# Get the enc file <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/Gbk.zip Gbk.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/<br />
# Get the map file <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/map.zip map.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/<br />
# Put the ttf font files you got in step 1 to <tt>texmf-fonts/fonts/truetype/chinese</tt><br />
# Unzip the files you got in step 2 and you get four corresponding directories (which contain tfm files), then put them in <tt>texmf-fonts/fonts/tfm/chinese</tt><br />
# Unzip <tt>Gbk.zip</tt>, you will get a directory named <tt>Gbk</tt> which contains many enc files. Put the directory to <tt>texmf-fonts/fonts/enc/chinese</tt><br />
# Unzip <tt>map.zip</tt>, you will get many map files, you need just the <tt>gbk.map</tt>. You need to edit <tt>gbk.map</tt>, delete entries of gbli* at the end of the file (lines 505-629). Then, put the modified <tt>gbk.map</tt> to <tt>texmf-fonts/fonts/map/chinese</tt>. Note that newer pdfetex don't read [[pdftex.cfg]] so better use <cmd>loadmapfile[gbk]</cmd> in your document.<br />
# Your document should be compilable now. See sample below.<br />
# I haven't tried to compile Traditional Chinese documents. Maybe just get corresponding files for Traditional Chinese and put there to the right location will work. I'm not sure.<br />
<br />
Sample Code (save in cp936 encoding):<br />
<texcode><br />
\loadmapfile[gbk]<br />
\usemodule[chinese]<br />
\setuppagenumbering[state=stop]<br />
\starttext<br />
\tfd<br />
这里什么饮料也没有真不像话!<br />
\stoptext<br />
</texcode><br />
<br />
If you want to use UTF-8, the [http://www.ntg.nl/pipermail/ntg-context/2005/013542.html script by Lutz Haseloff] might of interest to you; the needed perl module Encode::HanConvert is [http://search.cpan.org/dist/Encode-HanConvert/ available at CPAN]. Note, however, that you may only use characters representable in gbk, German umlauts for instance are converted into ??.<br />
[[Category:Fonts]]<br />
[[Category:International]]</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Chinese_Japanese_and_Korean&diff=4600Chinese Japanese and Korean2005-12-20T19:01:59Z<p>134.95.66.63: Add more regarding the numbers.</p>
<hr />
<div>< [[Fonts]] | [[Encodings and Regimes]] ><br />
<br />
* old introduction [[Uptodate]] by Pragma: [http://www.pragma-ade.com/general/uptodate/up-007-s.pdf screen] and [http://www.pragma-ade.com/general/uptodate/up-007-p.pdf paper] version<br />
* manual by Pragma: [http://www.pragma-ade.com/general/manuals/mchinese.pdf Chinese in ConTeXt]<br />
<br />
=Chinese in ConTeXt (ConTeXt 2005.12.19 and newer)=<br />
<br />
If you have [[Context 2005.12.19]], you only have to get the fonts.<br />
<br />
# You need some Chinese (TrueType) fonts; you may want to get [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htfs.ttf FangSong], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/hthei.ttf HeiTi], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htkai.ttf KaiTi] and [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htsong.ttf SongTi]. Put those e.g. into $TEXMF/fonts/truetype/chinese/.<br />
# Use Hans Hagen's experimental [[http://www.physik.fu-berlin.de/~tburnus/ttf2uni.rb ttf2uni.rb]] script to create .map, .tmf and .enc files. You can then put the files e.g. to $TEXMF/fonts/tfm/chinese/ (*.tmf files), $TEXMF/fonts/enc/chinese/ (*.enc files, they are basically the same for all fonts) and to $TEXMF/fonts/map/chinese/.<br />
# You may now need to update the hash TeX uses to find the files; using teTeX this is done by running <tt>texhash</tt>.<br />
# How you can run your Hello World program:<br />
<texcode><br />
\enableregime[utf]<br />
\usemodule[chi-00]<br />
\starttext<br />
你好!<br />
\stoptext<br />
</texcode><br />
<br />
If you want to typset vertical text, use <tt>\startvertical ... \stopvertical</tt>, if you want to use Chinese numbers, you can use e.g. <tt>\startitemize[c]</tt>; possible options are <tt>c</tt> or <tt>cn</tt> for normal Chinese numbers (一, 二, 三, 四, 无, 六 etc.), <tt>cc</tt> for the capitalized (or financial) Chinese numbers (壹, 貳, 叄 etc.), <tt>ec</tt> for an extended version which uses 廿 and 卅 (instead of 一十 and 二十), and <tt>ac</tt> for using the Chinese numbers zero (零, 〇) to nine (九) in the same way one does with the Arabical digits 0 to 9.<br />
<br />
<br />
=Chinese in ConTeXt (before 2005.12.19)=<br />
[[User:Xiaojf|Xiao Jianfeng]] wrote in a [http://archive.contextgarden.net/message/20050606.080842.5e1c2057.en.html mail to the mailing list on 2005-06-06]:<br />
<br />
Here is my way of Chinese setup in ConTeXt. I hope this can be of any help to some newbies like me who have problems in processing Chinese.<br />
<br />
# Get the truetype fonts <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htfs.ttf htfs.ttf], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/hthei.ttf hthei.ttf], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htkai.ttf htkai.ttf]</tt> and <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htsong.ttf htsong.ttf]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/<br />
# Get corresponding tfm files <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbfs.zip gbfs.zip], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbhei.zip gbhei.zip], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbkai.zip gbkai.zip]</tt> and <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbsong.zip gbsong.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/<br />
# Get the enc file <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/Gbk.zip Gbk.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/<br />
# Get the map file <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/map.zip map.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/<br />
# Put the ttf font files you got in step 1 to <tt>texmf-fonts/fonts/truetype/chinese</tt><br />
# Unzip the files you got in step 2 and you get four corresponding directories (which contain tfm files), then put them in <tt>texmf-fonts/fonts/tfm/chinese</tt><br />
# Unzip <tt>Gbk.zip</tt>, you will get a directory named <tt>Gbk</tt> which contains many enc files. Put the directory to <tt>texmf-fonts/fonts/enc/chinese</tt><br />
# Unzip <tt>map.zip</tt>, you will get many map files, you need just the <tt>gbk.map</tt>. You need to edit <tt>gbk.map</tt>, delete entries of gbli* at the end of the file (lines 505-629). Then, put the modified <tt>gbk.map</tt> to <tt>texmf-fonts/fonts/map/chinese</tt>. Note that newer pdfetex don't read [[pdftex.cfg]] so better use <cmd>loadmapfile[gbk]</cmd> in your document.<br />
# Your document should be compilable now. See sample below.<br />
# I haven't tried to compile Traditional Chinese documents. Maybe just get corresponding files for Traditional Chinese and put there to the right location will work. I'm not sure.<br />
<br />
Sample Code (save in cp936 encoding):<br />
<texcode><br />
\loadmapfile[gbk]<br />
\usemodule[chinese]<br />
\setuppagenumbering[state=stop]<br />
\starttext<br />
\tfd<br />
这里什么饮料也没有真不像话!<br />
\stoptext<br />
</texcode><br />
<br />
If you want to use UTF-8, the [http://www.ntg.nl/pipermail/ntg-context/2005/013542.html script by Lutz Haseloff] might of interest to you; the needed perl module Encode::HanConvert is [http://search.cpan.org/dist/Encode-HanConvert/ available at CPAN]. Note, however, that you may only use characters representable in gbk, German umlauts for instance are converted into ??.<br />
[[Category:Fonts]]<br />
[[Category:International]]</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Chinese_Japanese_and_Korean&diff=4598Chinese Japanese and Korean2005-12-20T18:24:55Z<p>134.95.66.63: New version for ConTeXt >= 2005.12.19</p>
<hr />
<div>< [[Fonts]] | [[Encodings and Regimes]] ><br />
<br />
* old introduction [[Uptodate]] by Pragma: [http://www.pragma-ade.com/general/uptodate/up-007-s.pdf screen] and [http://www.pragma-ade.com/general/uptodate/up-007-p.pdf paper] version<br />
* manual by Pragma: [http://www.pragma-ade.com/general/manuals/mchinese.pdf Chinese in ConTeXt]<br />
<br />
=Chinese in ConTeXt (ConTeXt 2005.12.19 and newer)=<br />
<br />
If you have [[Context 2005.12.19]], you only have to get the fonts.<br />
<br />
# You need some Chinese (TrueType) fonts; you may want to get [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htfs.ttf FangSong], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/hthei.ttf HeiTi], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htkai.ttf KaiTi] and [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htsong.ttf SongTi]. Put those e.g. into $TEXMF/fonts/truetype/chinese/.<br />
# Use Hans Hagen's experimental [[http://www.physik.fu-berlin.de/~tburnus/ttf2uni.rb ttf2uni.rb]] script to create .map, .tmf and .enc files. You can then put the files e.g. to $TEXMF/fonts/tfm/chinese/ (*.tmf files), $TEXMF/fonts/enc/chinese/ (*.enc files, they are basically the same for all fonts) and to $TEXMF/fonts/map/chinese/.<br />
# You may now need to update the hash TeX uses to find the files; using teTeX this is done by running <tt>texhash</tt>.<br />
# How you can run your Hello World program:<br />
<texcode><br />
\enableregime[utf]<br />
\usemodule[chi-00]<br />
\starttext<br />
你好!<br />
\stoptext<br />
</texcode><br />
<br />
If you want to typset vertical text, use <tt>\startvertical ... \stopvertical</tt>, if you want to use Chinese numbers, you can use e.g. <tt>\startitemize[c]</tt>.<br />
<br />
<br />
=Chinese in ConTeXt (before 2005.12.19)=<br />
[[User:Xiaojf|Xiao Jianfeng]] wrote in a [http://archive.contextgarden.net/message/20050606.080842.5e1c2057.en.html mail to the mailing list on 2005-06-06]:<br />
<br />
Here is my way of Chinese setup in ConTeXt. I hope this can be of any help to some newbies like me who have problems in processing Chinese.<br />
<br />
# Get the truetype fonts <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htfs.ttf htfs.ttf], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/hthei.ttf hthei.ttf], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htkai.ttf htkai.ttf]</tt> and <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htsong.ttf htsong.ttf]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/<br />
# Get corresponding tfm files <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbfs.zip gbfs.zip], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbhei.zip gbhei.zip], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbkai.zip gbkai.zip]</tt> and <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbsong.zip gbsong.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/<br />
# Get the enc file <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/Gbk.zip Gbk.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/<br />
# Get the map file <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/map.zip map.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/<br />
# Put the ttf font files you got in step 1 to <tt>texmf-fonts/fonts/truetype/chinese</tt><br />
# Unzip the files you got in step 2 and you get four corresponding directories (which contain tfm files), then put them in <tt>texmf-fonts/fonts/tfm/chinese</tt><br />
# Unzip <tt>Gbk.zip</tt>, you will get a directory named <tt>Gbk</tt> which contains many enc files. Put the directory to <tt>texmf-fonts/fonts/enc/chinese</tt><br />
# Unzip <tt>map.zip</tt>, you will get many map files, you need just the <tt>gbk.map</tt>. You need to edit <tt>gbk.map</tt>, delete entries of gbli* at the end of the file (lines 505-629). Then, put the modified <tt>gbk.map</tt> to <tt>texmf-fonts/fonts/map/chinese</tt>. Note that newer pdfetex don't read [[pdftex.cfg]] so better use <cmd>loadmapfile[gbk]</cmd> in your document.<br />
# Your document should be compilable now. See sample below.<br />
# I haven't tried to compile Traditional Chinese documents. Maybe just get corresponding files for Traditional Chinese and put there to the right location will work. I'm not sure.<br />
<br />
Sample Code (save in cp936 encoding):<br />
<texcode><br />
\loadmapfile[gbk]<br />
\usemodule[chinese]<br />
\setuppagenumbering[state=stop]<br />
\starttext<br />
\tfd<br />
这里什么饮料也没有真不像话!<br />
\stoptext<br />
</texcode><br />
<br />
If you want to use UTF-8, the [http://www.ntg.nl/pipermail/ntg-context/2005/013542.html script by Lutz Haseloff] might of interest to you; the needed perl module Encode::HanConvert is [http://search.cpan.org/dist/Encode-HanConvert/ available at CPAN]. Note, however, that you may only use characters representable in gbk, German umlauts for instance are converted into ??.<br />
[[Category:Fonts]]<br />
[[Category:International]]</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Fonts_-_Old_Content&diff=4597Fonts - Old Content2005-12-20T17:51:38Z<p>134.95.66.63: /* Available Free Fonts */ Correct free math-fonts link</p>
<hr />
<div>< [[Visuals]] | [[Symbols]] ><br />
<br />
Font handling in ConTeXt is &ldquo;strange&rdquo; for LaTeX users. It's a system of abstraction and aliases, complex and mighty&nbsp;&hellip; But there's help:<br />
<br />
* [http://homepage.mac.com/atl/tex/ Adam Lindsay's page] focuses on typography (OpenType, Unicode etc.), esp. on MacOS X<br />
* [http://home.salamander.com/~wmcclain/context-help.html Bill McClain's ConTeXt beginners page] has also a lot about fonts<br />
* [http://www.pragma-ade.com/general/manuals/mtexfont.pdf font installation with texfont] by Pragma<br />
* [http://tug.org/pracjourn/2005-2/schmitz/schmitz.pdf Integrating TrueType Fonts into ConTeXt] by Thomas A. Schmitz (PracTeX Journal)<br />
* [http://www.pragma-ade.com/general/manuals/mfonts.pdf ConTeXt's font mechanism in detail] by Pragma<br />
* [http://www.pragma-ade.com/general/manuals/mmakempy.pdf making outlines] by Pragma<br />
* [http://pragma-ade.nl/fonttest.pdf Here] you can try out several TeX fonts online (PDF interface!)<br />
* Troubleshooting: solving [[TeXfont]] problems.<br />
* '''The ConTeXt way of using fonts are [[TypeScripts]].'''<br />
* [[Installing a TrueType font, step by step]]. If you just need to install a TrueType font, this may be what you are looking for.<br />
* [http://dl.contextgarden.net/myway/expertfonts.pdf Installing Expert Fonts: Minion Pro] by Idris Samawi Hamid; contains step-by-step instructions, from preinstallation to writing typescripts<br />
* [[URW Garamond]]<br />
* [[Font Handling Internals]]<br />
* [[Pseudo Small Caps]] by Vit Zyka<br />
<br />
=Basic Hints=<br />
<br />
''Some hints by Taco from the mailing list on 2005-11-20:''<br />
<br />
Q: How up to date or out of date is the information in [http://www.pragma-ade.com/general/manuals/mfonts.pdf mfonts manual]?<br />
<br />
A: It looks like it is still quite up-to-date, but some of the examples it gives may no longer be the very best and latest way of doing things, and possibly there are some new developments that do not get as much attention as desired (like [http://www.pragma-ade.com/general/manuals/mtexfont.pdf texfont], and the issues arising from font map files). Overall, the document appears accurate, though.<br />
<br />
An important thing to remember is this:<br />
<br />
'''ConTeXt does not share font metric conventions with LaTeX.'''<br />
<br />
(at one point it started doing so, like supporting the ''Karl Berry naming scheme'' and the ''PSNFSS'' style font family names, but that has since been abandoned).<br />
<br />
Another important thing is that it also does not share font map files with LaTeX and, specifically,<br />
<br />
'''ConTeXt does not make pdfetex read <tt>pdftex.map</tt>.'''<br />
<br />
(this is at the root of a great many problems reported by users only familiar with PSNFSS)<br />
<br />
The preferred format for metric files in ConTeXt is<br />
<br />
<tt><vendor>/<familyname>/<encoding>-<fontname>.tfm</tt><br />
<br />
for metrics and<br />
<br />
<tt><encoding>-<vendor>-<familyname>.map</tt><br />
<br />
for the mapping files.<br />
<br />
* <fontname> is usually derived from the font source (afm or ttf),<br />
* <encoding> is a 'controlled' list, (see [[Encodings and Regimes]])<br />
* <vendor> and <familyname> are user-supplied (at install time).<br />
<br />
There are ways to trick ConTeXt into using different conventions, but if you do that you are likely to run into trouble.<br />
<br />
=Configuration=<br />
* Using [[psnfss]] metrics in ConTeXt<br />
* Matt Gushee about [http://havenrock.com/textips/bookfonts.html virtual fonts]<br />
* Fonts rely on [[Encodings and Regimes]], and it helps to know what happens underneath the hood, from time to time.<br />
* In newer distributions, map files belong in <tt>&hellip;/fonts/map/pdftex/context</tt>!<br />
* Don't forget to look at [[cont-sys.tex]]!<br />
<br />
= Available Free Fonts =<br />
* [http://www.math.uiuc.edu/~hartke/computer/latex/freefonts.php Free Math Fonts] - overview of different free Math fonts<br />
* [http://greekfontsociety.org/ GFS Didot] - Latin, full set of polytonik Greek, small caps, oldstyle figures, full f-ligatures ([http://modules.contextgarden.net/gfsdidot Module for ConTeXt])<br />
* ''... many more to be added ...''<br />
<br />
=Hints by Language=<br />
* general: [[Encodings and Regimes]]<br />
* [[Arabian and Hebrew]] (Idris? other ArabTeX specialists?)<br />
* [[Chinese]]<br />
* [[Greek]]<br />
* [[Russian]]<br />
* [[Vietnamese]]<br />
<br />
[[Category:Fonts]]</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Fonts_-_Old_Content&diff=4596Fonts - Old Content2005-12-20T17:50:27Z<p>134.95.66.63: /* Available Free Fonts */ Add gfsdidot-module link</p>
<hr />
<div>< [[Visuals]] | [[Symbols]] ><br />
<br />
Font handling in ConTeXt is &ldquo;strange&rdquo; for LaTeX users. It's a system of abstraction and aliases, complex and mighty&nbsp;&hellip; But there's help:<br />
<br />
* [http://homepage.mac.com/atl/tex/ Adam Lindsay's page] focuses on typography (OpenType, Unicode etc.), esp. on MacOS X<br />
* [http://home.salamander.com/~wmcclain/context-help.html Bill McClain's ConTeXt beginners page] has also a lot about fonts<br />
* [http://www.pragma-ade.com/general/manuals/mtexfont.pdf font installation with texfont] by Pragma<br />
* [http://tug.org/pracjourn/2005-2/schmitz/schmitz.pdf Integrating TrueType Fonts into ConTeXt] by Thomas A. Schmitz (PracTeX Journal)<br />
* [http://www.pragma-ade.com/general/manuals/mfonts.pdf ConTeXt's font mechanism in detail] by Pragma<br />
* [http://www.pragma-ade.com/general/manuals/mmakempy.pdf making outlines] by Pragma<br />
* [http://pragma-ade.nl/fonttest.pdf Here] you can try out several TeX fonts online (PDF interface!)<br />
* Troubleshooting: solving [[TeXfont]] problems.<br />
* '''The ConTeXt way of using fonts are [[TypeScripts]].'''<br />
* [[Installing a TrueType font, step by step]]. If you just need to install a TrueType font, this may be what you are looking for.<br />
* [http://dl.contextgarden.net/myway/expertfonts.pdf Installing Expert Fonts: Minion Pro] by Idris Samawi Hamid; contains step-by-step instructions, from preinstallation to writing typescripts<br />
* [[URW Garamond]]<br />
* [[Font Handling Internals]]<br />
* [[Pseudo Small Caps]] by Vit Zyka<br />
<br />
=Basic Hints=<br />
<br />
''Some hints by Taco from the mailing list on 2005-11-20:''<br />
<br />
Q: How up to date or out of date is the information in [http://www.pragma-ade.com/general/manuals/mfonts.pdf mfonts manual]?<br />
<br />
A: It looks like it is still quite up-to-date, but some of the examples it gives may no longer be the very best and latest way of doing things, and possibly there are some new developments that do not get as much attention as desired (like [http://www.pragma-ade.com/general/manuals/mtexfont.pdf texfont], and the issues arising from font map files). Overall, the document appears accurate, though.<br />
<br />
An important thing to remember is this:<br />
<br />
'''ConTeXt does not share font metric conventions with LaTeX.'''<br />
<br />
(at one point it started doing so, like supporting the ''Karl Berry naming scheme'' and the ''PSNFSS'' style font family names, but that has since been abandoned).<br />
<br />
Another important thing is that it also does not share font map files with LaTeX and, specifically,<br />
<br />
'''ConTeXt does not make pdfetex read <tt>pdftex.map</tt>.'''<br />
<br />
(this is at the root of a great many problems reported by users only familiar with PSNFSS)<br />
<br />
The preferred format for metric files in ConTeXt is<br />
<br />
<tt><vendor>/<familyname>/<encoding>-<fontname>.tfm</tt><br />
<br />
for metrics and<br />
<br />
<tt><encoding>-<vendor>-<familyname>.map</tt><br />
<br />
for the mapping files.<br />
<br />
* <fontname> is usually derived from the font source (afm or ttf),<br />
* <encoding> is a 'controlled' list, (see [[Encodings and Regimes]])<br />
* <vendor> and <familyname> are user-supplied (at install time).<br />
<br />
There are ways to trick ConTeXt into using different conventions, but if you do that you are likely to run into trouble.<br />
<br />
=Configuration=<br />
* Using [[psnfss]] metrics in ConTeXt<br />
* Matt Gushee about [http://havenrock.com/textips/bookfonts.html virtual fonts]<br />
* Fonts rely on [[Encodings and Regimes]], and it helps to know what happens underneath the hood, from time to time.<br />
* In newer distributions, map files belong in <tt>&hellip;/fonts/map/pdftex/context</tt>!<br />
* Don't forget to look at [[cont-sys.tex]]!<br />
<br />
= Available Free Fonts =<br />
* [http://www.math.uiuc.edu/~hartke/latex/survey/survey.html Free Math Fonts] - overview of different free Math fonts<br />
* [http://greekfontsociety.org/ GFS Didot] - Latin, full set of polytonik Greek, small caps, oldstyle figures, full f-ligatures ([http://modules.contextgarden.net/gfsdidot Module for ConTeXt])<br />
* ''... many more to be added ...''<br />
<br />
=Hints by Language=<br />
* general: [[Encodings and Regimes]]<br />
* [[Arabian and Hebrew]] (Idris? other ArabTeX specialists?)<br />
* [[Chinese]]<br />
* [[Greek]]<br />
* [[Russian]]<br />
* [[Vietnamese]]<br />
<br />
[[Category:Fonts]]</div>134.95.66.63https://wiki.contextgarden.net/index.php?title=Chinese_Japanese_and_Korean&diff=4595Chinese Japanese and Korean2005-12-20T17:46:05Z<p>134.95.66.63: Note that 2005.12.19 also supports UTF-8 & mention \startvertical; page nees some clean up.</p>
<hr />
<div>< [[Fonts]] | [[Encodings and Regimes]] ><br />
<br />
* old introduction [[Uptodate]] by Pragma: [http://www.pragma-ade.com/general/uptodate/up-007-s.pdf screen] and [http://www.pragma-ade.com/general/uptodate/up-007-p.pdf paper] version<br />
* manual by Pragma: [http://www.pragma-ade.com/general/manuals/mchinese.pdf Chinese in ConTeXt]<br />
<br />
<br />
[[User:Xiaojf|Xiao Jianfeng]] wrote in a [http://archive.contextgarden.net/message/20050606.080842.5e1c2057.en.html mail to the mailing list on 2005-06-06]:<br />
<br />
Here is my way of Chinese setup in ConTeXt. I hope this can be of any help to some newbies like me who have problems in processing Chinese.<br />
<br />
# Get the truetype fonts <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htfs.ttf htfs.ttf], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/hthei.ttf hthei.ttf], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htkai.ttf htkai.ttf]</tt> and <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/htsong.ttf htsong.ttf]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/ttf/<br />
# Get corresponding tfm files <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbfs.zip gbfs.zip], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbhei.zip gbhei.zip], [ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbkai.zip gbkai.zip]</tt> and <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/gbsong.zip gbsong.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/tfm/<br />
# Get the enc file <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/Gbk.zip Gbk.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/<br />
# Get the map file <tt>[ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/map.zip map.zip]</tt> from ftp://ftp.ctex.org/pub/tex/fonts/truetype/for_pdftex/enc_map/<br />
# Put the ttf font files you got in step 1 to <tt>texmf-fonts/fonts/truetype/chinese</tt><br />
# Unzip the files you got in step 2 and you get four corresponding directories (which contain tfm files), then put them in <tt>texmf-fonts/fonts/tfm/chinese</tt><br />
# Unzip <tt>Gbk.zip</tt>, you will get a directory named <tt>Gbk</tt> which contains many enc files. Put the directory to <tt>texmf-fonts/fonts/enc/chinese</tt><br />
# Unzip <tt>map.zip</tt>, you will get many map files, you need just the <tt>gbk.map</tt>. You need to edit <tt>gbk.map</tt>, delete entries of gbli* at the end of the file (lines 505-629). Then, put the modified <tt>gbk.map</tt> to <tt>texmf-fonts/fonts/map/chinese</tt>. Note that newer pdfetex don't read [[pdftex.cfg]] so better use <cmd>loadmapfile[gbk]</cmd> in your document.<br />
# Your document should be compilable now. See sample below.<br />
# I haven't tried to compile Traditional Chinese documents. Maybe just get corresponding files for Traditional Chinese and put there to the right location will work. I'm not sure.<br />
<br />
Sample Code (save in cp936 encoding):<br />
<texcode><br />
\loadmapfile[gbk]<br />
\usemodule[chinese]<br />
\setuppagenumbering[state=stop]<br />
\starttext<br />
\tfd<br />
这里什么饮料也没有真不像话!<br />
\stoptext<br />
</texcode><br />
<br />
If you want to use UTF-8, the [http://www.ntg.nl/pipermail/ntg-context/2005/013542.html script by Lutz Haseloff] might of interest to you; the needed perl module Encode::HanConvert is [http://search.cpan.org/dist/Encode-HanConvert/ available at CPAN]. Note, however, that you may only use characters representable in gbk, German umlauts for instance are converted into ??.<br />
<br />
Starting from [[Context 2005.12.19]] UTF-8 encoded files also work (<tt>\enableregime[utf]</tt>).<br />
<br />
If you want to have the text vertically typeset, use <tt>\startvertical ... \stopvertical</tt>.<br />
[[Category:Fonts]]<br />
[[Category:International]]</div>134.95.66.63