https://wiki.contextgarden.net/api.php?action=feedcontributions&user=Huttarl&feedformat=atomWiki - User contributions [en]2024-03-29T12:52:13ZUser contributionsMediaWiki 1.34.1https://wiki.contextgarden.net/index.php?title=ConTeXt_Standalone&diff=22221ConTeXt Standalone2014-01-08T16:40:56Z<p>Huttarl: fixed formatting problem with backticks</p>
<hr />
<div>The '''ConTeXt suite''' is a complete, up-to-date ConTeXt distribution which can be upgraded efficiently. It can be used to install either the stable or the beta version of ConTeXt. It can also be used in parallel with existing TeX installations such as MikTeX, TeXLive, or older minimal installation. It is aimed towards ConTeXt users, so it does not include LaTeX specific packages and binaries. <br />
<br />
ConTeXt develops at a fast pace, and sometimes beta releases have serious bugs. ConTeXt suite allows you to test the latest ConTeXt release without having to worry if an upgrade will mess an critical project. You can have two (or multiple) parallel ConTeXt suites, and freeze one for your critical projects, and use the other one for experimenting.<br />
<br />
ConTeXt is also included in TeXlive. The ConTeXt suite is updated continuously, whereas ConTeXt in TeXlive is updated less often. In particular, <code>luatex</code> and <code>metapost</code> are under active development and their binaries are updated frequently. ConTeXt follows these developments, indeed often drives development. As the binaries included in the TeXlive distribution are only updated yearly, ConTeXt on TeXlive will necessarily be less current than the ConTeXt suite. (ConTeXt on TeXlive can be kept somewhat more current using the http://tlcontrib.metatex.org repository.) The ConTeXt suite is self-contained and can happily coexist alongside another installed TeX distribution.<br />
<br />
{{TOClimit|limit=1}}<br />
<br />
= General Information =<br />
<br />
== Supported platforms ==<br />
<br />
{| style="border:1px solid #DDDDDD;"<br />
|- align="left" <br />
! Platform<br />
! Short name<br />
! Binaries by<br />
! Notes<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Windows<br />
| mswin<br />
| Akira Kakuto ([http://w32tex.org W32TeX])<br />
|<br />
|- align="left"<br />
! Linux<br />
| linux<br />
| Hans Hagen, Mojca Miklavec, Alan Braslau<br />
| compiled with glibc 2.3.6<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, 64-bit<br />
| linux-64<br />
| Alan Braslau<br />
|<br />
|- align="left"<br />
! Linux, PowerPC<br />
| linux-ppc<br />
| Piotr Kopszak<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, Arm (low end.)<br />
| linux-armel<br />
| Boris Veytsman<br />
| in progress<br />
|- align="left"<br />
! Mac OS X, Intel (32-bit)<br />
| osx-intel<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Mac OS X, Intel (64-bit)<br />
| osx-64<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left"<br />
! Mac OS X, PowerPC<br />
| osx-ppc<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Mac OS X, Universal Binaries<br />
| osx-universal<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left"<br />
! FreeBSD<br />
| freebsd<br />
| Alan Braslau<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! FreeBSD, 64-bit<br />
| freebsd-amd64<br />
| Alan Braslau<br />
| <br />
|- align="left"<br />
! kFreeBSD<br />
| kfreebsd-i386<br />
| Alan Braslau<br />
| FreeBSD + glibc (Debian)<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! kFreeBSD, 64-bit<br />
| kfreebsd-amd64<br />
| Alan Braslau<br />
| FreeBSD + glibc (Debian)<br />
|- align="left"<br />
! Solaris, Intel<br />
| solaris-intel<br />
| Marco Patzer<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Solaris, Sparc<br />
| solaris-sparc<br />
| Mojca Miklavec<br />
| Solaris 10 on [http://www.opencsw.org/about/ OpenCSW]<br />
|}<br />
<br />
We need volunteers for providing binaries for other platforms. If you want to support a platform, please write to [[ConTeXt Mailing Lists]]<br />
<br />
== Dependencies ==<br />
* [http://www.ruby-lang.org Ruby] 1.8 or newer (used for MKII)<br />
* Rsync (The windows binary of rsync is distributed within the suite)<br />
<br />
<br />
The following programs are not required for running ConTeXt, but their installation adds additional functionality.<br />
<br />
* ghostscript : for converting PostScript images to PDF<br />
* graphicsmagick : for converting GIF and TIFF images<br />
* inkscape : for converting SVG and compressed SVG<br />
* pstoedit : for converting PostScript to MetaPost outlines<br />
* zint : for providing barcodes<br />
* curl : for including remote content<br />
<br />
== Disc space required ==<br />
ConTeXt macro files are small (less than 10MB), but the suite comes with various free fonts which considerably increase the size of the distribution to around 200MB).<br />
<br />
== Standalone ==<br />
<br />
* [[ConTeXt Standalone/FAQ|Standalone/FAQ]] <br />
* [[ConTeXt Standalone/Structure|Standalone/Structure]] <br />
* [[ConTeXt Standalone/Implementation|Standalone/Implementation]]<br />
* [[ConTeXt Standalone/TODO|Standalone/TODO]] <br />
* [[ConTeXt Standalone/Contents|Standalone/Contents]] <br />
* [[ConTeXt Standalone/TeX Live|Standalone/TeX Live]]<br />
* Browse the [http://minimals.contextgarden.net installation tree]<br />
<br />
<br />
<br />
= Unix-like platforms (Linux/MacOS X/FreeBSD/Solaris) =<br />
<br />
For Mac installation see also [http://wiki.contextgarden.net/Mac_Installation Mac installation page].<br />
<br />
== Single user installation ==<br />
<br />
Select a folder where you want to install ConTeXt. We recommend that you can use your <code>$HOME/context</code> directory. Create this folder. Then download <br />
[http://minimals.contextgarden.net/setup/first-setup.sh first-setup.sh] and place it in <code>$HOME/context</code> directory. Open a terminal, then:<br />
<br />
cd context<br />
<br />
Then make <code>first-setup.sh</code> executable and run it to download the whole distribution and make formats:<br />
<br />
chmod +x first-setup.sh<br />
sh ./first-setup.sh<br />
<br />
This takes a long time, so go have a coffee.<br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use<br />
<br />
sh ./first-setup.sh --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
sh ./first-setup.sh --modules=all<br />
<br />
Installing mkiv only reduces the size of the installation (including all the modules) from about 270 to 200MB . Use<br />
<br />
sh ./first-setup.sh --modules=all --engine=luatex<br />
<br />
== System-wide installation ==<br />
<br />
A system wide installation is only recommended for users who are comfortable with the command line. Only the location of installing ConTeXt is different for a system wide installation.<br />
<br />
* on Linux you can use <code>/opt/context</code><br />
* on MacOS X you can use <code>/Applications/ConTeXt</code><br />
<br />
Note that, at present, while ''using'' MkIV, you need to have write permissions<ref>Actually, you only need write permission for <code>$TEXMFCACHE</code>.</ref> in the installation directory.<ref>This effectively means that only one user will be able to generate the formats</ref> So, if you are installing the suite in <code>/opt/context</code> or <code>/Applications/ConTeXt</code>, run<br />
<br />
<pre>chown `whoami` -R /opt/context</pre><br />
<br />
or <br />
<br />
<pre>chown `whoami` -R /Applications/ConTeXt</pre><br />
<br />
(<code>whoami</code> outputs your user name; you can type that directly, of course. The backticks substitute the output of the <code>whoami</code> command as an argument to <code>chown</code>.)<br />
<br />
In order to install the suite, open a terminal, go to the installation directory and download [http://minimals.contextgarden.net/setup/first-setup.sh first-setup.sh]:<br />
<br />
$ rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .<br />
<br />
Then run that script to download the whole distribution and make formats:<br />
<br />
sh ./first-setup.sh<br />
<br />
This takes a long time, so go have a coffee.<br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use<br />
<br />
sh ./first-setup.sh --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
sh ./first-setup.sh --modules=all<br />
<br />
===Cache===<br />
<br />
Normaly you do not want to allow access in e.g. /opt. but you like to allow it in /var/cache/*. So create the needed cache directory as a superuser via<br />
<br />
mkdir /var/cache/context<br />
mkdir /var/cache/context/texmf-cache<br />
chmod 777 /var/cache/context/texmf-cache<br />
<br />
Change in the file ./tex/texmf/web2c/texmfcnf.lua the value of TEXMFCACHE to the directory you want (in this example /var/cache/context/texmf-cache).<br />
<br />
===Font Directory===<br />
<br />
Add the OSOFONTDIR into ./tex/setuptex. Go to under the line:<br />
<br />
# TODO: we could set OSFONTDIR on Mac for example<br />
<br />
(if you don't have the line above, go to the end of the file) and add there:<br />
<br />
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"<br />
<br />
For more information: [[Fonts in LuaTeX]]<br />
<br />
==Arch Linux==<br />
There’s a [http://aur.archlinux.org/packages.php?ID=30398 PKGBUILD] in<br />
the AUR, provided by Aditya [https://github.com/adityam/context-pkgbuild].<br />
Install it using your favorite AUR frontend, e.g.<br />
<br />
<pre><br />
yaourt -S context-minimals-git<br />
</pre><br />
<br />
This will get you a fresh, up-to-date Context tree in<br />
<tt>/opt/context-minimals</tt>.<br />
<br />
== The funtoo way ==<br />
<br />
If you are using [http://funtoo.org funtoo] there are ebuilds that will make an installation as easy as installing any other package from portage. Take a look at the [[ConTeXt Standalone Funtoo]] Howto. This might also work for [http://www.gentoo.org gentoo], but is untested right now.<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal or your startup script (<code>.bashrc</code> or the corresponding file for your shell). Replace username, password, proxyhost and proxyport with the correct information<br />
<br />
export RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
ConTeXt suite works in a non-interfering manner because it does not put anything in your <code>$PATH</code> and does not set any system variables. This in turn means that in order to use it, you need to do some initialization. An intialization script called <code>setuptex</code> is provided in <code>installation-dir/tex/</code>. <br />
<br />
If you run context from a terminal, source <code>setuptex</code> like so:<br />
<br />
source /installation-dir/tex/setuptex<br />
<br />
== Exclusive usage ==<br />
<br />
The above method means that you always have to type <code>source /installation-dir/tex/setuptex</code> in a terminal before you can use typeset. If you always use ConTeXt suite and never use LaTeX or plain TeX provided by another TeX distribution, you can add the above intialization line to the startup script of your shell. For bash, this means <code>$HOME/.bashrc</code>; for zsh, this means <code>$HOME/.zshrc</code>; for (t)csh, this means <code>$HOME/.cshrc</code> or <code>$HOME/.tcshrc</code>. Then, <code>setuptex</code> will always be sourced in your terminal. <br />
<br />
== Integrating with an editor ==<br />
<br />
If you run ConTeXt from an editor, you need to source {{code|setuptex}} in a terminal and then open your editor from the same terminal. <br />
<br />
Depending on how your editor initializes, you may still need to source {{code|setuptex}} in order to run ConTeXt directly from your editor. In theory, it is sufficient to add {{code|/installation-dir/tex/texmf-<platform>/bin}} to your {{code|$PATH}} in order to use the suite. You can try to add this to the paths that your editor searches.<br />
<br />
For information about configuring [http://smultron.sourceforge.net/ Smultron] and [http://www.uoregon.edu/~koch/texshop/obtaining.html TeXShop] (which are popular TeX editors on Mac) see [[ConTeXt Standalone/Mac Installation]]. For a list of text editors with ConTeXt integration, see the article on [[Text Editors|text editors]].<br />
<br />
== Updating ==<br />
<br />
For updating the ConTeXt suite, <br />
first update <code>first-setup.sh</code>, then run it. You could<br />
also create an alias or a little script “ctx-update”<br />
with the following example contents:<br />
<pre><br />
cd /opt/context<br />
rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .<br />
./first-setup.sh --modules=all<br />
</pre><br />
<br />
== Uninstalling ==<br />
<br />
ConTeXt suite does not touch anything outside its installation folder. So to uninstall it, you can simply remove the installation folder.<br />
<br />
== Remaking formats ==<br />
<br />
Normally, the update script should create the formats for you. If for some reason you need to recreate the formats, you can do the following:<br />
<br />
* For making MKII format.<br />
<br />
mktexlsr<br />
texexec --make --all <br />
<br />
* For making XeTeX format<br />
<br />
mktexlsr<br />
texexec --make --xtx --all <br />
<br />
* For making MKIV format<br />
<br />
mtxrun --selfupdate<br />
mtxrun --generate<br />
luatools --generate<br />
context --make<br />
<br />
= Windows =<br />
<br />
If you want to use ConTeXt suite alongside MikTeX/TeXLive (needed if you also run LaTeX), follow the command-line installation method. <br />
<br />
== Installation ==<br />
<br />
=== Command line method ===<br />
Download [http://minimals.contextgarden.net/setup/context-setup-mswin.zip context-setup-mswin.zip] or [http://minimals.contextgarden.net/setup/context-setup-win64.zip context-setup-win64.zip], and unzip to a directory where you want to install ConTeXt. It is recommended that you choose a directory that does not have a space in its full path. Then open <code>cmd.exe</code>, go to the installation directory and run<br />
<br />
first-setup.bat<br />
<br />
This takes a long time, so go have a coffee. <br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use <br />
<br />
first-setup.bat --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
first-setup.bat --modules=all<br />
<br />
<br />
If the above installation instructions don't seem to answer your questions, see page [[Windows_Installation:_ConTeXt_Suite_with_SciTe| Windows Installation: ConTeXt Suite with SciTe]] for more detailed information.<br />
<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal as (replace username, password, proxyhost and proxyport with the correct information)<br />
<br />
set RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
or set the variable permanently as a Windows environment variable.<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
Before running ConTeXt, you need to run <code>setuptex.bat</code> which is provided in <code>installation-dir\tex\</code>. This can be done by typing<br />
<br />
installation-dir\tex\setuptex.bat<br />
<br />
on cmd.exe before you run ConTeXt. To avoid always having to type this, you can create a shortcut to cmd.exe and edit the command line to read (assuming you installed the suite in <code>C:\Programs</code>; otherwise replace <code>C:\Programs\</code> with your installation directory)<br />
<br />
C:\WINDOWS\System32\cmd.exe /k C:\Programs\context\tex\setuptex.bat<br />
<br />
This starts up a new command shell with the environment pre-loaded. Within the new shell you can just type <code>context</code> to run ConTeXt. E.g.<br />
<br />
C:\> context --version<br />
<br />
to check that you are running the version you think you're running.<br />
<br />
=== Use ConTeXt with Cygwin ===<br />
After installing the ConTeXt suite, you can run it under Cygwin. With Cygwin, you may use gmake and other Unix tools for your automated workflow.<br />
<br />
# Run <code>setuptex.bat</code> in DOS command prompt<br />
# In the same DOS prompt, enter Cygwin by running <code>cygwin.bat</code> (in your Cygwin installation directory)<br />
# Under Cygwin prompt, run <code> context.cmd test.tex </code>. Note that the <code>.cmd</code> extension is needed under Cygwin.<br />
<br />
== Updating ==<br />
<br />
If you used the command line method, just run <code>first-setup.bat</code> again to update the suite. If you have third party modules installed, you should use<br />
first-setup.bat --keep<br />
to upgrade. See [[ConTeXt_Standalone#Installing_third_party_modules| Installing third party modules]] for details.<br />
<br />
<br />
== Uninstallation ==<br />
<br />
If you used the command-line installer, you can just delete the installation directory to uninstall the suite.<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
* rsync sometimes has problems with paths with uppercase letters (like <code>c:\Temp</code> or <code>C:\Documents and Settings</code>). Installing into all-lowercase paths without spaces sometimes helps.<br />
* Directory-name length may also have an effect, due to Windows's 8.3 filename conventions. An indicator is if running "texexec --lua" on a file produces missing-file warnings containing Windows-created 8-character directory names, such as "C:\CONTEX~1\tex", where your ConTeXt directory is really "C:\context_minimals\tex". Be conservative and choose a short name like "C:\ctm\tex". Also, this may even work when an 8-character-or-less directory name like "C:\ctexmin\tex" doesn't.<br />
* If you're behind firewall and rsync times out, you need to open port 873 for outgoing TCP connections.<br />
* If you update luaTeX occasionally you may get something like <br />
<br />
<code>engine mismatch (luv: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2013/dev)(rev <number1>) <> bin: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2012/W32TeX)(rev <number2>)), forcing remake</code><br />
<br />
In which case your format will be remade every time you compile a file. In /texmf-mswin make sure that luatex.exe and texlua.exe have the same date; then also delete luatex.dll. This usually solves the problem.<br />
<br />
= Installing third party modules =<br />
<br />
The ConTeXt suite only comes with Taco's [[Bibliography|t-bib]] module. If you want to install [http://modules.contextgarden.net/ a new module], say Wolfgang's [[Letter|t-letter]] module, you can use<br />
first-setup.sh --modules="t-letter"<br />
<br />
If you want to install more than one extra module, you can separate them by commas. So, to install the t-letter and t-mathsets module, do<br />
sh ./first-setup.sh --modules="t-letter,t-mathsets"<br />
<br />
If you want to install all extra modules at once, do<br />
sh ./first-setup.sh --modules=all<br />
<br />
= Reverting to an older installation =<br />
<br />
If, for some reason, you want to revert to an older installation, you can do that by<br />
<br />
sh ./first-setup.sh --context=date<br />
<br />
where <code>date</code> is the date of one of the stable releases of ConTeXt. The complete list of old releases that are available is [http://minimals.contextgarden.net/current/context/ here].<br />
<br />
<br />
= Moving the installation tree around = <br />
<br />
According to this post, http://archive.contextgarden.net/message/20101129.144331.d721372f.en.html it's safe to move the installation tree across directory or machines (say you don't have broadband access). You just have to clean and regenerate the cache (./tex/texmf-cache/luatex-cache) with <br />
mtxrun --generate<br />
<br />
= Notes =<br />
<references/><br />
<br />
{{Installation navbox}}<br />
{{Getting started navbox}}<br />
[[Category:Installation]]<br />
[[Category:Standalone]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=ConTeXt_Standalone&diff=22203ConTeXt Standalone2013-11-26T21:07:28Z<p>Huttarl: fixed formatting for my link, and slightly clarified the Usage section for Windows.</p>
<hr />
<div>The '''ConTeXt suite''' is a complete, up-to-date ConTeXt distribution which can be upgraded efficiently. It can be used to install either the stable or the beta version of ConTeXt. It can also be used in parallel with existing TeX installations such as MikTeX, TeXLive, or older minimal installation. It is aimed towards ConTeXt users, so it does not include LaTeX specific packages and binaries. <br />
<br />
ConTeXt develops at a fast pace, and sometimes beta releases have serious bugs. ConTeXt suite allows you to test the latest ConTeXt release without having to worry if an upgrade will mess an critical project. You can have two (or multiple) parallel ConTeXt suites, and freeze one for your critical projects, and use the other one for experimenting.<br />
<br />
ConTeXt is also included in TeXlive. The ConTeXt suite is updated continuously, whereas ConTeXt in TeXlive is updated less often. In particular, <code>luatex</code> and <code>metapost</code> are under active development and their binaries are updated frequently. ConTeXt follows these developments, indeed often drives development. As the binaries included in the TeXlive distribution are only updated yearly, ConTeXt on TeXlive will necessarily be less current than the ConTeXt suite. (ConTeXt on TeXlive can be kept somewhat more current using the http://tlcontrib.metatex.org repository.) The ConTeXt suite is self-contained and can happily coexist alongside another installed TeX distribution.<br />
<br />
{{TOClimit|limit=1}}<br />
<br />
= General Information =<br />
<br />
== Supported platforms ==<br />
<br />
{| style="border:1px solid #DDDDDD;"<br />
|- align="left" <br />
! Platform<br />
! Short name<br />
! Binaries by<br />
! Notes<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Windows<br />
| mswin<br />
| Akira Kakuto ([http://w32tex.org W32TeX])<br />
|<br />
|- align="left"<br />
! Linux<br />
| linux<br />
| Hans Hagen, Mojca Miklavec, Alan Braslau<br />
| compiled with glibc 2.3.6<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, 64-bit<br />
| linux-64<br />
| Peter Münster<br />
|<br />
|- align="left"<br />
! Linux, PowerPC<br />
| linux-ppc<br />
| Piotr Kopszak<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, Arm (low end.)<br />
| linux-armel<br />
| Boris Veytsman<br />
| in progress<br />
|- align="left"<br />
! Mac OS X, Intel (32-bit)<br />
| osx-intel<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Mac OS X, Intel (64-bit)<br />
| osx-64<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left"<br />
! Mac OS X, PowerPC<br />
| osx-ppc<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Mac OS X, Universal Binaries<br />
| osx-universal<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left"<br />
! FreeBSD<br />
| freebsd<br />
| Alan Braslau<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! FreeBSD, 64-bit<br />
| freebsd-amd64<br />
| Alan Braslau<br />
| <br />
|- align="left"<br />
! kFreeBSD<br />
| kfreebsd-i386<br />
| Alan Braslau<br />
| FreeBSD + glibc (Debian)<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! kFreeBSD, 64-bit<br />
| kfreebsd-amd64<br />
| Alan Braslau<br />
| FreeBSD + glibc (Debian)<br />
|- align="left"<br />
! Solaris, Intel<br />
| solaris-intel<br />
| Marco Patzer<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Solaris, Sparc<br />
| solaris-sparc<br />
| Mojca Miklavec<br />
| Solaris 10 on [http://www.opencsw.org/about/ OpenCSW]<br />
|}<br />
<br />
We need volunteers for providing binaries for other platforms. If you want to support a platform, please write to [[ConTeXt Mailing Lists]]<br />
<br />
== Dependencies ==<br />
* [http://www.ruby-lang.org Ruby] 1.8 or newer (used for MKII)<br />
* Rsync (The windows binary of rsync is distributed within the suite)<br />
<br />
<br />
The following programs are not required for running ConTeXt, but their installation adds additional functionality.<br />
<br />
* ghostscript : for converting PostScript images to PDF<br />
* graphicsmagick : for converting GIF and TIFF images<br />
* inkscape : for converting SVG and compressed SVG<br />
* pstoedit : for converting PostScript to MetaPost outlines<br />
* zint : for providing barcodes<br />
* curl : for including remote content<br />
<br />
== Disc space required ==<br />
ConTeXt macro files are small (less than 10MB), but the suite comes with various free fonts which considerably increase the size of the distribution to around 200MB).<br />
<br />
== Standalone ==<br />
<br />
* [[ConTeXt Standalone/FAQ|Standalone/FAQ]] <br />
* [[ConTeXt Standalone/Structure|Standalone/Structure]] <br />
* [[ConTeXt Standalone/Implementation|Standalone/Implementation]]<br />
* [[ConTeXt Standalone/TODO|Standalone/TODO]] <br />
* [[ConTeXt Standalone/Contents|Standalone/Contents]] <br />
* [[ConTeXt Standalone/TeX Live|Standalone/TeX Live]]<br />
* Browse the [http://minimals.contextgarden.net installation tree]<br />
<br />
<br />
<br />
= Unix-like platforms (Linux/MacOS X/FreeBSD/Solaris) =<br />
<br />
For Mac installation see also [http://wiki.contextgarden.net/Mac_Installation Mac installation page].<br />
<br />
== Single user installation ==<br />
<br />
Select a folder where you want to install ConTeXt. We recommend that you can use your <code>$HOME/context</code> directory. Create this folder. Then download <br />
[http://minimals.contextgarden.net/setup/first-setup.sh first-setup.sh] and place it in <code>$HOME/context</code> directory. Open a terminal, then:<br />
<br />
cd context<br />
<br />
Then make <code>first-setup.sh</code> executable and run it to download the whole distribution and make formats:<br />
<br />
chmod +x first-setup.sh<br />
sh ./first-setup.sh<br />
<br />
This takes a long time, so go have a coffee.<br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use<br />
<br />
sh ./first-setup.sh --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
sh ./first-setup.sh --modules=all<br />
<br />
Installing mkiv only reduces the size of the installation (including all the modules) from about 270 to 200MB . Use<br />
<br />
sh ./first-setup.sh --modules=all --engine=luatex<br />
<br />
== System-wide installation ==<br />
<br />
A system wide installation is only recommeded for users who are comfortable with the command line. Only the location of installing ConTeXt is different for a system wide installation.<br />
<br />
* on Linux you can use <code>/opt/context</code><br />
* on MacOS X you can use <code>/Applications/ConTeXt</code><br />
<br />
Note that, at present, while ''using'' MkIV, you need to have write permissions<ref>Actually, you only need write permission for <code>$TEXMFCACHE</code>.</ref> in the installation directory.<ref>This effectively means that only one user will be able to generate the formats</ref> So, if you are installing the suite in <code>/opt/context</code> or <code>/Applications/ConTeXt</code>, run<br />
<br />
chown `whoami` -R /opt/context <br />
<br />
or <br />
<br />
chown `whoami` -R /Applications/ConTeXt<br />
<br />
(<code>`whoami`</code> outputs your user name, you can type that directly, of course.)<br />
<br />
In order to install the suite, open a terminal, go to the installation directory and download [http://minimals.contextgarden.net/setup/first-setup.sh first-setup.sh]:<br />
<br />
$ rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .<br />
<br />
Then run that script to download the whole distribution and make formats:<br />
<br />
sh ./first-setup.sh<br />
<br />
This takes a long time, so go have a coffee.<br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use<br />
<br />
sh ./first-setup.sh --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
sh ./first-setup.sh --modules=all<br />
<br />
===Cache===<br />
<br />
Normaly you do not want to allow access in e.g. /opt. but you like to allow it in /var/cache/*. So create the needed cache directory as a superuser via<br />
<br />
mkdir /var/cache/context<br />
mkdir /var/cache/context/texmf-cache<br />
chmod 777 /var/cache/context/texmf-cache<br />
<br />
Change in the file ./tex/texmf/web2c/texmfcnf.lua the value of TEXMFCACHE to the directory you want (in this example /var/cache/context/texmf-cache).<br />
<br />
===Font Directory===<br />
<br />
Add the OSOFONTDIR into ./tex/setuptex. Go to under the line:<br />
<br />
# TODO: we could set OSFONTDIR on Mac for example<br />
<br />
(if you don't have the line above, go to the end of the file) and add there:<br />
<br />
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"<br />
<br />
For more information: [[Fonts in LuaTeX]]<br />
<br />
==Arch Linux==<br />
There’s a [http://aur.archlinux.org/packages.php?ID=30398 PKGBUILD] in<br />
the AUR, provided by Aditya [https://github.com/adityam/context-pkgbuild].<br />
Install it using your favorite AUR frontend, e.g.<br />
<br />
<pre><br />
yaourt -S context-minimals-git<br />
</pre><br />
<br />
This will get you a fresh, up-to-date Context tree in<br />
<tt>/opt/context-minimals</tt>.<br />
<br />
== The funtoo way ==<br />
<br />
If you are using [http://funtoo.org funtoo] there are ebuilds that will make an installation as easy as installing any other package from portage. Take a look at the [[ConTeXt Standalone Funtoo]] Howto. This might also work for [http://www.gentoo.org gentoo], but is untested right now.<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal or your startup script (<code>.bashrc</code> or the corresponding file for your shell). Replace username, password, proxyhost and proxyport with the correct information<br />
<br />
export RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
ConTeXt suite works in a non-interfering manner because it does not put anything in your <code>$PATH</code> and does not set any system variables. This in turn means that in order to use it, you need to do some initialization. An intialization script called <code>setuptex</code> is provided in <code>installation-dir/tex/</code>. <br />
<br />
If you run context from a terminal, source <code>setuptex</code> like so:<br />
<br />
source /installation-dir/tex/setuptex<br />
<br />
== Exclusive usage ==<br />
<br />
The above method means that you always have to type <code>source /installation-dir/tex/setuptex</code> in a terminal before you can use typeset. If you always use ConTeXt suite and never use LaTeX or plain TeX provided by another TeX distribution, you can add the above intialization line to the startup script of your shell. For bash, this means <code>$HOME/.bashrc</code>; for zsh, this means <code>$HOME/.zshrc</code>; for (t)csh, this means <code>$HOME/.cshrc</code> or <code>$HOME/.tcshrc</code>. Then, <code>setuptex</code> will always be sourced in your terminal. <br />
<br />
== Integrating with an editor ==<br />
<br />
If you run ConTeXt from an editor, you need to source {{code|setuptex}} in a terminal and then open your editor from the same terminal. <br />
<br />
Depending on how your editor initializes, you may still need to source {{code|setuptex}} in order to run ConTeXt directly from your editor. In theory, it is sufficient to add {{code|/installation-dir/tex/texmf-<platform>/bin}} to your {{code|$PATH}} in order to use the suite. You can try to add this to the paths that your editor searches.<br />
<br />
For information about configuring [http://smultron.sourceforge.net/ Smultron] and [http://www.uoregon.edu/~koch/texshop/obtaining.html TeXShop] (which are popular TeX editors on Mac) see [[ConTeXt Standalone/Mac Installation]]. For a list of text editors with ConTeXt integration, see the article on [[Text Editors|text editors]].<br />
<br />
== Updating ==<br />
<br />
For updating the ConTeXt suite, <br />
first update <code>first-setup.sh</code>, then run it. You could<br />
also create an alias or a little script “ctx-update”<br />
with the following example contents:<br />
<pre><br />
cd /opt/context<br />
rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .<br />
./first-setup.sh --modules=all<br />
</pre><br />
<br />
== Uninstalling ==<br />
<br />
ConTeXt suite does not touch anything outside its installation folder. So to uninstall it, you can simply remove the installation folder.<br />
<br />
== Remaking formats ==<br />
<br />
Normally, the update script should create the formats for you. If for some reason you need to recreate the formats, you can do the following:<br />
<br />
* For making MKII format.<br />
<br />
mktexlsr<br />
texexec --make --all <br />
<br />
* For making XeTeX format<br />
<br />
mktexlsr<br />
texexec --make --xtx --all <br />
<br />
* For making MKIV format<br />
<br />
mtxrun --selfupdate<br />
mtxrun --generate<br />
luatools --generate<br />
context --make<br />
<br />
= Windows =<br />
<br />
If you want to use ConTeXt suite alongside MikTeX/TeXLive (needed if you also run LaTeX), follow the command-line installation method. <br />
<br />
== Installation ==<br />
<br />
=== Command line method ===<br />
Download [http://minimals.contextgarden.net/setup/context-setup-mswin.zip context-setup-mswin.zip] or [http://minimals.contextgarden.net/setup/context-setup-win64.zip context-setup-win64.zip], and unzip to a directory where you want to install ConTeXt. It is recommended that you choose a directory that does not have a space in its full path. Then open <code>cmd.exe</code>, go to the installation directory and run<br />
<br />
first-setup.bat<br />
<br />
This takes a long time, so go have a coffee. <br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use <br />
<br />
first-setup.bat --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
first-setup.bat --modules=all<br />
<br />
<br />
If the above installation instructions don't seem to answer your questions, see page [[Windows_Installation:_ConTeXt_Suite_with_SciTe| Windows Installation: ConTeXt Suite with SciTe]] for more detailed information.<br />
<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal as (replace username, password, proxyhost and proxyport with the correct information)<br />
<br />
set RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
or set the variable permanently as a Windows environment variable.<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
Before running ConTeXt, you need to run <code>setuptex.bat</code> which is provided in <code>installation-dir\tex\</code>. This can be done by typing<br />
<br />
installation-dir\tex\setuptex.bat<br />
<br />
on cmd.exe before you run ConTeXt. To avoid always having to type this, you can create a shortcut to cmd.exe and edit the command line to read (assuming you installed the suite in <code>C:\Programs</code>; otherwise replace <code>C:\Programs\</code> with your installation directory)<br />
<br />
C:\WINDOWS\System32\cmd.exe /k C:\Programs\context\tex\setuptex.bat<br />
<br />
This starts up a new command shell with the environment pre-loaded. Within the new shell you can just type <code>context</code> to run ConTeXt. E.g.<br />
<br />
C:\> context --version<br />
<br />
to check that you are running the version you think you're running.<br />
<br />
=== Use ConTeXt with Cygwin ===<br />
After installing the ConTeXt suite, you can run it under Cygwin. With Cygwin, you may use gmake and other Unix tools for your automated workflow.<br />
<br />
# Run <code>setuptex.bat</code> in DOS command prompt<br />
# In the same DOS prompt, enter Cygwin by running <code>cygwin.bat</code> (in your Cygwin installation directory)<br />
# Under Cygwin prompt, run <code> context.cmd test.tex </code>. Note that the <code>.cmd</code> extension is needed under Cygwin.<br />
<br />
== Updating ==<br />
<br />
If you used the command line method, just run <code>first-setup.bat</code> again to update the suite. If you have third party modules installed, you should use<br />
first-setup.bat --keep<br />
to upgrade. See [[ConTeXt_Standalone#Installing_third_party_modules| Installing third party modules]] for details.<br />
<br />
<br />
== Uninstallation ==<br />
<br />
If you used the command-line installer, you can just delete the installation directory to uninstall the suite.<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
* rsync sometimes has problems with paths with uppercase letters (like <code>c:\Temp</code> or <code>C:\Documents and Settings</code>). Installing into all-lowercase paths without spaces sometimes helps.<br />
* Directory-name length may also have an effect, due to Windows's 8.3 filename conventions. An indicator is if running "texexec --lua" on a file produces missing-file warnings containing Windows-created 8-character directory names, such as "C:\CONTEX~1\tex", where your ConTeXt directory is really "C:\context_minimals\tex". Be conservative and choose a short name like "C:\ctm\tex". Also, this may even work when an 8-character-or-less directory name like "C:\ctexmin\tex" doesn't.<br />
* If you're behind firewall and rsync times out, you need to open port 873 for outgoing TCP connections.<br />
* If you update luaTeX occasionally you may get something like <br />
<br />
<code>engine mismatch (luv: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2013/dev)(rev <number1>) <> bin: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2012/W32TeX)(rev <number2>)), forcing remake</code><br />
<br />
In which case your format will be remade every time you compile a file. In /texmf-mswin make sure that luatex.exe and texlua.exe have the same date; then also delete luatex.dll. This usually solves the problem.<br />
<br />
= Installing third party modules =<br />
<br />
The ConTeXt suite only comes with Taco's [[Bibliography|t-bib]] module. If you want to install [http://modules.contextgarden.net/ a new module], say Wolfgang's [[Letter|t-letter]] module, you can use<br />
first-setup.sh --modules="t-letter"<br />
<br />
If you want to install more than one extra module, you can separate them by commas. So, to install the t-letter and t-mathsets module, do<br />
sh ./first-setup.sh --modules="t-letter,t-mathsets"<br />
<br />
If you want to install all extra modules at once, do<br />
sh ./first-setup.sh --modules=all<br />
<br />
= Reverting to an older installation =<br />
<br />
If, for some reason, you want to revert to an older installation, you can do that by<br />
<br />
sh ./first-setup.sh --context=date<br />
<br />
where <code>date</code> is the date of one of the stable releases of ConTeXt. The complete list of old releases that are available is [http://minimals.contextgarden.net/current/context/ here].<br />
<br />
<br />
= Moving the installation tree around = <br />
<br />
According to this post, http://archive.contextgarden.net/message/20101129.144331.d721372f.en.html it's safe to move the installation tree across directory or machines (say you don't have broadband access). You just have to clean and regenerate the cache (./tex/texmf-cache/luatex-cache) with <br />
mtxrun --generate<br />
<br />
= Notes =<br />
<references/><br />
<br />
{{Installation navbox}}<br />
{{Getting started navbox}}<br />
[[Category:Installation]]<br />
[[Category:Standalone]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=ConTeXt_Standalone&diff=22202ConTeXt Standalone2013-11-24T01:59:34Z<p>Huttarl: added link for win64 version of context</p>
<hr />
<div>The '''ConTeXt suite''' is a complete, up-to-date ConTeXt distribution which can be upgraded efficiently. It can be used to install either the stable or the beta version of ConTeXt. It can also be used in parallel with existing TeX installations such as MikTeX, TeXLive, or older minimal installation. It is aimed towards ConTeXt users, so it does not include LaTeX specific packages and binaries. <br />
<br />
ConTeXt develops at a fast pace, and sometimes beta releases have serious bugs. ConTeXt suite allows you to test the latest ConTeXt release without having to worry if an upgrade will mess an critical project. You can have two (or multiple) parallel ConTeXt suites, and freeze one for your critical projects, and use the other one for experimenting.<br />
<br />
ConTeXt is also included in TeXlive. The ConTeXt suite is updated continuously, whereas ConTeXt in TeXlive is updated less often. In particular, <code>luatex</code> and <code>metapost</code> are under active development and their binaries are updated frequently. ConTeXt follows these developments, indeed often drives development. As the binaries included in the TeXlive distribution are only updated yearly, ConTeXt on TeXlive will necessarily be less current than the ConTeXt suite. (ConTeXt on TeXlive can be kept somewhat more current using the http://tlcontrib.metatex.org repository.) The ConTeXt suite is self-contained and can happily coexist alongside another installed TeX distribution.<br />
<br />
{{TOClimit|limit=1}}<br />
<br />
= General Information =<br />
<br />
== Supported platforms ==<br />
<br />
{| style="border:1px solid #DDDDDD;"<br />
|- align="left" <br />
! Platform<br />
! Short name<br />
! Binaries by<br />
! Notes<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Windows<br />
| mswin<br />
| Akira Kakuto ([http://w32tex.org W32TeX])<br />
|<br />
|- align="left"<br />
! Linux<br />
| linux<br />
| Hans Hagen, Mojca Miklavec, Alan Braslau<br />
| compiled with glibc 2.3.6<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, 64-bit<br />
| linux-64<br />
| Peter Münster<br />
|<br />
|- align="left"<br />
! Linux, PowerPC<br />
| linux-ppc<br />
| Piotr Kopszak<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, Arm (low end.)<br />
| linux-armel<br />
| Boris Veytsman<br />
| in progress<br />
|- align="left"<br />
! Mac OS X, Intel (32-bit)<br />
| osx-intel<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Mac OS X, Intel (64-bit)<br />
| osx-64<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left"<br />
! Mac OS X, PowerPC<br />
| osx-ppc<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Mac OS X, Universal Binaries<br />
| osx-universal<br />
| Richard Koch, Mojca Miklavec<br />
|<br />
|- align="left"<br />
! FreeBSD<br />
| freebsd<br />
| Alan Braslau<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! FreeBSD, 64-bit<br />
| freebsd-amd64<br />
| Alan Braslau<br />
| <br />
|- align="left"<br />
! kFreeBSD<br />
| kfreebsd-i386<br />
| Alan Braslau<br />
| FreeBSD + glibc (Debian)<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! kFreeBSD, 64-bit<br />
| kfreebsd-amd64<br />
| Alan Braslau<br />
| FreeBSD + glibc (Debian)<br />
|- align="left"<br />
! Solaris, Intel<br />
| solaris-intel<br />
| Marco Patzer<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Solaris, Sparc<br />
| solaris-sparc<br />
| Mojca Miklavec<br />
| Solaris 10 on [http://www.opencsw.org/about/ OpenCSW]<br />
|}<br />
<br />
We need volunteers for providing binaries for other platforms. If you want to support a platform, please write to [[ConTeXt Mailing Lists]]<br />
<br />
== Dependencies ==<br />
* [http://www.ruby-lang.org Ruby] 1.8 or newer (used for MKII)<br />
* Rsync (The windows binary of rsync is distributed within the suite)<br />
<br />
<br />
The following programs are not required for running ConTeXt, but their installation adds additional functionality.<br />
<br />
* ghostscript : for converting PostScript images to PDF<br />
* graphicsmagick : for converting GIF and TIFF images<br />
* inkscape : for converting SVG and compressed SVG<br />
* pstoedit : for converting PostScript to MetaPost outlines<br />
* zint : for providing barcodes<br />
* curl : for including remote content<br />
<br />
== Disc space required ==<br />
ConTeXt macro files are small (less than 10MB), but the suite comes with various free fonts which considerably increase the size of the distribution to around 200MB).<br />
<br />
== Standalone ==<br />
<br />
* [[ConTeXt Standalone/FAQ|Standalone/FAQ]] <br />
* [[ConTeXt Standalone/Structure|Standalone/Structure]] <br />
* [[ConTeXt Standalone/Implementation|Standalone/Implementation]]<br />
* [[ConTeXt Standalone/TODO|Standalone/TODO]] <br />
* [[ConTeXt Standalone/Contents|Standalone/Contents]] <br />
* [[ConTeXt Standalone/TeX Live|Standalone/TeX Live]]<br />
* Browse the [http://minimals.contextgarden.net installation tree]<br />
<br />
<br />
<br />
= Unix-like platforms (Linux/MacOS X/FreeBSD/Solaris) =<br />
<br />
For Mac installation see also [http://wiki.contextgarden.net/Mac_Installation Mac installation page].<br />
<br />
== Single user installation ==<br />
<br />
Select a folder where you want to install ConTeXt. We recommend that you can use your <code>$HOME/context</code> directory. Create this folder. Then download <br />
[http://minimals.contextgarden.net/setup/first-setup.sh first-setup.sh] and place it in <code>$HOME/context</code> directory. Open a terminal, then:<br />
<br />
cd context<br />
<br />
Then make <code>first-setup.sh</code> executable and run it to download the whole distribution and make formats:<br />
<br />
chmod +x first-setup.sh<br />
sh ./first-setup.sh<br />
<br />
This takes a long time, so go have a coffee.<br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use<br />
<br />
sh ./first-setup.sh --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
sh ./first-setup.sh --modules=all<br />
<br />
Installing mkiv only reduces the size of the installation (including all the modules) from about 270 to 200MB . Use<br />
<br />
sh ./first-setup.sh --modules=all --engine=luatex<br />
<br />
== System-wide installation ==<br />
<br />
A system wide installation is only recommeded for users who are comfortable with the command line. Only the location of installing ConTeXt is different for a system wide installation.<br />
<br />
* on Linux you can use <code>/opt/context</code><br />
* on MacOS X you can use <code>/Applications/ConTeXt</code><br />
<br />
Note that, at present, while ''using'' MkIV, you need to have write permissions<ref>Actually, you only need write permission for <code>$TEXMFCACHE</code>.</ref> in the installation directory.<ref>This effectively means that only one user will be able to generate the formats</ref> So, if you are installing the suite in <code>/opt/context</code> or <code>/Applications/ConTeXt</code>, run<br />
<br />
chown `whoami` -R /opt/context <br />
<br />
or <br />
<br />
chown `whoami` -R /Applications/ConTeXt<br />
<br />
(<code>`whoami`</code> outputs your user name, you can type that directly, of course.)<br />
<br />
In order to install the suite, open a terminal, go to the installation directory and download [http://minimals.contextgarden.net/setup/first-setup.sh first-setup.sh]:<br />
<br />
$ rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .<br />
<br />
Then run that script to download the whole distribution and make formats:<br />
<br />
sh ./first-setup.sh<br />
<br />
This takes a long time, so go have a coffee.<br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use<br />
<br />
sh ./first-setup.sh --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
sh ./first-setup.sh --modules=all<br />
<br />
===Cache===<br />
<br />
Normaly you do not want to allow access in e.g. /opt. but you like to allow it in /var/cache/*. So create the needed cache directory as a superuser via<br />
<br />
mkdir /var/cache/context<br />
mkdir /var/cache/context/texmf-cache<br />
chmod 777 /var/cache/context/texmf-cache<br />
<br />
Change in the file ./tex/texmf/web2c/texmfcnf.lua the value of TEXMFCACHE to the directory you want (in this example /var/cache/context/texmf-cache).<br />
<br />
===Font Directory===<br />
<br />
Add the OSOFONTDIR into ./tex/setuptex. Go to under the line:<br />
<br />
# TODO: we could set OSFONTDIR on Mac for example<br />
<br />
(if you don't have the line above, go to the end of the file) and add there:<br />
<br />
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"<br />
<br />
For more information: [[Fonts in LuaTeX]]<br />
<br />
==Arch Linux==<br />
There’s a [http://aur.archlinux.org/packages.php?ID=30398 PKGBUILD] in<br />
the AUR, provided by Aditya [https://github.com/adityam/context-pkgbuild].<br />
Install it using your favorite AUR frontend, e.g.<br />
<br />
<pre><br />
yaourt -S context-minimals-git<br />
</pre><br />
<br />
This will get you a fresh, up-to-date Context tree in<br />
<tt>/opt/context-minimals</tt>.<br />
<br />
== The funtoo way ==<br />
<br />
If you are using [http://funtoo.org funtoo] there are ebuilds that will make an installation as easy as installing any other package from portage. Take a look at the [[ConTeXt Standalone Funtoo]] Howto. This might also work for [http://www.gentoo.org gentoo], but is untested right now.<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal or your startup script (<code>.bashrc</code> or the corresponding file for your shell). Replace username, password, proxyhost and proxyport with the correct information<br />
<br />
export RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
ConTeXt suite works in a non-interfering manner because it does not put anything in your <code>$PATH</code> and does not set any system variables. This in turn means that in order to use it, you need to do some initialization. An intialization script called <code>setuptex</code> is provided in <code>installation-dir/tex/</code>. <br />
<br />
If you run context from a terminal, source <code>setuptex</code> like so:<br />
<br />
source /installation-dir/tex/setuptex<br />
<br />
== Exclusive usage ==<br />
<br />
The above method means that you always have to type <code>source /installation-dir/tex/setuptex</code> in a terminal before you can use typeset. If you always use ConTeXt suite and never use LaTeX or plain TeX provided by another TeX distribution, you can add the above intialization line to the startup script of your shell. For bash, this means <code>$HOME/.bashrc</code>; for zsh, this means <code>$HOME/.zshrc</code>; for (t)csh, this means <code>$HOME/.cshrc</code> or <code>$HOME/.tcshrc</code>. Then, <code>setuptex</code> will always be sourced in your terminal. <br />
<br />
== Integrating with an editor ==<br />
<br />
If you run ConTeXt from an editor, you need to source {{code|setuptex}} in a terminal and then open your editor from the same terminal. <br />
<br />
Depending on how your editor initializes, you may still need to source {{code|setuptex}} in order to run ConTeXt directly from your editor. In theory, it is sufficient to add {{code|/installation-dir/tex/texmf-<platform>/bin}} to your {{code|$PATH}} in order to use the suite. You can try to add this to the paths that your editor searches.<br />
<br />
For information about configuring [http://smultron.sourceforge.net/ Smultron] and [http://www.uoregon.edu/~koch/texshop/obtaining.html TeXShop] (which are popular TeX editors on Mac) see [[ConTeXt Standalone/Mac Installation]]. For a list of text editors with ConTeXt integration, see the article on [[Text Editors|text editors]].<br />
<br />
== Updating ==<br />
<br />
For updating the ConTeXt suite, <br />
first update <code>first-setup.sh</code>, then run it. You could<br />
also create an alias or a little script “ctx-update”<br />
with the following example contents:<br />
<pre><br />
cd /opt/context<br />
rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .<br />
./first-setup.sh --modules=all<br />
</pre><br />
<br />
== Uninstalling ==<br />
<br />
ConTeXt suite does not touch anything outside its installation folder. So to uninstall it, you can simply remove the installation folder.<br />
<br />
== Remaking formats ==<br />
<br />
Normally, the update script should create the formats for you. If for some reason you need to recreate the formats, you can do the following:<br />
<br />
* For making MKII format.<br />
<br />
mktexlsr<br />
texexec --make --all <br />
<br />
* For making XeTeX format<br />
<br />
mktexlsr<br />
texexec --make --xtx --all <br />
<br />
* For making MKIV format<br />
<br />
mtxrun --selfupdate<br />
mtxrun --generate<br />
luatools --generate<br />
context --make<br />
<br />
= Windows =<br />
<br />
If you want to use ConTeXt suite alongside MikTeX/TeXLive (needed if you also run LaTeX), follow the command-line installation method. <br />
<br />
== Installation ==<br />
<br />
=== Command line method ===<br />
Download [http://minimals.contextgarden.net/setup/context-setup-mswin.zip context-setup-mswin.zip] or [[http://minimals.contextgarden.net/setup/context-setup-win64.zip context-setup-win64.zip]], and unzip to a directory where you want to install ConTeXt. It is recommended that you choose a directory that does not have a space in its full path. Then open <code>cmd.exe</code>, go to the installation directory and run<br />
<br />
first-setup.bat<br />
<br />
This takes a long time, so go have a coffee. <br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use <br />
<br />
first-setup.bat --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
first-setup.bat --modules=all<br />
<br />
<br />
If the above installation instructions don't seem to answer your questions, see page [[Windows_Installation:_ConTeXt_Suite_with_SciTe| Windows Installation: ConTeXt Suite with SciTe]] for more detailed information.<br />
<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal as (replace username, password, proxyhost and proxyport with the correct information)<br />
<br />
set RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
or set the variable permanently as a Windows environment variable.<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
Before running ConTeXt, you need to run <code>setuptex.bat</code> which is provided in <code>installation-dir\tex\</code>. This can be done by typing<br />
<br />
installation-dir\tex\setuptex.bat<br />
<br />
on cmd.exe before you run ConTeXt. To avoid always having to type this, you can create a shortcut to cmd.exe and edit the command line to read (assuming you installed the suite in <code>C:\Programs</code>; otherwise replace <code>C:\Programs\</code> with your installation directory)<br />
<br />
C:\WINDOWS\System32\cmd.exe /k C:\Programs\context\tex\setuptex.bat<br />
<br />
This starts up a new command shell with the environment pre-loaded.<br />
<br />
=== Use ConTeXt with Cygwin ===<br />
After installing the ConTeXt suite, you can run it under Cygwin. With Cygwin, you may use gmake and other Unix tools for your automated workflow.<br />
<br />
# Run <code>setuptex.bat</code> in DOS command prompt<br />
# In the same DOS prompt, enter Cygwin by running <code>cygwin.bat</code> (in your Cygwin installation directory)<br />
# Under Cygwin prompt, run <code> context.cmd test.tex </code>. Note that the <code>.cmd</code> extension is needed under Cygwin.<br />
<br />
== Updating ==<br />
<br />
If you used the command line method, just run <code>first-setup.bat</code> again to update the suite. If you have third party modules installed, you should use<br />
first-setup.bat --keep<br />
to upgrade. See [[ConTeXt_Standalone#Installing_third_party_modules| Installing third party modules]] for details.<br />
<br />
<br />
== Uninstallation ==<br />
<br />
If you used the command-line installer, you can just delete the installation directory to uninstall the suite.<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
* rsync sometimes has problems with paths with uppercase letters (like <code>c:\Temp</code> or <code>C:\Documents and Settings</code>). Installing into all-lowercase paths without spaces sometimes helps.<br />
* Directory-name length may also have an effect, due to Windows's 8.3 filename conventions. An indicator is if running "texexec --lua" on a file produces missing-file warnings containing Windows-created 8-character directory names, such as "C:\CONTEX~1\tex", where your ConTeXt directory is really "C:\context_minimals\tex". Be conservative and choose a short name like "C:\ctm\tex". Also, this may even work when an 8-character-or-less directory name like "C:\ctexmin\tex" doesn't.<br />
* If you're behind firewall and rsync times out, you need to open port 873 for outgoing TCP connections.<br />
* If you update luaTeX occasionally you may get something like <br />
<br />
<code>engine mismatch (luv: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2013/dev)(rev <number1>) <> bin: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2012/W32TeX)(rev <number2>)), forcing remake</code><br />
<br />
In which case your format will be remade every time you compile a file. In /texmf-mswin make sure that luatex.exe and texlua.exe have the same date; then also delete luatex.dll. This usually solves the problem.<br />
<br />
= Installing third party modules =<br />
<br />
The ConTeXt suite only comes with Taco's [[Bibliography|t-bib]] module. If you want to install [http://modules.contextgarden.net/ a new module], say Wolfgang's [[Letter|t-letter]] module, you can use<br />
first-setup.sh --modules="t-letter"<br />
<br />
If you want to install more than one extra module, you can separate them by commas. So, to install the t-letter and t-mathsets module, do<br />
sh ./first-setup.sh --modules="t-letter,t-mathsets"<br />
<br />
If you want to install all extra modules at once, do<br />
sh ./first-setup.sh --modules=all<br />
<br />
= Reverting to an older installation =<br />
<br />
If, for some reason, you want to revert to an older installation, you can do that by<br />
<br />
sh ./first-setup.sh --context=date<br />
<br />
where <code>date</code> is the date of one of the stable releases of ConTeXt. The complete list of old releases that are available is [http://minimals.contextgarden.net/current/context/ here].<br />
<br />
<br />
= Moving the installation tree around = <br />
<br />
According to this post, http://archive.contextgarden.net/message/20101129.144331.d721372f.en.html it's safe to move the installation tree across directory or machines (say you don't have broadband access). You just have to clean and regenerate the cache (./tex/texmf-cache/luatex-cache) with <br />
mtxrun --generate<br />
<br />
= Notes =<br />
<references/><br />
<br />
{{Installation navbox}}<br />
{{Getting started navbox}}<br />
[[Category:Installation]]<br />
[[Category:Standalone]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/getmarking&diff=22196Command/getmarking2013-11-21T15:47:36Z<p>Huttarl: flagged a few keywords that need to be explained</p>
<hr />
<div>{{Reference<br />
|name=getmarking<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\getmarking<span class="first" >[...]</span><span class="second" >[...]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td>name </td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">[...]</td><br />
<td>first last top bottom previous next both all current </td><br />
</tr><br />
</table><br />
<br />
<br />
== Description == <br />
<br />
Marks are somewhat special in the sense that they can be loners or part of a chain (chapter-section-...) with special reset requirements.<br />
<br />
As TeX’s natural model has some limitations, in mkIV we do things a bit different (but rather well defined). When a set of marks on a page is identified, the following keywords can be used:<br />
<br />
previous : last before sync<br />
next : first after sync<br />
<br />
top : first in sync<br />
bottom : last in sync<br />
<br />
first : first not top in sync<br />
last : last not bottom in sync<br />
<br />
both : ?<br />
all : ?<br />
<br />
current : ?<br />
<br />
When the chain is to be ignored, one can append ":nocheck" to the keyword. There’s also a 'current' method.<br />
<br />
<br />
== Example ==<br />
Example of usage for each column in columnsets:<br />
<texcode><br />
<br />
\startsetups S<br />
[p=(\getmarking[M][1][previous])<br />
f=(\getmarking[M][1][first])<br />
l=(\getmarking[M][1][last])]\quad<br />
[p=(\getmarking[M][2][previous])<br />
f=(\getmarking[M][2][first])<br />
l=(\getmarking[M][2][last])]\quad<br />
[p=(\getmarking[M][3][previous])<br />
f=(\getmarking[M][3][first])<br />
l=(\getmarking[M][3][last])]<br />
\global\mofcolumns\plusone<br />
\stopsetups<br />
<br />
\setupheadertexts[\setups{S}]<br />
<br />
\definecolumnset[C][n=3]<br />
<br />
\definemarking[M]<br />
<br />
\startbuffer<br />
\section{Knuth}<br />
[k1]\marking[M]{k1}<br />
[k2]\marking[M]{k2}<br />
\input knuth<br />
\section{Zapf}<br />
[z]\marking[M]{z}<br />
\input zapf<br />
\stopbuffer<br />
<br />
\starttext<br />
<br />
\startcolumnset[C]<br />
\dorecurse{10}{\getbuffer}<br />
\stopcolumnset<br />
<br />
\stoptext<br />
</texcode><br />
<br />
<br />
<br />
== Example ==<br />
<br />
<texcode><br />
\definemarking[M]<br />
<br />
\startsetups S<br />
default=(\getmarking[M])~<br />
first=(\getmarking[M][first])~<br />
last=(\getmarking[M][last])~<br />
previous=(\getmarking[M][previous])~<br />
both=(\getmarking[M][both])~<br />
all=(\getmarking[M][all])~<br />
current=(\getmarking[M][current])<br />
\stopsetups<br />
<br />
\setupheadertexts[text]<br />
[\setups{S}][]<br />
[\setups{S}][]<br />
<br />
\setuppagenumbering[location=footer]<br />
<br />
\starttext<br />
<br />
\startbuffer<br />
\section{Knuth}<br />
[k1]\marking[M]{k1}[k2]\marking[M]{k2}<br />
\input knuth<br />
\section{Zapf}<br />
[z]\marking[M]{z}<br />
\input zapf<br />
\stopbuffer<br />
<br />
\dorecurse{10}{\getbuffer}<br />
<br />
\stoptext<br />
</texcode><br />
<br />
<br />
== See also ==<br />
{{cmd|definemarking}}<br />
{{cmd|marking}}<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Marking|getmarking]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/measure&diff=22184Command/measure2013-11-18T19:08:19Z<p>Huttarl: created page for \measure with reference to \definemeasure</p>
<hr />
<div>See {{cmd|definemeasure}}.<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Simplefonts_-_Old_Content&diff=22180Simplefonts - Old Content2013-11-14T17:16:48Z<p>Huttarl: fixed examples that aren't self-contained</p>
<hr />
<div>=== Introduction ===<br />
<br />
`simplefonts` is a third–party module written by Wolfgang Schuster.<br />
<br />
It has two main advantages over the standard font handling in ConTeXt:<br />
<br />
* the user doesn’t need to write [[Fonts_in_LuaTeX#The_standard_way:_Typescripts|typescripts]].<br />
<br />
* the interface is much easier to use.<br />
<br />
* Note that some major changes were released in Oct. 2013. Documentation on this page typically describes the earlier version of simplefonts distributed with TeX Live 2013, unless otherwise noted.<br />
<br />
=== Installing <code>simplefonts</code> ===<br />
<br />
* If you’re using LuaTeX along with [https://www.tug.org/texlive/ TeX Live], <code>simplefonts</code> is already installed.<br />
<br />
* If you’re running [[ConTeXt Standalone]] (which is updated more often, allowing use of newer features but with less stability testing), <code>simplefonts</code> can be installed like [[ConTeXt_Standalone#Installing_third_party_modules|any third-party module]]:<br />
first-setup.sh --modules="t-simplefonts"<br />
<br />
==== Setting the system font directory ====<br />
<br />
If you want to use system font within ConTeXt, the path to these fonts must be known to ConTeXt.<br />
<br />
You have to set the `OSFONTDIR` variable to the path where your system font are located. If you use [[ConTeXt Standalone]], please follow [[ConTeXt_Standalone#Font_Directory|these instructions]].<br />
<br />
In Linux, the standard value is:<br />
<br />
OSFONTDIR= /usr/share/fonts//;$HOME/.fonts<br />
<br />
In Windows, the following line is to be added (slashes are fine, no need for backslashes):<br />
<br />
OSFONTDIR= c:/{windows,winnt,winnt35}/fonts//<br />
<br />
On Mac, here is a value:<br />
<br />
OSFONTDIR = /Library/Fonts//;/System/Library/Fonts;$HOME/Library/Fonts<br />
<br />
(If you have font in non–standard locations or use another operating system, all you have to do is to add the path to the `OSFONTDIR` variable.)<br />
<br />
In TeX Live, you have to add this variable (or update it) in `texmf.cnf` (find it with `kpsewhich texmf.cnf`).<br />
<br />
=== Basic usage ===<br />
<br />
Here is the most basic sample:<br />
<br />
<context mode="mkiv" source="yes"><br />
\setupbodyfontenvironment[default][em=italic]<br />
\usemodule[simplefonts][size=10pt]<br />
\setmainfont[TeX Gyre Termes]<br />
\setsansfont[TeX Gyre Heros]<br />
\setmonofont[TeX Gyre Cursor]<br />
<br />
\starttext<br />
Serif typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.<br />
<br />
{\ss Sans--serif typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.}<br />
<br />
{\tt Monospace typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.}<br />
\stoptext<br />
</context><br />
<br />
It isn’t required to define size for 12pt, since it is the default value.<br />
<br />
=== Mixing fonts ===<br />
<br />
In some cases, you might want to mix fonts (it is up to you whether they really match or not).<br />
<br />
Here is the way to do it (I know that fonts don’t match):<br />
<br />
<context mode="mkiv" source="yes"><br />
\setupbodyfontenvironment[default][em=italic]<br />
\usemodule[simplefonts]<br />
\setmainfont[TeX Gyre Termes][italicfont=TeX Gyre Bonum-Italic,<br />
boldfont=TeX Gyre Adventor-Bold, bolditalicfont=TeX Gyre Pagella-Bold Italic]<br />
<br />
\starttext<br />
Serif typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.<br />
\stoptext<br />
</context><br />
<br />
=== Font fallback mechanism ===<br />
<br />
We can have documents in which we use typefaces that lack some characters or a whole character range. In that case, font fallbacks can be defined.<br />
<br />
The example shows how to get Greek characters for TeX Gyre Pagella (I know they don’t fit well together, but I rely on system fonts):<br />
<br />
<context mode="mkiv" source="yes"><br />
\setupbodyfontenvironment[default][em=italic]<br />
\usemodule[simplefonts]<br />
\setmainfontfallback[DejaVu Serif][range={greekandcoptic, greekextended},<br />
force=yes, rscale=auto]<br />
\setmainfont[TeX Gyre Pagella]<br />
<br />
\starttext<br />
English text. δύσκολα τὰ καλά.<br />
<br />
{\em English text. δύσκολα τὰ καλά.}<br />
<br />
{\bf English text. δύσκολα τὰ καλά.}<br />
<br />
{\bf\em English text. δύσκολα τὰ καλά.}<br />
\stoptext<br />
</context><br />
<br />
Two things to be considered:<br />
<br />
* `range` can assume the following values: any of the block names in {{src|char-ini.lua}}, or a manual range such as `0x003B1-0x003B6`.<br />
<br />
* `force=yes` should be enabled, unless you want the characters to have their glyphs from the original font replaced with the ones from the fallback font.<br />
<br />
=== Defining other typefaces and fonts ===<br />
<br />
`simplefonts` has two commands to define fonts and two commands to define typefaces (Times Regular, Times Italics, Times Bold and Times Bold Italic are four different fonts, but a single typeface):<br />
<br />
*`\definesimplefont`, defines a font for the use in headers or other style elements.<br />
*`\simplefont`, defines a font for inline use.<br />
*`\definesimplefonttypeface`, defines a single typeface.<br />
*`\simplefonttypeface`, can define a typeface set (such as serif, sans–serif, monospaced, caligraphy and others).<br />
<br />
The \definesimplefont command can be used when you want a certain font<br />
for the heading of a chapter, section etc. E.g.<br />
<br />
<texcode><br />
\definesimplefont[ChapterFont][Gentium Basic][size=24pt]<br />
\setuphead[chapter][style=ChapterFont]<br />
</texcode><br />
<br />
but Wolfgang doesn’t recommend this command anymore (and removed it from the new, Oct. 2013 version) because you can get the same result with a custom typeface, e.g.<br />
<br />
<texcode><br />
\definesimplefonttypeface[chapterfont][TeX Gyre Termes]<br />
\definefont[ChapterFont][\classfont{chapterfont}{Serif} at 24pt]<br />
\setuphead[chapter][style=ChapterFont]<br />
</texcode><br />
<br />
When you want to change only the global font for your document you<br />
need the <code>\definesimplefonttypeface</code> command, e.g.<br />
<br />
<texcode><br />
\definesimplefonttypeface[documentfont][TeX Gyre Termes]<br />
\setupbodyfont[documentfont]<br />
</texcode><br />
<br />
=== Handling special cases ===<br />
<br />
If the font in question has an unusual naming scheme (or wrong names) and/or it is missing some features, it may be necessary to specify the names to look for and the font features to implement.<br />
<br />
==== Faking italics and bold fonts ====<br />
<br />
As a general rule, it is not a good idea to use faked italics and bold fonts. A slanted font is by no means an italic one (at least, in the vast majority of typefaces). And faked bold fonts don’t look the same as real bold fonts (a similar consideration could be made about small caps).<br />
<br />
Again, it would be the exception, rather than the rule, where this suggested method outputs a reasonable result. If you use ConTeXt for its high–quality typographical performance, using faked fonts can ruin that performance.<br />
<br />
Wolfgang Schuster proposed the following code to get slanted and fake bold fonts:<br />
<br />
<context mode="mkiv" source="yes"><br />
\setupbodyfontenvironment[default][em=italic]<br />
\usemodule[simplefonts]<br />
<br />
\definefontfeature[fakeitalic][default][slant=.25]<br />
\definefontfeature[fakebold][default][extend=2]<br />
\definefontfeature[fakebolditalic][default][slant=.25, extend=2]<br />
\setmainfont[TeX Gyre Pagella]<br />
<br />
\definesimplefonttypeface[fakingall][TeX Gyre Pagella][italicfont={* Regular}, boldfont={* Regular}, bolditalicfont={* Regular}, italicfeatures=fakeitalic,<br />
boldfeatures=fakebold, bolditalicfeatures=fakebolditalic]<br />
<br />
\starttext<br />
Compare:<br />
<br />
Four fonts, real typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.<br />
<br />
{\fakingall One font, faked typeface: regular, {\em italic (actually slanted)} , {\bf bold (actually stretched)} and {\bf\em bold italic (actually slanted and stretched)} fonts.}<br />
\stoptext<br />
</context></div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Simplefonts_-_Old_Content&diff=22179Simplefonts - Old Content2013-11-14T17:10:19Z<p>Huttarl: Added information from wolfgang about defining other typefaces and fonts</p>
<hr />
<div>=== Introduction ===<br />
<br />
`simplefonts` is a third–party module written by Wolfgang Schuster.<br />
<br />
It has two main advantages over the standard font handling in ConTeXt:<br />
<br />
* the user doesn’t need to write [[Fonts_in_LuaTeX#The_standard_way:_Typescripts|typescripts]].<br />
<br />
* the interface is much easier to use.<br />
<br />
* Note that some major changes were released in Oct. 2013. Documentation on this page typically describes the earlier version of simplefonts distributed with TeX Live 2013, unless otherwise noted.<br />
<br />
=== Installing <code>simplefonts</code> ===<br />
<br />
* If you’re using LuaTeX along with [https://www.tug.org/texlive/ TeX Live], <code>simplefonts</code> is already installed.<br />
<br />
* If you’re running [[ConTeXt Standalone]] (which is updated more often, allowing use of newer features but with less stability testing), <code>simplefonts</code> can be installed like [[ConTeXt_Standalone#Installing_third_party_modules|any third-party module]]:<br />
first-setup.sh --modules="t-simplefonts"<br />
<br />
==== Setting the system font directory ====<br />
<br />
If you want to use system font within ConTeXt, the path to these fonts must be known to ConTeXt.<br />
<br />
You have to set the `OSFONTDIR` variable to the path where your system font are located. If you use [[ConTeXt Standalone]], please follow [[ConTeXt_Standalone#Font_Directory|these instructions]].<br />
<br />
In Linux, the standard value is:<br />
<br />
OSFONTDIR= /usr/share/fonts//;$HOME/.fonts<br />
<br />
In Windows, the following line is to be added (slashes are fine, no need for backslashes):<br />
<br />
OSFONTDIR= c:/{windows,winnt,winnt35}/fonts//<br />
<br />
On Mac, here is a value:<br />
<br />
OSFONTDIR = /Library/Fonts//;/System/Library/Fonts;$HOME/Library/Fonts<br />
<br />
(If you have font in non–standard locations or use another operating system, all you have to do is to add the path to the `OSFONTDIR` variable.)<br />
<br />
In TeX Live, you have to add this variable (or update it) in `texmf.cnf` (find it with `kpsewhich texmf.cnf`).<br />
<br />
=== Basic usage ===<br />
<br />
Here is the most basic sample:<br />
<br />
<context mode="mkiv" source="yes"><br />
\setupbodyfontenvironment[default][em=italic]<br />
\usemodule[simplefonts][size=10pt]<br />
\setmainfont[TeX Gyre Termes]<br />
\setsansfont[TeX Gyre Heros]<br />
\setmonofont[TeX Gyre Cursor]<br />
<br />
\starttext<br />
Serif typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.<br />
<br />
{\ss Sans--serif typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.}<br />
<br />
{\tt Monospace typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.}<br />
\stoptext<br />
</context><br />
<br />
It isn’t required to define size for 12pt, since it is the default value.<br />
<br />
=== Mixing fonts ===<br />
<br />
In some cases, you might want to mix fonts (it is up to you whether they really match or not).<br />
<br />
Here is the way to do it (I know that fonts don’t match):<br />
<br />
<context mode="mkiv" source="yes"><br />
\setupbodyfontenvironment[default][em=italic]<br />
\usemodule[simplefonts]<br />
\setmainfont[TeX Gyre Termes][italicfont=TeX Gyre Bonum-Italic,<br />
boldfont=TeX Gyre Adventor-Bold, bolditalicfont=TeX Gyre Pagella-Bold Italic]<br />
<br />
\starttext<br />
Serif typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.<br />
\stoptext<br />
</context><br />
<br />
=== Font fallback mechanism ===<br />
<br />
We can have documents in which we use typefaces that lack some characters or a whole character range. In that case, font fallbacks can be defined.<br />
<br />
The example shows how to get Greek characters for TeX Gyre Pagella (I know they don’t fit well together, but I rely on system fonts):<br />
<br />
<context mode="mkiv" source="yes"><br />
\setupbodyfontenvironment[default][em=italic]<br />
\usemodule[simplefonts]<br />
\setmainfontfallback[DejaVu Serif][range={greekandcoptic, greekextended},<br />
force=yes, rscale=auto]<br />
\setmainfont[TeX Gyre Pagella]<br />
<br />
\starttext<br />
English text. δύσκολα τὰ καλά.<br />
<br />
{\em English text. δύσκολα τὰ καλά.}<br />
<br />
{\bf English text. δύσκολα τὰ καλά.}<br />
<br />
{\bf\em English text. δύσκολα τὰ καλά.}<br />
\stoptext<br />
</context><br />
<br />
Two things to be considered:<br />
<br />
* `range` can assume the following values: any of the block names in {{src|char-ini.lua}}, or a manual range such as `0x003B1-0x003B6`.<br />
<br />
* `force=yes` should be enabled, unless you want the characters to have their glyphs from the original font replaced with the ones from the fallback font.<br />
<br />
=== Defining other typefaces and fonts ===<br />
<br />
`simplefonts` has two commands to define fonts and two commands to define typefaces (Times Regular, Times Italics, Times Bold and Times Bold Italic are four different fonts, but a single typeface):<br />
<br />
*`\definesimplefont`, defines a font for the use in headers or other style elements.<br />
*`\simplefont`, defines a font for inline use.<br />
*`\definesimplefonttypeface`, defines a single typeface.<br />
*`\simplefonttypeface`, can define a typeface set (such as serif, sans–serif, monospaced, caligraphy and others).<br />
<br />
The \definesimplefont command can be used when you want a certain font<br />
for the heading of a chapter, section etc. E.g.<br />
<br />
<context mode="mkiv" source="yes"><br />
\definesimplefont[ChapterFont][Gentium Basic][size=24pt]<br />
\setuphead[chapter][style=ChapterFont]<br />
</context><br />
<br />
but Wolfgang doesn’t recommend this command anymore (and removed it from the new, Oct. 2013 version) because you can get the same result with a custom typeface, e.g.<br />
<br />
<context mode="mkiv" source="yes"><br />
\definesimplefonttypeface[chapterfont][Gentium Basic]<br />
\definefont[ChapterFont][\classfont{chapterfont}{Serif} at 24pt]<br />
\setuphead[chapter][style=ChapterFont]<br />
</context><br />
<br />
When you want to change only the global font for your document you<br />
need the <code>\definesimplefonttypeface</code> command, e.g.<br />
<br />
<context mode="mkiv" source="yes"><br />
\definesimplefonttypeface[documentfont][Gentium Basic]<br />
\setupbodyfont[documentfont]<br />
</context><br />
<br />
=== Handling special cases ===<br />
<br />
If the font in question has an unusual naming scheme (or wrong names) and/or it is missing some features, it may be necessary to specify the names to look for and the font features to implement.<br />
<br />
==== Faking italics and bold fonts ====<br />
<br />
As a general rule, it is not a good idea to use faked italics and bold fonts. A slanted font is by no means an italic one (at least, in the vast majority of typefaces). And faked bold fonts don’t look the same as real bold fonts (a similar consideration could be made about small caps).<br />
<br />
Again, it would be the exception, rather than the rule, where this suggested method outputs a reasonable result. If you use ConTeXt for its high–quality typographical performance, using faked fonts can ruin that performance.<br />
<br />
Wolfgang Schuster proposed the following code to get slanted and fake bold fonts:<br />
<br />
<context mode="mkiv" source="yes"><br />
\setupbodyfontenvironment[default][em=italic]<br />
\usemodule[simplefonts]<br />
<br />
\definefontfeature[fakeitalic][default][slant=.25]<br />
\definefontfeature[fakebold][default][extend=2]<br />
\definefontfeature[fakebolditalic][default][slant=.25, extend=2]<br />
\setmainfont[TeX Gyre Pagella]<br />
<br />
\definesimplefonttypeface[fakingall][TeX Gyre Pagella][italicfont={* Regular}, boldfont={* Regular}, bolditalicfont={* Regular}, italicfeatures=fakeitalic,<br />
boldfeatures=fakebold, bolditalicfeatures=fakebolditalic]<br />
<br />
\starttext<br />
Compare:<br />
<br />
Four fonts, real typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.<br />
<br />
{\fakingall One font, faked typeface: regular, {\em italic (actually slanted)} , {\bf bold (actually stretched)} and {\bf\em bold italic (actually slanted and stretched)} fonts.}<br />
\stoptext<br />
</context></div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Unexpected_behavior&diff=22176Unexpected behavior2013-11-12T02:12:05Z<p>Huttarl: </p>
<hr />
<div>If ConTeXt appears to behave in a counterintuitive way, chances are<br />
that it’s actually your intuitions that lack calibration.<br />
<br />
== Controlling Page Break Before Headings ==<br />
If you add the option <code>page=yes</code> to a heading setup, this<br />
will cause ConTeXt to break the page.<br />
Ordinarily this works as expected, unless, however, the heading<br />
immediately follows a previous section heading with no text in between.<br />
The rationale behind this is that consecutive headings are conceived of<br />
collectively as one single structural element.<br />
For example, the following code will generate only a single page<br />
break although the unit {{cmd|section}} appears twice.<br />
<br />
<texcode><br />
\setuphead[section][page=yes] %% toggle page breaking<br />
<br />
\starttext<br />
\chapter{foo} %% structural inhibits breaking<br />
\section{bar} \input knuth %% -> no break!<br />
\section{baz} \input dawkins %% -> break<br />
\stoptext<br />
</texcode><br />
<br />
In order to get the page break at the section regardless of surrounding<br />
structurals elements, you need to ''unset'' the heading parameter<br />
<code>continue</code> as well.<br />
[http://archive.contextgarden.net/message/20080107.115201.ca26c682.en.html]<br />
<br />
<texcode><br />
\setuphead[section][page=yes,continue=no]<br />
<br />
\starttext<br />
\chapter{foo}<br />
\section{bar} \input knuth %% -> break<br />
\section{baz} \input dawkins %% -> break<br />
\stoptext<br />
</texcode><br />
<br />
(For the curious, the explanation can be found in the definition of the<br />
macro {{cmd|strc_sectioning_handle_page_nop|link=no}} in {{src|strc-sec.mkiv}}).<br />
<br />
<br />
== Unsolicited Vertical Mode ==<br />
Some commands like {{cmd|framed}} cause line breaks to happen if used<br />
in vertical mode, e.g. at the beginning of a line.<br />
Example:<br />
<br />
<context source="yes"><br />
\starttext<br />
\framed{foo} bar.<br />
\stoptext<br />
</context><br />
<br />
The explanation according to the corresponding<br />
[http://wiki.contextgarden.net/FAQ#Why_is_there_a_line-break_in_the_output_after_some_commands.3F FAQ item]<br />
is that before the token <code>\frame</code> is encountered, TEX is<br />
in vertical mode.<br />
This state is ''preserved until after TEX finishes typesetting the<br />
<code>\framed</code> macro''.<br />
Consequently, horizontal mode (where paragraphs are made) is entered<br />
only at the tokens <code>bar</code>.<br />
<br />
To have the frame begin the paragraph instead, horizontal mode will<br />
have to be initiated explicitly.<br />
There are a couple macros for this purpose: the very basic<br />
{{cmd|leavevmode}} ({{src|syst-ini.mkiv}}; inserts an empty box, same<br />
as in the Plain format) and the more familiar {{cmd|dontleavehmode}}<br />
({{src|syst-aux.mkiv}}).<br />
Just use the immediately before the <code>\framed</code> macro and<br />
everything should be fine:<br />
<br />
<context source="yes"><br />
\starttext<br />
\leavevmode \framed{foo} bar.\par<br />
\dontleavehmode \framed{foo} bar.<br />
\stoptext<br />
</context><br />
<br />
== Disappearing Crop Marks ==<br />
Crop marks, activated as <code>\setuplayout[marking=on]</code>, are a<br />
useful feature that Context supports out of the box.<br />
They have a peculiarity, though, which my make them useless in specific<br />
cases: They are, by definition, located ''outside the page dimension''.<br />
This means that they show up iff the paper size exceeds the page size.<br />
<br />
Thus if you need auxiliary lines for cutting but have the pages fit the<br />
paper size exactly, you can instead resort to enabling the '''page<br />
background frame'''.<br />
This example sums up the solutions posted by Wolfgang and Marco on<br />
[http://archive.contextgarden.net/message/20120605.202113.0989aa34.en.html<br />
the Context Mailing List].<br />
<texcode><br />
%% the paper size will be a multiple of the page sizes<br />
\setuppapersize [A6,landscape] [A3] <br />
\setuplayout [nx=2,ny=4]%, marking=on] <br />
%% enable the page frame<br />
\setupbackgrounds [page] [frame=on]<br />
%% some further display setups<br />
\setuppagenumbering [location=] <br />
\setupbackgrounds [page] [background=color, backgroundcolor=gray] <br />
\setupbodyfont [sans,58pt] <br />
%% testing ...<br />
\starttext <br />
\dorecurse{4} <br />
{\null\vfill\centerline\recurselevel\vfill\null\page} <br />
\stoptext<br />
</texcode><br />
<br />
== Left and Right ==<br />
When it comes to the justification of paragraphs, do not trust your<br />
intuitions about ''handedness''.<br />
This is a [[Right_and_left|FAQ item]].<br />
<br />
== Footnotes: The Difference between {{cmd|setupnotation}} and {{cmd|setupnote}} ==<br />
<br />
There is a bit of terminology mess concerning notes.<br />
<br />
<!-- I really loathe the wikitext table syntax. --><br />
{|cellpadding="10" style="border:2px solid #addeff"<br />
! style="background:#addeff;" | Instruction !! Goal<br />
|-<br />
| {{cmd|setupnotation}}<br />
| This command configures the '''note insert''', i.e. the textual content that will usually be placed at the bottom (with footnotes) or the end of the text (with endnotes). (The control sequence used to be <code>\setupnotedefinition</code>.)<br />
|-<br />
| {{cmd|setupnote}}<br />
| Configure the '''note environment''' where the inserts will be located. Inherits some parameters from {{cmd|framed}}.<br />
|-<br />
| <code>\setupnote[textstyle=,textcommand=]</code><br />
| Configure the '''note symbol''' as appears in the main text, where the note macro is called.<br />
|-<br />
| Plural forms {{cmd|setupnotes}}, {{cmd|setupnotations}}<br />
| These are synonyms for their singular forms.<br />
|-<br />
| {{cmd|setupfootnotes}}<br />
| This is equivalent to <code>\setupnote[footnote]</code>.<br />
|}<br />
<br />
''Summary'':<br />
to setup a blue note, you would first need to define and configure the<br />
insert via {{cmd|setupnotation}}:<br />
<texcode><br />
\definenote [bluenote] [footnote]<br />
\setupnotation [bluenote] [<br />
color=blue,<br />
style=bf,<br />
]<br />
<br />
\starttext foo\bluenote{bar} baz \stoptext<br />
</texcode><br />
<br />
Now adjust the container where the blue notes will reside at the bottom<br />
of the page ({{cmd|setupnote}}):<br />
<br />
<texcode><br />
\definenote [bluenote] [footnote]<br />
\setupnote [bluenote] [<br />
frame=on, %% frame containing all inserts<br />
framecolor=blue,<br />
background=screen,<br />
rulecolor=blue, %% the line above the inserts<br />
rulethickness=1pt, %% both the frame and line width<br />
]<br />
<br />
\starttext foo\bluenote{bar} baz \bluenote{xyzzy} \stoptext<br />
</texcode><br />
<br />
Finally, direct your attention to the note indicator, most commonly a<br />
number or a symbol.<br />
For precise control over the placement define a monadic macro and hook<br />
it into <code>textcommand</code>.<br />
<br />
<texcode><br />
\setupnote [bluenote] [<br />
textstyle=\tx\sans\bold\blue,<br />
textcommand=\myfootnotecommand,<br />
]<br />
\define[1]\myfootnotecommand{\rotate[rotation=42]{#1}}<br />
<br />
\starttext foo\bluenote{bar} baz \bluenote{xyzzy} \stoptext<br />
</texcode><br />
<br />
(For more definite answers concerning the ''notes'' mechanism, use the<br />
source, Luke: {{src|strc-not.mkvi}}.)<br />
<br />
<br />
== Float Insertion Issues ==<br />
<br />
Floating objects can be tricky.<br />
Deciding where they fit best is hard enough, actually getting them<br />
there may be a lot tougher.<br />
Inserting a float will force a line break where the object is<br />
referenced in the source code.<br />
Thus, very long paragraphs may not leave an opportunity to inject the<br />
float if they cover the entire page.<br />
[http://archive.contextgarden.net/message/20120405.103626.a1349c1c.en.html]<br />
<texcode><br />
\starttext<br />
Cows make<br />
\placefigure[top]{A genuine Dutch cow.}{\externalfigure[cow]}<br />
great pets.<br />
\stoptext<br />
</texcode><br />
In these cases the ''postponing mechanism'' offers a reliable way out<br />
({{cmd|startpostponing}}).<br />
It lets you specify an offset (in pages) by which the content of the<br />
postponing environment will be delayed.<br />
In order to place a floating object at the top of the ''n''th page from<br />
the location it is encountered, its argument has needs to be<br />
<code>[+n]</code>.<br />
(Absolute pages can be specified as simply <code>[n]</code>.)<br />
E.&nbsp;g. to put the foat on the following page:<br />
<texcode><br />
\starttext<br />
\startpostponing[+1]<br />
\placefigure[top]{A genuine Dutch cow.}{\externalfigure[cow.pdf]}<br />
\stoppostponing<br />
\input knuth<br />
\page<br />
Cows make great pets.<br />
\stoptext<br />
</texcode><br />
<br />
Another solution can be the less-known ''hangaround environment''<br />
({{cmd|starthangaround}}, cf.<br />
[[Using_Graphics#Flow_text_around_a_picture|Hangaround]]).<br />
It lets the text of a given paragraph (the content of the environment)<br />
flow around a box (the first argument).<br />
In contrast to real floats it does not place a caption.<br />
This poses a problem in MkIV as the new code will not allow placing<br />
captions arbitrarily.<br />
[[http://repo.or.cz/w/context.git/blob/refs/heads/origin:/tex/context/base/strc-flt.mkvi#l257]]<br />
(If you desparately need separate captions please send a feature<br />
request to one of the<br />
[[ConTeXt_Mailing_Lists#Mailing Lists]]).<br />
<br />
<context source="yes" mode="mkii"><br />
\starttext<br />
\input dawkins<br />
<br />
\starthangaround{<br />
\framed[align=right,frame=off,width=.3\textwidth]{<br />
\externalfigure [cow] [width=.3\textwidth]\crlf<br />
%% NB the fake caption works *only in mkii*<br />
\placefloatcaption<br />
[figure]<br />
[ref:acow]<br />
{A smiling Dutch cow.<br />
{\italic Bos primigenius taurus}}<br />
}<br />
}<br />
\input dawkins<br />
\stophangaround<br />
<br />
\input dawkins<br />
\stoptext<br />
</context><br />
<br />
= Syntax =<br />
== Assignments ==<br />
<br />
In the most common form of key-value type arguments, ConTeXt will<br />
accept trailing commas or even empty items. For example, the following<br />
code shows this tolerance for the command {{cmd|definehighlight}}.<br />
<br />
<texcode><br />
\definehighlight [dontmiss] [<br />
color=red,<br />
,, %% empty option: do nothing<br />
style=bold, %% trailing delimiter<br />
]<br />
</texcode><br />
<br />
This is the syntax accepted e.g. by the majority of setups and<br />
[[Commands_with_KeyVal_arguments|<code>\getparameters</code>]].<br />
(For the parser code cf. {{src|syst-aux.mkiv}}.)<br />
<br />
There are, however, exceptions to this rule. A known case where<br />
options are processed in a less tolerant fashion is<br />
{{cmd|setuplabeltext}}.<br />
[http://www.ntg.nl/pipermail/ntg-context/2012/067585.html]<br />
Thus the following snippet will not compile, forcing ConTeXt to fail<br />
with a cryptic <code>Argument of ...</code> error message.<br />
<texcode><br />
\setuplabeltext<br />
[Nomen=nomen,<br />
Est=est,<br />
Omen=est,] %% <= fails!<br />
\setuplabeltext [Nomen=nomen, Est=est, Omen=omen] %% <= works<br />
\starttext<br />
\labeltext{Nomen}<br />
\labeltext{Est}<br />
\labeltext{Omen}<br />
\stoptext<br />
</texcode><br />
<br />
(A similar exception concerning {{cmd|definepalet}} has been migrated<br />
to the standard argument model but may still show the earlier behavior<br />
in not so recent installations.<br />
[http://www.ntg.nl/pipermail/ntg-context/2012/067673.html])<br />
<br />
<!--<br />
== \usepath ==<br />
Hans announced this one can be expected to be unified in the near<br />
future.<br />
[http://archive.contextgarden.net/message/20110929.151806.3ad6fbdd.en.html]<br />
<br />
What’s the status of this?<br />
--><br />
<br />
== Treacherous Dimensions ==<br />
<br />
At some places dimension-lookalikes are expected but they do not behave<br />
exactly as in TEX per se because they are evaluated differently.<br />
A very common example is the command {{cmd|setupbodyfont}} that is<br />
possibly called, albeit implicitly, in every production document.<br />
Its argument, the ''font size'', although it may look like an ordinary<br />
dimension expression, will not have the same result if it has zeros<br />
prepended or decimal places are specified.<br />
<br />
Suppose you want to set the main font to a very large size:<br />
<br />
<texcode><br />
\setupbodyfont[42pt]<br />
\starttext foobar \stoptext<br />
</texcode><br />
<br />
this works out well as long as you do not mistake the expression<br />
''42pt'' to be a real dimension.<br />
<br />
In TEX dimensions (which are really just integers) are treated the same<br />
irrespective of leading or trailing zeros used in the variable<br />
assignment.<br />
Thus the following are all equivalent:<br />
<br />
<texcode><br />
\newdimen\fortytwo\fortytwo=42pt<br />
\newdimen\fortytoo\fortytoo=042pt<br />
\newdimen\fortytww\fortytww=42.00pt<br />
<br />
\starttext<br />
\the\fortytwo\ \ifnum\fortytwo=\fortytoo\m{\top}\else\m{\bot}\fi\par<br />
\the\fortytoo\ \ifnum\fortytwo=\fortytww\m{\top}\else\m{\bot}\fi\par<br />
\the\fortytww\ \ifnum\fortytoo=\fortytww\m{\top}\else\m{\bot}\fi\par<br />
\stoptext<br />
</texcode><br />
<br />
However, this does not hold for the Context commands<br />
{{cmd|setupbodyfont}} and {{cmd|switchtobodyfont}}.<br />
With the latter macros, only the ''pure-integer'' specification<br />
(<code>42pt</code>) can be used reliably, everything else, even though it<br />
denotates the same TEX dimension, will result in a warning:<br />
<br />
<pre><br />
fonts > bodyfont 42.0pt is defined (can better be done global)<br />
</pre><br />
<br />
Additionally, if the code in question relies on font switching a lot<br />
(e.&nbsp;g. Lua snippets that calculcate font sizes from floating point<br />
numbers), there will be a ''huge'' perfomance penalty because everytime<br />
a font switch occurs, the font will be reloaded entirely.<br />
The reason for this is that the process of defining a font for the main<br />
text is accompanied by a myriad of secondary definitions for different<br />
relative font sizes ({{cmd|tfx|link=no}}, {{cmd|tfa|link=no}}<br />
[[Font_Switching#Font_sizes|and the likes]]) and shapes &ndash; the<br />
creation of the ''body font environment''.<br />
If the “size” requested by {{cmd|setupbodyfont}} cannot be found in the<br />
internal table, this environment will be rebuilt on the spot.<br />
<br />
''It is also not possible to catch these cases by predefining the corresponding bodyfont environments''<br />
by placing {{cmd|definebodyfontenvironment}} statements in the preamble.<br />
So if you have, say:<br />
<br />
<texcode><br />
\definebodyfontenvironment[42.0pt]<br />
\definebodyfontenvironment[042pt]<br />
\definebodyfontenvironment[042.0pt]<br />
\starttext<br />
\setupbodyfont[42.0pt] foo bar<br />
\setupbodyfont[042pt] foo bar<br />
\setupbodyfont[042.0pt] foo bar<br />
\stoptext<br />
</texcode><br />
<br />
the warning and slowdown will occur regardless.<br />
The only real option is to serve {{cmd|setupbodyfont}} and the likes<br />
natural integers only.<br />
<br />
Alternatively you can always employ raw font definitions, if there<br />
isn’t any need for the environment in the first place:<br />
<texcode><br />
\starttext<br />
\definedfont[file:iwona-regular.otf at 42.0pt] foo bar<br />
\definedfont[file:iwona-regular.otf at 042pt] foo bar<br />
\definedfont[file:iwona-regular.otf at 042.0pt] foo bar<br />
\stoptext<br />
</texcode><br />
Here the dimensions are ''real''.<br />
<br />
For further information see<br />
[http://www.ntg.nl/pipermail/ntg-context/2012/067324.html this] and<br />
[http://www.ntg.nl/pipermail/ntg-context/2012/066940.html this]<br />
thread on the mailing list.<br />
<br />
<br />
= Multipass =<br />
<br />
In some circumstances, portions of code are evaluated two or more<br />
times.<br />
This can be disruptive in contexts where the order of actions is<br />
important.<br />
<br />
== Trialtypesetting ==<br />
<br />
Often the size of elements must be calculated prior to determining the<br />
optimal placements.<br />
Probably the most common example are tables:<br />
In order to align cells correctly the dimensions of later parts of the<br />
document must already be determined before anything is typeset.<br />
The stage during which this takes place is called *trial typesetting*.<br />
<br />
The system mode ''trialtypesetting'' allows fine-grained control over<br />
what code should be executed during what stage.<br />
For instance, the naive definition of a macro that increments and<br />
prints a counter register will behave erratically in tables:<br />
<br />
<context source="yes" mode="mkiv"><br />
\def \inccount {%<br />
\incrementnumber [somecount]%<br />
\getnumber [somecount]%<br />
}<br />
\definenumber [somecount]<br />
\setnumber [somecount] [42]<br />
<br />
\starttext<br />
<br />
before \inccount<br />
<br />
\startplacetable[location=here]<br />
\bTABLE<br />
\bTR \bTD \inccount \eTD \bTD \inccount \eTD \eTR<br />
\eTABLE<br />
\stopplacetable<br />
<br />
after \inccount<br />
<br />
\stoptext<br />
</context><br />
<br />
To bypass the extra evaluation, wrap the incrementation part in an<br />
<code>\iftrialtypesetting</code> conditional.<br />
<br />
<context source="yes" mode="mkiv"><br />
\def \inccount {%<br />
\iftrialtypesetting \else<br />
\incrementnumber [somecount]%<br />
\fi<br />
\getnumber [somecount]%<br />
}<br />
<br />
\definenumber [somecount]<br />
\setnumber [somecount] [42]<br />
<br />
\starttext<br />
<br />
before \inccount<br />
<br />
\startplacetable[location=here]<br />
\bTABLE<br />
\bTR \bTD \inccount \eTD \bTD \inccount \eTD \eTR<br />
\eTABLE<br />
\stopplacetable<br />
<br />
after \inccount<br />
<br />
\stoptext<br />
</context><br />
<br />
<br />
Note that annoying as it may appear, the trial typesetting phase is<br />
essential for certain features to work, so take extra care when<br />
omitting it.<br />
In the example above the number itself must be present as placeholder<br />
during the first pass even though it has not been updated at this<br />
point.<br />
<br />
<texcode><br />
\def \inccount {%<br />
\iftrialtypesetting \else<br />
\incrementnumber [somecount]%<br />
\getnumber [somecount]% <= wrong!<br />
\fi<br />
}<br />
</texcode><br />
<br />
<context mode="mkiv" source="no"><br />
\def \inccount {%<br />
\iftrialtypesetting \else<br />
\incrementnumber [somecount]%<br />
\getnumber [somecount]%<br />
\fi<br />
}<br />
<br />
\definenumber [somecount]<br />
\setnumber [somecount] [42]<br />
<br />
\starttext<br />
<br />
before \inccount<br />
<br />
\startplacetable[location=here]<br />
\bTABLE<br />
\bTR \bTD \inccount \eTD \bTD \inccount \eTD \eTR<br />
\eTABLE<br />
\stopplacetable<br />
<br />
after \inccount<br />
<br />
\stoptext<br />
</context><br />
<br />
<br />
== Tables ==<br />
<br />
In addition to trial typesetting Context also knows a ''table'' state:<br />
<br />
<context mode="mkiv" source="yes"><br />
\def \tablecheck {\ifintable In table. \else Outside table. \fi}<br />
<br />
\starttext<br />
\tablecheck<br />
\startplacetable[location=here]<br />
\bTABLE<br />
\bTR \bTD \tablecheck \eTD \bTD \tablecheck \eTD \eTR<br />
\eTABLE<br />
\stopplacetable<br />
\tablecheck %% decrement<br />
\stoptext<br />
</context><br />
<br />
== Metapost ==<br />
<br />
As with TeX, Metapost sometimes requires multiple passes,<br />
especially when processing text.<br />
In below snippet, the Metapost tracer reveals that the code is actually<br />
evaluated twice:<br />
<br />
<texcode><br />
\enabletrackers[metapost.showlog]<br />
\starttext<br />
\startMPcode<br />
show "This gets printed twice.";<br />
label (btex Some label text etex, (0,0));<br />
\stopMPcode<br />
\stoptext<br />
</texcode><br />
<br />
NB removing the <code>label</code> statement will result in the second<br />
pass being omitted.<br />
<br />
In [[Metafun]], the default Metapost format in Context, the booleans<br />
<code>mfun_first_run</code> and <code>mfun_trial_run</code> allow<br />
detecting the individual stages:<br />
<br />
<texcode><br />
\enabletrackers[metapost.showlog]<br />
\starttext<br />
\startMPcode<br />
if mfun_trial_run :<br />
show "This gets printed during the trial pass.";<br />
else :<br />
show "This gets printed during the final pass.";<br />
fi;<br />
label (btex Some label text etex, (0,0));<br />
\stopMPcode<br />
\stoptext<br />
</texcode></div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/setuptab&diff=22175Command/setuptab2013-11-11T15:52:55Z<p>Huttarl: clarify what we're talking about before diving into the details.</p>
<hr />
<div>{{Reference<br />
|name=setuptab<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\setuptab<span class="first" >[...,...=...,...]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[[Command/keyword:headstyle|headstyle]]</td><br />
<td>'''[[Command/value:normal|normal]]''' [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small...|small...]] [[Command/value:command|command]] </td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[[Command/keyword:style|style]]</td><br />
<td>'''[[Command/value:normal|normal]]''' [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small|small]]... ''[[Command/value:command|command]]'' </td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[[Command/keyword:sample|sample]]</td><br />
<td>[[Command/value:text|text]] </td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[[Command/keyword:width|width]]</td><br />
<td>[[Command/value:dimension|dimension]] default: '''broad'''</td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[[Command/keyword:sample|sample]]</td><br />
<td>[[Command/value:dimension|dimension]] default: '''\hskip4em'''</td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">MkII: [[Command/keyword:location|location]]<br /><br />
MkIV: [[Command/keyword:alternative|alternative]]</td><br />
<td>'''left'''</td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">...=...</td><br />
<td>''see'' {{cmd|setupdescriptions}}</td><br />
</tr><br />
</table><br />
<br />
== Description == <br />
<code>\tab</code> (a <code>description</code> created with <code>{{cmd|definedescription}}[tab]</code>) starts an indented paragraph with a word or two (the 'key') in front of it. <code>\setuptab</code> configures styles and dimensions for <code>\tab</code>. By default, it leaves 4em for the key and 2em of space between the key area and the paragraph, the latter thanks to <code>width=broad</code>. <code>width=fit</code> leaves no space in between. In mkiv, <code>width=fit</code> leaves 1em of space between the key space and the paragraph; this is probably a bug.<br />
<br />
== Example ==<br />
<context source=yes><br />
\def\ruler{%<br />
\dorecurse{8}{%<br />
\dontleavehmode%<br />
\blackrule[width={\dimexpr1em-0.5pt}, height=0.5pt]%<br />
\dontleavehmode%<br />
\blackrule[width=0.5pt, height=1ex]%<br />
}<br />
}<br />
<br />
\def\testpara{%<br />
They might have called Sunday the super-man. If any such creature<br />
be conceivable, he looked, indeed, somewhat like it, with his<br />
earth-shaking abstraction, as of a stone statue walking.<br />
}<br />
<br />
(The ruler is marked in ems. <br />
The quotation is from G.K. Chesterton's {\em The Man who was Thursday}.)<br />
<br />
\ruler \par<br />
\setuptab[width=broad, sample={\blackrule[width=2em]}, headstyle=slanted]<br />
\tab{\blackrule[width=2em]} (Sample of 2em wide, broad width.) \testpara \par<br />
<br />
\ruler \par<br />
\setuptab[width=broad, sample={\blackrule[width=4em]}, headstyle=slanted]<br />
\tab{\blackrule[width=4em]} (Sample of 4em wide, broad width.) \testpara \par<br />
<br />
\ruler \par<br />
\setuptab[width=fit, sample={\blackrule[width=2em]}, headstyle=slanted]<br />
\tab{\blackrule[width=2em]} (Sample of 2em wide, fit width.) \testpara \par<br />
<br />
\ruler \par<br />
\setuptab[width=3em, sample={thisisaverylongsample}, headstyle=slanted]<br />
\tab{\blackrule[width=3em]} (Exact width of 3em overrides long sample.) \testpara \par<br />
<br />
</context><br />
<br />
== See also ==<br />
* {{cmd|tab}}<br />
* {{cmd|setupdescriptions}}<br />
* [[source:core-mis.mkii|core-mis.mkii]], [[source:core:mis.mkiv|core-mis.mkiv]]<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Paragraphs|setuptab]]<br />
[[Category:Command/Descriptions|setuptab]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/setvariables&diff=22172Command/setvariables2013-11-07T21:34:06Z<p>Huttarl: created page</p>
<hr />
<div>{{Reference<br />
|name=setupvariables<br />
|attributes=<br />
}}<br />
<br />
== Description ==<br />
<br />
Assign values to variables in a namespace. See [[Setups]].<br />
<br />
== Example ==<br />
<br />
<texcode><br />
% \setups[namespace:set] is automatically called right after 'set' is assigned<br />
\setvariables[namespace]<br />
[set={\setups[namespace:set]},<br />
key={Apples are \applecolor!},<br />
reset={\setups[namespace:reset]},<br />
]<br />
<br />
</texcode><br />
<br />
== See also ==<br />
* {{cmd|getvariable}}<br />
* {{cmd|setupvariables}}<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|setupvariables}}<br />
<br />
[[Category:Command|setupvariables]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/getvariable&diff=22171Command/getvariable2013-11-07T21:21:47Z<p>Huttarl: created page</p>
<hr />
<div>{{Reference<br />
|name=getvariable<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\getvariable<!--<br />
--><span class="first">{...}</span><!--<br />
--><span class="second">{...}</span><!--<br />
--></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">{...}</td><br />
<td>''namespace?''</td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">{...}</td><br />
<td>''variable name?''</td><br />
</tr><br />
</table><br />
<br />
== Description ==<br />
Retrieve the value of the named variable in the specified namespace.<br />
<br />
== Example ==<br />
<texcode><br />
</texcode><br />
<br />
<br />
== See also ==<br />
* {{cmd|setupvariables}}<br />
* {{cmd|env}}<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|getvariable}}<br />
<br />
[[Category:Command/Internals|getvariable]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/startsetups&diff=22170Command/startsetups2013-11-07T20:14:07Z<p>Huttarl: pointed to Setups, since that's the most direct route to an explanation of \startsetups.</p>
<hr />
<div>{{Reference<br />
|name=startsetups<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<br />
<br />
== Description == <br />
See [[Setups]] for details.<br />
<br />
<br />
== Example ==<br />
<!-- Please fill in an example if you can --><br />
<br />
== See also ==<br />
<!-- something like {{cmd|goto}} --><br />
* [[Setups]]<br />
* {{cmd|setups}}<br />
* {{cmd|directsetups}}<br />
* {{cmd|rawsetups}}<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Commands|setups]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/setup&diff=22167Command/setup2013-11-07T19:31:42Z<p>Huttarl: Created page with "{{Reference |name=setup |attributes= }} == Syntax == <table cellspacing="4" cellpadding="2" class="cmd"> <tr> <td colspan="2" class="cmd">\setup<span cl..."</p>
<hr />
<div>{{Reference<br />
|name=setup<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\setup<span class="first" style="color:red;">[ID]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[ID]</td><br />
<td>the name of the setup to invoke</td><br />
</tr><br />
</table><br />
<br />
== Description == <br />
<br />
See {{cmd|setups}}.<br />
<br />
== See also ==<br />
* [[Setups]]<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Commands|setups]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/setups&diff=22166Command/setups2013-11-07T19:29:38Z<p>Huttarl: Created page with "{{Reference |name=setups |attributes= }} == Syntax == <table cellspacing="4" cellpadding="2" class="cmd"> <tr> <td colspan="2" class="cmd">\setups<span ..."</p>
<hr />
<div>{{Reference<br />
|name=setups<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\setups<span class="first" style="color:red;">[ID]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[ID]</td><br />
<td>the name of the setup to invoke</td><br />
</tr><br />
</table><br />
<br />
== Description == <br />
<br />
{{cmd|setup|[mysetup]}} or {{cmd|setups|[mysetup]}} invokes a previously defined setup.<br />
See [[Setups]] for more information.<br />
<br />
== See also ==<br />
* [[Setups]]<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Commands|setups]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Setups&diff=22165Setups2013-11-07T19:13:31Z<p>Huttarl: </p>
<hr />
<div>In ConTEXt, setups are a rather common variant on macros. Setups have two useful properties:<br />
<br />
* Spaces inside setups are ignored. This means that you can format the setup's contents with spaces and linebreaks for maximum readability, instead of having to write a dense macro or, worse, a long in-place definition. You can explicitly request spaces with {{cmd|space}}, {{cmd|crlf}}, {{cmd|par}}, etc.<br />
<br />
* If you call the setup inside a {{cmd|start}} (just 'start') environment, any definitions made by that setup remain inside that group. This lets you define macros in a setup, and then call the setup inside a group to use the macros as 'local macros' of sorts.<br />
<br />
== Commands ==<br />
<br />
* {{cmd|startsetups| mysetup}} begins a setup definition (with optional brackets around <tt>mysetup</tt>)<br />
* {{cmd|setup|[mysetup]}} or {{cmd|setups|[mysetup]}} invokes a setup.<br />
<br />
== Examples ==<br />
<br />
<br />
Here are two simple examples:<br />
{{Multicol}}<br />
<texcode width=50%><br />
% Create two setups<br />
\startsetups doc:print<br />
\setuppapersize[A4][A4]<br />
\stopsetups<br />
<br />
\startsetups doc:screen<br />
\setuppapersize[S6][S4]<br />
\stopsetups<br />
<br />
% Use one or another setup<br />
\doifmodeelse {paper} {<br />
\setup[doc:print]<br />
} {<br />
\setup[doc:screen]<br />
}<br />
</texcode><br />
{{Multicol-break}}<br />
<texcode><br />
% Set up a headertext. Whitespace is ignored<br />
\startsetups[doc:header]<br />
\marking[chapter]<br />
\space<br />
--<br />
\space<br />
\pagenumber<br />
\stopsetups<br />
<br />
% Use the setup<br />
\setupheadertexts[\setup{doc:header}]<br />
</texcode><br />
{{Multicol-end}}<br />
<br />
You can place setups almost everywhere and environment will not be affected by their execution. It is useful to wrap overlay definitions and such in setups as in (copied from [[Colorful_CD_Inlay]] page):<br />
<br />
<texcode><br />
\defineoverlay [origin] [\setups{origin}]<br />
<br />
\startsetups origin<br />
\vbox to \overlayheight {<br />
\vfill\tfxx\setstrut<br />
\hsize\overlaywidth<br />
\hfill Fiona Apple\enspace EM\enspace2005\quad\strut\endgraf<br />
\kern1ex<br />
}<br />
\stopsetups<br />
</texcode><br />
<br />
You can even do things like:<br />
<br />
<texcode><br />
\starttext<br />
\startsetups settest<br />
\def\command{do something with}<br />
<br />
I want to \command{} my command.<br />
\stopsetups<br />
<br />
\start<br />
\setups{settest}<br />
\stop<br />
<br />
\command aaa % will give "undefined control sequence" error<br />
<br />
\stoptext<br />
</texcode><br />
<br />
== Using setups for namespaces ==<br />
Using <tt>\setups</tt> for a variable namespace allows an easier control over the<br />
containing variables.<br />
All you have to do is to define the setups<br />
<tt>namespace:set</tt> and/or <tt>namespace:reset</tt><br />
for a given namespace.<br />
Now every time a variable of that namespace is assigned (written), ConTeXt<br />
automatically calls these setups. Reading of variables is totally unaffected by these<br />
settings.<br />
A possible use are default values, calculations and even verification.<br />
<br />
So once you have 'setup' your variables proper, you don't have to worry about<br />
unset variables and alike any more. Also changes can be made easy, as there is only<br />
one common setup.<br />
The drawback is the slower speed in use,<br />
as every assignment to a variable calls these setups.<br />
<br />
<br />
To give you the idea, try this example.<br />
<br />
* When you initialize the namespace, the setups assigned to {{code|set}} are called.<br />
<br />
* When you assign a variable to the namespace, first the setup in {{code|reset}} is called, and then the setup in {{code|set}}.<br />
<br />
<context source=yes><br />
\startsetups namespace:set<br />
% Print message to log and to document<br />
\writestatus{VARIABLES}{namespace:set is being called..}%<br />
\space{\blue[namespace:set]}<br />
\def\applecolor{red}<br />
% whatever must be done with your variables after you assign a value<br />
% (initialisation with defaults,..)<br />
\stopsetups<br />
<br />
\startsetups namespace:reset<br />
% Print message to log and document<br />
\writestatus{VARIABLES}{namespace:set is being called..}%<br />
\space{\red[namespace:reset]}<br />
<br />
% whatever must be done after an assignment (verification, calculation,..)<br />
\stopsetups<br />
<br />
<br />
% \setups[namespace:set] is automatically called right after 'set' is assigned<br />
\setvariables[namespace]<br />
[set={\setups[namespace:set]},<br />
key={Apples are \applecolor!},<br />
reset={\setups[namespace:reset]},<br />
]<br />
<br />
% watch for the colors<br />
\setupcolors[state=start]<br />
<br />
\starttext<br />
\hairline<br />
{\bf reading has no effect\par}<br />
{\tt Calling \type{\getvariable{namespace}{key}}...\getvariable{namespace}{key}}<br />
<br />
\blank<br />
{\bf writing calls reset and set\par}<br />
{\tt Calling \type{\setvariables[namespace][key=value]}...\setvariables[namespace][key=value]}<br />
<br />
\stoptext<br />
</context></div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Setups&diff=22164Setups2013-11-07T19:10:45Z<p>Huttarl: corrected typo: \startsetup is not defined</p>
<hr />
<div>In ConTEXt, setups are a rather common variant on macros. Setups have two useful properties:<br />
<br />
* Spaces inside setups are ignored. This means that you can format the setup's contents with spaces and linebreaks for maximum readability, instead of having to write a dense macro or, worse, a long in-place definition. You can explicitly request spaces with {{cmd|space}}, {{cmd|crlf}}, {{cmd|par}}, etc.<br />
<br />
* If you call the setup inside a {{cmd|start}} (just 'start') environment, any definitions made by that setup remain inside that group. This lets you define macros in a setup, and then call the setup inside a group to use the macros as 'local macros' of sorts.<br />
<br />
== Commands ==<br />
<br />
* {{cmd|startsetups| mysetup}} begins a setup definition<br />
* {{cmd|setup|[mysetup]}} or {{cmd|setups|[mysetup]}} invokes a setup.<br />
<br />
== Examples ==<br />
<br />
<br />
Here are two simple examples:<br />
{{Multicol}}<br />
<texcode width=50%><br />
% Create two setups<br />
\startsetups doc:print<br />
\setuppapersize[A4][A4]<br />
\stopsetups<br />
<br />
\startsetups doc:screen<br />
\setuppapersize[S6][S4]<br />
\stopsetups<br />
<br />
% Use one or another setup<br />
\doifmodeelse {paper} {<br />
\setup[doc:print]<br />
} {<br />
\setup[doc:screen]<br />
}<br />
</texcode><br />
{{Multicol-break}}<br />
<texcode><br />
% Set up a headertext. Whitespace is ignored<br />
\startsetups[doc:header]<br />
\marking[chapter]<br />
\space<br />
--<br />
\space<br />
\pagenumber<br />
\stopsetups<br />
<br />
% Use the setup<br />
\setupheadertexts[\setup{doc:header}]<br />
</texcode><br />
{{Multicol-end}}<br />
<br />
You can place setups almost everywhere and environment will not be affected by their execution. It is useful to wrap overlay definitions and such in setups as in (copied from [[Colorful_CD_Inlay]] page):<br />
<br />
<texcode><br />
\defineoverlay [origin] [\setups{origin}]<br />
<br />
\startsetups origin<br />
\vbox to \overlayheight {<br />
\vfill\tfxx\setstrut<br />
\hsize\overlaywidth<br />
\hfill Fiona Apple\enspace EM\enspace2005\quad\strut\endgraf<br />
\kern1ex<br />
}<br />
\stopsetups<br />
</texcode><br />
<br />
You can even do things like:<br />
<br />
<texcode><br />
\starttext<br />
\startsetups settest<br />
\def\command{do something with}<br />
<br />
I want to \command{} my command.<br />
\stopsetups<br />
<br />
\start<br />
\setups{settest}<br />
\stop<br />
<br />
\command aaa % will give "undefined control sequence" error<br />
<br />
\stoptext<br />
</texcode><br />
<br />
== Using setups for namespaces ==<br />
Using <tt>\setups</tt> for a variable namespace allows an easier control over the<br />
containing variables.<br />
All you have to do is to define the setups<br />
<tt>namespace:set</tt> and/or <tt>namespace:reset</tt><br />
for a given namespace.<br />
Now every time a variable of that namespace is assigned (written), ConTeXt<br />
automatically calls these setups. Reading of variables is totally unaffected by these<br />
settings.<br />
A possible use are default values, calculations and even verification.<br />
<br />
So once you have 'setup' your variables proper, you don't have to worry about<br />
unset variables and alike any more. Also changes can be made easy, as there is only<br />
one common setup.<br />
The drawback is the slower speed in use,<br />
as every assignment to a variable calls these setups.<br />
<br />
<br />
To give you the idea, try this example.<br />
<br />
* When you initialize the namespace, the setups assigned to {{code|set}} are called.<br />
<br />
* When you assign a variable to the namespace, first the setup in {{code|reset}} is called, and then the setup in {{code|set}}.<br />
<br />
<context source=yes><br />
\startsetups namespace:set<br />
% Print message to log and to document<br />
\writestatus{VARIABLES}{namespace:set is being called..}%<br />
\space{\blue[namespace:set]}<br />
\def\applecolor{red}<br />
% whatever must be done with your variables after you assign a value<br />
% (initialisation with defaults,..)<br />
\stopsetups<br />
<br />
\startsetups namespace:reset<br />
% Print message to log and document<br />
\writestatus{VARIABLES}{namespace:set is being called..}%<br />
\space{\red[namespace:reset]}<br />
<br />
% whatever must be done after an assignment (verification, calculation,..)<br />
\stopsetups<br />
<br />
<br />
% \setups[namespace:set] is automatically called right after 'set' is assigned<br />
\setvariables[namespace]<br />
[set={\setups[namespace:set]},<br />
key={Apples are \applecolor!},<br />
reset={\setups[namespace:reset]},<br />
]<br />
<br />
% watch for the colors<br />
\setupcolors[state=start]<br />
<br />
\starttext<br />
\hairline<br />
{\bf reading has no effect\par}<br />
{\tt Calling \type{\getvariable{namespace}{key}}...\getvariable{namespace}{key}}<br />
<br />
\blank<br />
{\bf writing calls reset and set\par}<br />
{\tt Calling \type{\setvariables[namespace][key=value]}...\setvariables[namespace][key=value]}<br />
<br />
\stoptext<br />
</context></div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Installing_a_TrueType_font,_step_by_step_-_Old_Content&diff=22162Installing a TrueType font, step by step - Old Content2013-11-05T00:17:42Z<p>Huttarl: Expanded note at top, and clarified about bold weight.</p>
<hr />
<div>{{note | The contents of this page are OLD, from before ConTeXt MKIV. It might need a bit of updating...<br />
<br />
The easier route than what's on this page is to install the [http://tug.org/gentium/ gentium-tug package]. In TeX Live on Linux, type <br />
<tt>sudo /usr/local/bin/tlmgr install gentium-tug</tt>}}<br />
<br />
== Background ==<br />
<br />
I wanted to install the very fine Gentium font to my computer. The font is a free font with a very wide collection of Latin and Greek glyphs (Cyrillic to come later). It can be downloaded from the SIL web page: http://scripts.sil.org/cms/scripts/page.php?item_id=Gentium.<br />
<br />
While the font system is rather elegant and can be tweaked every possible way, it is difficult to get started with. For a beginner, new fonts may feel extremely difficult to install.<br />
<br />
There are several good introductions to the subject. This is not one of those, as I am not going to tell a word about why or what. This is just a description of how I managed to install a new font. The process is surprisingly easy if it goes smoothly. If it doesn't, then I cannot help... If you want to stay out of trouble, please test your ConTeXt installation before installing the fonts. If it doesn't work before, it won't after.<br />
<br />
My installation is a rather recent gwTeX (31 Jan 05) on Mac OS X with a ConTeXt installation from the same date. As the distribution is based on TeX Live, I guess the instructions given here should be rather universal. I am sorry, but the instructions give all the commands in the Unix form, so Windows users have to adapt. I try to give some hints to Windows and Linux users, as well, but everything is untested.<br />
<br />
== Procedure ==<br />
<br />
Before starting, it is important to understand that the ConTeXt font installation is completely independent from the operating system fonts. You may have a font which ConTeXt can use but the operating system does not see, or vice versa. In many cases it is very useful to have the same fonts available, e.g., it is nice to be able to use the same fonts in illustrations drawn with a drawing package and text typeset by ConTeXt. Unfortunately, there is no simple link between the two font systems.<br />
<br />
In most cases it is possible to install the operating system fonts for ConTeXt to use. The converse holds true, as well. Especially the OS part of that is certainly beyond the scope of this text, but some ideas for the opposite are given.<br />
<br />
=== Getting the font files ===<br />
<br />
Before anything can be installed, that anything should be obtained. ConTeXt requires the TrueType <tt>.ttf</tt> files (or type 1, but that's another story). The easiest way to get the <tt>.ttf</tt> files is to download the Windows font files from the foundry (wherever you get your fonts from). Even if your system is Linux or OS X, the Windows files provide the easiest way to get the font files in the correct format, because they are almost always either pure <tt>.ttf</tt> or zipped <tt>.ttf</tt> files.<br />
<br />
If you have the font installed in Windows or XWin (Linux, etc.), try to locate the corresponding <tt>.ttf</tt> file (actual location varies by the OS). The naming scheme may be confusing, finding the right files may take some effort. Usually you need at least two to four files (bold and italic are separate files, etc.)<br />
<br />
With OS X the situation is a bit trickier, as the system does not store the <tt>.ttf</tt> files as such. If you either have only the OS X font file (usually <tt>.sit</tt>) or the font is only installed in your computer, you need to extract the actual <tt>.ttf</tt> files. Go and get a small utility called <tt>fondu</tt>. The utility comes with OpenOffice or can be downloaded from http://fondu.sourceforge.net/ . Using the utility is very simple: just type the path to the font to be converted, e.g.: <tt>fondu /Users/username/Library/Fonts/Gentium</tt> and you will get a couple of <tt>.ttf</tt> files in the current working directory.<br />
<br />
=== Installing the fonts ===<br />
<br />
Once you have obtained the <tt>.ttf</tt> files one way or another, it is wise to make a temporary directory somewhere. If you do not know where, go and make a directory under <tt>/tmp</tt>, for example <tt>/tmp/work</tt>. There is no magic in the directory name, anything goes.<br />
<br />
Now we have a nice temporary directory somewhere and a few <tt>.ttf</tt> files in it. Then the actual font installation goes with a magic command (read on, if you want to avoid some pitfalls with file permissions):<br />
<br />
<tt>texfont --ve=sil --co=gentium --makepath --install</tt><br />
<br />
This tells the wonderful <tt>texfont</tt> script to process all the <tt>.ttf</tt> files in the directory (you can limit the choice by supplying file names to the end of the command). The vendor of the fonts is <tt>sil</tt> and the name for the font collection is <tt>gentium</tt>. Again, there is no magic in these names, they are just used as directory names in the <tt>texmf</tt> tree. However, using just anything will make administration harder later on, so try to stick to reality.<br />
<br />
The last two switches tell the script to make all missing directories and install the actual <tt>.ttf</tt> files to the right place in the <tt>texmf</tt> tree. In my case everything was installed into the local tree (<tt>/usr/local/teTex/share/texmf.local/...</tt>).<br />
<br />
Beware, you will need administrative priviledges (power user, administrator, root) to be able to change the <tt>texmf</tt> tree. On Unix/Linux/OS X systems you can either log in as <tt>root</tt> which is not a good idea in general or use <tt>sudo</tt>. In OS X and other <tt>sudo</tt>-aware operating systems the following will work for all power users:<br />
<br />
<tt>sudo texfont --ve=sil --co=gentium --makepath --install</tt><br />
<br />
Note that the password asked at this point is your password, not the root password.<br />
<br />
In Windows, you should log in as a Power User (Administrator, whatever, different names in different versions of Windows). Otherwise you will end up with permission conflicts.<br />
<br />
If you manage to get to this point and <tt>texfont</tt> does not complain much, the fonts are installed!<br />
<br />
The command above will make the fonts with texnansi encoding. If you don't know what encodings are, then just let it be as it is. If you need another encoding (such as ec, 8r), it can be specified with a switch <tt>--en=ec</tt>. You can install the same font several times with different encodings; the naming scheme allows coexistence.<br />
<br />
With the simple command line you may have problems with ligatures. For example, two hyphens <tt>--</tt> in the source file still print as two hyphens (not as an en dash). This can be cured by giving the switch <tt>--afmpl</tt> which tells <tt>texfont</tt> to use a slightly more intelligent utility (<tt>afm2pl</tt>) with the fonts.<br />
<br />
Unfortunately, there seems to be a file missing in gwTeX, so you will need to get <tt>default.lig</tt> somewhere. The easiest way is to download it from http://www.tug.org/ftp/texlive/Contents/testinstalled/texmf/fonts/lig/afm2pl/default.lig . Placing it in your working directory is enough, but you could also download all the <tt>.lig</tt> files in that directory and putting them in your own TeX tree at fonts/lig/afm2pl, and then run texhash/mktexlsr.<br />
<br />
== Testing the fonts ==<br />
<br />
One of the nicest features in <tt>texfont</tt> is that it produces a test file. In this case the file is called <tt>texnansi-sil-gentium.tex</tt>. This file can be run by <tt>texexec --pdf texnansi-sil-gentium.tex</tt>. It will take a while (with my 1.25 GHz G4 it takes around a minute), but the result will be a few pages of glyphs.<br />
<br />
<br />
== Using the fonts in a document ==<br />
<br />
To use the fonts in a document, a few definitions are needed. A simple test document is shown below:<br />
<br />
<texcode><br />
\loadmapfile[ec-sil-gentium.map]<br />
\usetypescriptfile[type-buy]<br />
<br />
\starttypescript [serif] [Gentium] [ec]<br />
\usetypescript[serif][fallback]<br />
\definefontsynonym [Gentium-Roman] [ec-GentiumRegular] [encoding=ec]<br />
\definefontsynonym [Gentium-Italic] [ec-GentiumItalic] [encoding=ec]<br />
\stoptypescript<br />
<br />
\starttypescript [serif] [Gentium] [name]<br />
\usetypescript[serif][fallback]<br />
\definefontsynonym [Serif] [Gentium-Roman]<br />
\definefontsynonym [SerifItalic] [Gentium-Italic]<br />
\stoptypescript<br />
<br />
\starttypescript [Gentium] <br />
\definetypeface [MyGentium] [rm] [serif] [Gentium] [default] [encoding=ec]<br />
\stoptypescript<br />
<br />
\usetypescript[Gentium]<br />
\setupbodyfont[MyGentium,11pt]<br />
<br />
\starttext<br />
<br />
This is Gentium!<br />
<br />
{\it This is Gentium Italic!}<br />
<br />
\stoptext<br />
</texcode><br />
<br />
One important thing to note is that '''there aren't Bold or Bold Italic flavours''' available yet for Gentium Plus. So, "to regularly go where no man has gone before". But bold Gentium Basic and Gentium Book Basic do include bold and bold italic.<br />
<br />
Of course, you can (and probably should) put the typescript definitions into another file so that they can be reused in other documents. For more information on using typescripts, Wiki around! My suggestion is to start with the [http://home.salamander.com/~wmcclain/context-help.html Bill McClain's ConTeXt beginners page] and then check the [[TypeScripts]] page. Note that the font names on the latter are slightly different from the ones on this page even though the font is the same.<br />
<br />
[[Category:Fonts]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/definefont&diff=22124Command/definefont2013-10-08T19:49:11Z<p>Huttarl: filled in from reference manual</p>
<hr />
<div>{{Reference<br />
|name=definefont<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\definefont<span class="first" >[...]</span><span class="second" >[...]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td>name </td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">[...]</td><br />
<td>file </td><br />
</tr><br />
<tr valign="top" class="third"><br />
<td class="cmd">[...]</td><br />
<td>text (optional) </td><br />
</tr><br />
</table><br />
<br />
<br />
== Description == <br />
This macro defines a font with the same name as the first argument and you can use its name<br />
as an identifier to select that font. The second argument works in the same way as the second<br />
argument to \definefontsynonym: you can use either a font synonym or a real font. There<br />
is an optional third argument that can be either a bare number like 1.5 , or a named setup. In case of a bare number, that is a local setting for the interline space. In case<br />
of a setup, that setup can do whatever it wants.<br />
<br />
== Example ==<br />
<texcode><br />
\loadmapfile [koeieletters]<br />
\definefont [ContextLogo] [koeielogos at 72pt]<br />
\ContextLogo \char 2<br />
</texcode><br />
<br />
== See also ==<br />
<!-- something like {{cmd|goto}} --><br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Fonts|definefont]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Font_Switching&diff=22109Font Switching2013-09-30T20:12:06Z<p>Huttarl: Reworded to explain how the quick font switch commands don't change the body font, just the effective font</p>
<hr />
<div>< [[Basic Text Formatting]] | [[Fonts]] | [[Font Sizes]] ><br />
<br />
<br />
In ConTeXt there are four ways to switch fonts:<br />
<br />
* font style/alternative commands ({{cmd|rm}}, {{cmd|ss}}, etc.),<br />
* font size commands ({{cmd|tfa}}, {{cmd|tfb}}, etc.),<br />
* mnemonic command aliases ({{cmd|bold}}, {{cmd|sans}}, etc.),<br />
* a complete font change ({{cmd|setupbodyfont}}, {{cmd|switchtobodyfont}}).<br />
<br />
== Font styles and alternatives ==<br />
<br />
There are three main types of font styles: serif, sans serif, and teletype. To<br />
switch between these styles, use {{cmd|rm}} for serif, {{cmd|ss}} for<br />
sans serif, and {{cmd|tt}} for teletype.<br />
<br />
Each of these styles comes in different alternatives: normal, bold, italic,<br />
slanted, bold-italic, bold-slanted, and small-capped. To switch to a different<br />
alternative, use {{cmd|tf}} ("typeface") for normal, {{cmd|bf}} for bold, {{cmd|it}}<br />
for italic, {{cmd|sl}} for slanted, {{cmd|bi}} for bold-italic,<br />
{{cmd|bs}} for bold-slanted, and {{cmd|sc}} for small-capped.<br />
<br />
You can generally combine font styles with alternatives, so if you want to<br />
switch to bold sans serif, you can use either <code>\bf\ss</code> or<br />
<code>\ss\bf</code>. <br />
<br />
There is a font switch {{cmd|em}} to ''emphasize'' text. This is somewhat<br />
special: it does automatic italic correction and changes the alternative depending<br />
on the current alternative. For example, if the current font alternative is normal (i.e. upright),<br />
{{cmd|em}} switches to slanted; and if the current font alternative is slanted,<br />
{{cmd|em}} switches to normal.<br />
<br />
ConTeXt uses the Latin Modern fonts by default; these fonts look<br />
similar to the original Computer Modern fonts, but have a much larger<br />
character repertoire. As it happens, in the Latin Modern (and Computer<br />
Modern) fonts, the slanted font does not stand out from the<br />
upright font enough for some tastes; so, many people prefer to use the<br />
italic font for emphasis. To do that use <br />
<texcode><br />
\definebodyfontenvironment[default][em=italic]<br />
</texcode><br />
<br />
A font switch remains valid for the rest of the ''group''. So, if you want to<br />
temporarily switch to a different font, use the font style command inside a<br />
group. The easiest way to start a group is to enclose the text within braces<br />
(also called curly brackets), for example<br />
<br />
<texcode><br />
This is serif text<br />
{\ss This is sans serif}<br />
This is serif again<br />
{\tt and this is typewriter}<br />
And serif again<br />
</texcode><br />
<br />
which gives (notice the braces in the above lines)<br />
<br />
<context><br />
This is serif text \crlf<br />
{\ss This is sans serif} \crlf<br />
This is serif again \crlf<br />
{\tt and this is typewriter} \crlf<br />
And serif again<br />
</context><br />
<br />
== Font sizes ==<br />
<br />
Occasionally one needs to use a font size different from the bodyfont. ConTeXt provides two series<br />
of commands for that. For a larger font size, you can use {{cmd|tfa}} to scale<br />
the font size by a factor of <code>1.2</code>, {{cmd|tfb}} to scale by a factor of<br />
<code>(1.2)^2 = 1.44</code>, {{cmd|tfc}} to scale by <code>(1.2)^3 = 1.728</code> and {{cmd|tfd}} to<br />
scale by <code>(1.2)^4 = 2.074</code>. The scale is relative to the current bodyfont size.<br />
<br />
To decrease the font size, you can use {{cmd|tfx}}<br />
to scale the font by a factor of <code>0.8</code> and {{cmd|tfxx}} to scale by a factor<br />
of <code>0.6</code>.<br />
<br />
The mapping of particular command suffixes (a, x, etc.) and current bodyfont size to effective font size can<br />
be changed by {{cmd|definebodyfontenvironment}}.<br />
For example, if you want<br />
{{cmd|tfa}} to set the effective font size to 12pt when the bodyfont size is 10pt, and to set the effective font size to <br />
14pt when the bodyfont size is 11pt, then add<br />
<texcode><br />
\definebodyfontenvironment [10pt] [a=12pt]<br />
\definebodyfontenvironment [11pt] [a=14pt]<br />
</texcode><br />
{{cmd|definebodyfontenvironment}} is described in detail in <br />
the ConTeXt manual and the [[source:font-ini.tex|font-ini.tex]] source file.<br />
<br />
Font size can be combined with font styles. As a shortcut, you can use<br />
{{cmd|bfa}} to get bold font scaled by <code>1.2</code>, {{cmd|bfx}} to get a bold font<br />
scaled by <code>0.8</code> and similar commands for other font styles.<br />
<br />
These quick font switches are meant for changing the font style, alternative, or size of a few<br />
words: they do not change the bodyfont, so they don't affect interline spacing or math font sizes. So, if<br />
you want to change the font size of an entire paragraph, use<br />
{{cmd|switchtobodyfont}} described below in [[Font_Switching#Complete_font_change|Complete Font Change]]. However, it<br />
is fine to use them as style directives in setup commands, that is, using them<br />
as an option for <code>[[Style_and_Color_Parameters|style=]]...</code> in any setup command that accepts<br />
<code>style</code> option.<br />
<br />
== Mnemonic font switches ==<br />
<br />
While learning a document markup language like ConTeXt, it can be hard to<br />
remember all the commands. ConTeXt provides other, easy-to-remember font<br />
switches. So for bold you can use {{cmd|bold}}, for italic you can use<br />
{{cmd|italic}}, for slanted you can use {{cmd|slanted}}, and so on. You can<br />
probably guess what the following do:<br />
<br />
{|<br />
| {{cmd|normal}} <br />
| {{cmd|slanted}}<br />
|-<br />
| {{cmd|boldslanted}}<br />
| {{cmd|slantedbold}}<br />
|-<br />
| {{cmd|bolditalic}}<br />
| {{cmd|italicbold}}<br />
|-<br />
| {{cmd|small}}<br />
| {{cmd|smallnormal}}<br />
|-<br />
| {{cmd|smallbold}}<br />
| {{cmd|smallslanted}}<br />
|-<br />
| {{cmd|smallboldslanted}}<br />
| {{cmd|smallslantedbold}}<br />
|-<br />
| {{cmd|smallbolditalic}}<br />
| {{cmd|smallitalicbold}}<br />
|-<br />
| {{cmd|sans}}<br />
| {{cmd|sansserif}}<br />
|-<br />
| {{cmd|sansbold}}<br />
| {{cmd|smallcaps}} <br />
|}<br />
<br />
In addition, the commands {{cmd|smallbodyfont}} and<br />
{{cmd|bigbodyfont}} can be used to change the font size.<br />
<br />
These mnemonic font switches are pretty smart. You can either use them as<br />
font style switches inside a { ''group'' }, or as a font changing command that takes an<br />
argument. For example,<br />
<br />
<context source="yes"><br />
This is {\bold bold} and so is \bold{this}. But this is not.<br />
</context><br />
<br />
These mnemonic font switches can also be used for all <code>style=...</code><br />
options, and while using them as style options, you can just give the command<br />
name without the backslash. For example:<br />
<texcode><br />
\setuphead[section][style=bold] <br />
</texcode><br />
<br />
== Complete font (bodyfont) change ==<br />
<br />
If you need to change to a different font size and take care of interline<br />
spacing, you can change the bodyfont by using {{cmd|switchtobodyfont}}. For example, to switch to 12pt<br />
you can use <code>\switchtobodyfont[12pt]</code>.<br />
<br />
<br />
ConTeXt provides two relative sizes, called ''big'' and ''small''. So, to increase the bodyfont size, use <code>\switchtobodyfont[big]</code> (or <code>\setbigbodyfont</code>), and to decrease the bodyfont size, use <code>\switchtobodyfont[small]</code> (or <code>\setsmallbodyfont</code>). The exact<br />
size used for big and small can be set using <br />
{{cmd|definebodyfontenvironment}}.<br />
<br />
The {{cmd|setupbodyfont}} command accepts all the same arguments as<br />
{{cmd|switchtobodyfont}}. The difference between the two is that<br />
{{cmd|setupbodyfont}} also changes the font for headers, footers and other<br />
page markings, while {{cmd|switchtobodyfont}} does not. So you should use<br />
{{cmd|setupbodyfont}} for global font definitions to apply to the whole document, and<br />
{{cmd|switchtobodyfont}} for local font changes (i.e. changes to the running text only). The effect of<br />
{{cmd|switchtobodyfont}} can be localized within a group as usual.<br />
<br />
== Different typefaces ==<br />
<br />
So far we have discussed style and size changes within a given typeface<br />
family. If you want to use a different typeface altogether, such as Times or<br />
Palatino, the Pragma web site has recipes covering all the commonly available<br />
typefaces [http://pragma-ade.com/general/manuals/showfont.pdf], while a<br />
separate manual describes how to write support for new typefaces<br />
[http://pragma-ade.com/general/manuals/mfonts.pdf].<br />
<br />
The recipes as given work with the standalone ConTeXt distribution, but not<br />
with TeX Live et al. [http://pragma-ade.com/general/technotes/tfmetrics.pdf]<br />
explains why ConText uses separate font metrics, and gives some differences<br />
between the sets. To use the recipes with other distributions,<br />
try adding one of <code>\usetypescript[berry][ec]</code> or<br />
<code>\usetypescript[adobekb][ec]</code>.<br />
<br />
* [[Simple Typescript Example]]<br />
* [[Example with normal and condensed font variants]]<br />
* [[Linux Libertine on mkiv]]<br />
<br />
== Conclusion ==<br />
<br />
There are many other ways of choosing font styles in ConTeXt. If these<br />
basic styles do not satisfy your needs, have a look at the [[Manuals|manuals]],<br />
or ask on the [[ConTeXt Mailing Lists]].<br />
<br />
[[Category:Fonts]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Font_Switching&diff=22102Font Switching2013-09-27T19:32:51Z<p>Huttarl: Avoiding confusing usage of the term 'alternative'</p>
<hr />
<div>< [[Basic Text Formatting]] | [[Fonts]] | [[Font Sizes]] ><br />
<br />
<br />
In ConTeXt there are four ways to switch fonts:<br />
<br />
* font style/alternative commands ({{cmd|rm}}, {{cmd|ss}}, etc.),<br />
* font size commands ({{cmd|tfa}}, {{cmd|tfb}}, etc.),<br />
* mnemonic command aliases ({{cmd|bold}}, {{cmd|sans}}, etc.),<br />
* a complete font change ({{cmd|setupbodyfont}}, {{cmd|switchtobodyfont}}).<br />
<br />
== Font styles and alternatives ==<br />
<br />
There are three main types of font styles: serif, sans serif, and teletype. To<br />
switch between these styles, use {{cmd|rm}} for serif, {{cmd|ss}} for<br />
sans serif, and {{cmd|tt}} for teletype.<br />
<br />
Each of these styles comes in different alternatives: normal, bold, italic,<br />
slanted, bold-italic, bold-slanted, and small-capped. To switch to a different<br />
alternative, use {{cmd|tf}} ("typeface") for normal, {{cmd|bf}} for bold, {{cmd|it}}<br />
for italic, {{cmd|sl}} for slanted, {{cmd|bi}} for bold-italic,<br />
{{cmd|bs}} for bold-slanted, and {{cmd|sc}} for small-capped.<br />
<br />
You can generally combine font styles with alternatives, so if you want to<br />
switch to bold sans serif, you can use either <code>\bf\ss</code> or<br />
<code>\ss\bf</code>. <br />
<br />
There is a font switch {{cmd|em}} to ''emphasize'' text. This is somewhat<br />
special: it does automatic italic correction and changes the alternative depending<br />
on the current alternative. For example, if the current font alternative is normal (i.e. upright),<br />
{{cmd|em}} switches to slanted; and if the current font alternative is slanted,<br />
{{cmd|em}} switches to normal.<br />
<br />
ConTeXt uses the Latin Modern fonts by default; these fonts look<br />
similar to the original Computer Modern fonts, but have a much larger<br />
character repertoire. As it happens, in the Latin Modern (and Computer<br />
Modern) fonts, the slanted font does not stand out from the<br />
upright font enough for some tastes; so, many people prefer to use the<br />
italic font for emphasis. To do that use <br />
<texcode><br />
\definebodyfontenvironment[default][em=italic]<br />
</texcode><br />
<br />
A font switch remains valid for the rest of the ''group''. So, if you want to<br />
temporarily switch to a different font, use the font style command inside a<br />
group. The easiest way to start a group is to enclose the text within braces<br />
(also called curly brackets), for example<br />
<br />
<texcode><br />
This is serif text<br />
{\ss This is sans serif}<br />
This is serif again<br />
{\tt and this is typewriter}<br />
And serif again<br />
</texcode><br />
<br />
which gives (notice the braces in the above lines)<br />
<br />
<context><br />
This is serif text \crlf<br />
{\ss This is sans serif} \crlf<br />
This is serif again \crlf<br />
{\tt and this is typewriter} \crlf<br />
And serif again<br />
</context><br />
<br />
== Font sizes ==<br />
<br />
Occasionally one needs to change the font size. ConTeXt provides two series<br />
of commands for that. To increase the font you can use {{cmd|tfa}} to scale<br />
the font size by a factor of <code>1.2</code>, {{cmd|tfb}} to scale by a factor of<br />
<code>(1.2)^2 = 1.44</code>, {{cmd|tfc}} to scale by <code>(1.2)^3 = 1.728</code> and {{cmd|tfd}} to<br />
scale by <code>(1.2)^4 = 2.074</code>.<br />
<br />
To decrease the font size, you can use {{cmd|tfx}}<br />
to scale the font by a factor of <code>0.8</code> and {{cmd|tfxx}} to scale by a factor<br />
of <code>0.6</code>. The scale factors can be a function of the current font size and can<br />
be changed by {{cmd|definebodyfontenvironment}}.<br />
<br />
For example, if you want<br />
{{cmd|tfa}} to be equal to 12pt when you are using 10pt font, and be equal to<br />
14pt when you are using 11pt font, then add<br />
<texcode><br />
\definebodyfontenvironment [10pt] [a=12pt]<br />
\definebodyfontenvironment [11pt] [a=14pt]<br />
</texcode><br />
{{cmd|definebodyfontenvironment}} is described in detail in <br />
the ConTeXt manual and the [[source:font-ini.tex|font-ini.tex]] source file.<br />
<br />
Font size can be combined with font styles. As a shortcut, you can use<br />
{{cmd|bfa}} to get bold font scaled by <code>1.2</code>, {{cmd|bfx}} to get a bold font<br />
scaled by <code>0.8</code> and similar commands for other font styles.<br />
<br />
These font size switches are meant for changing the font size of a few<br />
words: they do not change the interline spacing and math font sizes. So, if<br />
you want to change the font size of an entire paragraph, use<br />
{{cmd|switchtobodyfont}} described below in [[Font_Switching#Complete_font_change|Complete Font Change]]. However, it<br />
is fine to use them as style directives in setup commands, that is, using them<br />
as an option for <code>[[Style_and_Color_Parameters|style=]]...</code> in any setup command that accepts<br />
<code>style</code> option.<br />
<br />
== Mnemonic font switches ==<br />
<br />
While learning a document markup language like ConTeXt, it can be hard to<br />
remember all the commands. ConTeXt provides other, easy-to-remember font<br />
switches. So for bold you can use {{cmd|bold}}, for italic you can use<br />
{{cmd|italic}}, for slanted you can use {{cmd|slanted}}, and so on. You can<br />
probably guess what the following do:<br />
<br />
{|<br />
| {{cmd|normal}} <br />
| {{cmd|slanted}}<br />
|-<br />
| {{cmd|boldslanted}}<br />
| {{cmd|slantedbold}}<br />
|-<br />
| {{cmd|bolditalic}}<br />
| {{cmd|italicbold}}<br />
|-<br />
| {{cmd|small}}<br />
| {{cmd|smallnormal}}<br />
|-<br />
| {{cmd|smallbold}}<br />
| {{cmd|smallslanted}}<br />
|-<br />
| {{cmd|smallboldslanted}}<br />
| {{cmd|smallslantedbold}}<br />
|-<br />
| {{cmd|smallbolditalic}}<br />
| {{cmd|smallitalicbold}}<br />
|-<br />
| {{cmd|sans}}<br />
| {{cmd|sansserif}}<br />
|-<br />
| {{cmd|sansbold}}<br />
| {{cmd|smallcaps}} <br />
|}<br />
<br />
In addition, the commands {{cmd|smallbodyfont}} and<br />
{{cmd|bigbodyfont}} can be used to change the font size.<br />
<br />
These mnemonic font switches are pretty smart. You can either use them as<br />
font style switches inside a { ''group'' }, or as a font changing command that takes an<br />
argument. For example,<br />
<br />
<context source="yes"><br />
This is {\bold bold} and so is \bold{this}. But this is not.<br />
</context><br />
<br />
These mnemonic font switches can also be used for all <code>style=...</code><br />
options, and while using them as style options, you can just give the command<br />
name without the backslash. For example:<br />
<texcode><br />
\setuphead[section][style=bold] <br />
</texcode><br />
<br />
== Complete font change ==<br />
<br />
If you need to change to a different font size and take care of interline<br />
spacing, you can use {{cmd|switchtobodyfont}}. For example, to switch to 12pt<br />
you can use <code>\switchtobodyfont[12pt]</code>.<br />
<br />
<br />
ConTeXt provides two relative sizes, called ''big'' and ''small''. So, to go to a<br />
bigger font size use <code>\switchtobodyfont[big]</code> and to use a<br />
smaller font size use <code>\switchtobodyfont[small]</code>. The exact<br />
size used for big and small can be set using <br />
{{cmd|definebodyfontenvironment}}.<br />
<br />
The {{cmd|setupbodyfont}} command accepts all the same arguments as<br />
{{cmd|switchtobodyfont}}. The difference between the two is that<br />
{{cmd|setupbodyfont}} also changes the font for headers, footers and other<br />
page markings, while {{cmd|switchtobodyfont}} does not. So you should use<br />
{{cmd|setupbodyfont}} for global font definitions to apply to the whole document, and<br />
{{cmd|switchtobodyfont}} for local font changes. The effect of<br />
{{cmd|switchtobodyfont}} can be localized within a group as usual.<br />
<br />
== Different typefaces ==<br />
<br />
So far we have discussed style and size changes within a given typeface<br />
family. If you want to use a different typeface altogether, such as Times or<br />
Palatino, the Pragma web site has recipes covering all the commonly available<br />
typefaces [http://pragma-ade.com/general/manuals/showfont.pdf], while a<br />
separate manual describes how to write support for new typefaces<br />
[http://pragma-ade.com/general/manuals/mfonts.pdf].<br />
<br />
The recipes as given work with the standalone ConTeXt distribution, but not<br />
with TeX Live et al. [http://pragma-ade.com/general/technotes/tfmetrics.pdf]<br />
explains why ConText uses separate font metrics, and gives some differences<br />
between the sets. To use the recipes with other distributions,<br />
try adding one of <code>\usetypescript[berry][ec]</code> or<br />
<code>\usetypescript[adobekb][ec]</code>.<br />
<br />
* [[Simple Typescript Example]]<br />
* [[Example with normal and condensed font variants]]<br />
* [[Linux Libertine on mkiv]]<br />
<br />
== Conclusion ==<br />
<br />
There are many other ways of choosing font styles in ConTeXt. If these<br />
basic styles do not satisfy your needs, have a look at the [[Manuals|manuals]],<br />
or ask on the [[ConTeXt Mailing Lists]].<br />
<br />
[[Category:Fonts]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Font_Switching&diff=22101Font Switching2013-09-27T19:25:18Z<p>Huttarl: fixed terminology "family", "style", and "alternative" to be consistent with the ref manual, ch. 5</p>
<hr />
<div>< [[Basic Text Formatting]] | [[Fonts]] | [[Font Sizes]] ><br />
<br />
<br />
In ConTeXt there are four ways to switch fonts:<br />
<br />
* font style ({{cmd|rm}}, {{cmd|ss}}, etc.),<br />
* font size ({{cmd|tfa}}, {{cmd|tfb}}, etc.),<br />
* alternative font style ({{cmd|bold}}, {{cmd|sans}}, etc.),<br />
* a complete font change ({{cmd|setupbodyfont}}, {{cmd|switchtobodyfont}}).<br />
<br />
== Font styles and alternatives ==<br />
<br />
There are three main types of font styles: serif, sans serif, and teletype. To<br />
switch between these styles, use {{cmd|rm}} for serif, {{cmd|ss}} for<br />
sans serif, and {{cmd|tt}} for teletype.<br />
<br />
Each of these styles comes in different alternatives: normal, bold, italic,<br />
slanted, bold-italic, bold-slanted, and small-capped. To switch to a different<br />
alternative, use {{cmd|tf}} ("typeface") for normal, {{cmd|bf}} for bold, {{cmd|it}}<br />
for italic, {{cmd|sl}} for slanted, {{cmd|bi}} for bold-italic,<br />
{{cmd|bs}} for bold-slanted, and {{cmd|sc}} for small-capped.<br />
<br />
You can generally combine font styles with alternatives, so if you want to<br />
switch to bold sans serif, you can use either <code>\bf\ss</code> or<br />
<code>\ss\bf</code>. <br />
<br />
There is a font switch {{cmd|em}} to ''emphasize'' text. This is somewhat<br />
special: it does automatic italic correction and changes the alternative depending<br />
on the current alternative. For example, if the current font alternative is normal (i.e. upright),<br />
{{cmd|em}} switches to slanted; and if the current font alternative is slanted,<br />
{{cmd|em}} switches to normal.<br />
<br />
ConTeXt uses the Latin Modern fonts by default; these fonts look<br />
similar to the original Computer Modern fonts, but have a much larger<br />
character repertoire. As it happens, in the Latin Modern (and Computer<br />
Modern) fonts, the slanted font does not stand out from the<br />
upright font enough for some tastes; so, many people prefer to use the<br />
italic font for emphasis. To do that use <br />
<texcode><br />
\definebodyfontenvironment[default][em=italic]<br />
</texcode><br />
<br />
A font switch remains valid for the rest of the ''group''. So, if you want to<br />
temporarily switch to a different font, use the font style command inside a<br />
group. The easiest way to start a group is to enclose the text within braces<br />
(also called curly brackets), for example<br />
<br />
<texcode><br />
This is serif text<br />
{\ss This is sans serif}<br />
This is serif again<br />
{\tt and this is typewriter}<br />
And serif again<br />
</texcode><br />
<br />
which gives (notice the braces in the above lines)<br />
<br />
<context><br />
This is serif text \crlf<br />
{\ss This is sans serif} \crlf<br />
This is serif again \crlf<br />
{\tt and this is typewriter} \crlf<br />
And serif again<br />
</context><br />
<br />
== Font sizes ==<br />
<br />
Occasionally one needs to change the font size. ConTeXt provides two series<br />
of commands for that. To increase the font you can use {{cmd|tfa}} to scale<br />
the font size by a factor of <code>1.2</code>, {{cmd|tfb}} to scale by a factor of<br />
<code>(1.2)^2 = 1.44</code>, {{cmd|tfc}} to scale by <code>(1.2)^3 = 1.728</code> and {{cmd|tfd}} to<br />
scale by <code>(1.2)^4 = 2.074</code>.<br />
<br />
To decrease the font size, you can use {{cmd|tfx}}<br />
to scale the font by a factor of <code>0.8</code> and {{cmd|tfxx}} to scale by a factor<br />
of <code>0.6</code>. The scale factors can be a function of the current font size and can<br />
be changed by {{cmd|definebodyfontenvironment}}.<br />
<br />
For example, if you want<br />
{{cmd|tfa}} to be equal to 12pt when you are using 10pt font, and be equal to<br />
14pt when you are using 11pt font, then add<br />
<texcode><br />
\definebodyfontenvironment [10pt] [a=12pt]<br />
\definebodyfontenvironment [11pt] [a=14pt]<br />
</texcode><br />
{{cmd|definebodyfontenvironment}} is described in detail in <br />
the ConTeXt manual and the [[source:font-ini.tex|font-ini.tex]] source file.<br />
<br />
Font size can be combined with font styles. As a shortcut, you can use<br />
{{cmd|bfa}} to get bold font scaled by <code>1.2</code>, {{cmd|bfx}} to get a bold font<br />
scaled by <code>0.8</code> and similar commands for other font styles.<br />
<br />
These font size switches are meant for changing the font size of a few<br />
words: they do not change the interline spacing and math font sizes. So, if<br />
you want to change the font size of an entire paragraph, use<br />
{{cmd|switchtobodyfont}} described below in [[Font_Switching#Complete_font_change|Complete Font Change]]. However, it<br />
is fine to use them as style directives in setup commands, that is, using them<br />
as an option for <code>[[Style_and_Color_Parameters|style=]]...</code> in any setup command that accepts<br />
<code>style</code> option.<br />
<br />
== Alternative font styles ==<br />
<br />
While learning a document markup language like ConTeXt, it can be hard to<br />
remember all the commands. ConTeXt provides easy to remember alternative<br />
font styles. So for bold you can use {{cmd|bold}}, for italic you can use<br />
{{cmd|italic}}, for slanted you can use {{cmd|slanted}}, and so on. You can<br />
probably guess what the following do:<br />
<br />
{|<br />
| {{cmd|normal}} <br />
| {{cmd|slanted}}<br />
|-<br />
| {{cmd|boldslanted}}<br />
| {{cmd|slantedbold}}<br />
|-<br />
| {{cmd|bolditalic}}<br />
| {{cmd|italicbold}}<br />
|-<br />
| {{cmd|small}}<br />
| {{cmd|smallnormal}}<br />
|-<br />
| {{cmd|smallbold}}<br />
| {{cmd|smallslanted}}<br />
|-<br />
| {{cmd|smallboldslanted}}<br />
| {{cmd|smallslantedbold}}<br />
|-<br />
| {{cmd|smallbolditalic}}<br />
| {{cmd|smallitalicbold}}<br />
|-<br />
| {{cmd|sans}}<br />
| {{cmd|sansserif}}<br />
|-<br />
| {{cmd|sansbold}}<br />
| {{cmd|smallcaps}} <br />
|}<br />
<br />
In addition, the commands {{cmd|smallbodyfont}} and<br />
{{cmd|bigbodyfont}} can be used to change the font size.<br />
<br />
These alternative font styles are pretty smart. You can either use them as<br />
font style switches inside a { ''group'' }, or as a font changing command that takes an<br />
argument. For example,<br />
<br />
<context source="yes"><br />
This is {\bold bold} and so is \bold{this}.<br />
</context><br />
<br />
These alternative font styles can also be used for all <code>style=...</code><br />
options, and while using them as style options, you can just give the command<br />
name, for example:<br />
<texcode><br />
\setuphead[section][style=bold] <br />
</texcode><br />
<br />
== Complete font change ==<br />
<br />
If you need to change to a different font size and take care of interline<br />
spacing, you can use {{cmd|switchtobodyfont}}. For example, to switch to 12pt<br />
you can use <code>\switchtobodyfont[12pt]</code>.<br />
<br />
<br />
ConTeXt provides two relative sizes, called ''big'' and ''small''. So, to go to a<br />
bigger font size use <code>\switchtobodyfont[big]</code> and to use a<br />
smaller font size use <code>\switchtobodyfont[small]</code>. The exact<br />
size used for big and small can be set using <br />
{{cmd|definebodyfontenvironment}}.<br />
<br />
The {{cmd|setupbodyfont}} command accepts all the same arguments as<br />
{{cmd|switchtobodyfont}}. The difference between the two is that<br />
{{cmd|setupbodyfont}} also changes the font for headers, footers and other<br />
page markings, while {{cmd|switchtobodyfont}} does not. So you should use<br />
{{cmd|setupbodyfont}} for global font definitions to apply to the whole document, and<br />
{{cmd|switchtobodyfont}} for local font changes. The effect of<br />
{{cmd|switchtobodyfont}} can be localized within a group as usual.<br />
<br />
== Different typefaces ==<br />
<br />
So far we have discussed style and size changes within a given typeface<br />
family. If you want to use a different typeface altogether, such as Times or<br />
Palatino, the Pragma web site has recipes covering all the commonly available<br />
typefaces [http://pragma-ade.com/general/manuals/showfont.pdf], while a<br />
separate manual describes how to write support for new typefaces<br />
[http://pragma-ade.com/general/manuals/mfonts.pdf].<br />
<br />
The recipes as given work with the standalone ConTeXt distribution, but not<br />
with TeX Live et al. [http://pragma-ade.com/general/technotes/tfmetrics.pdf]<br />
explains why ConText uses separate font metrics, and gives some differences<br />
between the sets. To use the recipes with other distributions,<br />
try adding one of <code>\usetypescript[berry][ec]</code> or<br />
<code>\usetypescript[adobekb][ec]</code>.<br />
<br />
* [[Simple Typescript Example]]<br />
* [[Example with normal and condensed font variants]]<br />
* [[Linux Libertine on mkiv]]<br />
<br />
== Conclusion ==<br />
<br />
There are many other ways of choosing font styles in ConTeXt. If these<br />
basic styles do not satisfy your needs, have a look at the [[Manuals|manuals]],<br />
or ask on the [[ConTeXt Mailing Lists]].<br />
<br />
[[Category:Fonts]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Font_Switching&diff=22100Font Switching2013-09-27T19:02:15Z<p>Huttarl: expand the "group" example to show that font is restored at the end of a group.</p>
<hr />
<div>< [[Basic Text Formatting]] | [[Fonts]] | [[Font Sizes]] ><br />
<br />
<br />
In ConTeXt there are four ways to switch fonts:<br />
<br />
* font style ({{cmd|rm}}, {{cmd|ss}}, etc.),<br />
* font size ({{cmd|tfa}}, {{cmd|tfb}}, etc.),<br />
* alternative font style ({{cmd|bold}}, {{cmd|sans}}, etc.),<br />
* a complete font change ({{cmd|setupbodyfont}}, {{cmd|switchtobodyfont}}).<br />
<br />
== Font styles ==<br />
<br />
There are three types of font families: serif, sans serif, and teletype. To<br />
switch between these families, use {{cmd|rm}} for serif, {{cmd|ss}} for<br />
sans serif, and {{cmd|tt}} for teletype.<br />
<br />
Each of these families come in different styles: upright, bold, italic,<br />
slanted, bold-italic, bold-slanted, and small-capped. To switch to a different<br />
style, use {{cmd|tf}} for upright, {{cmd|bf}} for bold, {{cmd|it}}<br />
for italic, {{cmd|sl}} for slanted, {{cmd|bi}} for bold-italic,<br />
{{cmd|bs}} for bold-slanted, and {{cmd|sc}} for small-capped.<br />
<br />
You can generally combine font families and font styles, so if you want to<br />
switch to bold sans serif, you can use either <code>\bf\ss</code> or<br />
<code>\ss\bf</code>. <br />
<br />
There is a font switch {{cmd|em}} to ''emphasize'' text. This is somewhat<br />
special: it does automatic italic correction and changes the style depending<br />
on the current font style. For example, if the current font style is upright,<br />
{{cmd|em}} switches to slanted; and if the current font style is slanted,<br />
{{cmd|em}} switches to upright.<br />
<br />
ConTeXt uses the Latin Modern fonts by default; these fonts look<br />
similar to the original Computer Modern fonts, but have a much larger<br />
character repertoire. As it happens, in the Latin Modern (and Computer<br />
Modern) fonts, the slanted font does not stand out from the<br />
upright font enough for some tastes; so, many people prefer to use the<br />
italic font for emphasis. To do that use <br />
<texcode><br />
\definebodyfontenvironment[default][em=italic]<br />
</texcode><br />
<br />
A font switch remains valid for the rest of the ''group''. So, if you want to<br />
temporarily switch to a different font, use the font style command inside a<br />
group. The easiest way to start a group is to enclose the text within braces<br />
(also called curly brackets), for example<br />
<br />
<texcode><br />
This is serif text<br />
{\ss This is sans serif}<br />
This is serif again<br />
{\tt and this is typewriter}<br />
And serif again<br />
</texcode><br />
<br />
which gives (notice the braces in the above lines)<br />
<br />
<context><br />
This is serif text \crlf<br />
{\ss This is sans serif} \crlf<br />
This is serif again \crlf<br />
{\tt and this is typewriter} \crlf<br />
And serif again<br />
</context><br />
<br />
== Font sizes ==<br />
<br />
Occasionally one needs to change the font size. ConTeXt provides two series<br />
of commands for that. To increase the font you can use {{cmd|tfa}} to scale<br />
the font size by a factor of <code>1.2</code>, {{cmd|tfb}} to scale by a factor of<br />
<code>(1.2)^2 = 1.44</code>, {{cmd|tfc}} to scale by <code>(1.2)^3 = 1.728</code> and {{cmd|tfd}} to<br />
scale by <code>(1.2)^4 = 2.074</code>.<br />
<br />
To decrease the font size, you can use {{cmd|tfx}}<br />
to scale the font by a factor of <code>0.8</code> and {{cmd|tfxx}} to scale by a factor<br />
of <code>0.6</code>. The scale factors can be a function of the current font size and can<br />
be changed by {{cmd|definebodyfontenvironment}}.<br />
<br />
For example, if you want<br />
{{cmd|tfa}} to be equal to 12pt when you are using 10pt font, and be equal to<br />
14pt when you are using 11pt font, then add<br />
<texcode><br />
\definebodyfontenvironment [10pt] [a=12pt]<br />
\definebodyfontenvironment [11pt] [a=14pt]<br />
</texcode><br />
{{cmd|definebodyfontenvironment}} is described in detail in <br />
the ConTeXt manual and the [[source:font-ini.tex|font-ini.tex]] source file.<br />
<br />
Font size can be combined with font styles. As a shortcut, you can use<br />
{{cmd|bfa}} to get bold font scaled by <code>1.2</code>, {{cmd|bfx}} to get a bold font<br />
scaled by <code>0.8</code> and similar commands for other font styles.<br />
<br />
These font size switches are meant for changing the font size of a few<br />
words: they do not change the interline spacing and math font sizes. So, if<br />
you want to change the font size of an entire paragraph, use<br />
{{cmd|switchtobodyfont}} described below in [[Font_Switching#Complete_font_change|Complete Font Change]]. However, it<br />
is fine to use them as style directives in setup commands, that is, using them<br />
as an option for <code>[[Style_and_Color_Parameters|style=]]...</code> in any setup command that accepts<br />
<code>style</code> option.<br />
<br />
== Alternative font styles ==<br />
<br />
While learning a document markup language like ConTeXt, it can be hard to<br />
remember all the commands. ConTeXt provides easy to remember alternative<br />
font styles. So for bold you can use {{cmd|bold}}, for italic you can use<br />
{{cmd|italic}}, for slanted you can use {{cmd|slanted}}, and so on. You can<br />
probably guess what the following do:<br />
<br />
{|<br />
| {{cmd|normal}} <br />
| {{cmd|slanted}}<br />
|-<br />
| {{cmd|boldslanted}}<br />
| {{cmd|slantedbold}}<br />
|-<br />
| {{cmd|bolditalic}}<br />
| {{cmd|italicbold}}<br />
|-<br />
| {{cmd|small}}<br />
| {{cmd|smallnormal}}<br />
|-<br />
| {{cmd|smallbold}}<br />
| {{cmd|smallslanted}}<br />
|-<br />
| {{cmd|smallboldslanted}}<br />
| {{cmd|smallslantedbold}}<br />
|-<br />
| {{cmd|smallbolditalic}}<br />
| {{cmd|smallitalicbold}}<br />
|-<br />
| {{cmd|sans}}<br />
| {{cmd|sansserif}}<br />
|-<br />
| {{cmd|sansbold}}<br />
| {{cmd|smallcaps}} <br />
|}<br />
<br />
In addition, the commands {{cmd|smallbodyfont}} and<br />
{{cmd|bigbodyfont}} can be used to change the font size.<br />
<br />
These alternative font styles are pretty smart. You can either use them as<br />
font style switches inside a { ''group'' }, or as a font changing command that takes an<br />
argument. For example,<br />
<br />
<context source="yes"><br />
This is {\bold bold} and so is \bold{this}.<br />
</context><br />
<br />
These alternative font styles can also be used for all <code>style=...</code><br />
options, and while using them as style options, you can just give the command<br />
name, for example:<br />
<texcode><br />
\setuphead[section][style=bold] <br />
</texcode><br />
<br />
== Complete font change ==<br />
<br />
If you need to change to a different font size and take care of interline<br />
spacing, you can use {{cmd|switchtobodyfont}}. For example, to switch to 12pt<br />
you can use <code>\switchtobodyfont[12pt]</code>.<br />
<br />
<br />
ConTeXt provides two relative sizes, called ''big'' and ''small''. So, to go to a<br />
bigger font size use <code>\switchtobodyfont[big]</code> and to use a<br />
smaller font size use <code>\switchtobodyfont[small]</code>. The exact<br />
size used for big and small can be set using <br />
{{cmd|definebodyfontenvironment}}.<br />
<br />
The {{cmd|setupbodyfont}} command accepts all the same arguments as<br />
{{cmd|switchtobodyfont}}. The difference between the two is that<br />
{{cmd|setupbodyfont}} also changes the font for headers, footers and other<br />
page markings, while {{cmd|switchtobodyfont}} does not. So you should use<br />
{{cmd|setupbodyfont}} for global font definitions to apply to the whole document, and<br />
{{cmd|switchtobodyfont}} for local font changes. The effect of<br />
{{cmd|switchtobodyfont}} can be localized within a group as usual.<br />
<br />
== Different typefaces ==<br />
<br />
So far we have discussed style and size changes within a given typeface<br />
family. If you want to use a different typeface altogether, such as Times or<br />
Palatino, the Pragma web site has recipes covering all the commonly available<br />
typefaces [http://pragma-ade.com/general/manuals/showfont.pdf], while a<br />
separate manual describes how to write support for new typefaces<br />
[http://pragma-ade.com/general/manuals/mfonts.pdf].<br />
<br />
The recipes as given work with the standalone ConTeXt distribution, but not<br />
with TeX Live et al. [http://pragma-ade.com/general/technotes/tfmetrics.pdf]<br />
explains why ConText uses separate font metrics, and gives some differences<br />
between the sets. To use the recipes with other distributions,<br />
try adding one of <code>\usetypescript[berry][ec]</code> or<br />
<code>\usetypescript[adobekb][ec]</code>.<br />
<br />
* [[Simple Typescript Example]]<br />
* [[Example with normal and condensed font variants]]<br />
* [[Linux Libertine on mkiv]]<br />
<br />
== Conclusion ==<br />
<br />
There are many other ways of choosing font styles in ConTeXt. If these<br />
basic styles do not satisfy your needs, have a look at the [[Manuals|manuals]],<br />
or ask on the [[ConTeXt Mailing Lists]].<br />
<br />
[[Category:Fonts]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Font_Switching&diff=22099Font Switching2013-09-27T18:36:45Z<p>Huttarl: </p>
<hr />
<div>< [[Basic Text Formatting]] | [[Fonts]] | [[Font Sizes]] ><br />
<br />
<br />
In ConTeXt there are four ways to switch fonts:<br />
<br />
* font style ({{cmd|rm}}, {{cmd|ss}}, etc.),<br />
* font size ({{cmd|tfa}}, {{cmd|tfb}}, etc.),<br />
* alternative font style ({{cmd|bold}}, {{cmd|sans}}, etc.),<br />
* a complete font change ({{cmd|setupbodyfont}}, {{cmd|switchtobodyfont}}).<br />
<br />
== Font styles ==<br />
<br />
There are three types of font families: serif, sans serif, and teletype. To<br />
switch between these families, use {{cmd|rm}} for serif, {{cmd|ss}} for<br />
sans serif, and {{cmd|tt}} for teletype.<br />
<br />
Each of these families come in different styles: upright, bold, italic,<br />
slanted, bold-italic, bold-slanted, and small-capped. To switch to a different<br />
style, use {{cmd|tf}} for upright, {{cmd|bf}} for bold, {{cmd|it}}<br />
for italic, {{cmd|sl}} for slanted, {{cmd|bi}} for bold-italic,<br />
{{cmd|bs}} for bold-slanted, and {{cmd|sc}} for small-capped.<br />
<br />
You can generally combine font families and font styles, so if you want to<br />
switch to bold sans serif, you can use either <code>\bf\ss</code> or<br />
<code>\ss\bf</code>. <br />
<br />
There is a font switch {{cmd|em}} to ''emphasize'' text. This is somewhat<br />
special: it does automatic italic correction and changes the style depending<br />
on the current font style. For example, if the current font style is upright,<br />
{{cmd|em}} switches to slanted; and if the current font style is slanted,<br />
{{cmd|em}} switches to upright.<br />
<br />
ConTeXt uses the Latin Modern fonts by default; these fonts look<br />
similar to the original Computer Modern fonts, but have a much larger<br />
character repertoire. As it happens, in the Latin Modern (and Computer<br />
Modern) fonts, the slanted font does not stand out from the<br />
upright font enough for some tastes; so, many people prefer to use the<br />
italic font for emphasis. To do that use <br />
<texcode><br />
\definebodyfontenvironment[default][em=italic]<br />
</texcode><br />
<br />
A font switch remains valid for the rest of the ''group''. So, if you want to<br />
temporarily switch to a different font, use the font style command inside a<br />
group. The easiest way to start a group is to enclose the text within braces<br />
(also called curly brackets), for example<br />
<br />
<texcode><br />
This is serif text<br />
{\ss This is sans serif}<br />
{\tt and this is typewriter}<br />
</texcode><br />
<br />
which gives (notice the braces in the above lines)<br />
<br />
<context><br />
This is serif text \crlf<br />
{\ss This is sans serif} \crlf<br />
{\tt and this is typewriter}<br />
</context><br />
<br />
== Font sizes ==<br />
<br />
Occasionally one needs to change the font size. ConTeXt provides two series<br />
of commands for that. To increase the font you can use {{cmd|tfa}} to scale<br />
the font size by a factor of <code>1.2</code>, {{cmd|tfb}} to scale by a factor of<br />
<code>(1.2)^2 = 1.44</code>, {{cmd|tfc}} to scale by <code>(1.2)^3 = 1.728</code> and {{cmd|tfd}} to<br />
scale by <code>(1.2)^4 = 2.074</code>.<br />
<br />
To decrease the font size, you can use {{cmd|tfx}}<br />
to scale the font by a factor of <code>0.8</code> and {{cmd|tfxx}} to scale by a factor<br />
of <code>0.6</code>. The scale factors can be a function of the current font size and can<br />
be changed by {{cmd|definebodyfontenvironment}}.<br />
<br />
For example, if you want<br />
{{cmd|tfa}} to be equal to 12pt when you are using 10pt font, and be equal to<br />
14pt when you are using 11pt font, then add<br />
<texcode><br />
\definebodyfontenvironment [10pt] [a=12pt]<br />
\definebodyfontenvironment [11pt] [a=14pt]<br />
</texcode><br />
{{cmd|definebodyfontenvironment}} is described in detail in <br />
the ConTeXt manual and the [[source:font-ini.tex|font-ini.tex]] source file.<br />
<br />
Font size can be combined with font styles. As a shortcut, you can use<br />
{{cmd|bfa}} to get bold font scaled by <code>1.2</code>, {{cmd|bfx}} to get a bold font<br />
scaled by <code>0.8</code> and similar commands for other font styles.<br />
<br />
These font size switches are meant for changing the font size of a few<br />
words: they do not change the interline spacing and math font sizes. So, if<br />
you want to change the font size of an entire paragraph, use<br />
{{cmd|switchtobodyfont}} described below in [[Font_Switching#Complete_font_change|Complete Font Change]]. However, it<br />
is fine to use them as style directives in setup commands, that is, using them<br />
as an option for <code>[[Style_and_Color_Parameters|style=]]...</code> in any setup command that accepts<br />
<code>style</code> option.<br />
<br />
== Alternative font styles ==<br />
<br />
While learning a document markup language like ConTeXt, it can be hard to<br />
remember all the commands. ConTeXt provides easy to remember alternative<br />
font styles. So for bold you can use {{cmd|bold}}, for italic you can use<br />
{{cmd|italic}}, for slanted you can use {{cmd|slanted}}, and so on. You can<br />
probably guess what the following do:<br />
<br />
{|<br />
| {{cmd|normal}} <br />
| {{cmd|slanted}}<br />
|-<br />
| {{cmd|boldslanted}}<br />
| {{cmd|slantedbold}}<br />
|-<br />
| {{cmd|bolditalic}}<br />
| {{cmd|italicbold}}<br />
|-<br />
| {{cmd|small}}<br />
| {{cmd|smallnormal}}<br />
|-<br />
| {{cmd|smallbold}}<br />
| {{cmd|smallslanted}}<br />
|-<br />
| {{cmd|smallboldslanted}}<br />
| {{cmd|smallslantedbold}}<br />
|-<br />
| {{cmd|smallbolditalic}}<br />
| {{cmd|smallitalicbold}}<br />
|-<br />
| {{cmd|sans}}<br />
| {{cmd|sansserif}}<br />
|-<br />
| {{cmd|sansbold}}<br />
| {{cmd|smallcaps}} <br />
|}<br />
<br />
In addition, the commands {{cmd|smallbodyfont}} and<br />
{{cmd|bigbodyfont}} can be used to change the font size.<br />
<br />
These alternative font styles are pretty smart. You can either use them as<br />
font style switches inside a { ''group'' }, or as a font changing command that takes an<br />
argument. For example,<br />
<br />
<context source="yes"><br />
This is {\bold bold} and so is \bold{this}.<br />
</context><br />
<br />
These alternative font styles can also be used for all <code>style=...</code><br />
options, and while using them as style options, you can just give the command<br />
name, for example:<br />
<texcode><br />
\setuphead[section][style=bold] <br />
</texcode><br />
<br />
== Complete font change ==<br />
<br />
If you need to change to a different font size and take care of interline<br />
spacing, you can use {{cmd|switchtobodyfont}}. For example, to switch to 12pt<br />
you can use <code>\switchtobodyfont[12pt]</code>.<br />
<br />
<br />
ConTeXt provides two relative sizes, called ''big'' and ''small''. So, to go to a<br />
bigger font size use <code>\switchtobodyfont[big]</code> and to use a<br />
smaller font size use <code>\switchtobodyfont[small]</code>. The exact<br />
size used for big and small can be set using <br />
{{cmd|definebodyfontenvironment}}.<br />
<br />
The {{cmd|setupbodyfont}} command accepts all the same arguments as<br />
{{cmd|switchtobodyfont}}. The difference between the two is that<br />
{{cmd|setupbodyfont}} also changes the font for headers, footers and other<br />
page markings, while {{cmd|switchtobodyfont}} does not. So you should use<br />
{{cmd|setupbodyfont}} for global font definitions to apply to the whole document, and<br />
{{cmd|switchtobodyfont}} for local font changes. The effect of<br />
{{cmd|switchtobodyfont}} can be localized within a group as usual.<br />
<br />
== Different typefaces ==<br />
<br />
So far we have discussed style and size changes within a given typeface<br />
family. If you want to use a different typeface altogether, such as Times or<br />
Palatino, the Pragma web site has recipes covering all the commonly available<br />
typefaces [http://pragma-ade.com/general/manuals/showfont.pdf], while a<br />
separate manual describes how to write support for new typefaces<br />
[http://pragma-ade.com/general/manuals/mfonts.pdf].<br />
<br />
The recipes as given work with the standalone ConTeXt distribution, but not<br />
with TeX Live et al. [http://pragma-ade.com/general/technotes/tfmetrics.pdf]<br />
explains why ConText uses separate font metrics, and gives some differences<br />
between the sets. To use the recipes with other distributions,<br />
try adding one of <code>\usetypescript[berry][ec]</code> or<br />
<code>\usetypescript[adobekb][ec]</code>.<br />
<br />
* [[Simple Typescript Example]]<br />
* [[Example with normal and condensed font variants]]<br />
* [[Linux Libertine on mkiv]]<br />
<br />
== Conclusion ==<br />
<br />
There are many other ways of choosing font styles in ConTeXt. If these<br />
basic styles do not satisfy your needs, have a look at the [[Manuals|manuals]],<br />
or ask on the [[ConTeXt Mailing Lists]].<br />
<br />
[[Category:Fonts]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/switchtobodyfont&diff=22098Command/switchtobodyfont2013-09-27T17:02:57Z<p>Huttarl: see also: page on Font Switching</p>
<hr />
<div>{{Reference<br />
|name=switchtobodyfont<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\switchtobodyfont<span class="first" >[...,...,...]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...,...,...]</td><br />
<td>5pt ... 12pt small big global </td><br />
</tr><br />
</table><br />
<br />
<br />
== Description == <br />
<br />
Use {{cmd|setupbodyfont}} to change the font size for whole document, {{cmd|switchtobodyfont}} doesn’t change the size for the header/footer.<br />
<br />
== Example ==<br />
<br />
<context source=yes><br />
<br />
\switchtobodyfont[pagella,small]<br />
\input ward<br />
<br />
</context><br />
<br />
== See also ==<br />
<!-- something like {{cmd|goto}} --><br />
[[Font_Switching]]<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Fonts|switchtobodyfont]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/definetypeface&diff=22095Command/definetypeface2013-09-25T20:41:06Z<p>Huttarl: Made definition of 1st and 2nd arguments more explicit.</p>
<hr />
<div>{{Reference<br />
|name=definetypeface<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\definetypeface<span class="first">[...]</span><span class="second">[...]</span><span class="third">[...]</span><span class="fourth">[...]</span><span class="fifth">[...]</span><span class="sixth">[...]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td>TEXT (typescript identifier)</td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">[...]</td><br />
<td>rm ss tt mm hw cg ("basic style")</td><br />
</tr><br />
<tr valign="top" class="third"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (existing font set)</td><br />
</tr><br />
<tr valign="top" class="fourth"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (existing font set)</td><br />
</tr><br />
<tr valign="top" class="fifth"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (?)</td><br />
</tr><br />
<tr valign="top" class="sixth"><br />
<td class="cmd">[...]</td><br />
<td>features = IDENTIFIER<br /><br />
rscale = NUMBER<br/><br />
encoding = IDENTIFIER<br/><br />
text = IDENTIFIER</td><br />
</tr><br />
</table><br />
<br />
== Description == <br />
<br />
{{cmd|definetypeface}} sets up a typeface for use within a typescript. This typeface links a style (rm, ss, etc.) to an actual font family (or font set).<br />
<br />
The first argument specifies the typescript of which the newly defined typeface will be a part.<br />
<br />
The second argument tells which style to define a typeface for.<br />
<br />
The third and fourth arguments to \definetypeface are pointers to already declared font sets;<br />
these are defined elsewhere. [[ConTeXt_reference_manual|Table 5.8]] gives the full list of predefined typescripts (the first<br />
argument of \starttypescript) and font sets that are attached to the styles (the third and<br />
fourth argument of each \definetypeface).<br />
The names in the third argument (like serif and sans) do not have the same meaning as the<br />
names used in \setupbodyfont. Inside \setupbodyfont, they were keywords that were in-<br />
ternally remapped to one of the two-letter internal styles. Inside \definetypeface, they are<br />
nothing more than convenience names that are attached to a group of fonts by the person that<br />
wrote the font definition. They only reflect a grouping that the person believed that could be<br />
a single font style. Oftentimes, these names are identical to the official style keywords, just as<br />
the typescript and typeface names are often the same, but there can be (and sometimes are)<br />
different names altogether.<br />
<br />
How to define your own font sets is explained in the reference manual, but there are quite a<br />
few predefined font sets that come with ConTEXt; these are all listed in the four [[ConTeXt_reference_manual|tables 5.9, 5.10,<br />
5.11, and 5.12]].<br />
For everything to work properly in MkII, the predefined font sets also have to have an encoding<br />
attached, you can look those up in the relevant tables as well.<br />
<br />
The fifth argument to \definetypeface specifies specific font size setups (if any), these will be<br />
covered in the reference manual. Almost always, specifying default will suffice.<br />
<br />
The optional sixth argument is used for tweaking font settings like the specification of font<br />
features or adjusting parameters. In this case, the two modern font sets are loaded with a small<br />
magnification, this evens out the visual heights of the font styles.<br />
<br />
== Example ==<br />
<context source="yes"><br />
\starttypescript [palatino] [texnansi,ec,qx,t5,default]<br />
\definetypeface[palatino] [rm] [serif][palatino] [default]<br />
\definetypeface[palatino] [ss] [sans] [modern] [default] [rscale=1.075]<br />
\definetypeface[palatino] [tt] [mono] [modern] [default] [rscale=1.075]<br />
\definetypeface[palatino] [mm] [math] [palatino] [default]<br />
\stoptypescript<br />
</context><br />
<br />
This defines a typescript named palatino in five different encodings. When this typescript is<br />
executed via \usetypescript, it will define four typefaces, one of each of the four basic styles<br />
rm, ss, tt, and mm.<br />
<br />
== See also ==<br />
* [[ConTeXt_reference_manual]] Section 5.8.3 Typeface definitions<br />
* {{cmd|starttypescript}}<br />
* [[Simple_Typescript_Example]]<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Paragraphs|setupinterlinespace]]<br />
[[Category:Command/Layout|setupinterlinespace]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/definetypeface&diff=22066Command/definetypeface2013-09-19T18:02:37Z<p>Huttarl: linked to context ref man for tables.</p>
<hr />
<div>{{Reference<br />
|name=definetypeface<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\definetypeface<span class="first">[...]</span><span class="second">[...]</span><span class="third">[...]</span><span class="fourth">[...]</span><span class="fifth">[...]</span><span class="sixth">[...]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td>TEXT (typescript identifier)</td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">[...]</td><br />
<td>rm ss tt mm hw cg ("basic style")</td><br />
</tr><br />
<tr valign="top" class="third"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (existing font set)</td><br />
</tr><br />
<tr valign="top" class="fourth"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (existing font set)</td><br />
</tr><br />
<tr valign="top" class="fifth"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (?)</td><br />
</tr><br />
<tr valign="top" class="sixth"><br />
<td class="cmd">[...]</td><br />
<td>features = IDENTIFIER<br /><br />
rscale = NUMBER<br/><br />
encoding = IDENTIFIER<br/><br />
text = IDENTIFIER</td><br />
</tr><br />
</table><br />
<br />
== Description == <br />
<br />
{{cmd|definetypeface}} sets up a typeface for use within a typescript.<br />
<br />
The third and fourth arguments to \definetypeface are pointers to already declared font sets;<br />
these are defined elsewhere. [[ConTeXt_reference_manual|Table 5.8]] gives the full list of predefined typescripts (the first<br />
argument of \starttypescript) and font sets that are attached to the styles (the third and<br />
fourth argument of each \definetypeface).<br />
The names in the third argument (like serif and sans) do not have the same meaning as the<br />
names used in \setupbodyfont. Inside \setupbodyfont, they were keywords that were in-<br />
ternally remapped to one of the two-letter internal styles. Inside \definetypeface, they are<br />
nothing more than convenience names that are attached to a group of fonts by the person that<br />
wrote the font definition. They only reflect a grouping that the person believed that could be<br />
a single font style. Oftentimes, these names are identical to the official style keywords, just as<br />
the typescript and typeface names are often the same, but there can be (and sometimes are)<br />
different names altogether.<br />
<br />
How to define your own font sets is explained in the reference manual, but there are quite a<br />
few predefined font sets that come with ConTEXt; these are all listed in the four [[ConTeXt_reference_manual|tables 5.9, 5.10,<br />
5.11, and 5.12]].<br />
For everything to work properly in MkII, the predefined font sets also have to have an encoding<br />
attached, you can look those up in the relevant tables as well.<br />
<br />
The fifth argument to \definetypeface specifies specific font size setups (if any), these will be<br />
covered in the reference manual. Almost always, specifying default will suffice.<br />
<br />
The optional sixth argument is used for tweaking font settings like the specification of font<br />
features or adjusting parameters. In this case, the two modern font sets are loaded with a small<br />
magnification, this evens out the visual heights of the font styles.<br />
<br />
== Example ==<br />
<context source="yes"><br />
\starttypescript [palatino] [texnansi,ec,qx,t5,default]<br />
\definetypeface[palatino] [rm] [serif][palatino] [default]<br />
\definetypeface[palatino] [ss] [sans] [modern] [default] [rscale=1.075]<br />
\definetypeface[palatino] [tt] [mono] [modern] [default] [rscale=1.075]<br />
\definetypeface[palatino] [mm] [math] [palatino] [default]<br />
\stoptypescript<br />
</context><br />
<br />
This defines a typescript named palatino in five different encodings. When this typescript is<br />
executed via \usetypescript, it will define four typefaces, one of each of the four basic styles<br />
rm, ss, tt, and mm.<br />
<br />
== See also ==<br />
* [[ConTeXt_reference_manual]] Section 5.8.3 Typeface definitions<br />
* {{cmd|starttypescript}}<br />
* [[Simple_Typescript_Example]]<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Paragraphs|setupinterlinespace]]<br />
[[Category:Command/Layout|setupinterlinespace]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/definetypeface&diff=22065Command/definetypeface2013-09-19T17:43:57Z<p>Huttarl: fixed reference to "next section"</p>
<hr />
<div>{{Reference<br />
|name=definetypeface<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\definetypeface<span class="first">[...]</span><span class="second">[...]</span><span class="third">[...]</span><span class="fourth">[...]</span><span class="fifth">[...]</span><span class="sixth">[...]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td>TEXT (typescript identifier)</td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">[...]</td><br />
<td>rm ss tt mm hw cg ("basic style")</td><br />
</tr><br />
<tr valign="top" class="third"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (existing font set)</td><br />
</tr><br />
<tr valign="top" class="fourth"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (existing font set)</td><br />
</tr><br />
<tr valign="top" class="fifth"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (?)</td><br />
</tr><br />
<tr valign="top" class="sixth"><br />
<td class="cmd">[...]</td><br />
<td>features = IDENTIFIER<br /><br />
rscale = NUMBER<br/><br />
encoding = IDENTIFIER<br/><br />
text = IDENTIFIER</td><br />
</tr><br />
</table><br />
<br />
== Description == <br />
<br />
{{cmd|definetypeface}} sets up a typeface for use within a typescript.<br />
<br />
The third and fourth arguments to \definetypeface are pointers to already declared font sets;<br />
these are defined elsewhere. Table 5.8 gives the full list of predefined typescripts (the first<br />
argument of \starttypescript) and font sets that are attached to the styles (the third and<br />
fourth argument of each \definetypeface).<br />
The names in the third argument (like serif and sans) do not have the same meaning as the<br />
names used in \setupbodyfont. Inside \setupbodyfont, they were keywords that were in-<br />
ternally remapped to one of the two-letter internal styles. Inside \definetypeface, they are<br />
nothing more than convenience names that are attached to a group of fonts by the person that<br />
wrote the font definition. They only reflect a grouping that the person believed that could be<br />
a single font style. Oftentimes, these names are identical to the official style keywords, just as<br />
the typescript and typeface names are often the same, but there can be (and sometimes are)<br />
different names altogether.<br />
<br />
How to define your own font sets is explained in the reference manual, but there are quite a<br />
few predefined font sets that come with ConTEXt; these are all listed in the four tables 5.9, 5.10,<br />
5.11, and 5.12.<br />
For everything to work properly in MkII, the predefined font sets also have to have an encoding<br />
attached, you can look those up in the relevant tables as well.<br />
<br />
The fifth argument to \definetypeface specifies specific font size setups (if any), these will be<br />
covered in the reference manual. Almost always, specifying default will suffice.<br />
<br />
The optional sixth argument is used for tweaking font settings like the specification of font<br />
features or adjusting parameters. In this case, the two modern font sets are loaded with a small<br />
magnification, this evens out the visual heights of the font styles.<br />
<br />
== Example ==<br />
<context source="yes"><br />
\starttypescript [palatino] [texnansi,ec,qx,t5,default]<br />
\definetypeface[palatino] [rm] [serif][palatino] [default]<br />
\definetypeface[palatino] [ss] [sans] [modern] [default] [rscale=1.075]<br />
\definetypeface[palatino] [tt] [mono] [modern] [default] [rscale=1.075]<br />
\definetypeface[palatino] [mm] [math] [palatino] [default]<br />
\stoptypescript<br />
</context><br />
<br />
This defines a typescript named palatino in five different encodings. When this typescript is<br />
executed via \usetypescript, it will define four typefaces, one of each of the four basic styles<br />
rm, ss, tt, and mm.<br />
<br />
== See also ==<br />
* [[ConTeXt_reference_manual]] Section 5.8.3 Typeface definitions<br />
* {{cmd|starttypescript}}<br />
* [[Simple_Typescript_Example]]<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Paragraphs|setupinterlinespace]]<br />
[[Category:Command/Layout|setupinterlinespace]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/definetypeface&diff=22064Command/definetypeface2013-09-19T17:42:22Z<p>Huttarl: my initial attempt at documenting \definetypeface, based on the ref man</p>
<hr />
<div>{{Reference<br />
|name=definetypeface<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\definetypeface<span class="first">[...]</span><span class="second">[...]</span><span class="third">[...]</span><span class="fourth">[...]</span><span class="fifth">[...]</span><span class="sixth">[...]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td>TEXT (typescript identifier)</td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">[...]</td><br />
<td>rm ss tt mm hw cg ("basic style")</td><br />
</tr><br />
<tr valign="top" class="third"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (existing font set)</td><br />
</tr><br />
<tr valign="top" class="fourth"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (existing font set)</td><br />
</tr><br />
<tr valign="top" class="fifth"><br />
<td class="cmd">[...]</td><br />
<td>IDENTIFIER (?)</td><br />
</tr><br />
<tr valign="top" class="sixth"><br />
<td class="cmd">[...]</td><br />
<td>features = IDENTIFIER<br /><br />
rscale = NUMBER<br/><br />
encoding = IDENTIFIER<br/><br />
text = IDENTIFIER</td><br />
</tr><br />
</table><br />
<br />
== Description == <br />
<br />
{{cmd|definetypeface}} sets up a typeface for use within a typescript.<br />
<br />
The third and fourth arguments to \definetypeface are pointers to already declared font sets;<br />
these are defined elsewhere. Table 5.8 gives the full list of predefined typescripts (the first<br />
argument of \starttypescript) and font sets that are attached to the styles (the third and<br />
fourth argument of each \definetypeface).<br />
The names in the third argument (like serif and sans) do not have the same meaning as the<br />
names used in \setupbodyfont. Inside \setupbodyfont, they were keywords that were in-<br />
ternally remapped to one of the two-letter internal styles. Inside \definetypeface, they are<br />
nothing more than convenience names that are attached to a group of fonts by the person that<br />
wrote the font definition. They only reflect a grouping that the person believed that could be<br />
a single font style. Oftentimes, these names are identical to the official style keywords, just as<br />
the typescript and typeface names are often the same, but there can be (and sometimes are)<br />
different names altogether.<br />
<br />
How to define your own font sets is explained in the reference manual, but there are quite a<br />
few predefined font sets that come with ConTEXt; these are all listed in the four tables 5.9, 5.10,<br />
5.11, and 5.12.<br />
For everything to work properly in MkII, the predefined font sets also have to have an encoding<br />
attached, you can look those up in the relevant tables as well.<br />
<br />
The fifth argument to \definetypeface specifies specific font size setups (if any), these will be<br />
covered in section ?? in the next chapter. Almost always, specifying default will suffice.<br />
<br />
The optional sixth argument is used for tweaking font settings like the specification of font<br />
features or adjusting parameters. In this case, the two modern font sets are loaded with a small<br />
magnification, this evens out the visual heights of the font styles.<br />
<br />
== Example ==<br />
<context source="yes"><br />
\starttypescript [palatino] [texnansi,ec,qx,t5,default]<br />
\definetypeface[palatino] [rm] [serif][palatino] [default]<br />
\definetypeface[palatino] [ss] [sans] [modern] [default] [rscale=1.075]<br />
\definetypeface[palatino] [tt] [mono] [modern] [default] [rscale=1.075]<br />
\definetypeface[palatino] [mm] [math] [palatino] [default]<br />
\stoptypescript<br />
</context><br />
<br />
This defines a typescript named palatino in five different encodings. When this typescript is<br />
executed via \usetypescript, it will define four typefaces, one of each of the four basic styles<br />
rm, ss, tt, and mm.<br />
<br />
== See also ==<br />
* [[ConTeXt_reference_manual]] Section 5.8.3 Typeface definitions<br />
* {{cmd|starttypescript}}<br />
* [[Simple_Typescript_Example]]<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Paragraphs|setupinterlinespace]]<br />
[[Category:Command/Layout|setupinterlinespace]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Ruby_Installation&diff=22063Ruby Installation2013-09-13T20:49:54Z<p>Huttarl: added note about "invalid multibyte escape" error</p>
<hr />
<div>ConTeXt scripts used to be written in Perl (phased out), then switched to Ruby and now to Lua. You need to have at least Ruby installed installed, and Perl for mptopdf.<br />
<br />
You can download 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 />
<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 them (remember the folder where you've put them!) you have to check if both executables are included in the PATH. Open the command line (''Start'' -> ''Run'' ... -> type '''<code>cmd</code>''' or '''<code>command</code>''') and check if<br />
perl --version<br />
and<br />
ruby --version<br />
work OK.<br />
<br />
If windows complains about ''"Command not found"'', go to the ''Control Panel'' -> ''System'' -> ''Advanced'' -> click on the ''"Environment variables"'' and choose '''path''' in ''"system variables"''. Type in the path (e.g. D\Program Files\Perl\bin\;) where the ruby and perl *.exe files are installed. Generally, the installation is automatic. you may not need the above method.<br />
<br />
If you get an error similar to ''invalid multibyte escape'' from Ruby, you may need to use a version of Ruby earlier than 1.9. There may be other ways to get around this problem; see e.g. http://gnuu.org/2009/11/02/ruby-1-9-encoding-issues-again/.</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command/definelayout&diff=22062Command/definelayout2013-09-12T05:38:45Z<p>Huttarl: created a page for \definelayout based on Layout page.</p>
<hr />
<div>{{Reference<br />
|name=definelayout<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\definelayout<!--<br />
--><span class="first">[...]</span><!--<br />
--><span class="second">[...]</span><!--<br />
--></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td>''layout name''</td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">[...]</td><br />
<td>''parameters''</td><br />
</tr><br />
</table><br />
<br />
== Description == <br />
Define a named layout.<br />
<br />
== Examples ==<br />
If you need to use different layouts in some parts of the document, you can set up a global layout, and then define additional named layouts for the deviating parts. You only need to specify the dimensions that differ: unspecified dimensions will be inherited from the global layout. <br />
<br />
To switch to a different layout, call it up in the appropriate place in the document. To revert back to the global layout, use \setuplayout[reset]. <br />
<br />
<texcode><br />
\setuplayout[...] % global layout<br />
\definelayout[wide][...] % layout of the first page<br />
<br />
\setuplayout[wide] % switch to layout called 'wide'<br />
\setuplayout[reset] % switch back to the global layout<br />
</texcode><br />
<br />
To specify in advance that you want to change layouts starting from page 4 (e.g.), use \definelayout[4][...]. Resetting the layout must be done explicitly; else, the new layout will be used until the end of the document. <br />
<br />
<texcode><br />
% different layout for first two pages<br />
\definelayout[1][wide]<br />
\definelayout[3][reset]<br />
</texcode><br />
<br />
== See also ==<br />
* [[Layout]]<br />
* {{cmd|setuplayout}}<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
{{Columns navbox}}<br />
<br />
[[Category:Command/Columns|definelayout]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command_old/marking&diff=21943Command old/marking2013-07-08T19:14:31Z<p>Huttarl: Linked to TeX primitive \mark, with explanation</p>
<hr />
<div>{{Reference<br />
|name=marking<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\marking<span class="first" >[...]</span><span class="second" >{...}</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td>name </td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">{...}</td><br />
<td><i>text</i> </td><br />
</tr><br />
</table><br />
<br />
<br />
== Description == <br />
<br />
(I'm filling this in with guesses/inferences because I can't find any better information.)<br />
<br />
Seems to set the value for a named "mark", used in things like headers and footers. Apparently related to the TeX primitive [http://www.tug.org/utilities/plain/cseq.html#mark-rp \mark], which "specifies text which should be ''marked''," which helps determine the ''guide words'' at the top of each page.<br />
<br />
== Example ==<br />
<texcode><br />
\marking[headername]{Other Languages}<br />
</texcode><br />
<br />
For a more complete example, see {{cmd|getmarking}}.<br />
<br />
== See also ==<br />
{{cmd|getmarking}}<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Marking|marking]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Command_old/marking&diff=21942Command old/marking2013-07-08T15:00:08Z<p>Huttarl: filled in a brief summary of what I suppose \marking does, and linked to \getmarking where the whole system is explained somewhat.</p>
<hr />
<div>{{Reference<br />
|name=marking<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\marking<span class="first" >[...]</span><span class="second" >{...}</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td>name </td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">{...}</td><br />
<td><i>text</i> </td><br />
</tr><br />
</table><br />
<br />
<br />
== Description == <br />
<br />
(I'm filling this in with guesses/inferences because I can't find any better information.)<br />
<br />
Seems to set the value for a named "mark", used in things like headers and footers.<br />
<br />
== Example ==<br />
<texcode><br />
\marking[headername]{Other Languages}<br />
</texcode><br />
<br />
For a more complete example, see {{cmd|getmarking}}.<br />
<br />
== See also ==<br />
{{cmd|getmarking}}<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Marking|marking]]</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Reviewing_hyphenation&diff=9242Reviewing hyphenation2009-02-04T22:37:13Z<p>Huttarl: /* Features */ added screenshot</p>
<hr />
<div>= The Problem =<br />
<br />
We have a situation where hyphenation is an issue, due to a 2-column<br />
layout where the columns are not very wide. We've done a lot of tweaking<br />
of settings for hyphenation and interword spacing, and the result seems<br />
pretty good. In particular, there are not many cases of consecutive<br />
lines that end with hyphens, and not many cases where a hyphenation<br />
occurs over a right-hand page break. The few cases that exist, we have<br />
been fixing manually by using <code>\hbox{...}</code> to prevent hyphenation at the<br />
trouble spot.<br />
<br />
But the hyphenation is by nature somewhat volatile, so whenever we<br />
change something we would like to be able to easily recheck the hyphenation.<br />
And our book is over 1200 pages, so it would be very helpful to have<br />
tools to make the checking more efficient.<br />
<br />
= Potential Solutions =<br />
<br />
== PDF viewers ==<br />
<br />
One tool we found was the "evince" PDF viewer in Linux, which highlights<br />
all search results at once. So you can search for "-", and it will<br />
highlight all hyphens, which makes it easier to scan the PDF visually<br />
for hyphenation problems.<br />
<br />
Still, this approach has its limitations... our layout domain experts<br />
don't have Linux machines, and I haven't found a PDF viewer for Windows<br />
that can highlight all search results at once.<br />
<br />
(We are still looking into Okular, which is available for Windows at http://windows.kde.org)<br />
<br />
== A ConTeXt solution ==<br />
Another approach we wondered about was having TeX highlight the<br />
hyphenations... e.g. have it change the background color to yellow or red, when<br />
outputting a word that's dynamically broken/hyphenated. (Rather like we<br />
have TeX output red grid lines to help with debugging layout.)<br />
I think we would also want to highlight static hyphens that occur at the<br />
end of a line, as in "Niger-<br><br />
Congo," because they have a similar visual impact. Possibly using a<br />
different color.<br />
<br />
This would be an ideal solution, I think, but we don't know how to have<br />
TeX detect when a word gets dynamically hyphenated. (I made some inquiries on the NTG list to this effect. The response was that it would be not difficult to implement this in mkiv, but it could not be done in mkii. And we are not free to move to mkiv at this time.)<br />
<br />
== Adobe Acrobat / Javascript ==<br />
<br />
Another possibility is using javascript in Adobe<br />
Acrobat Pro to automatically find and highlight end-of-line (and end-of-page) hyphens.<br />
That is the approach where we had most success. The features and limitations are described below, and the javascript code is attached.<br />
<br />
=== Features ===<br />
* In Acrobat Pro, load a PDF and select "Highlight Hyphens" from the Tools menu to begin the highlighting. The first part of each word that is line-broken with a hyphen is highlighted.<br />
* The javascript console window shows progress.<br />
* The console reports number of hyphens (actually, words line-broken with a hyphen) on each page.<br />
* The resulting highlighted PDF can be saved including the highlights.<br />
* The saved, highlighted PDF can be viewed with highlights using Adobe Reader (does not require Acrobat Pro).<br />
<br />
The resulting PDF looks something like this:<br />
<br />
[[image:Highlight-hyphens-scrshot.png]]<br />
<br />
=== Limitations ===<br />
* Slow. A representative test showed 0.07 pages per second (14 seconds per page!) That would mean about 5 hours for our book.<br />
* The resulting PDF file grows by about 25%.<br />
* Sometimes the highlighting function stops with an error ("Internal error" / "General error") after about 30 pages. We don't know why but maybe it could be avoided by only doing a limited number of pages at a time.<br />
<br />
=== The code ===<br />
The following two javascript files are to be placed in the Acrobat javascripts folder, e.g. C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts, and then Acrobat is restarted.<br />
<br />
'''<code>add-hyphen-menu.js</code>''' adds a menu item for "Highlight Hyphens..." on the Tools menu.<br />
<br />
<pre><br />
// Add a menu item for "Highlight Hyphens"<br />
<br />
app.addMenuItem({<br />
cName: "Highlight Hyphens...",<br />
cParent: "Tools",<br />
cExec: "highlightHyphens()"<br />
});<br />
</pre><br />
<br />
'''<code>findAndAnnot.js</code>''' defines the function that finds line-broken words and highlights the first "quad" of each.<br />
<pre><br />
// Find and highlight all words that are line-broken with "-"<br />
// Lars Huttar, lars_huttar@sil.org, 2009-02-04<br />
<br />
function highlightHyphens() {<br />
console.show(); // show console, for debugging.<br />
console.println('entered highlightFinalHyphens()');<br />
<br />
var word, numWords, q;<br />
var count = 0;<br />
var startTime = (new Date()).getTime();<br />
var startPage = 0; // may want to specify page range<br />
var hyphThisPage;<br />
<br />
for (var i = startPage; i < this.numPages; i++) {<br />
hyphThisPage = 0;<br />
numWords = this.getPageNumWords(i);<br />
for (var j = 0; j < numWords; j++) {<br />
word = this.getPageNthWord(i, j, false); // don't strip punctuation!<br />
// console.println('word ' + j + ': ' + word);<br />
// was: if (word.charAt(word.length - 1) == '-') {<br />
// Don't highlight single hyphens (which are common in headers/footers)<br />
// and which tend to come in as "- ";<br />
// Also, words that are line-broken with hyphens (tend to?) come in as<br />
// a single word with medial hyphen, e.g. "vari-eties", whereas those that<br />
// have a non-breaking hyphen come in as multiple words, e.g. "day-" "to-" "day".<br />
// So don't highlight words whose only hyphen is at the end.<br />
// We don't expect any word breaks with one character before the hyphen, e.g. "C-ontinent",<br />
// but if there were any we'd want to know about it!<br />
if ((word.length > 2 || (word.length > 1 && word.charAt(0) != '-'))) {<br />
ind = word.indexOf('-');<br />
if (ind > 0 && ind < word.length - 1) {<br />
hyphThisPage++;<br />
console.println('page ' + (i+1) + '/' + this.numPages + ' word: ' + word);<br />
q = this.getPageNthWordQuads(i, j);<br />
// The following call throws an exception in Reader; we don't have the right to manipulate comments,<br />
// unless such has been enabled on this PDF using LiveCycle.<br />
this.addAnnot({page: i, type: "Highlight", quads: new Array(q[0]) }); // highlight only the first quad<br />
}<br />
}<br />
}<br />
console.println('page ' + (i+1) + '/' + this.numPages + ': ' + hyphThisPage + ' hyphens');<br />
}<br />
var nPages = this.numPages - startPage;<br />
var endTime = (new Date()).getTime();<br />
console.println('Completed ' + nPages + ' pages in ' + ((endTime - startTime)/1000.0).toFixed(2) + ' sec. ('<br />
+ ((nPages + 0.0) * 1000 / (endTime - startTime)).toFixed(2) + ' pages/sec)');<br />
}<br />
</pre></div>Huttarlhttps://wiki.contextgarden.net/index.php?title=File:Highlight-hyphens-scrshot.png&diff=9241File:Highlight-hyphens-scrshot.png2009-02-04T22:29:25Z<p>Huttarl: shows highlighting of line-broken words using my javascript code in Adobe Acrobat</p>
<hr />
<div>shows highlighting of line-broken words using my javascript code in Adobe Acrobat</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Reviewing_hyphenation&diff=9240Reviewing hyphenation2009-02-04T22:23:59Z<p>Huttarl: /* A ConTeXt solution */ fixed a typo</p>
<hr />
<div>= The Problem =<br />
<br />
We have a situation where hyphenation is an issue, due to a 2-column<br />
layout where the columns are not very wide. We've done a lot of tweaking<br />
of settings for hyphenation and interword spacing, and the result seems<br />
pretty good. In particular, there are not many cases of consecutive<br />
lines that end with hyphens, and not many cases where a hyphenation<br />
occurs over a right-hand page break. The few cases that exist, we have<br />
been fixing manually by using <code>\hbox{...}</code> to prevent hyphenation at the<br />
trouble spot.<br />
<br />
But the hyphenation is by nature somewhat volatile, so whenever we<br />
change something we would like to be able to easily recheck the hyphenation.<br />
And our book is over 1200 pages, so it would be very helpful to have<br />
tools to make the checking more efficient.<br />
<br />
= Potential Solutions =<br />
<br />
== PDF viewers ==<br />
<br />
One tool we found was the "evince" PDF viewer in Linux, which highlights<br />
all search results at once. So you can search for "-", and it will<br />
highlight all hyphens, which makes it easier to scan the PDF visually<br />
for hyphenation problems.<br />
<br />
Still, this approach has its limitations... our layout domain experts<br />
don't have Linux machines, and I haven't found a PDF viewer for Windows<br />
that can highlight all search results at once.<br />
<br />
(We are still looking into Okular, which is available for Windows at http://windows.kde.org)<br />
<br />
== A ConTeXt solution ==<br />
Another approach we wondered about was having TeX highlight the<br />
hyphenations... e.g. have it change the background color to yellow or red, when<br />
outputting a word that's dynamically broken/hyphenated. (Rather like we<br />
have TeX output red grid lines to help with debugging layout.)<br />
I think we would also want to highlight static hyphens that occur at the<br />
end of a line, as in "Niger-<br><br />
Congo," because they have a similar visual impact. Possibly using a<br />
different color.<br />
<br />
This would be an ideal solution, I think, but we don't know how to have<br />
TeX detect when a word gets dynamically hyphenated. (I made some inquiries on the NTG list to this effect. The response was that it would be not difficult to implement this in mkiv, but it could not be done in mkii. And we are not free to move to mkiv at this time.)<br />
<br />
== Adobe Acrobat / Javascript ==<br />
<br />
Another possibility is using javascript in Adobe<br />
Acrobat Pro to automatically find and highlight end-of-line (and end-of-page) hyphens.<br />
That is the approach where we had most success. The features and limitations are described below, and the javascript code is attached.<br />
<br />
=== Features ===<br />
* In Acrobat Pro, load a PDF and select "Highlight Hyphens" from the Tools menu to begin the highlighting. The first part of each word that is line-broken with a hyphen is highlighted.<br />
* The javascript console window shows progress.<br />
* The console reports number of hyphens (actually, words line-broken with a hyphen) on each page.<br />
* The resulting highlighted PDF can be saved including the highlights.<br />
* The saved, highlighted PDF can be viewed with highlights using Adobe Reader (does not require Acrobat Pro).<br />
<br />
=== Limitations ===<br />
* Slow. A representative test showed 0.07 pages per second (14 seconds per page!) That would mean about 5 hours for our book.<br />
* The resulting PDF file grows by about 25%.<br />
* Sometimes the highlighting function stops with an error ("Internal error" / "General error") after about 30 pages. We don't know why but maybe it could be avoided by only doing a limited number of pages at a time.<br />
<br />
=== The code ===<br />
The following two javascript files are to be placed in the Acrobat javascripts folder, e.g. C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts, and then Acrobat is restarted.<br />
<br />
'''<code>add-hyphen-menu.js</code>''' adds a menu item for "Highlight Hyphens..." on the Tools menu.<br />
<br />
<pre><br />
// Add a menu item for "Highlight Hyphens"<br />
<br />
app.addMenuItem({<br />
cName: "Highlight Hyphens...",<br />
cParent: "Tools",<br />
cExec: "highlightHyphens()"<br />
});<br />
</pre><br />
<br />
'''<code>findAndAnnot.js</code>''' defines the function that finds line-broken words and highlights the first "quad" of each.<br />
<pre><br />
// Find and highlight all words that are line-broken with "-"<br />
// Lars Huttar, lars_huttar@sil.org, 2009-02-04<br />
<br />
function highlightHyphens() {<br />
console.show(); // show console, for debugging.<br />
console.println('entered highlightFinalHyphens()');<br />
<br />
var word, numWords, q;<br />
var count = 0;<br />
var startTime = (new Date()).getTime();<br />
var startPage = 0; // may want to specify page range<br />
var hyphThisPage;<br />
<br />
for (var i = startPage; i < this.numPages; i++) {<br />
hyphThisPage = 0;<br />
numWords = this.getPageNumWords(i);<br />
for (var j = 0; j < numWords; j++) {<br />
word = this.getPageNthWord(i, j, false); // don't strip punctuation!<br />
// console.println('word ' + j + ': ' + word);<br />
// was: if (word.charAt(word.length - 1) == '-') {<br />
// Don't highlight single hyphens (which are common in headers/footers)<br />
// and which tend to come in as "- ";<br />
// Also, words that are line-broken with hyphens (tend to?) come in as<br />
// a single word with medial hyphen, e.g. "vari-eties", whereas those that<br />
// have a non-breaking hyphen come in as multiple words, e.g. "day-" "to-" "day".<br />
// So don't highlight words whose only hyphen is at the end.<br />
// We don't expect any word breaks with one character before the hyphen, e.g. "C-ontinent",<br />
// but if there were any we'd want to know about it!<br />
if ((word.length > 2 || (word.length > 1 && word.charAt(0) != '-'))) {<br />
ind = word.indexOf('-');<br />
if (ind > 0 && ind < word.length - 1) {<br />
hyphThisPage++;<br />
console.println('page ' + (i+1) + '/' + this.numPages + ' word: ' + word);<br />
q = this.getPageNthWordQuads(i, j);<br />
// The following call throws an exception in Reader; we don't have the right to manipulate comments,<br />
// unless such has been enabled on this PDF using LiveCycle.<br />
this.addAnnot({page: i, type: "Highlight", quads: new Array(q[0]) }); // highlight only the first quad<br />
}<br />
}<br />
}<br />
console.println('page ' + (i+1) + '/' + this.numPages + ': ' + hyphThisPage + ' hyphens');<br />
}<br />
var nPages = this.numPages - startPage;<br />
var endTime = (new Date()).getTime();<br />
console.println('Completed ' + nPages + ' pages in ' + ((endTime - startTime)/1000.0).toFixed(2) + ' sec. ('<br />
+ ((nPages + 0.0) * 1000 / (endTime - startTime)).toFixed(2) + ' pages/sec)');<br />
}<br />
</pre></div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Reviewing_hyphenation&diff=9239Reviewing hyphenation2009-02-04T22:21:55Z<p>Huttarl: /* The code */ inserting js code because it's not allowed as an upload.</p>
<hr />
<div>= The Problem =<br />
<br />
We have a situation where hyphenation is an issue, due to a 2-column<br />
layout where the columns are not very wide. We've done a lot of tweaking<br />
of settings for hyphenation and interword spacing, and the result seems<br />
pretty good. In particular, there are not many cases of consecutive<br />
lines that end with hyphens, and not many cases where a hyphenation<br />
occurs over a right-hand page break. The few cases that exist, we have<br />
been fixing manually by using <code>\hbox{...}</code> to prevent hyphenation at the<br />
trouble spot.<br />
<br />
But the hyphenation is by nature somewhat volatile, so whenever we<br />
change something we would like to be able to easily recheck the hyphenation.<br />
And our book is over 1200 pages, so it would be very helpful to have<br />
tools to make the checking more efficient.<br />
<br />
= Potential Solutions =<br />
<br />
== PDF viewers ==<br />
<br />
One tool we found was the "evince" PDF viewer in Linux, which highlights<br />
all search results at once. So you can search for "-", and it will<br />
highlight all hyphens, which makes it easier to scan the PDF visually<br />
for hyphenation problems.<br />
<br />
Still, this approach has its limitations... our layout domain experts<br />
don't have Linux machines, and I haven't found a PDF viewer for Windows<br />
that can highlight all search results at once.<br />
<br />
(We are still looking into Okular, which is available for Windows at http://windows.kde.org)<br />
<br />
== A ConTeXt solution ==<br />
Another approach we wondered about was having TeX highlight the<br />
hyphenations... e.g. changed the background color to yellow or red, when<br />
outputting a word that's dynamically broken/hyphenated. (Rather like we<br />
have TeX output red grid lines to help with debugging layout.)<br />
I think we would also want to highlight static hyphens that occur at the<br />
end of a line, as in "Niger-<br />
Congo," because they have a similar visual impact. Possibly using a<br />
different color.<br />
<br />
This would be an ideal solution, I think, but we don't know how to have<br />
TeX detect when a word gets dynamically hyphenated. (I made some inquiries on the NTG list to this effect. The response was that it would be not difficult to implement this in mkiv, but it could not be done in mkii. And we were not free to move to mkiv.)<br />
<br />
== Adobe Acrobat / Javascript ==<br />
<br />
Another possibility is using javascript in Adobe<br />
Acrobat Pro to automatically find and highlight end-of-line (and end-of-page) hyphens.<br />
That is the approach where we had most success. The features and limitations are described below, and the javascript code is attached.<br />
<br />
=== Features ===<br />
* In Acrobat Pro, load a PDF and select "Highlight Hyphens" from the Tools menu to begin the highlighting. The first part of each word that is line-broken with a hyphen is highlighted.<br />
* The javascript console window shows progress.<br />
* The console reports number of hyphens (actually, words line-broken with a hyphen) on each page.<br />
* The resulting highlighted PDF can be saved including the highlights.<br />
* The saved, highlighted PDF can be viewed with highlights using Adobe Reader (does not require Acrobat Pro).<br />
<br />
=== Limitations ===<br />
* Slow. A representative test showed 0.07 pages per second (14 seconds per page!) That would mean about 5 hours for our book.<br />
* The resulting PDF file grows by about 25%.<br />
* Sometimes the highlighting function stops with an error ("Internal error" / "General error") after about 30 pages. We don't know why but maybe it could be avoided by only doing a limited number of pages at a time.<br />
<br />
=== The code ===<br />
The following two javascript files are to be placed in the Acrobat javascripts folder, e.g. C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts, and then Acrobat is restarted.<br />
<br />
'''<code>add-hyphen-menu.js</code>''' adds a menu item for "Highlight Hyphens..." on the Tools menu.<br />
<br />
<pre><br />
// Add a menu item for "Highlight Hyphens"<br />
<br />
app.addMenuItem({<br />
cName: "Highlight Hyphens...",<br />
cParent: "Tools",<br />
cExec: "highlightHyphens()"<br />
});<br />
</pre><br />
<br />
'''<code>findAndAnnot.js</code>''' defines the function that finds line-broken words and highlights the first "quad" of each.<br />
<pre><br />
// Find and highlight all words that are line-broken with "-"<br />
// Lars Huttar, lars_huttar@sil.org, 2009-02-04<br />
<br />
function highlightHyphens() {<br />
console.show(); // show console, for debugging.<br />
console.println('entered highlightFinalHyphens()');<br />
<br />
var word, numWords, q;<br />
var count = 0;<br />
var startTime = (new Date()).getTime();<br />
var startPage = 0; // may want to specify page range<br />
var hyphThisPage;<br />
<br />
for (var i = startPage; i < this.numPages; i++) {<br />
hyphThisPage = 0;<br />
numWords = this.getPageNumWords(i);<br />
for (var j = 0; j < numWords; j++) {<br />
word = this.getPageNthWord(i, j, false); // don't strip punctuation!<br />
// console.println('word ' + j + ': ' + word);<br />
// was: if (word.charAt(word.length - 1) == '-') {<br />
// Don't highlight single hyphens (which are common in headers/footers)<br />
// and which tend to come in as "- ";<br />
// Also, words that are line-broken with hyphens (tend to?) come in as<br />
// a single word with medial hyphen, e.g. "vari-eties", whereas those that<br />
// have a non-breaking hyphen come in as multiple words, e.g. "day-" "to-" "day".<br />
// So don't highlight words whose only hyphen is at the end.<br />
// We don't expect any word breaks with one character before the hyphen, e.g. "C-ontinent",<br />
// but if there were any we'd want to know about it!<br />
if ((word.length > 2 || (word.length > 1 && word.charAt(0) != '-'))) {<br />
ind = word.indexOf('-');<br />
if (ind > 0 && ind < word.length - 1) {<br />
hyphThisPage++;<br />
console.println('page ' + (i+1) + '/' + this.numPages + ' word: ' + word);<br />
q = this.getPageNthWordQuads(i, j);<br />
// The following call throws an exception in Reader; we don't have the right to manipulate comments,<br />
// unless such has been enabled on this PDF using LiveCycle.<br />
this.addAnnot({page: i, type: "Highlight", quads: new Array(q[0]) }); // highlight only the first quad<br />
}<br />
}<br />
}<br />
console.println('page ' + (i+1) + '/' + this.numPages + ': ' + hyphThisPage + ' hyphens');<br />
}<br />
var nPages = this.numPages - startPage;<br />
var endTime = (new Date()).getTime();<br />
console.println('Completed ' + nPages + ' pages in ' + ((endTime - startTime)/1000.0).toFixed(2) + ' sec. ('<br />
+ ((nPages + 0.0) * 1000 / (endTime - startTime)).toFixed(2) + ' pages/sec)');<br />
}<br />
</pre></div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Reviewing_hyphenation&diff=9238Reviewing hyphenation2009-02-04T22:14:04Z<p>Huttarl: created the page</p>
<hr />
<div>= The Problem =<br />
<br />
We have a situation where hyphenation is an issue, due to a 2-column<br />
layout where the columns are not very wide. We've done a lot of tweaking<br />
of settings for hyphenation and interword spacing, and the result seems<br />
pretty good. In particular, there are not many cases of consecutive<br />
lines that end with hyphens, and not many cases where a hyphenation<br />
occurs over a right-hand page break. The few cases that exist, we have<br />
been fixing manually by using <code>\hbox{...}</code> to prevent hyphenation at the<br />
trouble spot.<br />
<br />
But the hyphenation is by nature somewhat volatile, so whenever we<br />
change something we would like to be able to easily recheck the hyphenation.<br />
And our book is over 1200 pages, so it would be very helpful to have<br />
tools to make the checking more efficient.<br />
<br />
= Potential Solutions =<br />
<br />
== PDF viewers ==<br />
<br />
One tool we found was the "evince" PDF viewer in Linux, which highlights<br />
all search results at once. So you can search for "-", and it will<br />
highlight all hyphens, which makes it easier to scan the PDF visually<br />
for hyphenation problems.<br />
<br />
Still, this approach has its limitations... our layout domain experts<br />
don't have Linux machines, and I haven't found a PDF viewer for Windows<br />
that can highlight all search results at once.<br />
<br />
(We are still looking into Okular, which is available for Windows at http://windows.kde.org)<br />
<br />
== A ConTeXt solution ==<br />
Another approach we wondered about was having TeX highlight the<br />
hyphenations... e.g. changed the background color to yellow or red, when<br />
outputting a word that's dynamically broken/hyphenated. (Rather like we<br />
have TeX output red grid lines to help with debugging layout.)<br />
I think we would also want to highlight static hyphens that occur at the<br />
end of a line, as in "Niger-<br />
Congo," because they have a similar visual impact. Possibly using a<br />
different color.<br />
<br />
This would be an ideal solution, I think, but we don't know how to have<br />
TeX detect when a word gets dynamically hyphenated. (I made some inquiries on the NTG list to this effect. The response was that it would be not difficult to implement this in mkiv, but it could not be done in mkii. And we were not free to move to mkiv.)<br />
<br />
== Adobe Acrobat / Javascript ==<br />
<br />
Another possibility is using javascript in Adobe<br />
Acrobat Pro to automatically find and highlight end-of-line (and end-of-page) hyphens.<br />
That is the approach where we had most success. The features and limitations are described below, and the javascript code is attached.<br />
<br />
=== Features ===<br />
* In Acrobat Pro, load a PDF and select "Highlight Hyphens" from the Tools menu to begin the highlighting. The first part of each word that is line-broken with a hyphen is highlighted.<br />
* The javascript console window shows progress.<br />
* The console reports number of hyphens (actually, words line-broken with a hyphen) on each page.<br />
* The resulting highlighted PDF can be saved including the highlights.<br />
* The saved, highlighted PDF can be viewed with highlights using Adobe Reader (does not require Acrobat Pro).<br />
<br />
=== Limitations ===<br />
* Slow. A representative test showed 0.07 pages per second (14 seconds per page!) That would mean about 5 hours for our book.<br />
* The resulting PDF file grows by about 25%.<br />
* Sometimes the highlighting function stops with an error ("Internal error" / "General error") after about 30 pages. We don't know why but maybe it could be avoided by only doing a limited number of pages at a time.<br />
<br />
=== The code ===<br />
The two attached javascript files are placed in the Acrobat javascripts folder, e.g. C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts, and then Acrobat is restarted.<br />
add-hyphen-menu.js adds a menu item for "Highlight Hyphens..." on the Tools menu.<br />
findAndAnnot.js defines the function that finds line-broken words and highlights the first "quad" of each.</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Parallel&diff=9122Parallel2008-12-17T15:21:44Z<p>Huttarl: </p>
<hr />
<div>Thanks, everybody, for the discussion on running TeX distributed / in parallel.<br />
I am much educated about the state of the art. :-)<br />
<br />
Summary ...<br />
<br />
* There is plenty of optimization that normally can be done, without having to parallelize. If a ConTeXt run is taking a really long time, chances are that something is not being done according to the design.<br />
<br />
* For most (current) purposes, documents are small enough and ConTeXt is fast enough that the effort to automate distribution of typesetting runs may not be worthwhile. On the other hand, the usage of TeX might expand to larger applications if greater throughput were available.<br />
<br />
* However, as things stand now, one can always divide documents up by hand, typeset the parts independently, and stitch them back together using tools such as divert/undivert. One can even design a document with the spec that the canonical typesetting process is to typeset the sections independently; then the sections can never affect each other, except for explicitly added inter-section effects like page reference updates.<br />
<br />
If you're not aware of MarkMail, it's a handy place to browse / search archives of mailing lists. This thread can be found at <br />
http://markmail.org/search/?q=ntg+context+distributed+parallel<br />
<br />
On 12/17/2008 2:47 AM, Taco Hoekwater wrote:<br />
<pre><br />
> There are some interesting ideas in this discussion, but with<br />
> the current state of the code base all of this will be exceedingly<br />
> difficult (especially because of all the synchronisation issues).<br />
> <br />
> Unless someone wants to work on this idea him/herself (and that<br />
> would be great, there are not nearly enough people working on TeX<br />
> development!), you could remind me, say, two years from now?<br />
</pre><br />
<br />
Sure. Thank you for your interest.<br />
<br />
I wasn't asking for someone to implement new features for this, though I would be happy to see it happen if it is worthwhile for the community.<br />
<br />
As Dr Dobb's says, "Single core systems are history" (http://www.ddj.com/hpc-high-performance-computing/207100560). Software that can take advantage of multiple cores (or threads, or distributed nodes) will continue to scale. Of course some effort, and often some adjustment, is necessary to enable programs to effectively use parallelism.<br />
<br />
I'll create a page at http://wiki.contextgarden.net/Parallel summarizing this discussion if that's OK.<br />
<br />
Regards,<br />
Lars<br />
<br />
--[[User:Huttarl|Huttarl]] 15:16, 17 December 2008 (CET)</div>Huttarlhttps://wiki.contextgarden.net/index.php?title=Parallel&diff=9121Parallel2008-12-17T14:16:22Z<p>Huttarl: created page about running TeX in parallel / distributed environment</p>
<hr />
<div>Thanks, everybody, for the discussion on running TeX distributed / in parallel.<br />
I am much educated about the state of the art. :-)<br />
<br />
Summary ...<br />
<br />
* There is plenty of optimization that normally can be done. If a ConTeXt run is taking a really long time, chances are that something is not being done according to the design.<br />
<br />
* For most (current) purposes, documents are small enough and ConTeXt is fast enough that the effort to automate distribution of typesetting runs may not be worthwhile. On the other hand, the usage of TeX might expand if greater throughput were available.<br />
<br />
* However, as things stand now, one can always divide documents up by hand, typeset the parts independently, and stitch them back together using tools such as divert/undivert. One can even design a document with the spec that the canonical typesetting process is to typeset the sections independently; then the sections can never affect each other, except for explicitly added inter-section effects like page reference updates.<br />
<br />
If you're not aware of MarkMail, it's a handy place to browse / search archives of mailing lists. This thread can be found at <br />
http://markmail.org/search/?q=ntg+context+distributed+parallel<br />
<br />
On 12/17/2008 2:47 AM, Taco Hoekwater wrote:<br />
<pre><br />
> There are some interesting ideas in this discussion, but with<br />
> the current state of the code base all of this will be exceedingly<br />
> difficult (especially because of all the synchronisation issues).<br />
> <br />
> Unless someone wants to work on this idea him/herself (and that<br />
> would be great, there are not nearly enough people working on TeX<br />
> development!), you could remind me, say, two years from now?<br />
</pre><br />
<br />
Sure. Thank you for your interest.<br />
<br />
I wasn't asking for someone to implement new features for this, though I would be happy to see it happen if it is worthwhile for the community.<br />
<br />
As Dr Dobb's says, "Single core systems are history" (http://www.ddj.com/hpc-high-performance-computing/207100560). Software that can take advantage of multiple cores (or threads, or distributed nodes) will continue to scale. Of course some effort, and often some adjustment, is necessary to enable programs to effectively use parallelism.<br />
<br />
I'll create a page at http://wiki.contextgarden.net/Parallel summarizing this discussion if that's OK.<br />
<br />
Regards,<br />
Lars<br />
<br />
--[[User:Huttarl|Huttarl]] 15:16, 17 December 2008 (CET)</div>Huttarl