<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>True EDGE &#187; TeX</title>
	<atom:link href="http://blogs.gnome.org/happyaron/category/tex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/happyaron</link>
	<description>Hacker builds things.</description>
	<lastBuildDate>Fri, 27 May 2011 15:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>		<item>
		<title>Quotation in ConTeXt</title>
		<link>http://blogs.gnome.org/happyaron/2009/11/04/quotation-in-context/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/11/04/quotation-in-context/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 16:56:15 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=169</guid>
		<description><![CDATA[This time I read the guide on ConTeXt Wiki and learned some basic commands doing quotation. Not very much today in fact. 1.single quotes (&#8216;): \quote{some text} 2.double quotes (&#8220;): \quotation{some text} 3.long quote sections: For single quote: \startquote ... \stopquote For double quotes: \startquotation ... \stopquotation 4.Nested quotations: Add following lines first: \setupdelimitedtext [quotation] [...]]]></description>
			<content:encoded><![CDATA[<p>This time I read the guide on ConTeXt Wiki and learned some basic commands doing quotation.<br />
Not very much today in fact.<br />
1.single quotes (&#8216;):</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\quote</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">some text</span><span style="color: #E02020; ">}</span></pre></div></div>

<p>2.double quotes (&#8220;):</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\quotation</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">some text</span><span style="color: #E02020; ">}</span></pre></div></div>

<p>3.long quote sections:<br />
For single quote:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\startquote</span> ... <span style="color: #800000; font-weight: normal;">\stopquote</span></pre></div></div>

<p>For double quotes:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\startquotation</span> ... <span style="color: #800000; font-weight: normal;">\stopquotation</span></pre></div></div>

<p>4.Nested quotations:<br />
Add following lines first:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\setupdelimitedtext</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">quotation</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">1</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">left={<span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span>[leftquotation</span>]</span><span style="color: #E02020; ">}</span>,
   right=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rightquotation</span>]</span><span style="color: #E02020; ">}]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\setupdelimitedtext</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">quotation</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">2</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">left={<span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span>[leftquote</span>]</span><span style="color: #E02020; ">}</span>,
   right=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rightquote</span>]</span><span style="color: #E02020; ">}]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\setupdelimitedtext</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">quotation</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">3</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">left={<span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span>[leftquotation</span>]</span><span style="color: #E02020; ">}</span>,
   right=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rightquotation</span>]</span><span style="color: #E02020; ">}]</span></pre></div></div>

<p>Then try with:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\starttext</span>
Testing, <span style="color: #800000; font-weight: normal;">\quotation</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">A long quotation in which one character says,
<span style="color: #800000; font-weight: normal;">\quotation</span><span style="color: #E02020; ">{</span>Eh? What am I supposed to say? Something like, <span style="color: #800000; font-weight: normal;">\quotation</span>
{Quotations in this sentence are nested</span><span style="color: #E02020; ">}</span>?<span style="color: #E02020; ">}}</span> testing, 1, 2, 3.
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/11/04/quotation-in-context/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Font fallback in ConTeXt Mininals</title>
		<link>http://blogs.gnome.org/happyaron/2009/11/02/font-fallback-in-context-mininals/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/11/02/font-fallback-in-context-mininals/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:53:42 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=138</guid>
		<description><![CDATA[Indubitably, I need to remix Chinese and English in one document. But English characters in Chinese fonts aren&#8217;t look good in most time as others, so font fallback is needed here. First, make a English font as a fallback of Chinese font: \definefontsynonym[song][name:adobesongstd] \definefontfallback[hereos][name:texgyreherosregular][0x0000-0x0400] \definefontsynonym[fbsong][song][fallbacks=hereos] &#160; \definefont[newsong][fbsong] \setscript[hanzi] &#160; \starttext \newsong 夹杂 English 的中文文本 \stoptext [...]]]></description>
			<content:encoded><![CDATA[<p>Indubitably, I need to remix Chinese and English in one document. But English characters in Chinese fonts aren&#8217;t look good in most time as others, so font fallback is needed here.<br />
First, make a English font as a fallback of Chinese font:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">song</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontfallback</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hereos</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:texgyreherosregular</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0x0000-0x0400</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">fbsong</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">song</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=hereos</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">newsong</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbsong</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\setscript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hanzi</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttext</span>
<span style="color: #800000; font-weight: normal;">\newsong</span> 夹杂 English 的中文文本
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>This means we use texgyreherosregular as the fallback English font and name it as hereos, 0&#215;0000-0&#215;0400 is the interval of English characters in UTF-8 encoding. Then make &#8220;fbsong&#8221; the new font that is the remix of song (adobesongstd) and fallback hereos (texgyreherosregular).<br />
But on the tutorial I am following, the author said such action will lose some feature when ConTeXt processing English, so change to using a Chinese font as a fallback of English font:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hereos</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:texgyreherosregular</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontfallback</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">song</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0x00400-0x2FA1F</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">fbsong</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">hereos</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=song</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">newsong</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbsong</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\setscript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hanzi</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttext</span>
<span style="color: #800000; font-weight: normal;">\newsong</span> 夹杂~English~的中文文本
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>Then I&#8217;ve rewritten my type-myfonts.tex with fallback font:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\starttypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enserif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavuserif</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enserifbd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavuserifbold</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enserifit</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavuserifitalic</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enserifbi</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavuserifbolditalic</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontfallback</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">umingcn</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:arplumingcn</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0x00400-0x2FA1F</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enserif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=umingcn</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enserifbd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=umingcn</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enserifit</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=umingcn</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifBoldItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enserifbi</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=umingcn</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">ensans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusans</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">ensansbd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansbold</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">ensansob</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansoblique</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">ensansbo</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansboldoblique</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontfallback</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">ukaicn</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:arplukaicn</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0x00400-0x2FA1F</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ensans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=ukaicn</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ensansbd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=ukaicn</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansOblique</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ensansob</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=ukaicn</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansBoldOblique</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ensansbo</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=ukaicn</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enmono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansmono</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enmonobd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansmonobold</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enmonoob</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansmonooblique</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enmonobo</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansmonoboldoblique</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontfallback</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">microhei</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:wenquanyimicroheimono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0x00400-0x2FA1F</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enmono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=microhei</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enmonobd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=microhei</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoOblique</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enmonoob</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=microhei</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoBoldOblique</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enmonobo</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=microhei</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">rm</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ss</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">tt</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\stoptypescript</span></pre></div></div>

<p>And here is an example:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\usetypescriptfile</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">type-myfonts</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\usetypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\setupbodyfont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts,rm,12pt</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\setupbodyfontenvironment</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">default</span><span style="color: #E02020; ">]</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">em=italic</span><span style="color: #E02020; ">]</span> <span style="color: #2C922C; font-style: italic;">% slanted is default emphasize in ConTeXt</span>
<span style="color: #800000; font-weight: normal;">\setscript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hanzi</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\pdfoptionpdfminorversion</span>=6
<span style="color: #800000; font-weight: normal;">\pdfcompresslevel</span>=9
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttext</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\startcomment</span>
this is a test comment, you shouldn't see me.
<span style="color: #800000; font-weight: normal;">\stopcomment</span>
&nbsp;
我们在运行 <span style="color: #800000; font-weight: normal;">\CONTEXT</span><span style="color: #E02020; ">{</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\rm</span> 这是 fbfont 里的 serif，dejavuserif+arplumingcn <span style="color: #E02020; ">\\</span>
<span style="color: #800000; font-weight: normal;">\ss</span> 这是 fbfont 里的 sans，dejavusans+arplukaicn <span style="color: #E02020; ">\\</span>
<span style="color: #800000; font-weight: normal;">\tt</span> 这是 fbfont 里的 mono，dejavusansmono+wenquanyimicroheimono <span style="color: #E02020; ">\\</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>&#8220;setupbodyfontenvironment&#8221; is a command that tell ConTeXt our body&#8217;s font environment, here we change nothing but emphasis to italic instead of default slanted face.<br />
&#8220;%&#8221; is used to take comments and the TeX engine won&#8217;t do anything with items after it to the line&#8217;s ending. Multi-lines comments can be achieved by using &#8220;\startcomment &#8230; \stopcomment&#8221;.<br />
&#8220;\pdfoptionpdfminorversion&#8221; is the setting for pdf option in minor version, and we can have a table to list it:<br />
    * (1993) – PDF 1.0 / Acrobat 1.0<br />
    * (1994) – PDF 1.1 / Acrobat 2.0<br />
    * (1996) – PDF 1.2 / Acrobat 3.0<br />
    * (1999) – PDF 1.3 / Acrobat 4.0<br />
    * (2001) – PDF 1.4 / Acrobat 5.0<br />
    * (2003) – PDF 1.5 / Acrobat 6.0<br />
    * (2005) – PDF 1.6 / Acrobat 7.0<br />
    * (2006) – PDF 1.7 / Acrobat 8.0<br />
    * (2008) – PDF 1.7, Adobe Extension Level 3 / Acrobat 9.0<br />
The value of &#8220;pdfoptionpdfminorversion&#8221; is that x in &#8220;1.x&#8221;, in this example, &#8220;\pdfoptionpdfminorversion=6&#8243;, we set the version to PDF 1.6, correspond to Acrobat 7.0. The default setting is version 5 &#8211; PDF 1.5 for Acrobat 6.0.<br />
&#8220;pdfcompresslevel&#8221; is the compress level of output pdf file, 0 is the least and 9 highest. Default setting is 0.<br />
&#8220;\CONTEXT&#8221; is a sequence to produce the effect of sinking e in TEX. Other interesting are &#8220;\LATEX&#8221; &#8220;\TEX&#8221;, also &#8220;\LaTeX&#8221; and &#8220;\TeX&#8221; is acceptable, but I didn&#8217;t find how to produce a LaTeX2e, not &#8220;\LaTeXe&#8221; in LaTeX.<br />
The {} after &#8220;\CONTEXT{}&#8221; tell the TeX engine don&#8217;t eat all extra whitespace and empty lines.<br />
&#8220;\\&#8221; means force line breaking, we cannot use &#8220;\newline&#8221; as LaTeX does.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/11/02/font-fallback-in-context-mininals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Font model in ConTeXt &#8211; quick view from a starter</title>
		<link>http://blogs.gnome.org/happyaron/2009/11/02/font-model-in-context-quick-view-from-a-starter/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/11/02/font-model-in-context-quick-view-from-a-starter/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:30:14 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=140</guid>
		<description><![CDATA[There are three basic fonts in Chinese, Song, Hei and Fangsong, corresponding to Serif, Sans and Monospace in Latin characters. Another category is numbers, it is recognized as a separate category by ConTeXt. Using Adobe&#8217;s three fonts as a example, we can define type-myfonts.tex, a typescript file: \starttypescript[serif][zhfont] \definefontsynonym[Serif][name:adobesongstd] \definefontsynonym[SerifBold][name:adobesongstd] \definefontsynonym[SerifItalic][name:adobesongstd] \definefontsynonym[SerifBoldItalic][name:adobesongstd] \stoptypescript &#160; \starttypescript [...]]]></description>
			<content:encoded><![CDATA[<p>There are three basic fonts in Chinese, Song, Hei and Fangsong, corresponding to Serif, Sans and Monospace in Latin characters. Another category is numbers, it is recognized as a separate category by ConTeXt.<br />
Using Adobe&#8217;s three fonts as a example, we can define type-myfonts.tex, a typescript file:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\starttypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifBoldItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobeheitistd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobeheitistd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobeheitistd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansBoldItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobeheitistd</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobefangsongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobefangsongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobefangsongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoBoldItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobefangsongstd</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">rm</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ss</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">tt</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\stoptypescript</span></pre></div></div>

<p>Explanation by line:<br />
&#8220;\starttypescript[serif][zhfont]&#8221; means starting a typescript profile, named &#8220;serif&#8221; and classify it in &#8220;zhfont&#8221;;<br />
&#8220;\definefontsynonym[Serif][name:adobesongstd]&#8221; means start a font synonym definition, and assign &#8220;Serif&#8221; to &#8220;adobesongstd&#8221;;<br />
&#8220;\stoptypescript&#8221; means finishing a profile.<br />
We need to pay some attention at the last profile, that is to say &#8220;\definetypeface[myfonts][rm][serif][zhfont]&#8220;, we define the typeface series &#8220;myfonts&#8221; in this profile, and this line represent the &#8220;rm&#8221;, roman, face is assigned to serif, which we have defined in previous profiles, and &#8220;ss&#8221; fo &#8220;sans&#8221;, &#8220;tt&#8221; for &#8220;teletype&#8221; or rather &#8220;monospace&#8221; as we know.<br />
Then write another file, save as test.tex:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\usetypescriptfile</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">type-myfonts</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\usetypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\setupbodyfont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts,rm,12pt</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttext</span>
所有动物都生而平等，但有些动物比其他动物更平等
<span style="color: #800000; font-weight: normal;">\ss</span> 所有动物都生而平等，但有些动物比其他动物更平等
<span style="color: #800000; font-weight: normal;">\tt</span> 所有动物都生而平等，但有些动物比其他动物更平等
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>For explanation, &#8220;\usetypescriptfile[type-myfonts]&#8221; tell the TeX engine to find a typescript file named type-myfonts.tex in the same directory as current file, and include the contents here;  \usetypescript[myfonts]&#8221; tell it we are using &#8220;myfonts&#8221; typescript set as defined in type-myfonts.tex; &#8220;\setupbodyfont[myfonts,rm,12pt]&#8221; is telling that set the body font to myfonts&#8217;s rm style, with 12pt as the size.<br />
Between &#8220;\starttext&#8221;&#8230;&#8221;\stoptext&#8221; is the text, first line using default font, \rm, and second line change to \ss finaly \tt.<br />
Here is a list to tell font model:<br />
<img src="http://blogs.gnome.org/happyaron/files/2009/11/287aad4478e46712ae62ee809eff9fa9.png" alt="Font model from ConTeXt wiki" /><br />
Next we need to make ConTeXt know how to wrap lines for Chinese, that is, to break a long sentence into lines in a page. What we need to do is add &#8220;\setscript[hanzi]&#8221; to the header. Another example of test.tex:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\usetypescriptfile</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">type-myfonts</span><span style="color: #E02020; ">]</span> 
<span style="color: #800000; font-weight: normal;">\usetypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">]</span> 
<span style="color: #800000; font-weight: normal;">\setupbodyfont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts,rm,12pt</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\setscript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hanzi</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttext</span>
明亡后，朝鲜和日本认为中国已亡，日本从此蔑称中国为“支那”。明治维新后，自认为华夏正统的日本曾打着“攘夷主义”的旗号发动甲午战争等对清战争。  
<span style="color: #800000; font-weight: normal;">\stoptext</span> </pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/11/02/font-model-in-context-quick-view-from-a-starter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing ConTeXt Minimals</title>
		<link>http://blogs.gnome.org/happyaron/2009/11/01/installing-context-minimals/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/11/01/installing-context-minimals/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 18:56:29 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=127</guid>
		<description><![CDATA[I&#8217;ve chosen to study a TeX, and finally choose ConTeXt because it uses LuaTeX engine that can support Chinese with less pain than using LaTeX as well as someone is complaining about XeTeX may output a lower quality. I don&#8217;t know who&#8217;s true, but according to my own perception, ConTeXt Minimals with LuaTex may be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve chosen to study a TeX, and finally choose ConTeXt because it uses LuaTeX engine that can support Chinese with less pain than using LaTeX as well as someone is complaining about XeTeX may output a lower quality. I don&#8217;t know who&#8217;s true, but according to my own perception, ConTeXt Minimals with LuaTex may be the best choice, so I start this category of blog to track my course studing it.<br />
Today, I am trying to install it and output my first result file.</p>
<p>Installation is quite easy:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>context <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>context
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>minimals.contextgarden.net<span style="color: #000000; font-weight: bold;">/</span>setup<span style="color: #000000; font-weight: bold;">/</span>first-setup.sh</pre></div></div>

<p>It will call rsync and use ruby to achieve this, so make sure they are installed on system.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sh</span> first-setup.sh</pre></div></div>

<p>This will give you a dev-shot of ConTeXt Minimals, if a stable version is needed, run the following instead:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sh</span> first-setup.sh <span style="color: #660033;">--context</span>=current</pre></div></div>

<p>I continue with the dev version. Note, every time we want do an update of the program or move it somewhere else, we need to run the command above to make all things work.<br />
If we don&#8217;t have a connective Internet available but still want to change the directory, we may run the following command in the context/ folder with tex/ under it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mtxrun <span style="color: #660033;">--verbose</span> <span style="color: #660033;">--script</span> .<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mtx-update.lua <span style="color: #660033;">--update</span> <span style="color: #660033;">--make</span> <span style="color: #660033;">--force</span> <span style="color: #660033;">--engine</span>=all <span style="color: #660033;">--context</span>=beta <span style="color: #660033;">--texroot</span>=<span style="color: #007800;">$PWD</span><span style="color: #000000; font-weight: bold;">/</span>tex $<span style="color: #000000; font-weight: bold;">@</span></pre></div></div>

<p>Next, make sure there are fonts needed installed, on my system it&#8217;s /usr/share/fonts, with wqy-zenhei and wqy-microhei as my Chinese fonts and others like DejaVu and Droid as English fonts.<br />
We need to refresh the system&#8217;s font cache before continue, otherwise some fonts won&#8217;t work.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> fc-cache <span style="color: #660033;">-f</span></pre></div></div>

<p>Then add the system&#8217;s font directory to setuptex, which file is placed at ~/usr/context/tex/setuptex in my installation, add the following line at the end of file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">OSFONTDIR</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>fonts</pre></div></div>

<p>Reload font cache for ConTeXt:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mtxrun <span style="color: #660033;">--script</span> fonts <span style="color: #660033;">--reload</span></pre></div></div>

<p>Generate a list of usable fonts:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mtxrun <span style="color: #660033;">--script</span> fonts <span style="color: #660033;">--list</span> <span style="color: #660033;">--all</span> <span style="color: #000000; font-weight: bold;">&gt;</span> font-names.txt</pre></div></div>

<p>First row represents the font name we will use in our tex file, second is descriptions like font name in true life, the third line is the path to the font file in system.<br />
Finally source the setuptex file to make this environment sensible for current console:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">source</span> ~<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>context<span style="color: #000000; font-weight: bold;">/</span>tex<span style="color: #000000; font-weight: bold;">/</span>setuptex</pre></div></div>

<p>Now, we&#8217;ve finished setting up a environment that can work.<br />
The easiest example may be like this:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\starttext</span>
Hello world!
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>Have another test with Chinese:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\definefont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">uming</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:arplumingcn</span><span style="color: #E02020; ">]</span>               
<span style="color: #800000; font-weight: normal;">\starttext</span>
<span style="color: #800000; font-weight: normal;">\uming</span>  
终于看到中文了！
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>First line assign &#8220;uming&#8221; as &#8220;arplumingcn&#8221;, that is &#8220;uming&#8221; will be used in the following of this file to represent the &#8220;arplumingcn&#8221;, which is the name of this font that we can see in the first row of former generated font-names.txt.<br />
Second line tell the program we are starting the text, and the next line tell it we are choosing font &#8220;uming&#8221; for following text. And the last line tell it the text is finished.<br />
I save the file as hello.tex, and use this command to produce the result:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">context hello</pre></div></div>

<p>also we can use hello.tex, but like other Tex environment, ConTeXt knows that it is processing a TeX file so the suffix can be omitted safely.<br />
The the program print many things to our console and finally stopped with several hello.* files in our working directory, and hello.pdf is lying there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/11/01/installing-context-minimals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blogs.gnome.org/happyaron/category/tex/feed/ ) in 1.62022 seconds, on Feb 10th, 2012 at 6:25 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 10th, 2012 at 7:25 am UTC -->
