<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://els-support4.river-valley.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Thanh</id>
	<title>STMDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://els-support4.river-valley.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Thanh"/>
	<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php/Special:Contributions/Thanh"/>
	<updated>2026-04-16T13:41:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Mail_for_Shirin&amp;diff=628</id>
		<title>Mail for Shirin</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Mail_for_Shirin&amp;diff=628"/>
		<updated>2010-08-31T13:35:45Z</updated>

		<summary type="html">&lt;p&gt;Thanh: New page: ==Step 1== Visit mail.childpsych.co.uk Image:Screen shot 2010-08-31 at 14.01.30.png  ==Step 2== Enter username and password Image:Screen shot 2010-08-31 at 14.02.16.png  ==Step 3==...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Step 1==&lt;br /&gt;
Visit mail.childpsych.co.uk&lt;br /&gt;
[[Image:Screen shot 2010-08-31 at 14.01.30.png]]&lt;br /&gt;
&lt;br /&gt;
==Step 2==&lt;br /&gt;
Enter username and password&lt;br /&gt;
[[Image:Screen shot 2010-08-31 at 14.02.16.png]]&lt;br /&gt;
&lt;br /&gt;
==Step 3==&lt;br /&gt;
After login you should see this screen:&lt;br /&gt;
[[Image:Screen shot 2010-08-31 at 14.02.42.png]]&lt;br /&gt;
&lt;br /&gt;
==Step 4==&lt;br /&gt;
How to use gmail to read/send mails: see for example this link http://www.slideshare.net/caskeyd/gmail-3435481&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=File:Screen_shot_2010-08-31_at_14.02.42.png&amp;diff=627</id>
		<title>File:Screen shot 2010-08-31 at 14.02.42.png</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=File:Screen_shot_2010-08-31_at_14.02.42.png&amp;diff=627"/>
		<updated>2010-08-31T13:30:10Z</updated>

		<summary type="html">&lt;p&gt;Thanh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=File:Screen_shot_2010-08-31_at_14.02.16.png&amp;diff=626</id>
		<title>File:Screen shot 2010-08-31 at 14.02.16.png</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=File:Screen_shot_2010-08-31_at_14.02.16.png&amp;diff=626"/>
		<updated>2010-08-31T13:29:26Z</updated>

		<summary type="html">&lt;p&gt;Thanh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=File:Screen_shot_2010-08-31_at_14.01.30.png&amp;diff=625</id>
		<title>File:Screen shot 2010-08-31 at 14.01.30.png</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=File:Screen_shot_2010-08-31_at_14.01.30.png&amp;diff=625"/>
		<updated>2010-08-31T13:27:42Z</updated>

		<summary type="html">&lt;p&gt;Thanh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Using_TrueType_fonts_with_pdfTeX&amp;diff=248</id>
		<title>Using TrueType fonts with pdfTeX</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Using_TrueType_fonts_with_pdfTeX&amp;diff=248"/>
		<updated>2009-05-16T08:16:32Z</updated>

		<summary type="html">&lt;p&gt;Thanh: New page: === A closer look at TrueType fonts and pdfTeX === The most common outline format for TeX is Type&amp;amp;nbsp;1. The TrueType format is slightly different from Type&amp;amp;nbsp;1, and getting it right r...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== A closer look at TrueType fonts and pdfTeX ===&lt;br /&gt;
The most common outline format for TeX is Type&amp;amp;nbsp;1. The TrueType&lt;br /&gt;
format is slightly different from Type&amp;amp;nbsp;1, and getting it right&lt;br /&gt;
requires some extra work. In particular, it is important to understand&lt;br /&gt;
how TrueType handles encoding and glyph names (or more precisely,&lt;br /&gt;
glyph identity).&lt;br /&gt;
&lt;br /&gt;
We start with Type&amp;amp;nbsp;1, since most TeX users are more familiar with&lt;br /&gt;
it. In the Type&amp;amp;nbsp;1 format glyphs are referred to by names (such as&lt;br /&gt;
&#039;&#039;/A&#039;&#039;, &#039;&#039;/comma&#039;&#039;, and so on). Each glyph is identified by its name; so,&lt;br /&gt;
given a glyph name, it is easy to tell whether or not a Type&amp;amp;nbsp;1 font&lt;br /&gt;
contains that glyph. Encoding with Type&amp;amp;nbsp;1 is therefore simple: for&lt;br /&gt;
each number $n$ in the range 0 to 255, an encoding tells us the name&lt;br /&gt;
of the glyph that should be used to render (or display) the charcode&lt;br /&gt;
$n$. &lt;br /&gt;
&lt;br /&gt;
With TrueType the situation is not that simple, since TrueType does&lt;br /&gt;
not use names to refer to glyphs, but uses indices instead. This means&lt;br /&gt;
that each glyph is identified by its index, not its name. The indices&lt;br /&gt;
are numbers that differ from font to font. The TrueType format handles&lt;br /&gt;
encodings by a mechanism called &#039;&#039;cmap&#039;&#039;, which (roughly) consists of&lt;br /&gt;
tables mapping from character codes to glyph indices. A TrueType font&lt;br /&gt;
can contain one or more such tables (each corresponding to an&lt;br /&gt;
encoding).&lt;br /&gt;
&lt;br /&gt;
Since glyph names are not strictly necessary for TrueType, they are&lt;br /&gt;
not always available inside a TrueType font. Given a TrueType font,&lt;br /&gt;
one of the following cases may arise.&lt;br /&gt;
&lt;br /&gt;
* The font contains correct names for all its glyphs. This is the ideal situation and is often the case for high-quality latin fonts.&lt;br /&gt;
&lt;br /&gt;
* The font contains wrong name for all or most of its glyphs. This is the worst situation that often happens with poor-quality fonts, or fonts converted from other formats.&lt;br /&gt;
&lt;br /&gt;
* The font contains no glyph names at all. Newer versions of Palatino fonts by Linotype (v1.40, coming with Windows XP) are examples of this.&lt;br /&gt;
&lt;br /&gt;
* the font contains correct names for most glyphs, and no names or wrong names for a few glyphs. This happens from time to time.&lt;br /&gt;
&lt;br /&gt;
One may wonder why things can be so complex with glyph names in&lt;br /&gt;
TrueType. The reason is that Type&amp;amp;nbsp;1 fonts rely on correct names to&lt;br /&gt;
work properly. If a glyph has a wrong name, it gets noticed&lt;br /&gt;
immediately. As mentioned before, TrueType does not use names for&lt;br /&gt;
encoding. So, if glyph names in a TrueType font are wrong or missing,&lt;br /&gt;
it is usually not a big deal and often goes unnoticed.&lt;br /&gt;
&lt;br /&gt;
The potential problem with using TrueType in pdfTeX is that we are&lt;br /&gt;
so used to the Type&amp;amp;nbsp;1 encoding convention, which relies on correct&lt;br /&gt;
glyph names. Furthermore, most font tools rely on this convention and&lt;br /&gt;
all encoding files (.enc files) use glyph names. But, as explained&lt;br /&gt;
above, glyph names in TrueType are not very reliable. If we encounter&lt;br /&gt;
a font that does not have correct names for its glyphs, we need to do&lt;br /&gt;
some more work.&lt;br /&gt;
&lt;br /&gt;
If glyph names are not correct, we need a better way to refer to a&lt;br /&gt;
glyph in TrueType fonts, rather than using names. The most reliable&lt;br /&gt;
way seems to be via Unicode: most TrueType fonts provide a correct&lt;br /&gt;
mapping from Unicode value to glyph index. This is something we can&lt;br /&gt;
count on, since it is required for a TrueType font to be usable.&lt;br /&gt;
&lt;br /&gt;
From version 1.21a pdfTeX supports the naming convention &#039;&#039;uniXXXX&#039;&#039;&lt;br /&gt;
in encoding (.enc) files. This only makes sense with TrueType fonts,&lt;br /&gt;
of course. When pdfTeX sees for example &#039;&#039;/uni12AB&#039;&#039;, it will&lt;br /&gt;
* read the table &amp;lt;unicode&amp;gt; -&amp;gt; &amp;lt;glyph-index&amp;gt; from the font,&lt;br /&gt;
&lt;br /&gt;
* look up the value &#039;12AB&#039; in the table, and if found then pick the relevant glyph index.&lt;br /&gt;
&lt;br /&gt;
ttf2afm also does the same lookup when it sees names like &#039;&#039;uni12AB&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Now let us review the minimal steps to get a TrueType font working&lt;br /&gt;
with pdfTeX:&lt;br /&gt;
* generate an afm from TrueType using ttf2afm. Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ttf2afm -e 8r.enc -o times.afm times.ttf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* convert afm to tfm using whatever tool suitable: afm2tfm, fontinst, afm2pl, etc. Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
afm2tfm times.afm -T 8r.enc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* create the needed map entry for the font. Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\pdfmapline{+times TimesNewRomanPSMT &amp;lt;8r.enc &amp;lt;times.ttf}&lt;br /&gt;
\font\f=times \f Hello this is Times.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above deals with the easiest case: when glyph names are correct.&lt;br /&gt;
Now let us consider a font where we cannot rely on glyph names:&lt;br /&gt;
Palatino by Linotype version 1.40, for example. Let us assume that we&lt;br /&gt;
want to use the T1 encoding with this font. So we put pala.ttf and&lt;br /&gt;
ec.enc in the current directory before proceeding further.&lt;br /&gt;
&lt;br /&gt;
The first attempt would be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ttf2afm -e ec.enc -o pala.afm pala.ttf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, since the names in ec.enc are not available in pala.ttf (in&lt;br /&gt;
fact there are no names inside the font), we get a bunch of warnings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Warning: ttf2afm (file pala.ttf): no names available in &#039;&#039;post&#039;&#039; table, print&lt;br /&gt;
glyph names as indices&lt;br /&gt;
Warning: ttf2afm (file pala.ttf): glyph &#039;&#039;grave&#039;&#039; not found&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the output pala.afm will contain no names at all. Instead of glyph&lt;br /&gt;
names in ec.enc, we get weird things like &#039;&#039;index123&#039;&#039;. And glyphs are&lt;br /&gt;
not encoded:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C -1 ; WX 832 ; N index10 ; B 24 -3 807 689 ;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We try again, this time without giving an encoding:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ttf2afm -o pala.afm pala.ttf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since this time we did not ask ttf2afm to re-encode the output afm, we get&lt;br /&gt;
fewer warnings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Warning: ttf2afm (file pala.ttf): no names available in &#039;&#039;post&#039;&#039; table, print&lt;br /&gt;
glyph names as indices&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the afm output is the same as in the previous attempt. This is not&lt;br /&gt;
very useful, since there is little we can do with names like&lt;br /&gt;
&#039;&#039;index123&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
So we try to go with Unicode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ttf2afm -u -o pala.afm pala.ttf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time we get a different bunch of warnings, for instance:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Warning: ttf2afm (file pala.ttf): glyph 108 have multiple encodings (the&lt;br /&gt;
first one being used): uni0162 uni021A&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At first sight it is hard to understand what tfm2afm is telling us with&lt;br /&gt;
this message. So let us recap the connection between glyph name, glyph index&lt;br /&gt;
and Unicode value:&lt;br /&gt;
* TrueType glyphs are identified internally by index.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;glyph-name&amp;gt; -&amp;gt; &amp;lt;glyph-index&amp;gt; is optional, and not always reliable. Likewise &amp;lt;glyph-index&amp;gt; -&amp;gt; &amp;lt;glyph-name&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;unicode&amp;gt; -&amp;gt; &amp;lt;glyph-index&amp;gt; is (almost) always present and reliable.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;glyph-index&amp;gt; -&amp;gt; &amp;lt;unicode&amp;gt; is not always reliable, and need not even be a mapping, since there can be more than one Unicode value mapping to a given glyph index. Given a glyph index, there may be no corresponding Unicode value, or there may be more than one. If there is none, the glyph index will be used (&#039;&#039;index123&#039;&#039;, for example). Now suppose that there are more than one, as in the case above (where 0162 and 021A are both mapped to glyph index 108). We have asked ttf2afm to print glyphs by Unicode, and ttf2afm cannot know for sure which value to print in this case. Hence it outputs the first Unicode value and issues the warning.&lt;br /&gt;
&lt;br /&gt;
Now if all we want is to use pala.ttf with T1 encoding, probably the&lt;br /&gt;
easiest way is to create a new enc file ec-uni.enc from ec.enc, with&lt;br /&gt;
all glyph names replaced by Unicode values. (This simple approach&lt;br /&gt;
won&#039;t handle ligatures; see below.) This can be done easily for&lt;br /&gt;
example by a script that reads the AGL (Adobe Glyph List, available at&lt;br /&gt;
http://www.adobe.com/devnet/opentype/archives/glyphlist.txt) and&lt;br /&gt;
converts all glyph names to Unicode. Assuming that we have ec-uni.enc,&lt;br /&gt;
the steps needed to create the tfm are as follows.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ttf2afm -u -e ec-uni.enc -o pala-t1.afm pala.ttf&lt;br /&gt;
afm2pl pala-t1.afm&lt;br /&gt;
pltotf pala-t1.pl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We could then use the font as follows.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\pdfmapline{+pala-t1 &amp;lt;ec-uni.enc &amp;lt;pala.ttf}&lt;br /&gt;
\font\f=pala-t1\f&lt;br /&gt;
This is a test of font Palatino Regular in T1 encoding.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want to do more than just using pala.ttf with T1 encoding, for&lt;br /&gt;
example processing the afm output with fontinst for a more complex&lt;br /&gt;
font setup, then we must proceed slightly differently. Having an afm&lt;br /&gt;
file where all glyph names are converted to &#039;&#039;uniXXXX&#039;&#039; form is not very&lt;br /&gt;
useful for fontinst. Instead, we need an afm file with AGL names to&lt;br /&gt;
use with fontinst. We can do this as follows.&lt;br /&gt;
&lt;br /&gt;
* Generate an afm  with glyph names in form &#039;&#039;uniXXXX&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ttf2afm -u -o pala.afm pala.ttf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Convert pala.afm to pala-agl.afm, so that pala-agl.afm contains AGL names only. Again, a simple script can do that.&lt;br /&gt;
&lt;br /&gt;
* Process pala-agl.afm by fontinst as needed.&lt;br /&gt;
&lt;br /&gt;
* In the final stage, when we already have the tfm&#039;s from fontinst and friends, plus the map entries (generated by fontinst, or created manually), we need to replace the encoding by its counterpart with &#039;&#039;uniXXXX&#039;&#039; names. For example, if fontinst tell us to add a line saying&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pala-agl-8r &amp;lt;8r.enc &amp;lt;pala.ttf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to our map file, then we need to change that line to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pala-agl-8r &amp;lt;8r-uni.enc &amp;lt;pala.ttf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where 8r-uni.enc is derived from 8r.enc by converting all glyph&lt;br /&gt;
names to the &#039;&#039;uniXXXX&#039;&#039; form.&lt;br /&gt;
&lt;br /&gt;
The encoding files coming with TeX Gyre fonts cover almost everything a&lt;br /&gt;
typical TeX user might need. Those encodings have been converted to the&lt;br /&gt;
&#039;&#039;uniXXXX&#039;&#039; form for your convenience and are available at&lt;br /&gt;
http:/\!/tug.org/fontname and are named like &#039;&#039;q-ec-uni.enc&#039;&#039; etc.&lt;br /&gt;
&lt;br /&gt;
Another problem that happens from time to time is the case when we are&lt;br /&gt;
totally sure that a glyph exists inside a font but we don&#039;t get that&lt;br /&gt;
glyph in the output of pdfTeX. The likely reason of this problem is&lt;br /&gt;
that the glyph is referenced by different names at various places&lt;br /&gt;
during the process of creating support for the font, like tfm, vf, enc&lt;br /&gt;
or map files. For example the names &#039;&#039;dcroat&#039;&#039;, &#039;&#039;dbar&#039;&#039;, &#039;&#039;dslash&#039;&#039; and&lt;br /&gt;
&#039;&#039;dmacron&#039;&#039; can all refer to the same glyph in a TrueType font. The&lt;br /&gt;
origin of a glyph name can come from several sources:&lt;br /&gt;
&lt;br /&gt;
* the name comes from the font itself.&lt;br /&gt;
&lt;br /&gt;
* the name comes from a predefined scheme called &#039;&#039;the standard Macintosh ordering of glyphs&#039;&#039;. Unfortunately the TrueType specifications by various companies (Apple, Microsoft and Adobe) are not consistent in this scheme and there are small differences; one example is &#039;&#039;dmacron&#039;&#039; vs &#039;&#039;dslash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* the name comes out after conversion &amp;lt;unicode&amp;gt; -&amp;gt; &amp;lt;glyph-name&amp;gt; according to AGL.&lt;br /&gt;
&lt;br /&gt;
In such situation, probably the easiest and safest way to get the&lt;br /&gt;
glyph we want is to use a font editor like FontForge, look into the&lt;br /&gt;
font to find out the Unicode for the glyph and then use the &#039;&#039;uniXXXX&#039;&#039;&lt;br /&gt;
form to instruct ttf2afm and pdfTeX to pick up that glyph.&lt;br /&gt;
&lt;br /&gt;
Another way to get a problematic TrueType font to work with pdfTeX&lt;br /&gt;
is simply to convert the font to Type&amp;amp;nbsp;1 format using FontForge. While&lt;br /&gt;
it sounds like a quick hack, it can be a simple and effective&lt;br /&gt;
workaround.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Main_Page&amp;diff=247</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Main_Page&amp;diff=247"/>
		<updated>2009-05-16T07:54:15Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Support at River Valley */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;MediaWiki has been successfully installed.&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consult the [http://meta.wikimedia.org/wiki/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [http://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Support at River Valley==&lt;br /&gt;
&lt;br /&gt;
This is the main support page of [http://www.river-valley.com River Valley Technologies].  Currently we have started adding support documentation for the following:&lt;br /&gt;
&lt;br /&gt;
*[[Elsarticle.cls|Author support for &amp;lt;code&amp;gt;elsarticle.cls&amp;lt;/code&amp;gt;]]&lt;br /&gt;
*[[adnd.sty|Author support for &amp;lt;code&amp;gt;adnd.sty&amp;lt;/code&amp;gt;, auxiliary package for Journal of Atomic and Nuclear Data Tables]]&lt;br /&gt;
&lt;br /&gt;
None of the above are completed yet, but will hopefully be finished before long. A frequently asked questions (FAQ) is on the cards which will be based on the queries posted by authors to the support network.  Both the above documentation should be of assistance to authors since these are always available online.  Another point is that since it is in a Wiki, updating takes only minimal effort, meaning, this documentation will receive constant updates.&lt;br /&gt;
&lt;br /&gt;
* [[PDF annotators|Open Source tools to annotate PDFs]]&lt;br /&gt;
* [[Notes on TeX Live setup]]&lt;br /&gt;
* [[Notes on MacBook Pro Unibody]]&lt;br /&gt;
* [[Generating PDF/A compliant PDFs from pdftex]]&lt;br /&gt;
* [[Using TrueType fonts with pdfTeX]]&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=246</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=246"/>
		<updated>2009-04-28T20:38:17Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Pending */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* partitioning:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|keep original EFI partition&lt;br /&gt;
|/dev/sda1&lt;br /&gt;
|fat32&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|keep original MacOSX partition&lt;br /&gt;
|/dev/sda2&lt;br /&gt;
|journaled hfs+&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|/dev/sda3&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|/dev/sda4&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|/dev/sda5&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|/dev/sda6&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|/dev/sda7&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|/dev/sda8&lt;br /&gt;
|jfs&lt;br /&gt;
|100G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|/dev/sda9&lt;br /&gt;
|hfs+&lt;br /&gt;
|remaining size (120G)&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Disable startup chime===&lt;br /&gt;
* http://macupdate.com/info.php/id/16425&lt;br /&gt;
* http://homepage.mac.com/geerlingguy/mac_support/mac_help/pages/0025-startup_sound.html&lt;br /&gt;
&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I wanted to use a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There were however a few issues:&lt;br /&gt;
* write performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX. Read performance is ok (10-15MiB/s).&lt;br /&gt;
* if the NTFS partition was created by gparted, it got wrong flag and needs some manual work fo fix it. See http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
===Update on sharing data between Linux, OSX and Windows===&lt;br /&gt;
* have a partition 20GB for windows XP; winXP uses about 8-10G, the rest however can be easily accessed from OSX &amp;amp; Linux so the extra space is not wasted.&lt;br /&gt;
* NTFS-3G for OSX is getting better; last version (NTFS-3G 2009.4.4) has fixed the problem with low write performance as stated above&lt;br /&gt;
* to share data between linux &amp;amp; OSX, use a HFS+ partition (without journaling). Linux has mature support for HFS+.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Update on Ubuntu on MBP51==&lt;br /&gt;
* with Ubuntu 9.04, most of issues are solved&lt;br /&gt;
* follow this guide: https://help.ubuntu.com/community/MacBookPro5-1_5-2/Jaunty&lt;br /&gt;
===Some issues===&lt;br /&gt;
* synaptics driver doesn&#039;t seem to work as described in the above guide; SHMConfig is disabled&lt;br /&gt;
** hint to fix (tried but didn&#039;t work): http://ubuntuforums.org/showthread.php?p=7135425&lt;br /&gt;
** another promising thing to try is a GUI for synaptics: http://live.gnome.org/GPointingDeviceSettings&lt;br /&gt;
* I haven&#039;t tested sound thoroughly; just followed the instructions and playing sound works. Not tested recording yet&lt;br /&gt;
* update: fixed issue with synaptics by&lt;br /&gt;
** load synaptics module in xorg.conf&lt;br /&gt;
** upgrade the xserver-xorg-input-synaptics&lt;br /&gt;
** repeat the workaround: blacklisting usbhid in /etc/modprobe.d/backlist.conf, then load it manually after bcm5974 in  /etc/modules&lt;br /&gt;
** update initrd&lt;br /&gt;
* afterward the touchpad can be configured by eg gsynaptics or GPointingDeviceSettings&lt;br /&gt;
&lt;br /&gt;
===Pending===&lt;br /&gt;
* reboot&lt;br /&gt;
* getting touchpad work smoothly&lt;br /&gt;
* battery doesn&#039;t last long in comparison with OSX&lt;br /&gt;
&lt;br /&gt;
==Old news==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=245</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=245"/>
		<updated>2009-04-28T20:37:26Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Some issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* partitioning:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|keep original EFI partition&lt;br /&gt;
|/dev/sda1&lt;br /&gt;
|fat32&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|keep original MacOSX partition&lt;br /&gt;
|/dev/sda2&lt;br /&gt;
|journaled hfs+&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|/dev/sda3&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|/dev/sda4&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|/dev/sda5&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|/dev/sda6&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|/dev/sda7&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|/dev/sda8&lt;br /&gt;
|jfs&lt;br /&gt;
|100G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|/dev/sda9&lt;br /&gt;
|hfs+&lt;br /&gt;
|remaining size (120G)&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Disable startup chime===&lt;br /&gt;
* http://macupdate.com/info.php/id/16425&lt;br /&gt;
* http://homepage.mac.com/geerlingguy/mac_support/mac_help/pages/0025-startup_sound.html&lt;br /&gt;
&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I wanted to use a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There were however a few issues:&lt;br /&gt;
* write performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX. Read performance is ok (10-15MiB/s).&lt;br /&gt;
* if the NTFS partition was created by gparted, it got wrong flag and needs some manual work fo fix it. See http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
===Update on sharing data between Linux, OSX and Windows===&lt;br /&gt;
* have a partition 20GB for windows XP; winXP uses about 8-10G, the rest however can be easily accessed from OSX &amp;amp; Linux so the extra space is not wasted.&lt;br /&gt;
* NTFS-3G for OSX is getting better; last version (NTFS-3G 2009.4.4) has fixed the problem with low write performance as stated above&lt;br /&gt;
* to share data between linux &amp;amp; OSX, use a HFS+ partition (without journaling). Linux has mature support for HFS+.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Update on Ubuntu on MBP51==&lt;br /&gt;
* with Ubuntu 9.04, most of issues are solved&lt;br /&gt;
* follow this guide: https://help.ubuntu.com/community/MacBookPro5-1_5-2/Jaunty&lt;br /&gt;
===Some issues===&lt;br /&gt;
* synaptics driver doesn&#039;t seem to work as described in the above guide; SHMConfig is disabled&lt;br /&gt;
** hint to fix (tried but didn&#039;t work): http://ubuntuforums.org/showthread.php?p=7135425&lt;br /&gt;
** another promising thing to try is a GUI for synaptics: http://live.gnome.org/GPointingDeviceSettings&lt;br /&gt;
* I haven&#039;t tested sound thoroughly; just followed the instructions and playing sound works. Not tested recording yet&lt;br /&gt;
* update: fixed issue with synaptics by&lt;br /&gt;
** load synaptics module in xorg.conf&lt;br /&gt;
** upgrade the xserver-xorg-input-synaptics&lt;br /&gt;
** repeat the workaround: blacklisting usbhid in /etc/modprobe.d/backlist.conf, then load it manually after bcm5974 in  /etc/modules&lt;br /&gt;
** update initrd&lt;br /&gt;
* afterward the touchpad can be configured by eg gsynaptics or GPointingDeviceSettings&lt;br /&gt;
&lt;br /&gt;
===Pending===&lt;br /&gt;
* reboot&lt;br /&gt;
* getting touchpad work smoothly&lt;br /&gt;
&lt;br /&gt;
==Old news==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=244</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=244"/>
		<updated>2009-04-27T08:51:39Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Accessing NTFS partition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* partitioning:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|keep original EFI partition&lt;br /&gt;
|/dev/sda1&lt;br /&gt;
|fat32&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|keep original MacOSX partition&lt;br /&gt;
|/dev/sda2&lt;br /&gt;
|journaled hfs+&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|/dev/sda3&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|/dev/sda4&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|/dev/sda5&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|/dev/sda6&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|/dev/sda7&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|/dev/sda8&lt;br /&gt;
|jfs&lt;br /&gt;
|100G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|/dev/sda9&lt;br /&gt;
|hfs+&lt;br /&gt;
|remaining size (120G)&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Disable startup chime===&lt;br /&gt;
* http://macupdate.com/info.php/id/16425&lt;br /&gt;
* http://homepage.mac.com/geerlingguy/mac_support/mac_help/pages/0025-startup_sound.html&lt;br /&gt;
&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I wanted to use a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There were however a few issues:&lt;br /&gt;
* write performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX. Read performance is ok (10-15MiB/s).&lt;br /&gt;
* if the NTFS partition was created by gparted, it got wrong flag and needs some manual work fo fix it. See http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
===Update on sharing data between Linux, OSX and Windows===&lt;br /&gt;
* have a partition 20GB for windows XP; winXP uses about 8-10G, the rest however can be easily accessed from OSX &amp;amp; Linux so the extra space is not wasted.&lt;br /&gt;
* NTFS-3G for OSX is getting better; last version (NTFS-3G 2009.4.4) has fixed the problem with low write performance as stated above&lt;br /&gt;
* to share data between linux &amp;amp; OSX, use a HFS+ partition (without journaling). Linux has mature support for HFS+.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Update on Ubuntu on MBP51==&lt;br /&gt;
* with Ubuntu 9.04, most of issues are solved&lt;br /&gt;
* follow this guide: https://help.ubuntu.com/community/MacBookPro5-1_5-2/Jaunty&lt;br /&gt;
===Some issues===&lt;br /&gt;
* synaptics driver doesn&#039;t seem to work as described in the above guide; SHMConfig is disabled&lt;br /&gt;
** hint to fix (tried but didn&#039;t work): http://ubuntuforums.org/showthread.php?p=7135425&lt;br /&gt;
** another promising thing to try is a GUI for synaptics: http://live.gnome.org/GPointingDeviceSettings&lt;br /&gt;
* I haven&#039;t tested sound thoroughly; just followed the instructions and playing sound works. Not tested recording yet&lt;br /&gt;
===Pending===&lt;br /&gt;
* reboot&lt;br /&gt;
* getting touchpad work smoothly&lt;br /&gt;
&lt;br /&gt;
==Old news==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=243</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=243"/>
		<updated>2009-04-27T06:19:44Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Some issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* partitioning:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|keep original EFI partition&lt;br /&gt;
|/dev/sda1&lt;br /&gt;
|fat32&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|keep original MacOSX partition&lt;br /&gt;
|/dev/sda2&lt;br /&gt;
|journaled hfs+&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|/dev/sda3&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|/dev/sda4&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|/dev/sda5&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|/dev/sda6&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|/dev/sda7&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|/dev/sda8&lt;br /&gt;
|jfs&lt;br /&gt;
|100G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|/dev/sda9&lt;br /&gt;
|hfs+&lt;br /&gt;
|remaining size (120G)&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Disable startup chime===&lt;br /&gt;
* http://macupdate.com/info.php/id/16425&lt;br /&gt;
* http://homepage.mac.com/geerlingguy/mac_support/mac_help/pages/0025-startup_sound.html&lt;br /&gt;
&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The write performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX. Read performance is ok (10-15MiB/s).&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Update on Ubuntu on MBP51==&lt;br /&gt;
* with Ubuntu 9.04, most of issues are solved&lt;br /&gt;
* follow this guide: https://help.ubuntu.com/community/MacBookPro5-1_5-2/Jaunty&lt;br /&gt;
===Some issues===&lt;br /&gt;
* synaptics driver doesn&#039;t seem to work as described in the above guide; SHMConfig is disabled&lt;br /&gt;
** hint to fix (tried but didn&#039;t work): http://ubuntuforums.org/showthread.php?p=7135425&lt;br /&gt;
** another promising thing to try is a GUI for synaptics: http://live.gnome.org/GPointingDeviceSettings&lt;br /&gt;
* I haven&#039;t tested sound thoroughly; just followed the instructions and playing sound works. Not tested recording yet&lt;br /&gt;
===Pending===&lt;br /&gt;
* reboot&lt;br /&gt;
* getting touchpad work smoothly&lt;br /&gt;
&lt;br /&gt;
==Old news==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=242</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=242"/>
		<updated>2009-04-26T21:05:55Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Pending issues with Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* partitioning:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|keep original EFI partition&lt;br /&gt;
|/dev/sda1&lt;br /&gt;
|fat32&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|keep original MacOSX partition&lt;br /&gt;
|/dev/sda2&lt;br /&gt;
|journaled hfs+&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|/dev/sda3&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|/dev/sda4&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|/dev/sda5&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|/dev/sda6&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|/dev/sda7&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|/dev/sda8&lt;br /&gt;
|jfs&lt;br /&gt;
|100G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|/dev/sda9&lt;br /&gt;
|hfs+&lt;br /&gt;
|remaining size (120G)&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Disable startup chime===&lt;br /&gt;
* http://macupdate.com/info.php/id/16425&lt;br /&gt;
* http://homepage.mac.com/geerlingguy/mac_support/mac_help/pages/0025-startup_sound.html&lt;br /&gt;
&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The write performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX. Read performance is ok (10-15MiB/s).&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Update on Ubuntu on MBP51==&lt;br /&gt;
* with Ubuntu 9.04, most of issues are solved&lt;br /&gt;
* follow this guide: https://help.ubuntu.com/community/MacBookPro5-1_5-2/Jaunty&lt;br /&gt;
===Some issues===&lt;br /&gt;
* synaptics driver doesn&#039;t seem to work as described in the above guide; SHMConfig is disabled&lt;br /&gt;
** hint to fix (tried but didn&#039;t work): http://ubuntuforums.org/showthread.php?p=7135425&lt;br /&gt;
** another promising thing to try is a GUI for synaptics: http://live.gnome.org/GPointingDeviceSettings&lt;br /&gt;
==Old news==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=241</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=241"/>
		<updated>2009-04-26T20:58:35Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Disable startup chime */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* partitioning:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|keep original EFI partition&lt;br /&gt;
|/dev/sda1&lt;br /&gt;
|fat32&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|keep original MacOSX partition&lt;br /&gt;
|/dev/sda2&lt;br /&gt;
|journaled hfs+&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|/dev/sda3&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|/dev/sda4&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|/dev/sda5&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|/dev/sda6&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|/dev/sda7&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|/dev/sda8&lt;br /&gt;
|jfs&lt;br /&gt;
|100G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|/dev/sda9&lt;br /&gt;
|hfs+&lt;br /&gt;
|remaining size (120G)&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Disable startup chime===&lt;br /&gt;
* http://macupdate.com/info.php/id/16425&lt;br /&gt;
* http://homepage.mac.com/geerlingguy/mac_support/mac_help/pages/0025-startup_sound.html&lt;br /&gt;
&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The write performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX. Read performance is ok (10-15MiB/s).&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=240</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=240"/>
		<updated>2009-04-26T20:57:10Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Tuning OSX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* partitioning:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|keep original EFI partition&lt;br /&gt;
|/dev/sda1&lt;br /&gt;
|fat32&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|keep original MacOSX partition&lt;br /&gt;
|/dev/sda2&lt;br /&gt;
|journaled hfs+&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|/dev/sda3&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|/dev/sda4&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|/dev/sda5&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|/dev/sda6&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|/dev/sda7&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|/dev/sda8&lt;br /&gt;
|jfs&lt;br /&gt;
|100G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|/dev/sda9&lt;br /&gt;
|hfs+&lt;br /&gt;
|remaining size (120G)&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Disable startup chime===&lt;br /&gt;
See http://macupdate.com/info.php/id/16425&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The write performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX. Read performance is ok (10-15MiB/s).&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=239</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=239"/>
		<updated>2009-04-26T16:02:42Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Installation steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* partitioning:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|keep original EFI partition&lt;br /&gt;
|/dev/sda1&lt;br /&gt;
|fat32&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|keep original MacOSX partition&lt;br /&gt;
|/dev/sda2&lt;br /&gt;
|journaled hfs+&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|/dev/sda3&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|/dev/sda4&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|/dev/sda5&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|/dev/sda6&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|/dev/sda7&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|/dev/sda8&lt;br /&gt;
|jfs&lt;br /&gt;
|100G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|/dev/sda9&lt;br /&gt;
|hfs+&lt;br /&gt;
|remaining size (120G)&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The write performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX. Read performance is ok (10-15MiB/s).&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=238</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=238"/>
		<updated>2009-04-26T15:58:28Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Installation steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|/dev/sda3&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|/dev/sda4&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|/dev/sda5&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|/dev/sda6&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|/dev/sda7&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|/dev/sda8&lt;br /&gt;
|jfs&lt;br /&gt;
|100G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|/dev/sda9&lt;br /&gt;
|hfs+&lt;br /&gt;
|remaining size (120G)&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The write performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX. Read performance is ok (10-15MiB/s).&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=237</id>
		<title>Notes on TeX Live setup</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=237"/>
		<updated>2009-03-19T11:04:30Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Keeping packages up-to-date */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes steps to install [http://tug.org/texlive TeX Live] (TL from now) and needed tweaks so that other kpathsea programs that are not part of TL can also use TL data. This is useful if we recompile some program from sources and want it to be able to find TL data. For example, one might want to recompile pdftex with some patch, and use it instead of the binary coming with TL.&lt;br /&gt;
&lt;br /&gt;
This guide was written for TL2008 on Ubuntu linux 8.04 and should work with no or little change for other Linux/UNIX systems. &lt;br /&gt;
&lt;br /&gt;
When in doubt, please refer to the [http://www.tug.org/texlive/doc/texlive-en/texlive-en.html official TeX Live documentation]. This guide serves as a quick guide for some very specific purposes:&lt;br /&gt;
* how to install TL with minimal effort and confusion&lt;br /&gt;
* how to use TL data with non-TL binaries&lt;br /&gt;
* how to use different versions of pdftex&lt;br /&gt;
* how to add local packages in a systematic way&lt;br /&gt;
&lt;br /&gt;
== Install TL ==&lt;br /&gt;
* start with a shell where no tex-related environment variables are defined. A quick check can be done by &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
printenv | fgrep TEX&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* download [http://mirror.ctan.org/systems/texlive/Images/texlive2008.iso.lzma latest TL iso image] to e.g. &#039;&#039;&#039;$HOME/iso-images&#039;&#039;&#039; &lt;br /&gt;
* unpack the image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/iso-images&lt;br /&gt;
unlzma texlive2008.iso.lzma&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* mount the TL image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /mnt/texlive2008&lt;br /&gt;
mount -t iso 9660 -o loop $HOME/iso-images/texlive2008.iso /mnt/texlive2008/&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* run the TL installer:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
perl /mnt/texlive2008/install-tl&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* in next menu, change the destination of installation to &#039;&#039;&#039;/opt/texlive/2008&#039;&#039;&#039; by entering:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d&amp;lt;Enter&amp;gt;&lt;br /&gt;
1&amp;lt;Enter&amp;gt;&lt;br /&gt;
/opt/texlive/2008&amp;lt;Enter&amp;gt;&lt;br /&gt;
r&amp;lt;Enter&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* start the installation process by entering &#039;&#039;&#039;i&amp;lt;Enter&amp;gt;&#039;&#039;&#039;. When the installation process is done, the last messages should look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 pre-generating all format files (fmtutil-sys --all), be patient...done&lt;br /&gt;
&lt;br /&gt;
 See &lt;br /&gt;
   /opt/texlive/2008/index.html &lt;br /&gt;
 for links to documentation.  The TeX Live web site (http://tug.org/texlive/) &lt;br /&gt;
 contains any updates and corrections.&lt;br /&gt;
&lt;br /&gt;
 TeX Live is a joint project of the TeX user groups around the world;&lt;br /&gt;
 please consider supporting it by joining the group best for you. The&lt;br /&gt;
 list of groups is available on the web at http://tug.org/usergroups.html.&lt;br /&gt;
&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/man to MANPATH.&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/info to INFOPATH.&lt;br /&gt;
 Most importantly, add /opt/texlive/2008/bin/i386-linux&lt;br /&gt;
 to your PATH for current and future sessions.&lt;br /&gt;
&lt;br /&gt;
 Welcome to TeX Live!&lt;br /&gt;
&lt;br /&gt;
/mnt/texlive2008/install-tl: done.&lt;br /&gt;
Logfile: /opt/texlive/2008/install-tl.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;N.B.&#039;&#039;&#039;: if you are not using &#039;&#039;&#039;i386-linux&#039;&#039;&#039;, the value to be added to the &#039;&#039;&#039;PATH&#039;&#039;&#039; variable is different; for example if you are using 64-bit linux, the installation log will report &#039;&#039;&#039;x86_64-linux&#039;&#039;&#039; instead of &#039;&#039;&#039;i386-linux&#039;&#039;&#039;. &lt;br /&gt;
* create a partial copy of the main TL configuration file (we will modify this copy later):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /opt/texlive/2008/texmf/web2c/texmf.cnf | \&lt;br /&gt;
grep &#039;SELFAUTOPARENT\|^TEXMF \|^TEXMFDBS &#039; | \&lt;br /&gt;
grep -v &#039;^%&#039; &amp;gt; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* change some environment variables permanently as instructed by the installation log: add to &#039;&#039;&#039;/etc/profile&#039;&#039;&#039; the following lines (&#039;&#039;&#039;don&#039;t forget to check the value of PATH if you are not using i386-linux&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## added for TeX Live&lt;br /&gt;
TEXMFCNF=/opt/texlive/2008:/opt/texlive/2008/texmf/web2c&lt;br /&gt;
MANPATH=/mnt/texlive2008/texmf/doc/man:$MANPATH&lt;br /&gt;
INFOPATH=/mnt/texlive2008/texmf/doc/info:$INFOPATH&lt;br /&gt;
PATH=/opt/texlive/2008/bin/i386-linux:$PATH&lt;br /&gt;
export TEXMFCNF MANPATH INFOPATH PATH&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* logout and login again to ensure that the above environment variables are set. With &#039;&#039;&#039;bash&#039;&#039;&#039; as the default shell, it can be done by saying:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
exec bash -login&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the installation:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdflatex sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, we should get a log similar to the below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pdflatex sample2e&lt;br /&gt;
This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)&lt;br /&gt;
 %&amp;amp;-line parsing enabled.&lt;br /&gt;
entering extended mode&lt;br /&gt;
(/mnt/texlive2008/texmf-dist/tex/latex/base/sample2e.tex&lt;br /&gt;
LaTeX2e &amp;lt;2005/12/01&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
Output written on sample2e.pdf (3 pages, 69560 bytes).&lt;br /&gt;
Transcript written on sample2e.log.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Keeping packages up-to-date ==&lt;br /&gt;
There are 2 possible ways to keep packages up-to-date: &lt;br /&gt;
* using tlmgr: this is for real brave men; see [http://www.tug.org/texlive/doc/tlmgr.html tlmgr manual] and http://www.tug.org/texlive/tlmgr.html for further info.&lt;br /&gt;
* manual update: this is the simple, stupid way that I prefer. Let&#039;s update ie hyperref manually:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /opt/texlive/tds-packages&lt;br /&gt;
cd /opt/texlive/tds-packages&lt;br /&gt;
wget http://tug.org/applications/hyperref/ftp/hyperref.tds.zip &lt;br /&gt;
cd /opt/texlive/texmf-local&lt;br /&gt;
unzip ../tds-packages/hyperref.tds.zip&lt;br /&gt;
texhash `pwd`&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* it&#039;s a good idea to keep the tds packages around, so that we know which packages have been installed this way.&lt;br /&gt;
&lt;br /&gt;
== Use non-TL binaries with TL data ==&lt;br /&gt;
TL and all kpathsea programs use one or more config files called &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to search for needed data. In previous steps we have already defined an environment variable TEXMFCNF, which in sequence causes that all kpathsea programs will read first the customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;, then the default TL config file &#039;&#039;&#039;/opt/texlive/2008/texmf/web2c/texmf.cnf&#039;&#039;&#039;. The values defined in the first &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will override values in  the later one(s).&lt;br /&gt;
&lt;br /&gt;
It is critical to have TEXMFCNF defined explicitly as above. If TEXMFCNF is not defined, it&#039;s very hard to track down which config file(s) are being read, since there can be several &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; files laying around and which of them are read depends on quite a few factors. By setting TEXMFCNF to a fixed value, we can get rid of this headache and can concentrate on our customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since we have already defined TEXMFCNF in previous step and made a copy of &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039;, now it is simple to make  non-TL binaries work with TL data: we change our &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to get rid of SELFAUTOPARENT as follows: &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sed -i -e &#039;s:.SELFAUTOPARENT:/opt/texlive/2008:&#039; /opt/texlive/2008/texmf.cnf &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add another texmf tree ==&lt;br /&gt;
Suppose we have tetex previously installed to &#039;&#039;&#039;/opt/tetex-3.0&#039;&#039;&#039;. The tetex texmf tree is then located at &#039;&#039;&#039;/opt/tetex-3.0/share/texmf&#039;&#039;&#039;. To add this texmf tree to our setup, we do this:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /opt/tetex-3.0/share/texmf /opt/texlive/texmf-tetex&lt;br /&gt;
sed -i &#039;&lt;br /&gt;
/^TEXMFLOCAL/ a\&lt;br /&gt;
TEXMFTETEX = /opt/texlive/texmf-tetex&lt;br /&gt;
s/^\(TEXMF = .*\)}/\1,$TEXMFTETEX}/&lt;br /&gt;
&#039; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
texhash /opt/texlive/texmf-tetex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can repeat the above steps to add as many texmf trees as we need. For each texmf tree we must:&lt;br /&gt;
* choose a variable name that it&#039;s not used yet (TEXMFTETEX in the above example)&lt;br /&gt;
* locate the path to the texmf tree, and make a symlink in &#039;&#039;&#039;/opt/texlive&#039;&#039;&#039;&lt;br /&gt;
* adjust the above commands accordingly.&lt;br /&gt;
&lt;br /&gt;
Or, it is possible to use [http://download.river-valley.com/add-texmf-tree.sh this script] to automate the above steps. Usage:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh add-texmf-tree.sh TEXMFTETEX /opt/texlive/texmf-tetex /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
The script will do some checking before changing &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to ensure that the parameters are correct. The current &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will be backed up with timestamp appended like e.g. &#039;&#039;&#039;texmf.cnf--2008-10-20.19:43:05&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Use ls-R or not ===&lt;br /&gt;
Each texmf tree can have a file called &#039;&#039;&#039;ls-R&#039;&#039;&#039; at the top level, which can help to speed up searching if the texmf tree is large. But using ls-R is not always the best option, since it requires some extra effort to get it right. If a texmf tree is small and changes often, it&#039;s better not to use ls-R. If a texmf tree is large, then it&#039;s worthwhile to go for the trouble.&lt;br /&gt;
&lt;br /&gt;
To use ls-R with the texmf tree in the previous example, we must:&lt;br /&gt;
* edit texmf.cnf:&lt;br /&gt;
** change &#039;&#039;&#039;$TEXMFTETEX&#039;&#039;&#039; to &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; (only on one line -- the one starting with &#039;&#039;&#039;TEXMF = ...&#039;&#039;&#039;&lt;br /&gt;
** add &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; to TEXMFDBS&lt;br /&gt;
* run &#039;&#039;&#039;texhash /opt/texlive/texmf-tetex&#039;&#039;&#039; to make ls-R in sync with the contents of texmf tree. &lt;br /&gt;
&lt;br /&gt;
Failing to do any of the above steps will cause that some files might not be found as expected, and it&#039;s not always easy to trace down the reason.&lt;br /&gt;
&lt;br /&gt;
=== Change the order of file searching ===&lt;br /&gt;
If we need to change the precedence of a texmf tree, we can edit texmf.cnf and change the variable TEXMF. &lt;br /&gt;
TEXMF specifies which texmf trees are searched, and in which order. The order of the texmf trees given in &#039;&#039;&#039;TEXMF&#039;&#039;&#039; is important: earlier trees take precedence over the later ones in &#039;&#039;&#039;TEXMF&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
=== Some notes on other relevant variables ===&lt;br /&gt;
* &#039;&#039;&#039;TEXMFDBS&#039;&#039;&#039;: contains list of texmf trees with &#039;&#039;&#039;ls-R&#039;&#039;&#039; filename databases. It&#039;s not clear how the presence of ls-R in a texmf tree and the presence of that tree in TEXMF and TEXMFDBS are related. To avoid potential problems, it&#039;s better to stick with either one of the below scenarios:&lt;br /&gt;
** no ls-R, no presence of texmf tree in TEXMFDBS, presence in TEXMF without &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
** ls-R in sync with  contents of texmf tree, presence in TEXMF and TEXMFDBS with &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;SYSTEXMF&#039;&#039;&#039; (not listed above): contains a list of &#039;&#039;system&#039;&#039; texmf trees; its meaning is roughly this: if the source of a font is found in a system texmf tree and that tree is not writable for the current user, then the scripts &#039;&#039;&#039;mktexpk&#039;&#039;&#039;, &#039;&#039;&#039;mktextfm&#039;&#039;&#039;, and &#039;&#039;&#039;mktexmf&#039;&#039;&#039; will install their output into &#039;&#039;&#039;VARTEXFONTS&#039;&#039;&#039;, otherwise the generated fonts (tfm/pk/mf) will be left in the current directory. If we are not using MF fonts, we can safely forget this variable. If we are using MF fonts and want the fonts generated on-the-fly to be placed to proper location, we must add the relevant texmf tree to SYSTEXMF. Usually not needed, since most TeX fonts are available in outline formats and when not, they can be easily converted from MF to Type1 format using &#039;&#039;&#039;textrace&#039;&#039;&#039;. It is best if we can avoid touching this variable.&lt;br /&gt;
&lt;br /&gt;
== Run pdftex compiled from sources ==&lt;br /&gt;
Sometimes it&#039;s desirable to run a different version of pdftex than the one that comes with TL, for example when we want to run pdftex with some features or bugfixes not included in the version in TL. Then we must compile pdftex from sources and do some extra steps.&lt;br /&gt;
* compiling pdftex from sources: download pdftex sources tarball and apply patches if needed. Suppose that we have unpacked pdftex sources to &#039;&#039;&#039;$HOME/src/pdftex-1.40.9&#039;&#039;&#039;, then to build it:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/src/pdftex-1.40.9&lt;br /&gt;
./build.sh&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* when the above process finishes, the pdftex binary should be located at &#039;&#039;&#039;$HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex&#039;&#039;&#039;&lt;br /&gt;
* make symlinks (suppose that &#039;&#039;&#039;$HOME/bin&#039;&#039;&#039; is in &#039;&#039;&#039;$PATH&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdftex2&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdflatex2&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* find out the location of format files:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -d $(dirname $(kpsewhich -engine=pdftex pdflatex.fmt) )&lt;br /&gt;
/opt/texlive/2008/texmf-var/web2c/pdftex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* create formats:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
&lt;br /&gt;
pdftex2 -ini -translate-file=cp227.tcx &#039;*pdfetex.ini&#039;&lt;br /&gt;
mv pdfetex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdftex2.fmt&lt;br /&gt;
&lt;br /&gt;
pdflatex2 -ini -translate-file=cp227.tcx &#039;*pdflatex.ini&#039;&lt;br /&gt;
mv pdflatex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdflatex2.fmt&lt;br /&gt;
&lt;br /&gt;
texhash&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the new binary:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdftex2 story \\bye&lt;br /&gt;
pdflatex2 sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* repeat the above steps for other versions if needed; substitute pdftex2/pdflatex2 with whichever names that suit better your need/taste.&lt;br /&gt;
&lt;br /&gt;
== Maintain packages installed locally ==&lt;br /&gt;
If we keep installing local packages to a texmf tree for some time, we will find out that it&#039;s getting difficult to keep track of what has been installed, and how to remove or upgrade a package. This is the place where a &#039;&#039;package management system&#039;&#039; is useful. We will use miktex tools to maintain our local packages.&lt;br /&gt;
&lt;br /&gt;
===Install miktex tools===&lt;br /&gt;
* download miktex sources from http://miktex.org/SourceCode.aspx&lt;br /&gt;
* unpack the source tarball to $HOME/src/miktex-2.7.3135&lt;br /&gt;
* install all PREREQUISITES listed in ~/src/miktex-2.7.3135/README.unx&lt;br /&gt;
* compile and install:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cmake -G &amp;quot;Unix Makefiles&amp;quot; -DMIKTEX_INSTALLROOT=/opt/texlive/texmf-local -DCMAKE_INSTALL_PREFIX=/opt/miktex-2.7.3135&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, the miktex tools will be installed to /opt/miktex-2.7.3135.&lt;br /&gt;
* &#039;&#039;&#039;TODO&#039;&#039;&#039;: we will make a tarball of pre-compiled miktex tools binaries for i386-linux and x86_64-linux, to save the compilation step for you. Then to install it, one can simply unpack the tarball to &#039;&#039;&#039;/opt&#039;&#039;&#039;.&lt;br /&gt;
* we need to make a wrapper to run miktex tools. Create a file named &#039;&#039;&#039;run-miktex-tools&#039;&#039;&#039; with file mode 755 and with the following contents:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash                        &lt;br /&gt;
export LD_LIBRARY_PATH=/opt/miktex-2.7.3135/lib&lt;br /&gt;
export PATH=/opt/miktex-2.7.3135/bin:$PATH&lt;br /&gt;
  &lt;br /&gt;
opt=&amp;quot;--repository=/opt/miktex-repository/package-repository&amp;quot;&lt;br /&gt;
tool=$1                            &lt;br /&gt;
shift                              &lt;br /&gt;
  &lt;br /&gt;
ExecCmd() {&lt;br /&gt;
    echo &amp;quot;$@&amp;quot;                      &lt;br /&gt;
    &amp;quot;$@&amp;quot;                           &lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
case &amp;quot;$tool&amp;quot; in                    &lt;br /&gt;
mpm|mpc)&lt;br /&gt;
    ExecCmd $tool $opt &amp;quot;$@&amp;quot;        &lt;br /&gt;
    ;;&lt;br /&gt;
*)&lt;br /&gt;
    ExecCmd $tool &amp;quot;$@&amp;quot;             &lt;br /&gt;
    ;;                             &lt;br /&gt;
esac                               &lt;br /&gt;
exit                               &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test if it works -- we should get help messages on mpm usage from the below command:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
run-miktex-tools mpm --help&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* up to this point, miktex tools are setup so that it will look for available packages at &#039;&#039;&#039;/opt/miktex-repository/package-repository&#039;&#039;&#039; and install requested packages to &#039;&#039;&#039;/opt/texlive/texmf-local&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Set up miktex repository===&lt;br /&gt;
Before we can use miktex tools to install any packages, we must set up the local package repository.&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p  /opt/miktex-repository/package-repository&lt;br /&gt;
cd /opt/miktex-repository/package-repository&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb1-2.7.tar.lzma&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb2-2.7.tar.lzma&lt;br /&gt;
run-miktex-tools mpm --update-db&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create a package for use with miktex tools===&lt;br /&gt;
Suppose we have a texmf tree and we want to create a package from that texmf tree.&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;to be continued&#039;&#039;)&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=236</id>
		<title>Notes on TeX Live setup</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=236"/>
		<updated>2009-03-19T10:31:04Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Keeping packages up-to-date */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes steps to install [http://tug.org/texlive TeX Live] (TL from now) and needed tweaks so that other kpathsea programs that are not part of TL can also use TL data. This is useful if we recompile some program from sources and want it to be able to find TL data. For example, one might want to recompile pdftex with some patch, and use it instead of the binary coming with TL.&lt;br /&gt;
&lt;br /&gt;
This guide was written for TL2008 on Ubuntu linux 8.04 and should work with no or little change for other Linux/UNIX systems. &lt;br /&gt;
&lt;br /&gt;
When in doubt, please refer to the [http://www.tug.org/texlive/doc/texlive-en/texlive-en.html official TeX Live documentation]. This guide serves as a quick guide for some very specific purposes:&lt;br /&gt;
* how to install TL with minimal effort and confusion&lt;br /&gt;
* how to use TL data with non-TL binaries&lt;br /&gt;
* how to use different versions of pdftex&lt;br /&gt;
* how to add local packages in a systematic way&lt;br /&gt;
&lt;br /&gt;
== Install TL ==&lt;br /&gt;
* start with a shell where no tex-related environment variables are defined. A quick check can be done by &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
printenv | fgrep TEX&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* download [http://mirror.ctan.org/systems/texlive/Images/texlive2008.iso.lzma latest TL iso image] to e.g. &#039;&#039;&#039;$HOME/iso-images&#039;&#039;&#039; &lt;br /&gt;
* unpack the image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/iso-images&lt;br /&gt;
unlzma texlive2008.iso.lzma&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* mount the TL image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /mnt/texlive2008&lt;br /&gt;
mount -t iso 9660 -o loop $HOME/iso-images/texlive2008.iso /mnt/texlive2008/&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* run the TL installer:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
perl /mnt/texlive2008/install-tl&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* in next menu, change the destination of installation to &#039;&#039;&#039;/opt/texlive/2008&#039;&#039;&#039; by entering:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d&amp;lt;Enter&amp;gt;&lt;br /&gt;
1&amp;lt;Enter&amp;gt;&lt;br /&gt;
/opt/texlive/2008&amp;lt;Enter&amp;gt;&lt;br /&gt;
r&amp;lt;Enter&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* start the installation process by entering &#039;&#039;&#039;i&amp;lt;Enter&amp;gt;&#039;&#039;&#039;. When the installation process is done, the last messages should look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 pre-generating all format files (fmtutil-sys --all), be patient...done&lt;br /&gt;
&lt;br /&gt;
 See &lt;br /&gt;
   /opt/texlive/2008/index.html &lt;br /&gt;
 for links to documentation.  The TeX Live web site (http://tug.org/texlive/) &lt;br /&gt;
 contains any updates and corrections.&lt;br /&gt;
&lt;br /&gt;
 TeX Live is a joint project of the TeX user groups around the world;&lt;br /&gt;
 please consider supporting it by joining the group best for you. The&lt;br /&gt;
 list of groups is available on the web at http://tug.org/usergroups.html.&lt;br /&gt;
&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/man to MANPATH.&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/info to INFOPATH.&lt;br /&gt;
 Most importantly, add /opt/texlive/2008/bin/i386-linux&lt;br /&gt;
 to your PATH for current and future sessions.&lt;br /&gt;
&lt;br /&gt;
 Welcome to TeX Live!&lt;br /&gt;
&lt;br /&gt;
/mnt/texlive2008/install-tl: done.&lt;br /&gt;
Logfile: /opt/texlive/2008/install-tl.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;N.B.&#039;&#039;&#039;: if you are not using &#039;&#039;&#039;i386-linux&#039;&#039;&#039;, the value to be added to the &#039;&#039;&#039;PATH&#039;&#039;&#039; variable is different; for example if you are using 64-bit linux, the installation log will report &#039;&#039;&#039;x86_64-linux&#039;&#039;&#039; instead of &#039;&#039;&#039;i386-linux&#039;&#039;&#039;. &lt;br /&gt;
* create a partial copy of the main TL configuration file (we will modify this copy later):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /opt/texlive/2008/texmf/web2c/texmf.cnf | \&lt;br /&gt;
grep &#039;SELFAUTOPARENT\|^TEXMF \|^TEXMFDBS &#039; | \&lt;br /&gt;
grep -v &#039;^%&#039; &amp;gt; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* change some environment variables permanently as instructed by the installation log: add to &#039;&#039;&#039;/etc/profile&#039;&#039;&#039; the following lines (&#039;&#039;&#039;don&#039;t forget to check the value of PATH if you are not using i386-linux&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## added for TeX Live&lt;br /&gt;
TEXMFCNF=/opt/texlive/2008:/opt/texlive/2008/texmf/web2c&lt;br /&gt;
MANPATH=/mnt/texlive2008/texmf/doc/man:$MANPATH&lt;br /&gt;
INFOPATH=/mnt/texlive2008/texmf/doc/info:$INFOPATH&lt;br /&gt;
PATH=/opt/texlive/2008/bin/i386-linux:$PATH&lt;br /&gt;
export TEXMFCNF MANPATH INFOPATH PATH&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* logout and login again to ensure that the above environment variables are set. With &#039;&#039;&#039;bash&#039;&#039;&#039; as the default shell, it can be done by saying:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
exec bash -login&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the installation:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdflatex sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, we should get a log similar to the below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pdflatex sample2e&lt;br /&gt;
This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)&lt;br /&gt;
 %&amp;amp;-line parsing enabled.&lt;br /&gt;
entering extended mode&lt;br /&gt;
(/mnt/texlive2008/texmf-dist/tex/latex/base/sample2e.tex&lt;br /&gt;
LaTeX2e &amp;lt;2005/12/01&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
Output written on sample2e.pdf (3 pages, 69560 bytes).&lt;br /&gt;
Transcript written on sample2e.log.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Keeping packages up-to-date ==&lt;br /&gt;
There are 2 possible ways to keep packages up-to-date: &lt;br /&gt;
* using tlmgr: this is for real brave men; see [http://www.tug.org/texlive/doc/tlmgr.html tlmgr manual] and http://www.tug.org/texlive/tlmgr.html for further info.&lt;br /&gt;
* manual update: this is the simple, stupid way for cowards like me. Let&#039;s update ie hyperref manually:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /opt/texlive/tds-packages&lt;br /&gt;
cd /opt/texlive/tds-packages&lt;br /&gt;
wget http://tug.org/applications/hyperref/ftp/hyperref.tds.zip &lt;br /&gt;
cd /opt/texlive/texmf-local&lt;br /&gt;
unzip ../tds-packages/hyperref.tds.zip&lt;br /&gt;
texhash `pwd`&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* it&#039;s a good idea to keep the tds packages around, so that we know which packages have been installed this way.&lt;br /&gt;
&lt;br /&gt;
== Use non-TL binaries with TL data ==&lt;br /&gt;
TL and all kpathsea programs use one or more config files called &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to search for needed data. In previous steps we have already defined an environment variable TEXMFCNF, which in sequence causes that all kpathsea programs will read first the customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;, then the default TL config file &#039;&#039;&#039;/opt/texlive/2008/texmf/web2c/texmf.cnf&#039;&#039;&#039;. The values defined in the first &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will override values in  the later one(s).&lt;br /&gt;
&lt;br /&gt;
It is critical to have TEXMFCNF defined explicitly as above. If TEXMFCNF is not defined, it&#039;s very hard to track down which config file(s) are being read, since there can be several &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; files laying around and which of them are read depends on quite a few factors. By setting TEXMFCNF to a fixed value, we can get rid of this headache and can concentrate on our customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since we have already defined TEXMFCNF in previous step and made a copy of &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039;, now it is simple to make  non-TL binaries work with TL data: we change our &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to get rid of SELFAUTOPARENT as follows: &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sed -i -e &#039;s:.SELFAUTOPARENT:/opt/texlive/2008:&#039; /opt/texlive/2008/texmf.cnf &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add another texmf tree ==&lt;br /&gt;
Suppose we have tetex previously installed to &#039;&#039;&#039;/opt/tetex-3.0&#039;&#039;&#039;. The tetex texmf tree is then located at &#039;&#039;&#039;/opt/tetex-3.0/share/texmf&#039;&#039;&#039;. To add this texmf tree to our setup, we do this:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /opt/tetex-3.0/share/texmf /opt/texlive/texmf-tetex&lt;br /&gt;
sed -i &#039;&lt;br /&gt;
/^TEXMFLOCAL/ a\&lt;br /&gt;
TEXMFTETEX = /opt/texlive/texmf-tetex&lt;br /&gt;
s/^\(TEXMF = .*\)}/\1,$TEXMFTETEX}/&lt;br /&gt;
&#039; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
texhash /opt/texlive/texmf-tetex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can repeat the above steps to add as many texmf trees as we need. For each texmf tree we must:&lt;br /&gt;
* choose a variable name that it&#039;s not used yet (TEXMFTETEX in the above example)&lt;br /&gt;
* locate the path to the texmf tree, and make a symlink in &#039;&#039;&#039;/opt/texlive&#039;&#039;&#039;&lt;br /&gt;
* adjust the above commands accordingly.&lt;br /&gt;
&lt;br /&gt;
Or, it is possible to use [http://download.river-valley.com/add-texmf-tree.sh this script] to automate the above steps. Usage:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh add-texmf-tree.sh TEXMFTETEX /opt/texlive/texmf-tetex /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
The script will do some checking before changing &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to ensure that the parameters are correct. The current &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will be backed up with timestamp appended like e.g. &#039;&#039;&#039;texmf.cnf--2008-10-20.19:43:05&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Use ls-R or not ===&lt;br /&gt;
Each texmf tree can have a file called &#039;&#039;&#039;ls-R&#039;&#039;&#039; at the top level, which can help to speed up searching if the texmf tree is large. But using ls-R is not always the best option, since it requires some extra effort to get it right. If a texmf tree is small and changes often, it&#039;s better not to use ls-R. If a texmf tree is large, then it&#039;s worthwhile to go for the trouble.&lt;br /&gt;
&lt;br /&gt;
To use ls-R with the texmf tree in the previous example, we must:&lt;br /&gt;
* edit texmf.cnf:&lt;br /&gt;
** change &#039;&#039;&#039;$TEXMFTETEX&#039;&#039;&#039; to &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; (only on one line -- the one starting with &#039;&#039;&#039;TEXMF = ...&#039;&#039;&#039;&lt;br /&gt;
** add &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; to TEXMFDBS&lt;br /&gt;
* run &#039;&#039;&#039;texhash /opt/texlive/texmf-tetex&#039;&#039;&#039; to make ls-R in sync with the contents of texmf tree. &lt;br /&gt;
&lt;br /&gt;
Failing to do any of the above steps will cause that some files might not be found as expected, and it&#039;s not always easy to trace down the reason.&lt;br /&gt;
&lt;br /&gt;
=== Change the order of file searching ===&lt;br /&gt;
If we need to change the precedence of a texmf tree, we can edit texmf.cnf and change the variable TEXMF. &lt;br /&gt;
TEXMF specifies which texmf trees are searched, and in which order. The order of the texmf trees given in &#039;&#039;&#039;TEXMF&#039;&#039;&#039; is important: earlier trees take precedence over the later ones in &#039;&#039;&#039;TEXMF&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
=== Some notes on other relevant variables ===&lt;br /&gt;
* &#039;&#039;&#039;TEXMFDBS&#039;&#039;&#039;: contains list of texmf trees with &#039;&#039;&#039;ls-R&#039;&#039;&#039; filename databases. It&#039;s not clear how the presence of ls-R in a texmf tree and the presence of that tree in TEXMF and TEXMFDBS are related. To avoid potential problems, it&#039;s better to stick with either one of the below scenarios:&lt;br /&gt;
** no ls-R, no presence of texmf tree in TEXMFDBS, presence in TEXMF without &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
** ls-R in sync with  contents of texmf tree, presence in TEXMF and TEXMFDBS with &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;SYSTEXMF&#039;&#039;&#039; (not listed above): contains a list of &#039;&#039;system&#039;&#039; texmf trees; its meaning is roughly this: if the source of a font is found in a system texmf tree and that tree is not writable for the current user, then the scripts &#039;&#039;&#039;mktexpk&#039;&#039;&#039;, &#039;&#039;&#039;mktextfm&#039;&#039;&#039;, and &#039;&#039;&#039;mktexmf&#039;&#039;&#039; will install their output into &#039;&#039;&#039;VARTEXFONTS&#039;&#039;&#039;, otherwise the generated fonts (tfm/pk/mf) will be left in the current directory. If we are not using MF fonts, we can safely forget this variable. If we are using MF fonts and want the fonts generated on-the-fly to be placed to proper location, we must add the relevant texmf tree to SYSTEXMF. Usually not needed, since most TeX fonts are available in outline formats and when not, they can be easily converted from MF to Type1 format using &#039;&#039;&#039;textrace&#039;&#039;&#039;. It is best if we can avoid touching this variable.&lt;br /&gt;
&lt;br /&gt;
== Run pdftex compiled from sources ==&lt;br /&gt;
Sometimes it&#039;s desirable to run a different version of pdftex than the one that comes with TL, for example when we want to run pdftex with some features or bugfixes not included in the version in TL. Then we must compile pdftex from sources and do some extra steps.&lt;br /&gt;
* compiling pdftex from sources: download pdftex sources tarball and apply patches if needed. Suppose that we have unpacked pdftex sources to &#039;&#039;&#039;$HOME/src/pdftex-1.40.9&#039;&#039;&#039;, then to build it:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/src/pdftex-1.40.9&lt;br /&gt;
./build.sh&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* when the above process finishes, the pdftex binary should be located at &#039;&#039;&#039;$HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex&#039;&#039;&#039;&lt;br /&gt;
* make symlinks (suppose that &#039;&#039;&#039;$HOME/bin&#039;&#039;&#039; is in &#039;&#039;&#039;$PATH&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdftex2&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdflatex2&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* find out the location of format files:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -d $(dirname $(kpsewhich -engine=pdftex pdflatex.fmt) )&lt;br /&gt;
/opt/texlive/2008/texmf-var/web2c/pdftex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* create formats:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
&lt;br /&gt;
pdftex2 -ini -translate-file=cp227.tcx &#039;*pdfetex.ini&#039;&lt;br /&gt;
mv pdfetex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdftex2.fmt&lt;br /&gt;
&lt;br /&gt;
pdflatex2 -ini -translate-file=cp227.tcx &#039;*pdflatex.ini&#039;&lt;br /&gt;
mv pdflatex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdflatex2.fmt&lt;br /&gt;
&lt;br /&gt;
texhash&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the new binary:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdftex2 story \\bye&lt;br /&gt;
pdflatex2 sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* repeat the above steps for other versions if needed; substitute pdftex2/pdflatex2 with whichever names that suit better your need/taste.&lt;br /&gt;
&lt;br /&gt;
== Maintain packages installed locally ==&lt;br /&gt;
If we keep installing local packages to a texmf tree for some time, we will find out that it&#039;s getting difficult to keep track of what has been installed, and how to remove or upgrade a package. This is the place where a &#039;&#039;package management system&#039;&#039; is useful. We will use miktex tools to maintain our local packages.&lt;br /&gt;
&lt;br /&gt;
===Install miktex tools===&lt;br /&gt;
* download miktex sources from http://miktex.org/SourceCode.aspx&lt;br /&gt;
* unpack the source tarball to $HOME/src/miktex-2.7.3135&lt;br /&gt;
* install all PREREQUISITES listed in ~/src/miktex-2.7.3135/README.unx&lt;br /&gt;
* compile and install:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cmake -G &amp;quot;Unix Makefiles&amp;quot; -DMIKTEX_INSTALLROOT=/opt/texlive/texmf-local -DCMAKE_INSTALL_PREFIX=/opt/miktex-2.7.3135&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, the miktex tools will be installed to /opt/miktex-2.7.3135.&lt;br /&gt;
* &#039;&#039;&#039;TODO&#039;&#039;&#039;: we will make a tarball of pre-compiled miktex tools binaries for i386-linux and x86_64-linux, to save the compilation step for you. Then to install it, one can simply unpack the tarball to &#039;&#039;&#039;/opt&#039;&#039;&#039;.&lt;br /&gt;
* we need to make a wrapper to run miktex tools. Create a file named &#039;&#039;&#039;run-miktex-tools&#039;&#039;&#039; with file mode 755 and with the following contents:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash                        &lt;br /&gt;
export LD_LIBRARY_PATH=/opt/miktex-2.7.3135/lib&lt;br /&gt;
export PATH=/opt/miktex-2.7.3135/bin:$PATH&lt;br /&gt;
  &lt;br /&gt;
opt=&amp;quot;--repository=/opt/miktex-repository/package-repository&amp;quot;&lt;br /&gt;
tool=$1                            &lt;br /&gt;
shift                              &lt;br /&gt;
  &lt;br /&gt;
ExecCmd() {&lt;br /&gt;
    echo &amp;quot;$@&amp;quot;                      &lt;br /&gt;
    &amp;quot;$@&amp;quot;                           &lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
case &amp;quot;$tool&amp;quot; in                    &lt;br /&gt;
mpm|mpc)&lt;br /&gt;
    ExecCmd $tool $opt &amp;quot;$@&amp;quot;        &lt;br /&gt;
    ;;&lt;br /&gt;
*)&lt;br /&gt;
    ExecCmd $tool &amp;quot;$@&amp;quot;             &lt;br /&gt;
    ;;                             &lt;br /&gt;
esac                               &lt;br /&gt;
exit                               &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test if it works -- we should get help messages on mpm usage from the below command:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
run-miktex-tools mpm --help&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* up to this point, miktex tools are setup so that it will look for available packages at &#039;&#039;&#039;/opt/miktex-repository/package-repository&#039;&#039;&#039; and install requested packages to &#039;&#039;&#039;/opt/texlive/texmf-local&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Set up miktex repository===&lt;br /&gt;
Before we can use miktex tools to install any packages, we must set up the local package repository.&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p  /opt/miktex-repository/package-repository&lt;br /&gt;
cd /opt/miktex-repository/package-repository&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb1-2.7.tar.lzma&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb2-2.7.tar.lzma&lt;br /&gt;
run-miktex-tools mpm --update-db&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create a package for use with miktex tools===&lt;br /&gt;
Suppose we have a texmf tree and we want to create a package from that texmf tree.&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;to be continued&#039;&#039;)&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=235</id>
		<title>Notes on TeX Live setup</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=235"/>
		<updated>2009-03-19T10:05:05Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes steps to install [http://tug.org/texlive TeX Live] (TL from now) and needed tweaks so that other kpathsea programs that are not part of TL can also use TL data. This is useful if we recompile some program from sources and want it to be able to find TL data. For example, one might want to recompile pdftex with some patch, and use it instead of the binary coming with TL.&lt;br /&gt;
&lt;br /&gt;
This guide was written for TL2008 on Ubuntu linux 8.04 and should work with no or little change for other Linux/UNIX systems. &lt;br /&gt;
&lt;br /&gt;
When in doubt, please refer to the [http://www.tug.org/texlive/doc/texlive-en/texlive-en.html official TeX Live documentation]. This guide serves as a quick guide for some very specific purposes:&lt;br /&gt;
* how to install TL with minimal effort and confusion&lt;br /&gt;
* how to use TL data with non-TL binaries&lt;br /&gt;
* how to use different versions of pdftex&lt;br /&gt;
* how to add local packages in a systematic way&lt;br /&gt;
&lt;br /&gt;
== Install TL ==&lt;br /&gt;
* start with a shell where no tex-related environment variables are defined. A quick check can be done by &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
printenv | fgrep TEX&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* download [http://mirror.ctan.org/systems/texlive/Images/texlive2008.iso.lzma latest TL iso image] to e.g. &#039;&#039;&#039;$HOME/iso-images&#039;&#039;&#039; &lt;br /&gt;
* unpack the image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/iso-images&lt;br /&gt;
unlzma texlive2008.iso.lzma&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* mount the TL image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /mnt/texlive2008&lt;br /&gt;
mount -t iso 9660 -o loop $HOME/iso-images/texlive2008.iso /mnt/texlive2008/&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* run the TL installer:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
perl /mnt/texlive2008/install-tl&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* in next menu, change the destination of installation to &#039;&#039;&#039;/opt/texlive/2008&#039;&#039;&#039; by entering:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d&amp;lt;Enter&amp;gt;&lt;br /&gt;
1&amp;lt;Enter&amp;gt;&lt;br /&gt;
/opt/texlive/2008&amp;lt;Enter&amp;gt;&lt;br /&gt;
r&amp;lt;Enter&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* start the installation process by entering &#039;&#039;&#039;i&amp;lt;Enter&amp;gt;&#039;&#039;&#039;. When the installation process is done, the last messages should look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 pre-generating all format files (fmtutil-sys --all), be patient...done&lt;br /&gt;
&lt;br /&gt;
 See &lt;br /&gt;
   /opt/texlive/2008/index.html &lt;br /&gt;
 for links to documentation.  The TeX Live web site (http://tug.org/texlive/) &lt;br /&gt;
 contains any updates and corrections.&lt;br /&gt;
&lt;br /&gt;
 TeX Live is a joint project of the TeX user groups around the world;&lt;br /&gt;
 please consider supporting it by joining the group best for you. The&lt;br /&gt;
 list of groups is available on the web at http://tug.org/usergroups.html.&lt;br /&gt;
&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/man to MANPATH.&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/info to INFOPATH.&lt;br /&gt;
 Most importantly, add /opt/texlive/2008/bin/i386-linux&lt;br /&gt;
 to your PATH for current and future sessions.&lt;br /&gt;
&lt;br /&gt;
 Welcome to TeX Live!&lt;br /&gt;
&lt;br /&gt;
/mnt/texlive2008/install-tl: done.&lt;br /&gt;
Logfile: /opt/texlive/2008/install-tl.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;N.B.&#039;&#039;&#039;: if you are not using &#039;&#039;&#039;i386-linux&#039;&#039;&#039;, the value to be added to the &#039;&#039;&#039;PATH&#039;&#039;&#039; variable is different; for example if you are using 64-bit linux, the installation log will report &#039;&#039;&#039;x86_64-linux&#039;&#039;&#039; instead of &#039;&#039;&#039;i386-linux&#039;&#039;&#039;. &lt;br /&gt;
* create a partial copy of the main TL configuration file (we will modify this copy later):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /opt/texlive/2008/texmf/web2c/texmf.cnf | \&lt;br /&gt;
grep &#039;SELFAUTOPARENT\|^TEXMF \|^TEXMFDBS &#039; | \&lt;br /&gt;
grep -v &#039;^%&#039; &amp;gt; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* change some environment variables permanently as instructed by the installation log: add to &#039;&#039;&#039;/etc/profile&#039;&#039;&#039; the following lines (&#039;&#039;&#039;don&#039;t forget to check the value of PATH if you are not using i386-linux&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## added for TeX Live&lt;br /&gt;
TEXMFCNF=/opt/texlive/2008:/opt/texlive/2008/texmf/web2c&lt;br /&gt;
MANPATH=/mnt/texlive2008/texmf/doc/man:$MANPATH&lt;br /&gt;
INFOPATH=/mnt/texlive2008/texmf/doc/info:$INFOPATH&lt;br /&gt;
PATH=/opt/texlive/2008/bin/i386-linux:$PATH&lt;br /&gt;
export TEXMFCNF MANPATH INFOPATH PATH&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* logout and login again to ensure that the above environment variables are set. With &#039;&#039;&#039;bash&#039;&#039;&#039; as the default shell, it can be done by saying:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
exec bash -login&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the installation:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdflatex sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, we should get a log similar to the below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pdflatex sample2e&lt;br /&gt;
This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)&lt;br /&gt;
 %&amp;amp;-line parsing enabled.&lt;br /&gt;
entering extended mode&lt;br /&gt;
(/mnt/texlive2008/texmf-dist/tex/latex/base/sample2e.tex&lt;br /&gt;
LaTeX2e &amp;lt;2005/12/01&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
Output written on sample2e.pdf (3 pages, 69560 bytes).&lt;br /&gt;
Transcript written on sample2e.log.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Keeping packages up-to-date ==&lt;br /&gt;
* Tell TL that we want to update packages from TL site:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr option location http://mirror.ctan.org/systems/texlive/tlnet/2008&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* check which packages can be updated:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --list&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* update one package (rerun without --dry-run when you are sure):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --dry-run &amp;lt;package-name&amp;gt;&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* update all package (rerun without --dry-run when you are sure):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --dry-run --all&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Recommendations for update&#039;&#039;&#039;: &lt;br /&gt;
** don&#039;t update until you know why you have to (don&#039;t touch things that aren&#039;t broken)&lt;br /&gt;
** backup before update, so things can be reverted if needed. See [http://www.tug.org/texlive/doc/tlmgr.html tlmgr manual] and http://www.tug.org/texlive/tlmgr.html for further info on backup/restore. &lt;br /&gt;
** do &#039;&#039;&#039;not&#039;&#039;&#039; update all packages in one go&lt;br /&gt;
&lt;br /&gt;
== Use non-TL binaries with TL data ==&lt;br /&gt;
TL and all kpathsea programs use one or more config files called &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to search for needed data. In previous steps we have already defined an environment variable TEXMFCNF, which in sequence causes that all kpathsea programs will read first the customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;, then the default TL config file &#039;&#039;&#039;/opt/texlive/2008/texmf/web2c/texmf.cnf&#039;&#039;&#039;. The values defined in the first &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will override values in  the later one(s).&lt;br /&gt;
&lt;br /&gt;
It is critical to have TEXMFCNF defined explicitly as above. If TEXMFCNF is not defined, it&#039;s very hard to track down which config file(s) are being read, since there can be several &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; files laying around and which of them are read depends on quite a few factors. By setting TEXMFCNF to a fixed value, we can get rid of this headache and can concentrate on our customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since we have already defined TEXMFCNF in previous step and made a copy of &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039;, now it is simple to make  non-TL binaries work with TL data: we change our &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to get rid of SELFAUTOPARENT as follows: &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sed -i -e &#039;s:.SELFAUTOPARENT:/opt/texlive/2008:&#039; /opt/texlive/2008/texmf.cnf &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add another texmf tree ==&lt;br /&gt;
Suppose we have tetex previously installed to &#039;&#039;&#039;/opt/tetex-3.0&#039;&#039;&#039;. The tetex texmf tree is then located at &#039;&#039;&#039;/opt/tetex-3.0/share/texmf&#039;&#039;&#039;. To add this texmf tree to our setup, we do this:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /opt/tetex-3.0/share/texmf /opt/texlive/texmf-tetex&lt;br /&gt;
sed -i &#039;&lt;br /&gt;
/^TEXMFLOCAL/ a\&lt;br /&gt;
TEXMFTETEX = /opt/texlive/texmf-tetex&lt;br /&gt;
s/^\(TEXMF = .*\)}/\1,$TEXMFTETEX}/&lt;br /&gt;
&#039; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
texhash /opt/texlive/texmf-tetex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can repeat the above steps to add as many texmf trees as we need. For each texmf tree we must:&lt;br /&gt;
* choose a variable name that it&#039;s not used yet (TEXMFTETEX in the above example)&lt;br /&gt;
* locate the path to the texmf tree, and make a symlink in &#039;&#039;&#039;/opt/texlive&#039;&#039;&#039;&lt;br /&gt;
* adjust the above commands accordingly.&lt;br /&gt;
&lt;br /&gt;
Or, it is possible to use [http://download.river-valley.com/add-texmf-tree.sh this script] to automate the above steps. Usage:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh add-texmf-tree.sh TEXMFTETEX /opt/texlive/texmf-tetex /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
The script will do some checking before changing &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to ensure that the parameters are correct. The current &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will be backed up with timestamp appended like e.g. &#039;&#039;&#039;texmf.cnf--2008-10-20.19:43:05&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Use ls-R or not ===&lt;br /&gt;
Each texmf tree can have a file called &#039;&#039;&#039;ls-R&#039;&#039;&#039; at the top level, which can help to speed up searching if the texmf tree is large. But using ls-R is not always the best option, since it requires some extra effort to get it right. If a texmf tree is small and changes often, it&#039;s better not to use ls-R. If a texmf tree is large, then it&#039;s worthwhile to go for the trouble.&lt;br /&gt;
&lt;br /&gt;
To use ls-R with the texmf tree in the previous example, we must:&lt;br /&gt;
* edit texmf.cnf:&lt;br /&gt;
** change &#039;&#039;&#039;$TEXMFTETEX&#039;&#039;&#039; to &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; (only on one line -- the one starting with &#039;&#039;&#039;TEXMF = ...&#039;&#039;&#039;&lt;br /&gt;
** add &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; to TEXMFDBS&lt;br /&gt;
* run &#039;&#039;&#039;texhash /opt/texlive/texmf-tetex&#039;&#039;&#039; to make ls-R in sync with the contents of texmf tree. &lt;br /&gt;
&lt;br /&gt;
Failing to do any of the above steps will cause that some files might not be found as expected, and it&#039;s not always easy to trace down the reason.&lt;br /&gt;
&lt;br /&gt;
=== Change the order of file searching ===&lt;br /&gt;
If we need to change the precedence of a texmf tree, we can edit texmf.cnf and change the variable TEXMF. &lt;br /&gt;
TEXMF specifies which texmf trees are searched, and in which order. The order of the texmf trees given in &#039;&#039;&#039;TEXMF&#039;&#039;&#039; is important: earlier trees take precedence over the later ones in &#039;&#039;&#039;TEXMF&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
=== Some notes on other relevant variables ===&lt;br /&gt;
* &#039;&#039;&#039;TEXMFDBS&#039;&#039;&#039;: contains list of texmf trees with &#039;&#039;&#039;ls-R&#039;&#039;&#039; filename databases. It&#039;s not clear how the presence of ls-R in a texmf tree and the presence of that tree in TEXMF and TEXMFDBS are related. To avoid potential problems, it&#039;s better to stick with either one of the below scenarios:&lt;br /&gt;
** no ls-R, no presence of texmf tree in TEXMFDBS, presence in TEXMF without &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
** ls-R in sync with  contents of texmf tree, presence in TEXMF and TEXMFDBS with &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;SYSTEXMF&#039;&#039;&#039; (not listed above): contains a list of &#039;&#039;system&#039;&#039; texmf trees; its meaning is roughly this: if the source of a font is found in a system texmf tree and that tree is not writable for the current user, then the scripts &#039;&#039;&#039;mktexpk&#039;&#039;&#039;, &#039;&#039;&#039;mktextfm&#039;&#039;&#039;, and &#039;&#039;&#039;mktexmf&#039;&#039;&#039; will install their output into &#039;&#039;&#039;VARTEXFONTS&#039;&#039;&#039;, otherwise the generated fonts (tfm/pk/mf) will be left in the current directory. If we are not using MF fonts, we can safely forget this variable. If we are using MF fonts and want the fonts generated on-the-fly to be placed to proper location, we must add the relevant texmf tree to SYSTEXMF. Usually not needed, since most TeX fonts are available in outline formats and when not, they can be easily converted from MF to Type1 format using &#039;&#039;&#039;textrace&#039;&#039;&#039;. It is best if we can avoid touching this variable.&lt;br /&gt;
&lt;br /&gt;
== Run pdftex compiled from sources ==&lt;br /&gt;
Sometimes it&#039;s desirable to run a different version of pdftex than the one that comes with TL, for example when we want to run pdftex with some features or bugfixes not included in the version in TL. Then we must compile pdftex from sources and do some extra steps.&lt;br /&gt;
* compiling pdftex from sources: download pdftex sources tarball and apply patches if needed. Suppose that we have unpacked pdftex sources to &#039;&#039;&#039;$HOME/src/pdftex-1.40.9&#039;&#039;&#039;, then to build it:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/src/pdftex-1.40.9&lt;br /&gt;
./build.sh&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* when the above process finishes, the pdftex binary should be located at &#039;&#039;&#039;$HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex&#039;&#039;&#039;&lt;br /&gt;
* make symlinks (suppose that &#039;&#039;&#039;$HOME/bin&#039;&#039;&#039; is in &#039;&#039;&#039;$PATH&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdftex2&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdflatex2&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* find out the location of format files:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -d $(dirname $(kpsewhich -engine=pdftex pdflatex.fmt) )&lt;br /&gt;
/opt/texlive/2008/texmf-var/web2c/pdftex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* create formats:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
&lt;br /&gt;
pdftex2 -ini -translate-file=cp227.tcx &#039;*pdfetex.ini&#039;&lt;br /&gt;
mv pdfetex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdftex2.fmt&lt;br /&gt;
&lt;br /&gt;
pdflatex2 -ini -translate-file=cp227.tcx &#039;*pdflatex.ini&#039;&lt;br /&gt;
mv pdflatex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdflatex2.fmt&lt;br /&gt;
&lt;br /&gt;
texhash&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the new binary:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdftex2 story \\bye&lt;br /&gt;
pdflatex2 sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* repeat the above steps for other versions if needed; substitute pdftex2/pdflatex2 with whichever names that suit better your need/taste.&lt;br /&gt;
&lt;br /&gt;
== Maintain packages installed locally ==&lt;br /&gt;
If we keep installing local packages to a texmf tree for some time, we will find out that it&#039;s getting difficult to keep track of what has been installed, and how to remove or upgrade a package. This is the place where a &#039;&#039;package management system&#039;&#039; is useful. We will use miktex tools to maintain our local packages.&lt;br /&gt;
&lt;br /&gt;
===Install miktex tools===&lt;br /&gt;
* download miktex sources from http://miktex.org/SourceCode.aspx&lt;br /&gt;
* unpack the source tarball to $HOME/src/miktex-2.7.3135&lt;br /&gt;
* install all PREREQUISITES listed in ~/src/miktex-2.7.3135/README.unx&lt;br /&gt;
* compile and install:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cmake -G &amp;quot;Unix Makefiles&amp;quot; -DMIKTEX_INSTALLROOT=/opt/texlive/texmf-local -DCMAKE_INSTALL_PREFIX=/opt/miktex-2.7.3135&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, the miktex tools will be installed to /opt/miktex-2.7.3135.&lt;br /&gt;
* &#039;&#039;&#039;TODO&#039;&#039;&#039;: we will make a tarball of pre-compiled miktex tools binaries for i386-linux and x86_64-linux, to save the compilation step for you. Then to install it, one can simply unpack the tarball to &#039;&#039;&#039;/opt&#039;&#039;&#039;.&lt;br /&gt;
* we need to make a wrapper to run miktex tools. Create a file named &#039;&#039;&#039;run-miktex-tools&#039;&#039;&#039; with file mode 755 and with the following contents:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash                        &lt;br /&gt;
export LD_LIBRARY_PATH=/opt/miktex-2.7.3135/lib&lt;br /&gt;
export PATH=/opt/miktex-2.7.3135/bin:$PATH&lt;br /&gt;
  &lt;br /&gt;
opt=&amp;quot;--repository=/opt/miktex-repository/package-repository&amp;quot;&lt;br /&gt;
tool=$1                            &lt;br /&gt;
shift                              &lt;br /&gt;
  &lt;br /&gt;
ExecCmd() {&lt;br /&gt;
    echo &amp;quot;$@&amp;quot;                      &lt;br /&gt;
    &amp;quot;$@&amp;quot;                           &lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
case &amp;quot;$tool&amp;quot; in                    &lt;br /&gt;
mpm|mpc)&lt;br /&gt;
    ExecCmd $tool $opt &amp;quot;$@&amp;quot;        &lt;br /&gt;
    ;;&lt;br /&gt;
*)&lt;br /&gt;
    ExecCmd $tool &amp;quot;$@&amp;quot;             &lt;br /&gt;
    ;;                             &lt;br /&gt;
esac                               &lt;br /&gt;
exit                               &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test if it works -- we should get help messages on mpm usage from the below command:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
run-miktex-tools mpm --help&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* up to this point, miktex tools are setup so that it will look for available packages at &#039;&#039;&#039;/opt/miktex-repository/package-repository&#039;&#039;&#039; and install requested packages to &#039;&#039;&#039;/opt/texlive/texmf-local&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Set up miktex repository===&lt;br /&gt;
Before we can use miktex tools to install any packages, we must set up the local package repository.&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p  /opt/miktex-repository/package-repository&lt;br /&gt;
cd /opt/miktex-repository/package-repository&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb1-2.7.tar.lzma&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb2-2.7.tar.lzma&lt;br /&gt;
run-miktex-tools mpm --update-db&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create a package for use with miktex tools===&lt;br /&gt;
Suppose we have a texmf tree and we want to create a package from that texmf tree.&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;to be continued&#039;&#039;)&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=234</id>
		<title>Notes on TeX Live setup</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=234"/>
		<updated>2009-02-25T19:49:10Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Keeping packages up-to-date */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes steps to install [http://tug.org/texlive TeX Live] (TL from now) and needed tweaks so that other kpathsea programs that are not part of TL can also use TL data. This is useful if we recompile some program from sources and want it to be able to find TL data. For example, one might want to recompile pdftex with some patch, and use it instead of the binary coming with TL.&lt;br /&gt;
&lt;br /&gt;
This guide was written for TL2008 on Ubuntu linux 8.01 and should work with no or little change for other Linux/UNIX systems. &lt;br /&gt;
&lt;br /&gt;
When in doubt, please refer to the [http://www.tug.org/texlive/doc/texlive-en/texlive-en.html official TeX Live documentation]. This guide serves as a quick guide for some very specific purposes:&lt;br /&gt;
* how to install TL with minimal effort and confusion&lt;br /&gt;
* how to use TL data with non-TL binaries&lt;br /&gt;
* how to use different versions of pdftex&lt;br /&gt;
* how to add local packages in a systematic way&lt;br /&gt;
&lt;br /&gt;
== Install TL ==&lt;br /&gt;
* start with a shell where no tex-related environment variables are defined. A quick check can be done by &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
printenv | fgrep TEX&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* download [http://mirror.ctan.org/systems/texlive/Images/texlive2008.iso.lzma latest TL iso image] to e.g. &#039;&#039;&#039;$HOME/iso-images&#039;&#039;&#039; &lt;br /&gt;
* unpack the image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/iso-images&lt;br /&gt;
unlzma texlive2008.iso.lzma&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* mount the TL image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /mnt/texlive2008&lt;br /&gt;
mount -t iso 9660 -o loop $HOME/iso-images/texlive2008.iso /mnt/texlive2008/&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* run the TL installer:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
perl /mnt/texlive2008/install-tl&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* in next menu, change the destination of installation to &#039;&#039;&#039;/opt/texlive/2008&#039;&#039;&#039; by entering:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d&amp;lt;Enter&amp;gt;&lt;br /&gt;
1&amp;lt;Enter&amp;gt;&lt;br /&gt;
/opt/texlive/2008&amp;lt;Enter&amp;gt;&lt;br /&gt;
r&amp;lt;Enter&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* start the installation process by entering &#039;&#039;&#039;i&amp;lt;Enter&amp;gt;&#039;&#039;&#039;. When the installation process is done, the last messages should look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 pre-generating all format files (fmtutil-sys --all), be patient...done&lt;br /&gt;
&lt;br /&gt;
 See &lt;br /&gt;
   /opt/texlive/2008/index.html &lt;br /&gt;
 for links to documentation.  The TeX Live web site (http://tug.org/texlive/) &lt;br /&gt;
 contains any updates and corrections.&lt;br /&gt;
&lt;br /&gt;
 TeX Live is a joint project of the TeX user groups around the world;&lt;br /&gt;
 please consider supporting it by joining the group best for you. The&lt;br /&gt;
 list of groups is available on the web at http://tug.org/usergroups.html.&lt;br /&gt;
&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/man to MANPATH.&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/info to INFOPATH.&lt;br /&gt;
 Most importantly, add /opt/texlive/2008/bin/i386-linux&lt;br /&gt;
 to your PATH for current and future sessions.&lt;br /&gt;
&lt;br /&gt;
 Welcome to TeX Live!&lt;br /&gt;
&lt;br /&gt;
/mnt/texlive2008/install-tl: done.&lt;br /&gt;
Logfile: /opt/texlive/2008/install-tl.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;N.B.&#039;&#039;&#039;: if you are not using &#039;&#039;&#039;i386-linux&#039;&#039;&#039;, the value to be added to the &#039;&#039;&#039;PATH&#039;&#039;&#039; variable is different; for example if you are using 64-bit linux, the installation log will report &#039;&#039;&#039;x86_64-linux&#039;&#039;&#039; instead of &#039;&#039;&#039;i386-linux&#039;&#039;&#039;. &lt;br /&gt;
* create a partial copy of the main TL configuration file (we will modify this copy later):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /opt/texlive/2008/texmf/web2c/texmf.cnf | \&lt;br /&gt;
grep &#039;SELFAUTOPARENT\|^TEXMF \|^TEXMFDBS &#039; | \&lt;br /&gt;
grep -v &#039;^%&#039; &amp;gt; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* change some environment variables permanently as instructed by the installation log: add to &#039;&#039;&#039;/etc/profile&#039;&#039;&#039; the following lines (&#039;&#039;&#039;don&#039;t forget to check the value of PATH if you are not using i386-linux&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## added for TeX Live&lt;br /&gt;
TEXMFCNF=/opt/texlive/2008:/opt/texlive/2008/texmf/web2c&lt;br /&gt;
MANPATH=/mnt/texlive2008/texmf/doc/man:$MANPATH&lt;br /&gt;
INFOPATH=/mnt/texlive2008/texmf/doc/info:$INFOPATH&lt;br /&gt;
PATH=/opt/texlive/2008/bin/i386-linux:$PATH&lt;br /&gt;
export TEXMFCNF MANPATH INFOPATH PATH&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* logout and login again to ensure that the above environment variables are set. With &#039;&#039;&#039;bash&#039;&#039;&#039; as the default shell, it can be done by saying:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
exec bash -login&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the installation:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdflatex sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, we should get a log similar to the below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pdflatex sample2e&lt;br /&gt;
This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)&lt;br /&gt;
 %&amp;amp;-line parsing enabled.&lt;br /&gt;
entering extended mode&lt;br /&gt;
(/mnt/texlive2008/texmf-dist/tex/latex/base/sample2e.tex&lt;br /&gt;
LaTeX2e &amp;lt;2005/12/01&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
Output written on sample2e.pdf (3 pages, 69560 bytes).&lt;br /&gt;
Transcript written on sample2e.log.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Keeping packages up-to-date ==&lt;br /&gt;
* Tell TL that we want to update packages from TL site:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr option location http://mirror.ctan.org/systems/texlive/tlnet/2008&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* check which packages can be updated:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --list&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* update one package (rerun without --dry-run when you are sure):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --dry-run &amp;lt;package-name&amp;gt;&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* update all package (rerun without --dry-run when you are sure):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --dry-run --all&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Recommendations for update&#039;&#039;&#039;: &lt;br /&gt;
** don&#039;t update until you know why you have to (don&#039;t touch things that aren&#039;t broken)&lt;br /&gt;
** backup before update, so things can be reverted if needed. See [http://www.tug.org/texlive/doc/tlmgr.html tlmgr manual] and http://www.tug.org/texlive/tlmgr.html for further info on backup/restore. &lt;br /&gt;
** do &#039;&#039;&#039;not&#039;&#039;&#039; update all packages in one go&lt;br /&gt;
&lt;br /&gt;
== Use non-TL binaries with TL data ==&lt;br /&gt;
TL and all kpathsea programs use one or more config files called &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to search for needed data. In previous steps we have already defined an environment variable TEXMFCNF, which in sequence causes that all kpathsea programs will read first the customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;, then the default TL config file &#039;&#039;&#039;/opt/texlive/2008/texmf/web2c/texmf.cnf&#039;&#039;&#039;. The values defined in the first &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will override values in  the later one(s).&lt;br /&gt;
&lt;br /&gt;
It is critical to have TEXMFCNF defined explicitly as above. If TEXMFCNF is not defined, it&#039;s very hard to track down which config file(s) are being read, since there can be several &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; files laying around and which of them are read depends on quite a few factors. By setting TEXMFCNF to a fixed value, we can get rid of this headache and can concentrate on our customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since we have already defined TEXMFCNF in previous step and made a copy of &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039;, now it is simple to make  non-TL binaries work with TL data: we change our &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to get rid of SELFAUTOPARENT as follows: &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sed -i -e &#039;s:.SELFAUTOPARENT:/opt/texlive/2008:&#039; /opt/texlive/2008/texmf.cnf &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add another texmf tree ==&lt;br /&gt;
Suppose we have tetex previously installed to &#039;&#039;&#039;/opt/tetex-3.0&#039;&#039;&#039;. The tetex texmf tree is then located at &#039;&#039;&#039;/opt/tetex-3.0/share/texmf&#039;&#039;&#039;. To add this texmf tree to our setup, we do this:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /opt/tetex-3.0/share/texmf /opt/texlive/texmf-tetex&lt;br /&gt;
sed -i &#039;&lt;br /&gt;
/^TEXMFLOCAL/ a\&lt;br /&gt;
TEXMFTETEX = /opt/texlive/texmf-tetex&lt;br /&gt;
s/^\(TEXMF = .*\)}/\1,$TEXMFTETEX}/&lt;br /&gt;
&#039; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
texhash /opt/texlive/texmf-tetex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can repeat the above steps to add as many texmf trees as we need. For each texmf tree we must:&lt;br /&gt;
* choose a variable name that it&#039;s not used yet (TEXMFTETEX in the above example)&lt;br /&gt;
* locate the path to the texmf tree, and make a symlink in &#039;&#039;&#039;/opt/texlive&#039;&#039;&#039;&lt;br /&gt;
* adjust the above commands accordingly.&lt;br /&gt;
&lt;br /&gt;
Or, it is possible to use [http://download.river-valley.com/add-texmf-tree.sh this script] to automate the above steps. Usage:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh add-texmf-tree.sh TEXMFTETEX /opt/texlive/texmf-tetex /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
The script will do some checking before changing &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to ensure that the parameters are correct. The current &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will be backed up with timestamp appended like e.g. &#039;&#039;&#039;texmf.cnf--2008-10-20.19:43:05&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Use ls-R or not ===&lt;br /&gt;
Each texmf tree can have a file called &#039;&#039;&#039;ls-R&#039;&#039;&#039; at the top level, which can help to speed up searching if the texmf tree is large. But using ls-R is not always the best option, since it requires some extra effort to get it right. If a texmf tree is small and changes often, it&#039;s better not to use ls-R. If a texmf tree is large, then it&#039;s worthwhile to go for the trouble.&lt;br /&gt;
&lt;br /&gt;
To use ls-R with the texmf tree in the previous example, we must:&lt;br /&gt;
* edit texmf.cnf:&lt;br /&gt;
** change &#039;&#039;&#039;$TEXMFTETEX&#039;&#039;&#039; to &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; (only on one line -- the one starting with &#039;&#039;&#039;TEXMF = ...&#039;&#039;&#039;&lt;br /&gt;
** add &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; to TEXMFDBS&lt;br /&gt;
* run &#039;&#039;&#039;texhash /opt/texlive/texmf-tetex&#039;&#039;&#039; to make ls-R in sync with the contents of texmf tree. &lt;br /&gt;
&lt;br /&gt;
Failing to do any of the above steps will cause that some files might not be found as expected, and it&#039;s not always easy to trace down the reason.&lt;br /&gt;
&lt;br /&gt;
=== Change the order of file searching ===&lt;br /&gt;
If we need to change the precedence of a texmf tree, we can edit texmf.cnf and change the variable TEXMF. &lt;br /&gt;
TEXMF specifies which texmf trees are searched, and in which order. The order of the texmf trees given in &#039;&#039;&#039;TEXMF&#039;&#039;&#039; is important: earlier trees take precedence over the later ones in &#039;&#039;&#039;TEXMF&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
=== Some notes on other relevant variables ===&lt;br /&gt;
* &#039;&#039;&#039;TEXMFDBS&#039;&#039;&#039;: contains list of texmf trees with &#039;&#039;&#039;ls-R&#039;&#039;&#039; filename databases. It&#039;s not clear how the presence of ls-R in a texmf tree and the presence of that tree in TEXMF and TEXMFDBS are related. To avoid potential problems, it&#039;s better to stick with either one of the below scenarios:&lt;br /&gt;
** no ls-R, no presence of texmf tree in TEXMFDBS, presence in TEXMF without &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
** ls-R in sync with  contents of texmf tree, presence in TEXMF and TEXMFDBS with &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;SYSTEXMF&#039;&#039;&#039; (not listed above): contains a list of &#039;&#039;system&#039;&#039; texmf trees; its meaning is roughly this: if the source of a font is found in a system texmf tree and that tree is not writable for the current user, then the scripts &#039;&#039;&#039;mktexpk&#039;&#039;&#039;, &#039;&#039;&#039;mktextfm&#039;&#039;&#039;, and &#039;&#039;&#039;mktexmf&#039;&#039;&#039; will install their output into &#039;&#039;&#039;VARTEXFONTS&#039;&#039;&#039;, otherwise the generated fonts (tfm/pk/mf) will be left in the current directory. If we are not using MF fonts, we can safely forget this variable. If we are using MF fonts and want the fonts generated on-the-fly to be placed to proper location, we must add the relevant texmf tree to SYSTEXMF. Usually not needed, since most TeX fonts are available in outline formats and when not, they can be easily converted from MF to Type1 format using &#039;&#039;&#039;textrace&#039;&#039;&#039;. It is best if we can avoid touching this variable.&lt;br /&gt;
&lt;br /&gt;
== Run pdftex compiled from sources ==&lt;br /&gt;
Sometimes it&#039;s desirable to run a different version of pdftex than the one that comes with TL, for example when we want to run pdftex with some features or bugfixes not included in the version in TL. Then we must compile pdftex from sources and do some extra steps.&lt;br /&gt;
* compiling pdftex from sources: download pdftex sources tarball and apply patches if needed. Suppose that we have unpacked pdftex sources to &#039;&#039;&#039;$HOME/src/pdftex-1.40.9&#039;&#039;&#039;, then to build it:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/src/pdftex-1.40.9&lt;br /&gt;
./build.sh&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* when the above process finishes, the pdftex binary should be located at &#039;&#039;&#039;$HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex&#039;&#039;&#039;&lt;br /&gt;
* make symlinks (suppose that &#039;&#039;&#039;$HOME/bin&#039;&#039;&#039; is in &#039;&#039;&#039;$PATH&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdftex2&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdflatex2&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* find out the location of format files:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -d $(dirname $(kpsewhich -engine=pdftex pdflatex.fmt) )&lt;br /&gt;
/opt/texlive/2008/texmf-var/web2c/pdftex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* create formats:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
&lt;br /&gt;
pdftex2 -ini -translate-file=cp227.tcx &#039;*pdfetex.ini&#039;&lt;br /&gt;
mv pdfetex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdftex2.fmt&lt;br /&gt;
&lt;br /&gt;
pdflatex2 -ini -translate-file=cp227.tcx &#039;*pdflatex.ini&#039;&lt;br /&gt;
mv pdflatex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdflatex2.fmt&lt;br /&gt;
&lt;br /&gt;
texhash&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the new binary:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdftex2 story \\bye&lt;br /&gt;
pdflatex2 sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* repeat the above steps for other versions if needed; substitute pdftex2/pdflatex2 with whichever names that suit better your need/taste.&lt;br /&gt;
&lt;br /&gt;
== Maintain packages installed locally ==&lt;br /&gt;
If we keep installing local packages to a texmf tree for some time, we will find out that it&#039;s getting difficult to keep track of what has been installed, and how to remove or upgrade a package. This is the place where a &#039;&#039;package management system&#039;&#039; is useful. We will use miktex tools to maintain our local packages.&lt;br /&gt;
&lt;br /&gt;
===Install miktex tools===&lt;br /&gt;
* download miktex sources from http://miktex.org/SourceCode.aspx&lt;br /&gt;
* unpack the source tarball to $HOME/src/miktex-2.7.3135&lt;br /&gt;
* install all PREREQUISITES listed in ~/src/miktex-2.7.3135/README.unx&lt;br /&gt;
* compile and install:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cmake -G &amp;quot;Unix Makefiles&amp;quot; -DMIKTEX_INSTALLROOT=/opt/texlive/texmf-local -DCMAKE_INSTALL_PREFIX=/opt/miktex-2.7.3135&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, the miktex tools will be installed to /opt/miktex-2.7.3135.&lt;br /&gt;
* &#039;&#039;&#039;TODO&#039;&#039;&#039;: we will make a tarball of pre-compiled miktex tools binaries for i386-linux and x86_64-linux, to save the compilation step for you. Then to install it, one can simply unpack the tarball to &#039;&#039;&#039;/opt&#039;&#039;&#039;.&lt;br /&gt;
* we need to make a wrapper to run miktex tools. Create a file named &#039;&#039;&#039;run-miktex-tools&#039;&#039;&#039; with file mode 755 and with the following contents:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash                        &lt;br /&gt;
export LD_LIBRARY_PATH=/opt/miktex-2.7.3135/lib&lt;br /&gt;
export PATH=/opt/miktex-2.7.3135/bin:$PATH&lt;br /&gt;
  &lt;br /&gt;
opt=&amp;quot;--repository=/opt/miktex-repository/package-repository&amp;quot;&lt;br /&gt;
tool=$1                            &lt;br /&gt;
shift                              &lt;br /&gt;
  &lt;br /&gt;
ExecCmd() {&lt;br /&gt;
    echo &amp;quot;$@&amp;quot;                      &lt;br /&gt;
    &amp;quot;$@&amp;quot;                           &lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
case &amp;quot;$tool&amp;quot; in                    &lt;br /&gt;
mpm|mpc)&lt;br /&gt;
    ExecCmd $tool $opt &amp;quot;$@&amp;quot;        &lt;br /&gt;
    ;;&lt;br /&gt;
*)&lt;br /&gt;
    ExecCmd $tool &amp;quot;$@&amp;quot;             &lt;br /&gt;
    ;;                             &lt;br /&gt;
esac                               &lt;br /&gt;
exit                               &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test if it works -- we should get help messages on mpm usage from the below command:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
run-miktex-tools mpm --help&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* up to this point, miktex tools are setup so that it will look for available packages at &#039;&#039;&#039;/opt/miktex-repository/package-repository&#039;&#039;&#039; and install requested packages to &#039;&#039;&#039;/opt/texlive/texmf-local&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Set up miktex repository===&lt;br /&gt;
Before we can use miktex tools to install any packages, we must set up the local package repository.&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p  /opt/miktex-repository/package-repository&lt;br /&gt;
cd /opt/miktex-repository/package-repository&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb1-2.7.tar.lzma&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb2-2.7.tar.lzma&lt;br /&gt;
run-miktex-tools mpm --update-db&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create a package for use with miktex tools===&lt;br /&gt;
Suppose we have a texmf tree and we want to create a package from that texmf tree.&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;to be continued&#039;&#039;)&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=233</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=233"/>
		<updated>2009-02-07T07:17:51Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Accessing NTFS partition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The write performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX. Read performance is ok (10-15MiB/s).&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=232</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=232"/>
		<updated>2009-02-07T07:04:03Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Slimming OSX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
* another tool to show which files are candidate for deletion: http://www.omnigroup.com/applications/omnidisksweeper/&lt;br /&gt;
* good article and discussion on slimming OSX: http://arstechnica.com/apple/news/2008/11/five-ways-to-slim-down-your-mac-os-x-install.ars&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=231</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=231"/>
		<updated>2009-02-07T06:43:37Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Slimming OSX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
* great tool to have an overview on disk usage: http://www.derlien.com/index.html&lt;br /&gt;
&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=230</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=230"/>
		<updated>2009-02-06T16:20:28Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Tested kernel 2.6.29-rc3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no graphics acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=229</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=229"/>
		<updated>2009-02-06T16:19:43Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Try kernel 2.6.29-rc3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Tested kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no vide acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=228</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=228"/>
		<updated>2009-02-06T13:01:40Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Try kernel 2.6.29-rc3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Try kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* no vide acceleration&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=227</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=227"/>
		<updated>2009-02-06T13:01:11Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Pending issues with Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;br /&gt;
===Try kernel 2.6.29-rc3===&lt;br /&gt;
Build from sources, with ubuntu config from 2.6.28&lt;br /&gt;
;good news:&lt;br /&gt;
* it booted&lt;br /&gt;
* support for MBP5.1 seems to be there (the log said: &#039;&#039;&#039;MacBookPro 5,1 detected&#039;&#039;&#039;)&lt;br /&gt;
;bad news:&lt;br /&gt;
* wireless didn&#039;t work&lt;br /&gt;
* trackpad didn&#039;t work&lt;br /&gt;
* still hang during reboot&lt;br /&gt;
&lt;br /&gt;
It seems better to wait for a few months. Next ubuntu version (Jaunty) might have 2.6.29 kernel and will be released in 2 months.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=226</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=226"/>
		<updated>2009-02-06T09:59:11Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Pending issues with Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;br /&gt;
* there are some pending problems; it seems the hardware is too new and it will take sometime before the issues are solved.&lt;br /&gt;
** http://johannes.sipsolutions.net/MacBook&lt;br /&gt;
** http://www.spicious.com/blog/2008/11/gentoo-on-the-macbook-pro/&lt;br /&gt;
** https://help.ubuntu.com/community/MacBook5-1/Intrepid&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=225</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=225"/>
		<updated>2009-02-06T09:50:08Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Pending issues with Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off: http://bugzilla.kernel.org/show_bug.cgi?id=12445&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=224</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=224"/>
		<updated>2009-02-06T09:38:52Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* MacPorts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to install GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
===Uninstalling OSX software===&lt;br /&gt;
great guide: http://guides.macrumors.com/Uninstalling_Applications_in_Mac_OS_X&lt;br /&gt;
&lt;br /&gt;
===TeX for OSX===&lt;br /&gt;
* Good place to start: http://mactex-wiki.tug.org&lt;br /&gt;
* For Unix geeks: http://support.river-valley.com/wiki/index.php?title=Notes_on_TeX_Live_setup&lt;br /&gt;
&lt;br /&gt;
===Useful utilities===&lt;br /&gt;
* SuperDuper: for backup&lt;br /&gt;
* MacVim: my favorite editor&lt;br /&gt;
* Adobe Reader&lt;br /&gt;
* VLC: universal movie player&lt;br /&gt;
* mplayer: great movie player, installable via MacPorts&lt;br /&gt;
* MacTheRipper: rip dvd to disk&lt;br /&gt;
* HandBrake: dvd encoding&lt;br /&gt;
* QuickSilver: shortcuts for everything&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=223</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=223"/>
		<updated>2009-02-06T09:29:28Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Slimming OSX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
===MacPorts===&lt;br /&gt;
MacPorts is a system to instal GNU software on OSX. Very useful for Unix geeks on OSX.&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=222</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=222"/>
		<updated>2009-02-06T09:28:07Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Installation steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
&lt;br /&gt;
==Tuning OSX==&lt;br /&gt;
===Accessing NTFS partition===&lt;br /&gt;
I have a big NTFS share partition for media data and the like. To access this partition on OSX, install NTFS-3G from   as instructed at http://macntfs-3g.blogspot.com&lt;br /&gt;
&lt;br /&gt;
There is however a problem with NTFS partition created by gparted that requires a fix: http://www.macosxhints.com/article.php?story=20080130022147512&lt;br /&gt;
&lt;br /&gt;
The performance of NTFS-3G on my MBP is slow (1-2MiB/s), but it&#039;s expected to be improved in next version of NTFS-3G for OSX.&lt;br /&gt;
&lt;br /&gt;
===Slimming OSX===&lt;br /&gt;
*  good guide http://guides.macrumors.com/Mac_OS_X_On_A_Diet&lt;br /&gt;
* Xslimmer is not free, use Monolingual instead&lt;br /&gt;
* it&#039;s not possible to remove MacOSX components after install; it must be done by re-installation&lt;br /&gt;
* it&#039;s however possible to manually remove printer drivers:&lt;br /&gt;
** http://www.macosxhints.com/article.php?story=20010409015217397&lt;br /&gt;
** http://forums.macosxhints.com/showthread.php?t=19990&lt;br /&gt;
&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=221</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=221"/>
		<updated>2009-02-06T09:16:13Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Partitioning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|40G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=220</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=220"/>
		<updated>2009-02-06T09:15:07Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Partitioning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes. This partition can be accessed from both linux &amp;amp; OSX, so it&#039;s not harmful to give it some more space than needed.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose, so that we can test another linux distro (for example a new version of Ubuntu) without re-partitioning.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|30G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so it&#039;s better to start small, and expand it as needed. To expand /home partition, use GParted Live CD to shrink the share partition (below) and then expand /home. GParted can grow/shrink/move NTFS without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=219</id>
		<title>Notes on TeX Live setup</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=219"/>
		<updated>2009-02-04T09:47:12Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Run pdftex compiled from sources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes steps to install [http://tug.org/texlive TeX Live] (TL from now) and needed tweaks so that other kpathsea programs that are not part of TL can also use TL data. This is useful if we recompile some program from sources and want it to be able to find TL data. For example, one might want to recompile pdftex with some patch, and use it instead of the binary coming with TL.&lt;br /&gt;
&lt;br /&gt;
This guide was written for TL2008 on Ubuntu linux 8.01 and should work with no or little change for other Linux/UNIX systems. &lt;br /&gt;
&lt;br /&gt;
When in doubt, please refer to the [http://www.tug.org/texlive/doc/texlive-en/texlive-en.html official TeX Live documentation]. This guide serves as a quick guide for some very specific purposes:&lt;br /&gt;
* how to install TL with minimal effort and confusion&lt;br /&gt;
* how to use TL data with non-TL binaries&lt;br /&gt;
* how to use different versions of pdftex&lt;br /&gt;
* how to add local packages in a systematic way&lt;br /&gt;
&lt;br /&gt;
== Install TL ==&lt;br /&gt;
* start with a shell where no tex-related environment variables are defined. A quick check can be done by &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
printenv | fgrep TEX&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* download [http://mirror.ctan.org/systems/texlive/Images/texlive2008.iso.lzma latest TL iso image] to e.g. &#039;&#039;&#039;$HOME/iso-images&#039;&#039;&#039; &lt;br /&gt;
* unpack the image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/iso-images&lt;br /&gt;
unlzma texlive2008.iso.lzma&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* mount the TL image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /mnt/texlive2008&lt;br /&gt;
mount -t iso 9660 -o loop $HOME/iso-images/texlive2008.iso /mnt/texlive2008/&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* run the TL installer:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
perl /mnt/texlive2008/install-tl&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* in next menu, change the destination of installation to &#039;&#039;&#039;/opt/texlive/2008&#039;&#039;&#039; by entering:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d&amp;lt;Enter&amp;gt;&lt;br /&gt;
1&amp;lt;Enter&amp;gt;&lt;br /&gt;
/opt/texlive/2008&amp;lt;Enter&amp;gt;&lt;br /&gt;
r&amp;lt;Enter&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* start the installation process by entering &#039;&#039;&#039;i&amp;lt;Enter&amp;gt;&#039;&#039;&#039;. When the installation process is done, the last messages should look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 pre-generating all format files (fmtutil-sys --all), be patient...done&lt;br /&gt;
&lt;br /&gt;
 See &lt;br /&gt;
   /opt/texlive/2008/index.html &lt;br /&gt;
 for links to documentation.  The TeX Live web site (http://tug.org/texlive/) &lt;br /&gt;
 contains any updates and corrections.&lt;br /&gt;
&lt;br /&gt;
 TeX Live is a joint project of the TeX user groups around the world;&lt;br /&gt;
 please consider supporting it by joining the group best for you. The&lt;br /&gt;
 list of groups is available on the web at http://tug.org/usergroups.html.&lt;br /&gt;
&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/man to MANPATH.&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/info to INFOPATH.&lt;br /&gt;
 Most importantly, add /opt/texlive/2008/bin/i386-linux&lt;br /&gt;
 to your PATH for current and future sessions.&lt;br /&gt;
&lt;br /&gt;
 Welcome to TeX Live!&lt;br /&gt;
&lt;br /&gt;
/mnt/texlive2008/install-tl: done.&lt;br /&gt;
Logfile: /opt/texlive/2008/install-tl.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;N.B.&#039;&#039;&#039;: if you are not using &#039;&#039;&#039;i386-linux&#039;&#039;&#039;, the value to be added to the &#039;&#039;&#039;PATH&#039;&#039;&#039; variable is different; for example if you are using 64-bit linux, the installation log will report &#039;&#039;&#039;x86_64-linux&#039;&#039;&#039; instead of &#039;&#039;&#039;i386-linux&#039;&#039;&#039;. &lt;br /&gt;
* create a partial copy of the main TL configuration file (we will modify this copy later):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /opt/texlive/2008/texmf/web2c/texmf.cnf | \&lt;br /&gt;
grep &#039;SELFAUTOPARENT\|^TEXMF \|^TEXMFDBS &#039; | \&lt;br /&gt;
grep -v &#039;^%&#039; &amp;gt; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* change some environment variables permanently as instructed by the installation log: add to &#039;&#039;&#039;/etc/profile&#039;&#039;&#039; the following lines (&#039;&#039;&#039;don&#039;t forget to check the value of PATH if you are not using i386-linux&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## added for TeX Live&lt;br /&gt;
TEXMFCNF=/opt/texlive/2008:/opt/texlive/2008/texmf/web2c&lt;br /&gt;
MANPATH=/mnt/texlive2008/texmf/doc/man:$MANPATH&lt;br /&gt;
INFOPATH=/mnt/texlive2008/texmf/doc/info:$INFOPATH&lt;br /&gt;
PATH=/opt/texlive/2008/bin/i386-linux:$PATH&lt;br /&gt;
export TEXMFCNF MANPATH INFOPATH PATH&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* logout and login again to ensure that the above environment variables are set. With &#039;&#039;&#039;bash&#039;&#039;&#039; as the default shell, it can be done by saying:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
exec bash -login&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the installation:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdflatex sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, we should get a log similar to the below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pdflatex sample2e&lt;br /&gt;
This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)&lt;br /&gt;
 %&amp;amp;-line parsing enabled.&lt;br /&gt;
entering extended mode&lt;br /&gt;
(/mnt/texlive2008/texmf-dist/tex/latex/base/sample2e.tex&lt;br /&gt;
LaTeX2e &amp;lt;2005/12/01&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
Output written on sample2e.pdf (3 pages, 69560 bytes).&lt;br /&gt;
Transcript written on sample2e.log.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Keeping packages up-to-date ==&lt;br /&gt;
* Tell TL that we want to update packages from TL site:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr option location http://mirror.ctan.org/systems/texlive/tlnet/2008&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* check which packages can be updated:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --list&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* update one package (rerun without --dry-run when you are sure):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --dry-run &amp;lt;package-name&amp;gt;&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* update all package (rerun without --dry-run when you are sure):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --dry-run --all&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Recommendations for update&#039;&#039;&#039;: &lt;br /&gt;
** don&#039;t update until you know why you have to (don&#039;t touch things that aren&#039;t broken)&lt;br /&gt;
** backup before update, so things can be reverted if needed. See [http://www.tug.org/texlive/doc/tlmgr.html tlmgr manual] for further info on backup/restore. &lt;br /&gt;
** do &#039;&#039;&#039;not&#039;&#039;&#039; update all packages in one go&lt;br /&gt;
&lt;br /&gt;
== Use non-TL binaries with TL data ==&lt;br /&gt;
TL and all kpathsea programs use one or more config files called &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to search for needed data. In previous steps we have already defined an environment variable TEXMFCNF, which in sequence causes that all kpathsea programs will read first the customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;, then the default TL config file &#039;&#039;&#039;/opt/texlive/2008/texmf/web2c/texmf.cnf&#039;&#039;&#039;. The values defined in the first &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will override values in  the later one(s).&lt;br /&gt;
&lt;br /&gt;
It is critical to have TEXMFCNF defined explicitly as above. If TEXMFCNF is not defined, it&#039;s very hard to track down which config file(s) are being read, since there can be several &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; files laying around and which of them are read depends on quite a few factors. By setting TEXMFCNF to a fixed value, we can get rid of this headache and can concentrate on our customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since we have already defined TEXMFCNF in previous step and made a copy of &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039;, now it is simple to make  non-TL binaries work with TL data: we change our &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to get rid of SELFAUTOPARENT as follows: &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sed -i -e &#039;s:.SELFAUTOPARENT:/opt/texlive/2008:&#039; /opt/texlive/2008/texmf.cnf &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add another texmf tree ==&lt;br /&gt;
Suppose we have tetex previously installed to &#039;&#039;&#039;/opt/tetex-3.0&#039;&#039;&#039;. The tetex texmf tree is then located at &#039;&#039;&#039;/opt/tetex-3.0/share/texmf&#039;&#039;&#039;. To add this texmf tree to our setup, we do this:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /opt/tetex-3.0/share/texmf /opt/texlive/texmf-tetex&lt;br /&gt;
sed -i &#039;&lt;br /&gt;
/^TEXMFLOCAL/ a\&lt;br /&gt;
TEXMFTETEX = /opt/texlive/texmf-tetex&lt;br /&gt;
s/^\(TEXMF = .*\)}/\1,$TEXMFTETEX}/&lt;br /&gt;
&#039; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
texhash /opt/texlive/texmf-tetex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can repeat the above steps to add as many texmf trees as we need. For each texmf tree we must:&lt;br /&gt;
* choose a variable name that it&#039;s not used yet (TEXMFTETEX in the above example)&lt;br /&gt;
* locate the path to the texmf tree, and make a symlink in &#039;&#039;&#039;/opt/texlive&#039;&#039;&#039;&lt;br /&gt;
* adjust the above commands accordingly.&lt;br /&gt;
&lt;br /&gt;
Or, it is possible to use [http://download.river-valley.com/add-texmf-tree.sh this script] to automate the above steps. Usage:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh add-texmf-tree.sh TEXMFTETEX /opt/texlive/texmf-tetex /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
The script will do some checking before changing &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to ensure that the parameters are correct. The current &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will be backed up with timestamp appended like e.g. &#039;&#039;&#039;texmf.cnf--2008-10-20.19:43:05&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Use ls-R or not ===&lt;br /&gt;
Each texmf tree can have a file called &#039;&#039;&#039;ls-R&#039;&#039;&#039; at the top level, which can help to speed up searching if the texmf tree is large. But using ls-R is not always the best option, since it requires some extra effort to get it right. If a texmf tree is small and changes often, it&#039;s better not to use ls-R. If a texmf tree is large, then it&#039;s worthwhile to go for the trouble.&lt;br /&gt;
&lt;br /&gt;
To use ls-R with the texmf tree in the previous example, we must:&lt;br /&gt;
* edit texmf.cnf:&lt;br /&gt;
** change &#039;&#039;&#039;$TEXMFTETEX&#039;&#039;&#039; to &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; (only on one line -- the one starting with &#039;&#039;&#039;TEXMF = ...&#039;&#039;&#039;&lt;br /&gt;
** add &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; to TEXMFDBS&lt;br /&gt;
* run &#039;&#039;&#039;texhash /opt/texlive/texmf-tetex&#039;&#039;&#039; to make ls-R in sync with the contents of texmf tree. &lt;br /&gt;
&lt;br /&gt;
Failing to do any of the above steps will cause that some files might not be found as expected, and it&#039;s not always easy to trace down the reason.&lt;br /&gt;
&lt;br /&gt;
=== Change the order of file searching ===&lt;br /&gt;
If we need to change the precedence of a texmf tree, we can edit texmf.cnf and change the variable TEXMF. &lt;br /&gt;
TEXMF specifies which texmf trees are searched, and in which order. The order of the texmf trees given in &#039;&#039;&#039;TEXMF&#039;&#039;&#039; is important: earlier trees take precedence over the later ones in &#039;&#039;&#039;TEXMF&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
=== Some notes on other relevant variables ===&lt;br /&gt;
* &#039;&#039;&#039;TEXMFDBS&#039;&#039;&#039;: contains list of texmf trees with &#039;&#039;&#039;ls-R&#039;&#039;&#039; filename databases. It&#039;s not clear how the presence of ls-R in a texmf tree and the presence of that tree in TEXMF and TEXMFDBS are related. To avoid potential problems, it&#039;s better to stick with either one of the below scenarios:&lt;br /&gt;
** no ls-R, no presence of texmf tree in TEXMFDBS, presence in TEXMF without &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
** ls-R in sync with  contents of texmf tree, presence in TEXMF and TEXMFDBS with &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;SYSTEXMF&#039;&#039;&#039; (not listed above): contains a list of &#039;&#039;system&#039;&#039; texmf trees; its meaning is roughly this: if the source of a font is found in a system texmf tree and that tree is not writable for the current user, then the scripts &#039;&#039;&#039;mktexpk&#039;&#039;&#039;, &#039;&#039;&#039;mktextfm&#039;&#039;&#039;, and &#039;&#039;&#039;mktexmf&#039;&#039;&#039; will install their output into &#039;&#039;&#039;VARTEXFONTS&#039;&#039;&#039;, otherwise the generated fonts (tfm/pk/mf) will be left in the current directory. If we are not using MF fonts, we can safely forget this variable. If we are using MF fonts and want the fonts generated on-the-fly to be placed to proper location, we must add the relevant texmf tree to SYSTEXMF. Usually not needed, since most TeX fonts are available in outline formats and when not, they can be easily converted from MF to Type1 format using &#039;&#039;&#039;textrace&#039;&#039;&#039;. It is best if we can avoid touching this variable.&lt;br /&gt;
&lt;br /&gt;
== Run pdftex compiled from sources ==&lt;br /&gt;
Sometimes it&#039;s desirable to run a different version of pdftex than the one that comes with TL, for example when we want to run pdftex with some features or bugfixes not included in the version in TL. Then we must compile pdftex from sources and do some extra steps.&lt;br /&gt;
* compiling pdftex from sources: download pdftex sources tarball and apply patches if needed. Suppose that we have unpacked pdftex sources to &#039;&#039;&#039;$HOME/src/pdftex-1.40.9&#039;&#039;&#039;, then to build it:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/src/pdftex-1.40.9&lt;br /&gt;
./build.sh&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* when the above process finishes, the pdftex binary should be located at &#039;&#039;&#039;$HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex&#039;&#039;&#039;&lt;br /&gt;
* make symlinks (suppose that &#039;&#039;&#039;$HOME/bin&#039;&#039;&#039; is in &#039;&#039;&#039;$PATH&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdftex2&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdflatex2&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* find out the location of format files:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -d $(dirname $(kpsewhich -engine=pdftex pdflatex.fmt) )&lt;br /&gt;
/opt/texlive/2008/texmf-var/web2c/pdftex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* create formats:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
&lt;br /&gt;
pdftex2 -ini -translate-file=cp227.tcx &#039;*pdfetex.ini&#039;&lt;br /&gt;
mv pdfetex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdftex2.fmt&lt;br /&gt;
&lt;br /&gt;
pdflatex2 -ini -translate-file=cp227.tcx &#039;*pdflatex.ini&#039;&lt;br /&gt;
mv pdflatex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdflatex2.fmt&lt;br /&gt;
&lt;br /&gt;
texhash&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the new binary:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdftex2 story \\bye&lt;br /&gt;
pdflatex2 sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* repeat the above steps for other versions if needed; substitute pdftex2/pdflatex2 with whichever names that suit better your need/taste.&lt;br /&gt;
&lt;br /&gt;
== Maintain packages installed locally ==&lt;br /&gt;
If we keep installing local packages to a texmf tree for some time, we will find out that it&#039;s getting difficult to keep track of what has been installed, and how to remove or upgrade a package. This is the place where a &#039;&#039;package management system&#039;&#039; is useful. We will use miktex tools to maintain our local packages.&lt;br /&gt;
&lt;br /&gt;
===Install miktex tools===&lt;br /&gt;
* download miktex sources from http://miktex.org/SourceCode.aspx&lt;br /&gt;
* unpack the source tarball to $HOME/src/miktex-2.7.3135&lt;br /&gt;
* install all PREREQUISITES listed in ~/src/miktex-2.7.3135/README.unx&lt;br /&gt;
* compile and install:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cmake -G &amp;quot;Unix Makefiles&amp;quot; -DMIKTEX_INSTALLROOT=/opt/texlive/texmf-local -DCMAKE_INSTALL_PREFIX=/opt/miktex-2.7.3135&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, the miktex tools will be installed to /opt/miktex-2.7.3135.&lt;br /&gt;
* &#039;&#039;&#039;TODO&#039;&#039;&#039;: we will make a tarball of pre-compiled miktex tools binaries for i386-linux and x86_64-linux, to save the compilation step for you. Then to install it, one can simply unpack the tarball to &#039;&#039;&#039;/opt&#039;&#039;&#039;.&lt;br /&gt;
* we need to make a wrapper to run miktex tools. Create a file named &#039;&#039;&#039;run-miktex-tools&#039;&#039;&#039; with file mode 755 and with the following contents:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash                        &lt;br /&gt;
export LD_LIBRARY_PATH=/opt/miktex-2.7.3135/lib&lt;br /&gt;
export PATH=/opt/miktex-2.7.3135/bin:$PATH&lt;br /&gt;
  &lt;br /&gt;
opt=&amp;quot;--repository=/opt/miktex-repository/package-repository&amp;quot;&lt;br /&gt;
tool=$1                            &lt;br /&gt;
shift                              &lt;br /&gt;
  &lt;br /&gt;
ExecCmd() {&lt;br /&gt;
    echo &amp;quot;$@&amp;quot;                      &lt;br /&gt;
    &amp;quot;$@&amp;quot;                           &lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
case &amp;quot;$tool&amp;quot; in                    &lt;br /&gt;
mpm|mpc)&lt;br /&gt;
    ExecCmd $tool $opt &amp;quot;$@&amp;quot;        &lt;br /&gt;
    ;;&lt;br /&gt;
*)&lt;br /&gt;
    ExecCmd $tool &amp;quot;$@&amp;quot;             &lt;br /&gt;
    ;;                             &lt;br /&gt;
esac                               &lt;br /&gt;
exit                               &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test if it works -- we should get help messages on mpm usage from the below command:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
run-miktex-tools mpm --help&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* up to this point, miktex tools are setup so that it will look for available packages at &#039;&#039;&#039;/opt/miktex-repository/package-repository&#039;&#039;&#039; and install requested packages to &#039;&#039;&#039;/opt/texlive/texmf-local&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Set up miktex repository===&lt;br /&gt;
Before we can use miktex tools to install any packages, we must set up the local package repository.&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p  /opt/miktex-repository/package-repository&lt;br /&gt;
cd /opt/miktex-repository/package-repository&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb1-2.7.tar.lzma&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb2-2.7.tar.lzma&lt;br /&gt;
run-miktex-tools mpm --update-db&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create a package for use with miktex tools===&lt;br /&gt;
Suppose we have a texmf tree and we want to create a package from that texmf tree.&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;to be continued&#039;&#039;)&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=218</id>
		<title>Notes on TeX Live setup</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_TeX_Live_setup&amp;diff=218"/>
		<updated>2009-02-04T09:42:03Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Run pdftex compiled from sources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes steps to install [http://tug.org/texlive TeX Live] (TL from now) and needed tweaks so that other kpathsea programs that are not part of TL can also use TL data. This is useful if we recompile some program from sources and want it to be able to find TL data. For example, one might want to recompile pdftex with some patch, and use it instead of the binary coming with TL.&lt;br /&gt;
&lt;br /&gt;
This guide was written for TL2008 on Ubuntu linux 8.01 and should work with no or little change for other Linux/UNIX systems. &lt;br /&gt;
&lt;br /&gt;
When in doubt, please refer to the [http://www.tug.org/texlive/doc/texlive-en/texlive-en.html official TeX Live documentation]. This guide serves as a quick guide for some very specific purposes:&lt;br /&gt;
* how to install TL with minimal effort and confusion&lt;br /&gt;
* how to use TL data with non-TL binaries&lt;br /&gt;
* how to use different versions of pdftex&lt;br /&gt;
* how to add local packages in a systematic way&lt;br /&gt;
&lt;br /&gt;
== Install TL ==&lt;br /&gt;
* start with a shell where no tex-related environment variables are defined. A quick check can be done by &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
printenv | fgrep TEX&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* download [http://mirror.ctan.org/systems/texlive/Images/texlive2008.iso.lzma latest TL iso image] to e.g. &#039;&#039;&#039;$HOME/iso-images&#039;&#039;&#039; &lt;br /&gt;
* unpack the image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/iso-images&lt;br /&gt;
unlzma texlive2008.iso.lzma&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* mount the TL image:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /mnt/texlive2008&lt;br /&gt;
mount -t iso 9660 -o loop $HOME/iso-images/texlive2008.iso /mnt/texlive2008/&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* run the TL installer:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
perl /mnt/texlive2008/install-tl&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* in next menu, change the destination of installation to &#039;&#039;&#039;/opt/texlive/2008&#039;&#039;&#039; by entering:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d&amp;lt;Enter&amp;gt;&lt;br /&gt;
1&amp;lt;Enter&amp;gt;&lt;br /&gt;
/opt/texlive/2008&amp;lt;Enter&amp;gt;&lt;br /&gt;
r&amp;lt;Enter&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* start the installation process by entering &#039;&#039;&#039;i&amp;lt;Enter&amp;gt;&#039;&#039;&#039;. When the installation process is done, the last messages should look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 pre-generating all format files (fmtutil-sys --all), be patient...done&lt;br /&gt;
&lt;br /&gt;
 See &lt;br /&gt;
   /opt/texlive/2008/index.html &lt;br /&gt;
 for links to documentation.  The TeX Live web site (http://tug.org/texlive/) &lt;br /&gt;
 contains any updates and corrections.&lt;br /&gt;
&lt;br /&gt;
 TeX Live is a joint project of the TeX user groups around the world;&lt;br /&gt;
 please consider supporting it by joining the group best for you. The&lt;br /&gt;
 list of groups is available on the web at http://tug.org/usergroups.html.&lt;br /&gt;
&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/man to MANPATH.&lt;br /&gt;
 Add /opt/texlive/2008/texmf/doc/info to INFOPATH.&lt;br /&gt;
 Most importantly, add /opt/texlive/2008/bin/i386-linux&lt;br /&gt;
 to your PATH for current and future sessions.&lt;br /&gt;
&lt;br /&gt;
 Welcome to TeX Live!&lt;br /&gt;
&lt;br /&gt;
/mnt/texlive2008/install-tl: done.&lt;br /&gt;
Logfile: /opt/texlive/2008/install-tl.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;N.B.&#039;&#039;&#039;: if you are not using &#039;&#039;&#039;i386-linux&#039;&#039;&#039;, the value to be added to the &#039;&#039;&#039;PATH&#039;&#039;&#039; variable is different; for example if you are using 64-bit linux, the installation log will report &#039;&#039;&#039;x86_64-linux&#039;&#039;&#039; instead of &#039;&#039;&#039;i386-linux&#039;&#039;&#039;. &lt;br /&gt;
* create a partial copy of the main TL configuration file (we will modify this copy later):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /opt/texlive/2008/texmf/web2c/texmf.cnf | \&lt;br /&gt;
grep &#039;SELFAUTOPARENT\|^TEXMF \|^TEXMFDBS &#039; | \&lt;br /&gt;
grep -v &#039;^%&#039; &amp;gt; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* change some environment variables permanently as instructed by the installation log: add to &#039;&#039;&#039;/etc/profile&#039;&#039;&#039; the following lines (&#039;&#039;&#039;don&#039;t forget to check the value of PATH if you are not using i386-linux&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## added for TeX Live&lt;br /&gt;
TEXMFCNF=/opt/texlive/2008:/opt/texlive/2008/texmf/web2c&lt;br /&gt;
MANPATH=/mnt/texlive2008/texmf/doc/man:$MANPATH&lt;br /&gt;
INFOPATH=/mnt/texlive2008/texmf/doc/info:$INFOPATH&lt;br /&gt;
PATH=/opt/texlive/2008/bin/i386-linux:$PATH&lt;br /&gt;
export TEXMFCNF MANPATH INFOPATH PATH&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* logout and login again to ensure that the above environment variables are set. With &#039;&#039;&#039;bash&#039;&#039;&#039; as the default shell, it can be done by saying:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
exec bash -login&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the installation:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdflatex sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, we should get a log similar to the below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pdflatex sample2e&lt;br /&gt;
This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)&lt;br /&gt;
 %&amp;amp;-line parsing enabled.&lt;br /&gt;
entering extended mode&lt;br /&gt;
(/mnt/texlive2008/texmf-dist/tex/latex/base/sample2e.tex&lt;br /&gt;
LaTeX2e &amp;lt;2005/12/01&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
Output written on sample2e.pdf (3 pages, 69560 bytes).&lt;br /&gt;
Transcript written on sample2e.log.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Keeping packages up-to-date ==&lt;br /&gt;
* Tell TL that we want to update packages from TL site:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr option location http://mirror.ctan.org/systems/texlive/tlnet/2008&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* check which packages can be updated:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --list&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* update one package (rerun without --dry-run when you are sure):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --dry-run &amp;lt;package-name&amp;gt;&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* update all package (rerun without --dry-run when you are sure):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tlmgr update --dry-run --all&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Recommendations for update&#039;&#039;&#039;: &lt;br /&gt;
** don&#039;t update until you know why you have to (don&#039;t touch things that aren&#039;t broken)&lt;br /&gt;
** backup before update, so things can be reverted if needed. See [http://www.tug.org/texlive/doc/tlmgr.html tlmgr manual] for further info on backup/restore. &lt;br /&gt;
** do &#039;&#039;&#039;not&#039;&#039;&#039; update all packages in one go&lt;br /&gt;
&lt;br /&gt;
== Use non-TL binaries with TL data ==&lt;br /&gt;
TL and all kpathsea programs use one or more config files called &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to search for needed data. In previous steps we have already defined an environment variable TEXMFCNF, which in sequence causes that all kpathsea programs will read first the customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;, then the default TL config file &#039;&#039;&#039;/opt/texlive/2008/texmf/web2c/texmf.cnf&#039;&#039;&#039;. The values defined in the first &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will override values in  the later one(s).&lt;br /&gt;
&lt;br /&gt;
It is critical to have TEXMFCNF defined explicitly as above. If TEXMFCNF is not defined, it&#039;s very hard to track down which config file(s) are being read, since there can be several &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; files laying around and which of them are read depends on quite a few factors. By setting TEXMFCNF to a fixed value, we can get rid of this headache and can concentrate on our customized config file &#039;&#039;&#039;/opt/texlive/2008/texmf.cnf&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since we have already defined TEXMFCNF in previous step and made a copy of &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039;, now it is simple to make  non-TL binaries work with TL data: we change our &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to get rid of SELFAUTOPARENT as follows: &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sed -i -e &#039;s:.SELFAUTOPARENT:/opt/texlive/2008:&#039; /opt/texlive/2008/texmf.cnf &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add another texmf tree ==&lt;br /&gt;
Suppose we have tetex previously installed to &#039;&#039;&#039;/opt/tetex-3.0&#039;&#039;&#039;. The tetex texmf tree is then located at &#039;&#039;&#039;/opt/tetex-3.0/share/texmf&#039;&#039;&#039;. To add this texmf tree to our setup, we do this:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /opt/tetex-3.0/share/texmf /opt/texlive/texmf-tetex&lt;br /&gt;
sed -i &#039;&lt;br /&gt;
/^TEXMFLOCAL/ a\&lt;br /&gt;
TEXMFTETEX = /opt/texlive/texmf-tetex&lt;br /&gt;
s/^\(TEXMF = .*\)}/\1,$TEXMFTETEX}/&lt;br /&gt;
&#039; /opt/texlive/2008/texmf.cnf&lt;br /&gt;
texhash /opt/texlive/texmf-tetex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can repeat the above steps to add as many texmf trees as we need. For each texmf tree we must:&lt;br /&gt;
* choose a variable name that it&#039;s not used yet (TEXMFTETEX in the above example)&lt;br /&gt;
* locate the path to the texmf tree, and make a symlink in &#039;&#039;&#039;/opt/texlive&#039;&#039;&#039;&lt;br /&gt;
* adjust the above commands accordingly.&lt;br /&gt;
&lt;br /&gt;
Or, it is possible to use [http://download.river-valley.com/add-texmf-tree.sh this script] to automate the above steps. Usage:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh add-texmf-tree.sh TEXMFTETEX /opt/texlive/texmf-tetex /opt/texlive/2008/texmf.cnf&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
The script will do some checking before changing &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; to ensure that the parameters are correct. The current &#039;&#039;&#039;texmf.cnf&#039;&#039;&#039; will be backed up with timestamp appended like e.g. &#039;&#039;&#039;texmf.cnf--2008-10-20.19:43:05&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Use ls-R or not ===&lt;br /&gt;
Each texmf tree can have a file called &#039;&#039;&#039;ls-R&#039;&#039;&#039; at the top level, which can help to speed up searching if the texmf tree is large. But using ls-R is not always the best option, since it requires some extra effort to get it right. If a texmf tree is small and changes often, it&#039;s better not to use ls-R. If a texmf tree is large, then it&#039;s worthwhile to go for the trouble.&lt;br /&gt;
&lt;br /&gt;
To use ls-R with the texmf tree in the previous example, we must:&lt;br /&gt;
* edit texmf.cnf:&lt;br /&gt;
** change &#039;&#039;&#039;$TEXMFTETEX&#039;&#039;&#039; to &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; (only on one line -- the one starting with &#039;&#039;&#039;TEXMF = ...&#039;&#039;&#039;&lt;br /&gt;
** add &#039;&#039;&#039;!!$TEXMFTETEX&#039;&#039;&#039; to TEXMFDBS&lt;br /&gt;
* run &#039;&#039;&#039;texhash /opt/texlive/texmf-tetex&#039;&#039;&#039; to make ls-R in sync with the contents of texmf tree. &lt;br /&gt;
&lt;br /&gt;
Failing to do any of the above steps will cause that some files might not be found as expected, and it&#039;s not always easy to trace down the reason.&lt;br /&gt;
&lt;br /&gt;
=== Change the order of file searching ===&lt;br /&gt;
If we need to change the precedence of a texmf tree, we can edit texmf.cnf and change the variable TEXMF. &lt;br /&gt;
TEXMF specifies which texmf trees are searched, and in which order. The order of the texmf trees given in &#039;&#039;&#039;TEXMF&#039;&#039;&#039; is important: earlier trees take precedence over the later ones in &#039;&#039;&#039;TEXMF&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
=== Some notes on other relevant variables ===&lt;br /&gt;
* &#039;&#039;&#039;TEXMFDBS&#039;&#039;&#039;: contains list of texmf trees with &#039;&#039;&#039;ls-R&#039;&#039;&#039; filename databases. It&#039;s not clear how the presence of ls-R in a texmf tree and the presence of that tree in TEXMF and TEXMFDBS are related. To avoid potential problems, it&#039;s better to stick with either one of the below scenarios:&lt;br /&gt;
** no ls-R, no presence of texmf tree in TEXMFDBS, presence in TEXMF without &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
** ls-R in sync with  contents of texmf tree, presence in TEXMF and TEXMFDBS with &#039;&#039;&#039;!!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;SYSTEXMF&#039;&#039;&#039; (not listed above): contains a list of &#039;&#039;system&#039;&#039; texmf trees; its meaning is roughly this: if the source of a font is found in a system texmf tree and that tree is not writable for the current user, then the scripts &#039;&#039;&#039;mktexpk&#039;&#039;&#039;, &#039;&#039;&#039;mktextfm&#039;&#039;&#039;, and &#039;&#039;&#039;mktexmf&#039;&#039;&#039; will install their output into &#039;&#039;&#039;VARTEXFONTS&#039;&#039;&#039;, otherwise the generated fonts (tfm/pk/mf) will be left in the current directory. If we are not using MF fonts, we can safely forget this variable. If we are using MF fonts and want the fonts generated on-the-fly to be placed to proper location, we must add the relevant texmf tree to SYSTEXMF. Usually not needed, since most TeX fonts are available in outline formats and when not, they can be easily converted from MF to Type1 format using &#039;&#039;&#039;textrace&#039;&#039;&#039;. It is best if we can avoid touching this variable.&lt;br /&gt;
&lt;br /&gt;
== Run pdftex compiled from sources ==&lt;br /&gt;
Sometimes it&#039;s desirable to run a different version of pdftex than the one that comes with TL, for example when we want to run pdftex with some features or bugfixes not included in the version in TL. Then we must compile pdftex from sources and do some extra steps.&lt;br /&gt;
* compiling pdftex from sources: download pdftex sources tarball and apply patches if needed. Suppose that we have unpacked pdftex sources to &#039;&#039;&#039;$HOME/src/pdftex-1.40.9&#039;&#039;&#039;, then to build it:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME/src/pdftex-1.40.9&lt;br /&gt;
./build.sh&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* when the above process finishes, the pdftex binary should be located at &#039;&#039;&#039;$HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex&#039;&#039;&#039;&lt;br /&gt;
* make symlinks (suppose that &#039;&#039;&#039;$HOME/bin&#039;&#039;&#039; is in &#039;&#039;&#039;$PATH&#039;&#039;&#039;):&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdftex2&lt;br /&gt;
ln -s $HOME/src/pdftex-1.40.9/build/texk/web2c/pdftex $HOME/bin/pdflatex2&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* find out the location of format files:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -d $(dirname $(kpsewhich -engine=pdftex pdflatex.fmt) )&lt;br /&gt;
/opt/texlive/2008/texmf-var/web2c/pdftex&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* create formats:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
&lt;br /&gt;
pdftex2 -ini -translate-file=cp227.tcx &#039;*pdfetex.ini&#039;&lt;br /&gt;
mv pdfetex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdftex2.fmt&lt;br /&gt;
&lt;br /&gt;
pdflatex2 -ini -translate-file=cp227.tcx &#039;*pdflatex.ini&#039;&lt;br /&gt;
mv pdflatex.fmt /opt/texlive/2008/texmf-var/web2c/pdftex/pdflatex2.fmt&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test the new binary:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pdftex2 story \\bye&lt;br /&gt;
pdflatex2 sample2e&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* repeat the above steps for other versions if needed; substitute pdftex2/pdflatex2 with whichever names that suit better your need/taste.&lt;br /&gt;
&lt;br /&gt;
== Maintain packages installed locally ==&lt;br /&gt;
If we keep installing local packages to a texmf tree for some time, we will find out that it&#039;s getting difficult to keep track of what has been installed, and how to remove or upgrade a package. This is the place where a &#039;&#039;package management system&#039;&#039; is useful. We will use miktex tools to maintain our local packages.&lt;br /&gt;
&lt;br /&gt;
===Install miktex tools===&lt;br /&gt;
* download miktex sources from http://miktex.org/SourceCode.aspx&lt;br /&gt;
* unpack the source tarball to $HOME/src/miktex-2.7.3135&lt;br /&gt;
* install all PREREQUISITES listed in ~/src/miktex-2.7.3135/README.unx&lt;br /&gt;
* compile and install:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cmake -G &amp;quot;Unix Makefiles&amp;quot; -DMIKTEX_INSTALLROOT=/opt/texlive/texmf-local -DCMAKE_INSTALL_PREFIX=/opt/miktex-2.7.3135&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* if things go well, the miktex tools will be installed to /opt/miktex-2.7.3135.&lt;br /&gt;
* &#039;&#039;&#039;TODO&#039;&#039;&#039;: we will make a tarball of pre-compiled miktex tools binaries for i386-linux and x86_64-linux, to save the compilation step for you. Then to install it, one can simply unpack the tarball to &#039;&#039;&#039;/opt&#039;&#039;&#039;.&lt;br /&gt;
* we need to make a wrapper to run miktex tools. Create a file named &#039;&#039;&#039;run-miktex-tools&#039;&#039;&#039; with file mode 755 and with the following contents:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash                        &lt;br /&gt;
export LD_LIBRARY_PATH=/opt/miktex-2.7.3135/lib&lt;br /&gt;
export PATH=/opt/miktex-2.7.3135/bin:$PATH&lt;br /&gt;
  &lt;br /&gt;
opt=&amp;quot;--repository=/opt/miktex-repository/package-repository&amp;quot;&lt;br /&gt;
tool=$1                            &lt;br /&gt;
shift                              &lt;br /&gt;
  &lt;br /&gt;
ExecCmd() {&lt;br /&gt;
    echo &amp;quot;$@&amp;quot;                      &lt;br /&gt;
    &amp;quot;$@&amp;quot;                           &lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
case &amp;quot;$tool&amp;quot; in                    &lt;br /&gt;
mpm|mpc)&lt;br /&gt;
    ExecCmd $tool $opt &amp;quot;$@&amp;quot;        &lt;br /&gt;
    ;;&lt;br /&gt;
*)&lt;br /&gt;
    ExecCmd $tool &amp;quot;$@&amp;quot;             &lt;br /&gt;
    ;;                             &lt;br /&gt;
esac                               &lt;br /&gt;
exit                               &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* test if it works -- we should get help messages on mpm usage from the below command:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
run-miktex-tools mpm --help&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* up to this point, miktex tools are setup so that it will look for available packages at &#039;&#039;&#039;/opt/miktex-repository/package-repository&#039;&#039;&#039; and install requested packages to &#039;&#039;&#039;/opt/texlive/texmf-local&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Set up miktex repository===&lt;br /&gt;
Before we can use miktex tools to install any packages, we must set up the local package repository.&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p  /opt/miktex-repository/package-repository&lt;br /&gt;
cd /opt/miktex-repository/package-repository&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb1-2.7.tar.lzma&lt;br /&gt;
wget http://www.ctan.org/tex-archive/systems/win32/miktex/tm/packages/miktex-zzdb2-2.7.tar.lzma&lt;br /&gt;
run-miktex-tools mpm --update-db&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create a package for use with miktex tools===&lt;br /&gt;
Suppose we have a texmf tree and we want to create a package from that texmf tree.&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;to be continued&#039;&#039;)&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=217</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=217"/>
		<updated>2009-01-31T11:13:15Z</updated>

		<summary type="html">&lt;p&gt;Thanh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). It&#039;s fairly easy and safe to change the partition table (including grow/shrink partitions) this way if we follow strictly this practice: whenever we change the partition table with GParted, always use rEFIT to sync MBR table from GPT. &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|10G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose. For example, when I upgrade Ubuntu, I don&#039;t touch Linux1 partition but install a new version to Linux2 partition. When I am happy with the new version, I switch to Linux2 as the primary system, keep the previous version for a while (just in case I need something from that system). When I need to install another system, it will go to Linux1 partition again.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|30G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so I put it here before the NTFS share partition, so that if needed I can shrink the NTFS share partition and expand the /home partition without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
* create needed partitions:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
|remove windows partition&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|create grub partition&lt;br /&gt;
|ext2&lt;br /&gt;
|200M&lt;br /&gt;
|-&lt;br /&gt;
|create Windows partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|20G&lt;br /&gt;
|-&lt;br /&gt;
|create swap partition&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux1 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create Linux2 partition&lt;br /&gt;
|ext3&lt;br /&gt;
|8G&lt;br /&gt;
|-&lt;br /&gt;
|create /home partition&lt;br /&gt;
|jfs&lt;br /&gt;
|40G&lt;br /&gt;
|-&lt;br /&gt;
|create share partition&lt;br /&gt;
|ntfs&lt;br /&gt;
|remaining size&lt;br /&gt;
|}&lt;br /&gt;
* make sure the Windows partition has boot flag&lt;br /&gt;
* reboot, use rEFIT to sync MBR partition table&lt;br /&gt;
* reboot from windows CD, install windows&lt;br /&gt;
* reboot from Ubuntu CD, install Ubuntu&lt;br /&gt;
** choose manual partitioning, select root and swap partition&lt;br /&gt;
** don&#039;t install grub to MBR, but to grub partition (/dev/sda3, 200M)&lt;br /&gt;
==Pending issues with Linux==&lt;br /&gt;
* rebooting doesn&#039;t work; must hold the power button to turn it off&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=216</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=216"/>
		<updated>2009-01-31T10:53:23Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Partitioning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* don&#039;t try to make the partition table perfect from the beginning. Instead, start with minimal number of partitions, and add them as needed when we install new OS.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|10G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose. For example, when I upgrade Ubuntu, I don&#039;t touch Linux1 partition but install a new version to Linux2 partition. When I am happy with the new version, I switch to Linux2 as the primary system, keep the previous version for a while (just in case I need something from that system). When I need to install another system, it will go to Linux1 partition again.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|30G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so I put it here before the NTFS share partition, so that if needed I can shrink the NTFS share partition and expand the /home partition without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;br /&gt;
==Installation steps==&lt;br /&gt;
* start MacOSX, download and install rEFIT from http://refit.sourceforge.net/&lt;br /&gt;
* use BootCamp to resize MacOSX partition to 40G. Don&#039;t worry about the windows partition size, we will delete it later&lt;br /&gt;
* boot MBP with GParted Live CD (version 0.3.7-7 works ok, version 0.4.1-2 has problem with screen resolution which must be fixed by manual configuration: resolution 1024x768, driver VESA)&lt;br /&gt;
** remove windows partition&lt;br /&gt;
** create grub partition (ext2, 200M)&lt;br /&gt;
** create Windows partition (ntfs, 20G)&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=215</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=215"/>
		<updated>2009-01-31T10:40:24Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Multiple boot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* don&#039;t try to make the partition table perfect from the beginning. Instead, start with minimal number of partitions, and add them as needed when we install new OS.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows. If Windows partition is not in this position, installation goes ok but then it cannot boot (mystery error with missing &#039;&#039;&#039;hal.dll&#039;&#039;&#039;)&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;5&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|10G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose. For example, when I upgrade Ubuntu, I don&#039;t touch Linux1 partition but install a new version to Linux2 partition. When I am happy with the new version, I switch to Linux2 as the primary system, keep the previous version for a while (just in case I need something from that system). When I need to install another system, it will go to Linux1 partition again.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|30G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so I put it here before the NTFS share partition, so that if needed I can shrink the NTFS share partition and expand the /home partition without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=214</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=214"/>
		<updated>2009-01-31T10:38:36Z</updated>

		<summary type="html">&lt;p&gt;Thanh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 usable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this article]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* don&#039;t try to make the partition table perfect from the beginning. Instead, start with minimal number of partitions, and add them as needed when we install new OS.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partition to install grub&lt;br /&gt;
** Windows&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;5&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|10G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose. For example, when I upgrade Ubuntu, I don&#039;t touch Linux1 partition but install a new version to Linux2 partition. When I am happy with the new version, I switch to Linux2 as the primary system, keep the previous version for a while (just in case I need something from that system). When I need to install another system, it will go to Linux1 partition again.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|30G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so I put it here before the NTFS share partition, so that if needed I can shrink the NTFS share partition and expand the /home partition without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NTFS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, iso images, downloaded programs, etc. Ironically, we cannot access this partition from WinXP, since Windows uses MBR partition table and hence cannot see this share partition. But it&#039;s still the best choice for sharing data between MacOSX and Linux.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=213</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=213"/>
		<updated>2009-01-31T09:40:00Z</updated>

		<summary type="html">&lt;p&gt;Thanh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Multiple boot==&lt;br /&gt;
It is possible to have on MPB MacOSX, Windows and a few linux distros. Also, it is not true that when we use Linux/Windows on MBP, we are limited to 3 useable partitions, as often stated in many guides about dual or triple boot on Mac. I don&#039;t use MacOSX and Windows very often, but I find it useful to have them installed, they can be very handy to run some applications (Google Sketchup or 12VoIP are good examples). &lt;br /&gt;
&lt;br /&gt;
After many trials and errors, and spending quite some time googling, I found&lt;br /&gt;
[http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ this arcicle]. I find it important to know these points:&lt;br /&gt;
* [http://refit.sourceforge.net/myths/ Myths and Facts About Intel Macs]&lt;br /&gt;
* hybrid partition table MBR/GPT and BIOS is required to boot Windows, and also Linux if we want graphics acceleration. The best tool to deal with hybrid partition table MBR/GPT is rEFIT.&lt;br /&gt;
* don&#039;t try to make the partition table perfect from the beginning. Instead, start with minimal number of partitions, and add them as needed when we install new OS.&lt;br /&gt;
* to change the partition table, use GParted Live CD to boot MBP and make desired changes, then use refit to sync the MBR partition table. It&#039;s OK that after syncing, the MBR partition table looks different from the GPT table. MBR partition table is needed to boot MBP in BIOS mode and is used by Windows. Linux &amp;amp; MacOSX don&#039;t look at MBR partition table (they use the GPT one). &lt;br /&gt;
* the order how the OSes are installed is critical:&lt;br /&gt;
** MacOSX&lt;br /&gt;
** a small ext2/ext3 partitition to install grub&lt;br /&gt;
** Windows&lt;br /&gt;
** linux partitions; can be as many as we wish&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on my partitioning scheme:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;5&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I don&#039;t use MacOSX very often, so I don&#039;t need too much disk space for it. It&#039;s good to keep the MacOSX partition not too big so that I can backup the whole partitition to an external USB disk (mine is 30G). MacOSX can access NTFS, so non-system data (like audio, movies, etc.) can be put on another NTFS partitition.&lt;br /&gt;
|-&lt;br /&gt;
|Grub&lt;br /&gt;
|&lt;br /&gt;
|200MB&lt;br /&gt;
|ext2&lt;br /&gt;
|Grub must be installed to this partition (right after the MacOSX partition) so that rEFIT can chainload it. Then we boot linux from grub just like on PC.&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|10G&lt;br /&gt;
|NTFS&lt;br /&gt;
|I use WinXP from time to time to run or test software that don&#039;t run on other OSes.&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|Linux1&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|primary linux system, at the moment Ubuntu-8.10&lt;br /&gt;
|-&lt;br /&gt;
|Linux2&lt;br /&gt;
|4G&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing linux system. It&#039;s handy to have an extra partition to install another linux system for testing purpose. For example, when I upgrade Ubuntu, I don&#039;t touch Linux1 partition but install a new version to Linux2 partition. When I am happy with the new version, I switch to Linux2 as the primary system, keep the previous version for a while (just in case I need something from that system). When I need to install another system, it will go to Linux1 partition again.&lt;br /&gt;
|-&lt;br /&gt;
|/home&lt;br /&gt;
|30G&lt;br /&gt;
|grow as needed&lt;br /&gt;
|jfs&lt;br /&gt;
|/home partition that is shared between linux systems. jfs cannot shrink so I put it here before the NTFS share partition, so that if needed I can shrink the NTFS share partition and expand the /home partition without problem.&lt;br /&gt;
|-&lt;br /&gt;
|share&lt;br /&gt;
|10G&lt;br /&gt;
|grow/shrink as needed&lt;br /&gt;
|NTFS&lt;br /&gt;
|NFTS can be accessed from Windows, MacOSX and Linux so it&#039;s a good choice for data that are likely to be shared between systems, like photos, audio, video, cd images, downloaded programs, etc.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=212</id>
		<title>Notes on MacBook Pro Unibody</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Notes_on_MacBook_Pro_Unibody&amp;diff=212"/>
		<updated>2009-01-30T15:17:43Z</updated>

		<summary type="html">&lt;p&gt;Thanh: New page: Let&amp;#039;s put all our notes on MacBookPro here so we can share them.  ==Partitioning== MBP comes with preinstalled OSX on the whole disk. I made some notes on partitioning: {| border=&amp;quot;1&amp;quot; cellp...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Let&#039;s put all our notes on MacBookPro here so we can share them.&lt;br /&gt;
&lt;br /&gt;
==Partitioning==&lt;br /&gt;
MBP comes with preinstalled OSX on the whole disk. I made some notes on partitioning:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;5&amp;quot;&lt;br /&gt;
!Partition&lt;br /&gt;
!Minimal size&lt;br /&gt;
!Recommended size&lt;br /&gt;
!File system&lt;br /&gt;
!Notes&lt;br /&gt;
|&lt;br /&gt;
|Leopard&lt;br /&gt;
|9G&lt;br /&gt;
|30-40G&lt;br /&gt;
|HFS+&lt;br /&gt;
|I have an external USB disk 30GB, which is used to backup OSX&lt;br /&gt;
|-&lt;br /&gt;
|swap&lt;br /&gt;
|4G&lt;br /&gt;
|4G&lt;br /&gt;
|swap&lt;br /&gt;
|swap is used for linux, and must be as large as RAM amount for use with suspend&lt;br /&gt;
|-&lt;br /&gt;
|WinXP&lt;br /&gt;
|2G&lt;br /&gt;
|10G&lt;br /&gt;
|NTFS&lt;br /&gt;
|Useful to test software&lt;br /&gt;
|-&lt;br /&gt;
|WinVista&lt;br /&gt;
|10G&lt;br /&gt;
|20G&lt;br /&gt;
|NTFS&lt;br /&gt;
|Useful to test software&lt;br /&gt;
|-&lt;br /&gt;
|Ubuntu 8.10&lt;br /&gt;
|&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|-&lt;br /&gt;
|Ubuntu 9.04&lt;br /&gt;
|&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|testing&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|8G&lt;br /&gt;
|ext3&lt;br /&gt;
|/home&lt;br /&gt;
|&lt;br /&gt;
|jfs&lt;br /&gt;
|cannot shrink&lt;br /&gt;
|share&lt;br /&gt;
|NTFS&lt;br /&gt;
|}&lt;br /&gt;
==Multiple booting==&lt;br /&gt;
Booting multiple system on Mac can be tricky. The easiest way seems to use refit.&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Main_Page&amp;diff=211</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Main_Page&amp;diff=211"/>
		<updated>2009-01-30T14:38:45Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Support at River Valley */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;MediaWiki has been successfully installed.&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consult the [http://meta.wikimedia.org/wiki/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [http://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Support at River Valley==&lt;br /&gt;
&lt;br /&gt;
This is the main support page of [http://www.river-valley.com River Valley Technologies].  Currently we have started adding support documentation for the following:&lt;br /&gt;
&lt;br /&gt;
*[[Elsarticle.cls|Author support for &amp;lt;code&amp;gt;elsarticle.cls&amp;lt;/code&amp;gt;]]&lt;br /&gt;
*[[adnd.sty|Author support for &amp;lt;code&amp;gt;adnd.sty&amp;lt;/code&amp;gt;, auxiliary package for Journal of Atomic and Nuclear Data Tables]]&lt;br /&gt;
&lt;br /&gt;
None of the above are completed yet, but will hopefully be finished before long. A frequently asked questions (FAQ) is on the cards which will be based on the queries posted by authors to the support network.  Both the above documentation should be of assistance to authors since these are always available online.  Another point is that since it is in a Wiki, updating takes only minimal effort, meaning, this documentation will receive constant updates.&lt;br /&gt;
&lt;br /&gt;
* [[PDF annotators|Open Source tools to annotate PDFs]]&lt;br /&gt;
* [[Notes on TeX Live setup]]&lt;br /&gt;
* [[Notes on MacBook Pro Unibody]]&lt;br /&gt;
* [[Generating PDF/A compliant PDFs from pdftex]]&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=210</id>
		<title>Generating PDF/A compliant PDFs from pdftex</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=210"/>
		<updated>2008-12-02T09:04:01Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Annotation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes necessary steps to create PDF/A compliant PDFs from pdftex and related issues. When we compile a latex document with pdftex, there can be a few issues that can prevents the result from begin pdf/a compliant, such as:&lt;br /&gt;
* problems with fonts:&lt;br /&gt;
** font files are not embedded,&lt;br /&gt;
** mismatch of character widths,&lt;br /&gt;
** characters of zero widths,&lt;br /&gt;
** fonts don&#039;t have a ToUnicode mapping&lt;br /&gt;
* problems with metadata:&lt;br /&gt;
** XMP data not included,&lt;br /&gt;
** XMP data don&#039;t match the info in pdfInfo catalog.&lt;br /&gt;
* problem with interword spacing: pdftex don&#039;t use space to separate words in pdf output.&lt;br /&gt;
* problem with color data.&lt;br /&gt;
&lt;br /&gt;
The usual way to verify if a pdf file is pdf/a compliant is to use a validating tool. There are a few pdf/a checking tools; the most common one is the Preflight tool in Acrobat Professional version 8 or newer. Beware that these checking tools can give very different the result on pdf/a compliance of a given pdf: a pdf file that passes pdf/a compliance checking in acrobat 8 can still fail to pass a check by another tool. In this document, we assume the following:&lt;br /&gt;
* input are latex documents&lt;br /&gt;
* tex live 2008 (which includes pdftex version 1.40.9) is used for latexing&lt;br /&gt;
* Acrobat 8.0 for pdf/a validation&lt;br /&gt;
&lt;br /&gt;
We start by a minimal example, and then move to more complex ones, to illustrate the issues one may encounter when trying to achieve pdf/a compliance.All needed input files for the examples described in this wiki page are included in [[Media:pdfa-supp.zip|this zip]]&lt;br /&gt;
&lt;br /&gt;
==A minimal example==&lt;br /&gt;
Let&#039;s have a minimal document &#039;&#039;&#039;hello.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we compile it with pdflatex and check for pdf/a compliance, we will get a report like this:[[Image:Hello-report.png|Report of checking hello.pdf]]&lt;br /&gt;
&lt;br /&gt;
So it looks like our pdf is missing metadata. To fix this, we make a copy of &#039;&#039;&#039;hello.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
&lt;br /&gt;
%****************&lt;br /&gt;
% define medatata&lt;br /&gt;
%________________&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Some Name}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*********&lt;br /&gt;
% XMP data&lt;br /&gt;
%_________&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some notes on the example:&lt;br /&gt;
* it uses the latex package &#039;&#039;xmpincl&#039;&#039; to include XMP data to the pdf;&lt;br /&gt;
* it assumes there is a file &#039;&#039;&#039;pdfa-1b.xmp&#039;&#039;&#039; in the current directory.&lt;br /&gt;
&lt;br /&gt;
When we check the pdf result using acrobat 8, we got this report:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1b-report.png|Report of checking hello-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
With a little more effort, we can make our example to pass pdf/a-1a checking:&lt;br /&gt;
* use pdftex with a patch available at http://sarovar.org/tracker/index.php?func=detail&amp;amp;aid=945&amp;amp;group_id=106&amp;amp;atid=495&lt;br /&gt;
* make a copy of &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1a.tex&#039;&#039;&#039; and make the following change:&lt;br /&gt;
** replace &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
** add the following code:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
\pdfgeninterwordspace=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the file with patched pdftex, and we should get this report from checking:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1a-report.png|Report of checking hello-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
==Another trivial example==&lt;br /&gt;
Let&#039;s apply what we did above for another example: &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; which is part of standard latex distribution. &lt;br /&gt;
* We put all the additional latex code a file called &#039;&#039;&#039;pdfa-supp.tex&#039;&#039;&#039; which looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax&lt;br /&gt;
    \message{\string\pdfgeninterwordspace\space not supported by this version of pdftex}&lt;br /&gt;
\else&lt;br /&gt;
    \pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
    \pdfgeninterwordspace=1&lt;br /&gt;
\fi&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* let&#039;s add to &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; (after the line containing &amp;lt;tt&amp;gt;\documentclass{article}&amp;lt;/tt&amp;gt;) these lines to make it pass pdfa/1b check:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Leslie Lamport}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* to pass pdfa/1a check, we change &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
and compile the file by pdftex with the patch mentioned above.&lt;br /&gt;
&lt;br /&gt;
The result should be the same.&lt;br /&gt;
&lt;br /&gt;
==A less trivial example==&lt;br /&gt;
Now let&#039;s move on to &#039;&#039;&#039;sample2e.tex&#039;&#039;&#039;, which is another sample that is part of latex distribution. Again, let&#039;s start with pdf/a-1b check: we add the same thing as we did for &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; above, and the result is the same. However, with pdf/a-1a check we are not that lucky as before:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Sample2e-pdfa-1a-report.png|Report of checking sample2e-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
To fix this, we need to add these magic lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\input glyphtounicode.tex&lt;br /&gt;
\input glyphtounicode-cmr.tex&lt;br /&gt;
\pdfgentounicode=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code will cause that pdftex will generate ToUnicode mapping for all Type1 embedded fonts.&lt;br /&gt;
&lt;br /&gt;
==A slightly more complex example==&lt;br /&gt;
Let&#039;s continue with the example at http://www.tug.org/pracjourn/2006-2/eglen/. Based on what we did before, our first attempt is to add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Stephen Eglen}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But this time we got more errors than previously:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Intro2-pdfa-1b-report.png|Report from checking intro2-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
There are 2 problems:&lt;br /&gt;
* some fonts are not embedded. This is caused by the included pdf figure in the example. We fix this by loading the pdf in Inkspace, and save it again with all text converted to curves. Not the ideal approach, but it&#039;s a fast solution for the problem we are facing: how to get rid of non-embedded fonts from the pdf figure.&lt;br /&gt;
* the Color profile is not defined.&lt;br /&gt;
&lt;br /&gt;
So we fix the pdf figure, and add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\immediate\pdfobj stream attr{/N 4}  file{sRGBIEC1966-2.1.icm}&lt;br /&gt;
\pdfcatalog{%&lt;br /&gt;
  /OutputIntents [ &amp;lt;&amp;lt;&lt;br /&gt;
  /Type /OutputIntent&lt;br /&gt;
  /S/GTS_PDFA1&lt;br /&gt;
  /DestOutputProfile \the\pdflastobj\space 0 R&lt;br /&gt;
  /OutputConditionIdentifier (sRGB IEC61966-2.1)&lt;br /&gt;
  /Info(sRGB IEC61966-2.1)&lt;br /&gt;
 &amp;gt;&amp;gt; ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step, the output should pass pdf/a-1b check. For pdf/a-1a check, we replace &amp;lt;tt&amp;gt;\includexmp{pdfa-1b}&amp;lt;/tt&amp;gt; by &amp;lt;tt&amp;gt;\includexmp{pdfa-1a}&amp;lt;/tt&amp;gt; and compile by the patched pdftex.&lt;br /&gt;
&lt;br /&gt;
==Further notes==&lt;br /&gt;
It&#039;s hard to ensure pdf/a compliance for an arbitrary latex document. Here is a brief summary of issues we have experienced:&lt;br /&gt;
===Zero charwidth===&lt;br /&gt;
Some fonts have glyphs with zero character widths, which will be reported by Acrobat as &#039;&#039;Width information incomplete&#039;&#039;. Examples of such fonts are:&lt;br /&gt;
* cmsy&lt;br /&gt;
* euler&lt;br /&gt;
* MathTime Plus&lt;br /&gt;
* stmary&lt;br /&gt;
* xypic&lt;br /&gt;
&lt;br /&gt;
Usually we fix the problem by these steps:&lt;br /&gt;
*  convert original tfm to pl by tftopl&lt;br /&gt;
*  fix chars with zero width in pl (0.0 -&amp;gt; 0.001)&lt;br /&gt;
*  converted pl back to tfm by pltotf&lt;br /&gt;
*  convert original pfb to txt by t1disasm&lt;br /&gt;
*  check chars with zero width in *.txt (0 hsbw -&amp;gt; 1 hsbw)&lt;br /&gt;
*  converted txt back to pfb by t1asm&lt;br /&gt;
*  for each original pl, create a vpl which simply maps each char to itself&lt;br /&gt;
*  convert vpl to vf/tfm&lt;br /&gt;
&lt;br /&gt;
Example: let&#039;s have &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039; and &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039; where a few characters have zero widths. Applying the above steps, we get:&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.tfm&#039;&#039;&#039; = original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, except that chars with zero widths are replaced by 0.001&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.pfb&#039;&#039;&#039; = &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039;, except that chars with zero widths (0 hsbw) are replaced by 1 hsbw&lt;br /&gt;
* &#039;&#039;&#039;mtsy.vf&#039;&#039;&#039;: map each char to the same char in &#039;&#039;&#039;mtsy2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;: identical to original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;&lt;br /&gt;
The reason of using virtual fonts is that we don&#039;t want to make any change to &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, so that our workaround doesn&#039;t change the layout at all. TeX still &#039;&#039;sees&#039;&#039; the same font.&lt;br /&gt;
&lt;br /&gt;
===Character width mismatch===&lt;br /&gt;
Sometimes a Type1 font can use the &#039;&#039;&#039;div&#039;&#039;&#039; operator for specifying charwidth (hsbw) for better precision and the result don&#039;t match the value in tfm. In such cases, we bite the bullet and fix both tfm and type1 fonts by converting them to text format, process the text by some script and convert them back to tfm/type1. Luckily such fonts are not very common (so far we have encountered only one font xycirc10 from xypic).&lt;br /&gt;
&lt;br /&gt;
===Color===&lt;br /&gt;
to be added...&lt;br /&gt;
&lt;br /&gt;
===Annotation===&lt;br /&gt;
to be added...&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=209</id>
		<title>Generating PDF/A compliant PDFs from pdftex</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=209"/>
		<updated>2008-11-30T12:57:56Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Annotation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes necessary steps to create PDF/A compliant PDFs from pdftex and related issues. When we compile a latex document with pdftex, there can be a few issues that can prevents the result from begin pdf/a compliant, such as:&lt;br /&gt;
* problems with fonts:&lt;br /&gt;
** font files are not embedded,&lt;br /&gt;
** mismatch of character widths,&lt;br /&gt;
** characters of zero widths,&lt;br /&gt;
** fonts don&#039;t have a ToUnicode mapping&lt;br /&gt;
* problems with metadata:&lt;br /&gt;
** XMP data not included,&lt;br /&gt;
** XMP data don&#039;t match the info in pdfInfo catalog.&lt;br /&gt;
* problem with interword spacing: pdftex don&#039;t use space to separate words in pdf output.&lt;br /&gt;
* problem with color data.&lt;br /&gt;
&lt;br /&gt;
The usual way to verify if a pdf file is pdf/a compliant is to use a validating tool. There are a few pdf/a checking tools; the most common one is the Preflight tool in Acrobat Professional version 8 or newer. Beware that these checking tools can give very different the result on pdf/a compliance of a given pdf: a pdf file that passes pdf/a compliance checking in acrobat 8 can still fail to pass a check by another tool. In this document, we assume the following:&lt;br /&gt;
* input are latex documents&lt;br /&gt;
* tex live 2008 (which includes pdftex version 1.40.9) is used for latexing&lt;br /&gt;
* Acrobat 8.0 for pdf/a validation&lt;br /&gt;
&lt;br /&gt;
We start by a minimal example, and then move to more complex ones, to illustrate the issues one may encounter when trying to achieve pdf/a compliance.All needed input files for the examples described in this wiki page are included in [[Media:pdfa-supp.zip|this zip]]&lt;br /&gt;
&lt;br /&gt;
==A minimal example==&lt;br /&gt;
Let&#039;s have a minimal document &#039;&#039;&#039;hello.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we compile it with pdflatex and check for pdf/a compliance, we will get a report like this:[[Image:Hello-report.png|Report of checking hello.pdf]]&lt;br /&gt;
&lt;br /&gt;
So it looks like our pdf is missing metadata. To fix this, we make a copy of &#039;&#039;&#039;hello.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
&lt;br /&gt;
%****************&lt;br /&gt;
% define medatata&lt;br /&gt;
%________________&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Some Name}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*********&lt;br /&gt;
% XMP data&lt;br /&gt;
%_________&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some notes on the example:&lt;br /&gt;
* it uses the latex package &#039;&#039;xmpincl&#039;&#039; to include XMP data to the pdf;&lt;br /&gt;
* it assumes there is a file &#039;&#039;&#039;pdfa-1b.xmp&#039;&#039;&#039; in the current directory.&lt;br /&gt;
&lt;br /&gt;
When we check the pdf result using acrobat 8, we got this report:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1b-report.png|Report of checking hello-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
With a little more effort, we can make our example to pass pdf/a-1a checking:&lt;br /&gt;
* use pdftex with a patch available at http://sarovar.org/tracker/index.php?func=detail&amp;amp;aid=945&amp;amp;group_id=106&amp;amp;atid=495&lt;br /&gt;
* make a copy of &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1a.tex&#039;&#039;&#039; and make the following change:&lt;br /&gt;
** replace &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
** add the following code:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
\pdfgeninterwordspace=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the file with patched pdftex, and we should get this report from checking:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1a-report.png|Report of checking hello-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
==Another trivial example==&lt;br /&gt;
Let&#039;s apply what we did above for another example: &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; which is part of standard latex distribution. &lt;br /&gt;
* We put all the additional latex code a file called &#039;&#039;&#039;pdfa-supp.tex&#039;&#039;&#039; which looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax&lt;br /&gt;
    \message{\string\pdfgeninterwordspace\space not supported by this version of pdftex}&lt;br /&gt;
\else&lt;br /&gt;
    \pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
    \pdfgeninterwordspace=1&lt;br /&gt;
\fi&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* let&#039;s add to &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; (after the line containing &amp;lt;tt&amp;gt;\documentclass{article}&amp;lt;/tt&amp;gt;) these lines to make it pass pdfa/1b check:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Leslie Lamport}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* to pass pdfa/1a check, we change &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
and compile the file by pdftex with the patch mentioned above.&lt;br /&gt;
&lt;br /&gt;
The result should be the same.&lt;br /&gt;
&lt;br /&gt;
==A less trivial example==&lt;br /&gt;
Now let&#039;s move on to &#039;&#039;&#039;sample2e.tex&#039;&#039;&#039;, which is another sample that is part of latex distribution. Again, let&#039;s start with pdf/a-1b check: we add the same thing as we did for &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; above, and the result is the same. However, with pdf/a-1a check we are not that lucky as before:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Sample2e-pdfa-1a-report.png|Report of checking sample2e-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
To fix this, we need to add these magic lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\input glyphtounicode.tex&lt;br /&gt;
\input glyphtounicode-cmr.tex&lt;br /&gt;
\pdfgentounicode=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code will cause that pdftex will generate ToUnicode mapping for all Type1 embedded fonts.&lt;br /&gt;
&lt;br /&gt;
==A slightly more complex example==&lt;br /&gt;
Let&#039;s continue with the example at http://www.tug.org/pracjourn/2006-2/eglen/. Based on what we did before, our first attempt is to add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Stephen Eglen}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But this time we got more errors than previously:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Intro2-pdfa-1b-report.png|Report from checking intro2-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
There are 2 problems:&lt;br /&gt;
* some fonts are not embedded. This is caused by the included pdf figure in the example. We fix this by loading the pdf in Inkspace, and save it again with all text converted to curves. Not the ideal approach, but it&#039;s a fast solution for the problem we are facing: how to get rid of non-embedded fonts from the pdf figure.&lt;br /&gt;
* the Color profile is not defined.&lt;br /&gt;
&lt;br /&gt;
So we fix the pdf figure, and add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\immediate\pdfobj stream attr{/N 4}  file{sRGBIEC1966-2.1.icm}&lt;br /&gt;
\pdfcatalog{%&lt;br /&gt;
  /OutputIntents [ &amp;lt;&amp;lt;&lt;br /&gt;
  /Type /OutputIntent&lt;br /&gt;
  /S/GTS_PDFA1&lt;br /&gt;
  /DestOutputProfile \the\pdflastobj\space 0 R&lt;br /&gt;
  /OutputConditionIdentifier (sRGB IEC61966-2.1)&lt;br /&gt;
  /Info(sRGB IEC61966-2.1)&lt;br /&gt;
 &amp;gt;&amp;gt; ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step, the output should pass pdf/a-1b check. For pdf/a-1a check, we replace &amp;lt;tt&amp;gt;\includexmp{pdfa-1b}&amp;lt;/tt&amp;gt; by &amp;lt;tt&amp;gt;\includexmp{pdfa-1a}&amp;lt;/tt&amp;gt; and compile by the patched pdftex.&lt;br /&gt;
&lt;br /&gt;
==Further notes==&lt;br /&gt;
It&#039;s hard to ensure pdf/a compliance for an arbitrary latex document. Here is a brief summary of issues we have experienced:&lt;br /&gt;
===Zero charwidth===&lt;br /&gt;
Some fonts have glyphs with zero character widths, which will be reported by Acrobat as &#039;&#039;Width information incomplete&#039;&#039;. Examples of such fonts are:&lt;br /&gt;
* cmsy&lt;br /&gt;
* euler&lt;br /&gt;
* MathTime Plus&lt;br /&gt;
* stmary&lt;br /&gt;
* xypic&lt;br /&gt;
&lt;br /&gt;
Usually we fix the problem by these steps:&lt;br /&gt;
*  convert original tfm to pl by tftopl&lt;br /&gt;
*  fix chars with zero width in pl (0.0 -&amp;gt; 0.001)&lt;br /&gt;
*  converted pl back to tfm by pltotf&lt;br /&gt;
*  convert original pfb to txt by t1disasm&lt;br /&gt;
*  check chars with zero width in *.txt (0 hsbw -&amp;gt; 1 hsbw)&lt;br /&gt;
*  converted txt back to pfb by t1asm&lt;br /&gt;
*  for each original pl, create a vpl which simply maps each char to itself&lt;br /&gt;
*  convert vpl to vf/tfm&lt;br /&gt;
&lt;br /&gt;
Example: let&#039;s have &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039; and &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039; where a few characters have zero widths. Applying the above steps, we get:&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.tfm&#039;&#039;&#039; = original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, except that chars with zero widths are replaced by 0.001&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.pfb&#039;&#039;&#039; = &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039;, except that chars with zero widths (0 hsbw) are replaced by 1 hsbw&lt;br /&gt;
* &#039;&#039;&#039;mtsy.vf&#039;&#039;&#039;: map each char to the same char in &#039;&#039;&#039;mtsy2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;: identical to original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;&lt;br /&gt;
The reason of using virtual fonts is that we don&#039;t want to make any change to &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, so that our workaround doesn&#039;t change the layout at all. TeX still &#039;&#039;sees&#039;&#039; the same font.&lt;br /&gt;
&lt;br /&gt;
===Character width mismatch===&lt;br /&gt;
Sometimes a Type1 font can use the &#039;&#039;&#039;div&#039;&#039;&#039; operator for specifying charwidth (hsbw) for better precision and the result don&#039;t match the value in tfm. In such cases, we bite the bullet and fix both tfm and type1 fonts by converting them to text format, process the text by some script and convert them back to tfm/type1. Luckily such fonts are not very common (so far we have encountered only one font xycirc10 from xypic).&lt;br /&gt;
&lt;br /&gt;
===Color===&lt;br /&gt;
to be added...&lt;br /&gt;
&lt;br /&gt;
===Annotation===&lt;br /&gt;
to be added....&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=208</id>
		<title>Generating PDF/A compliant PDFs from pdftex</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=208"/>
		<updated>2008-11-29T08:46:14Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Annotation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes necessary steps to create PDF/A compliant PDFs from pdftex and related issues. When we compile a latex document with pdftex, there can be a few issues that can prevents the result from begin pdf/a compliant, such as:&lt;br /&gt;
* problems with fonts:&lt;br /&gt;
** font files are not embedded,&lt;br /&gt;
** mismatch of character widths,&lt;br /&gt;
** characters of zero widths,&lt;br /&gt;
** fonts don&#039;t have a ToUnicode mapping&lt;br /&gt;
* problems with metadata:&lt;br /&gt;
** XMP data not included,&lt;br /&gt;
** XMP data don&#039;t match the info in pdfInfo catalog.&lt;br /&gt;
* problem with interword spacing: pdftex don&#039;t use space to separate words in pdf output.&lt;br /&gt;
* problem with color data.&lt;br /&gt;
&lt;br /&gt;
The usual way to verify if a pdf file is pdf/a compliant is to use a validating tool. There are a few pdf/a checking tools; the most common one is the Preflight tool in Acrobat Professional version 8 or newer. Beware that these checking tools can give very different the result on pdf/a compliance of a given pdf: a pdf file that passes pdf/a compliance checking in acrobat 8 can still fail to pass a check by another tool. In this document, we assume the following:&lt;br /&gt;
* input are latex documents&lt;br /&gt;
* tex live 2008 (which includes pdftex version 1.40.9) is used for latexing&lt;br /&gt;
* Acrobat 8.0 for pdf/a validation&lt;br /&gt;
&lt;br /&gt;
We start by a minimal example, and then move to more complex ones, to illustrate the issues one may encounter when trying to achieve pdf/a compliance.All needed input files for the examples described in this wiki page are included in [[Media:pdfa-supp.zip|this zip]]&lt;br /&gt;
&lt;br /&gt;
==A minimal example==&lt;br /&gt;
Let&#039;s have a minimal document &#039;&#039;&#039;hello.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we compile it with pdflatex and check for pdf/a compliance, we will get a report like this:[[Image:Hello-report.png|Report of checking hello.pdf]]&lt;br /&gt;
&lt;br /&gt;
So it looks like our pdf is missing metadata. To fix this, we make a copy of &#039;&#039;&#039;hello.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
&lt;br /&gt;
%****************&lt;br /&gt;
% define medatata&lt;br /&gt;
%________________&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Some Name}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*********&lt;br /&gt;
% XMP data&lt;br /&gt;
%_________&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some notes on the example:&lt;br /&gt;
* it uses the latex package &#039;&#039;xmpincl&#039;&#039; to include XMP data to the pdf;&lt;br /&gt;
* it assumes there is a file &#039;&#039;&#039;pdfa-1b.xmp&#039;&#039;&#039; in the current directory.&lt;br /&gt;
&lt;br /&gt;
When we check the pdf result using acrobat 8, we got this report:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1b-report.png|Report of checking hello-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
With a little more effort, we can make our example to pass pdf/a-1a checking:&lt;br /&gt;
* use pdftex with a patch available at http://sarovar.org/tracker/index.php?func=detail&amp;amp;aid=945&amp;amp;group_id=106&amp;amp;atid=495&lt;br /&gt;
* make a copy of &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1a.tex&#039;&#039;&#039; and make the following change:&lt;br /&gt;
** replace &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
** add the following code:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
\pdfgeninterwordspace=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the file with patched pdftex, and we should get this report from checking:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1a-report.png|Report of checking hello-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
==Another trivial example==&lt;br /&gt;
Let&#039;s apply what we did above for another example: &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; which is part of standard latex distribution. &lt;br /&gt;
* We put all the additional latex code a file called &#039;&#039;&#039;pdfa-supp.tex&#039;&#039;&#039; which looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax&lt;br /&gt;
    \message{\string\pdfgeninterwordspace\space not supported by this version of pdftex}&lt;br /&gt;
\else&lt;br /&gt;
    \pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
    \pdfgeninterwordspace=1&lt;br /&gt;
\fi&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* let&#039;s add to &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; (after the line containing &amp;lt;tt&amp;gt;\documentclass{article}&amp;lt;/tt&amp;gt;) these lines to make it pass pdfa/1b check:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Leslie Lamport}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* to pass pdfa/1a check, we change &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
and compile the file by pdftex with the patch mentioned above.&lt;br /&gt;
&lt;br /&gt;
The result should be the same.&lt;br /&gt;
&lt;br /&gt;
==A less trivial example==&lt;br /&gt;
Now let&#039;s move on to &#039;&#039;&#039;sample2e.tex&#039;&#039;&#039;, which is another sample that is part of latex distribution. Again, let&#039;s start with pdf/a-1b check: we add the same thing as we did for &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; above, and the result is the same. However, with pdf/a-1a check we are not that lucky as before:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Sample2e-pdfa-1a-report.png|Report of checking sample2e-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
To fix this, we need to add these magic lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\input glyphtounicode.tex&lt;br /&gt;
\input glyphtounicode-cmr.tex&lt;br /&gt;
\pdfgentounicode=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code will cause that pdftex will generate ToUnicode mapping for all Type1 embedded fonts.&lt;br /&gt;
&lt;br /&gt;
==A slightly more complex example==&lt;br /&gt;
Let&#039;s continue with the example at http://www.tug.org/pracjourn/2006-2/eglen/. Based on what we did before, our first attempt is to add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Stephen Eglen}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But this time we got more errors than previously:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Intro2-pdfa-1b-report.png|Report from checking intro2-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
There are 2 problems:&lt;br /&gt;
* some fonts are not embedded. This is caused by the included pdf figure in the example. We fix this by loading the pdf in Inkspace, and save it again with all text converted to curves. Not the ideal approach, but it&#039;s a fast solution for the problem we are facing: how to get rid of non-embedded fonts from the pdf figure.&lt;br /&gt;
* the Color profile is not defined.&lt;br /&gt;
&lt;br /&gt;
So we fix the pdf figure, and add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\immediate\pdfobj stream attr{/N 4}  file{sRGBIEC1966-2.1.icm}&lt;br /&gt;
\pdfcatalog{%&lt;br /&gt;
  /OutputIntents [ &amp;lt;&amp;lt;&lt;br /&gt;
  /Type /OutputIntent&lt;br /&gt;
  /S/GTS_PDFA1&lt;br /&gt;
  /DestOutputProfile \the\pdflastobj\space 0 R&lt;br /&gt;
  /OutputConditionIdentifier (sRGB IEC61966-2.1)&lt;br /&gt;
  /Info(sRGB IEC61966-2.1)&lt;br /&gt;
 &amp;gt;&amp;gt; ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step, the output should pass pdf/a-1b check. For pdf/a-1a check, we replace &amp;lt;tt&amp;gt;\includexmp{pdfa-1b}&amp;lt;/tt&amp;gt; by &amp;lt;tt&amp;gt;\includexmp{pdfa-1a}&amp;lt;/tt&amp;gt; and compile by the patched pdftex.&lt;br /&gt;
&lt;br /&gt;
==Further notes==&lt;br /&gt;
It&#039;s hard to ensure pdf/a compliance for an arbitrary latex document. Here is a brief summary of issues we have experienced:&lt;br /&gt;
===Zero charwidth===&lt;br /&gt;
Some fonts have glyphs with zero character widths, which will be reported by Acrobat as &#039;&#039;Width information incomplete&#039;&#039;. Examples of such fonts are:&lt;br /&gt;
* cmsy&lt;br /&gt;
* euler&lt;br /&gt;
* MathTime Plus&lt;br /&gt;
* stmary&lt;br /&gt;
* xypic&lt;br /&gt;
&lt;br /&gt;
Usually we fix the problem by these steps:&lt;br /&gt;
*  convert original tfm to pl by tftopl&lt;br /&gt;
*  fix chars with zero width in pl (0.0 -&amp;gt; 0.001)&lt;br /&gt;
*  converted pl back to tfm by pltotf&lt;br /&gt;
*  convert original pfb to txt by t1disasm&lt;br /&gt;
*  check chars with zero width in *.txt (0 hsbw -&amp;gt; 1 hsbw)&lt;br /&gt;
*  converted txt back to pfb by t1asm&lt;br /&gt;
*  for each original pl, create a vpl which simply maps each char to itself&lt;br /&gt;
*  convert vpl to vf/tfm&lt;br /&gt;
&lt;br /&gt;
Example: let&#039;s have &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039; and &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039; where a few characters have zero widths. Applying the above steps, we get:&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.tfm&#039;&#039;&#039; = original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, except that chars with zero widths are replaced by 0.001&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.pfb&#039;&#039;&#039; = &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039;, except that chars with zero widths (0 hsbw) are replaced by 1 hsbw&lt;br /&gt;
* &#039;&#039;&#039;mtsy.vf&#039;&#039;&#039;: map each char to the same char in &#039;&#039;&#039;mtsy2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;: identical to original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;&lt;br /&gt;
The reason of using virtual fonts is that we don&#039;t want to make any change to &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, so that our workaround doesn&#039;t change the layout at all. TeX still &#039;&#039;sees&#039;&#039; the same font.&lt;br /&gt;
&lt;br /&gt;
===Character width mismatch===&lt;br /&gt;
Sometimes a Type1 font can use the &#039;&#039;&#039;div&#039;&#039;&#039; operator for specifying charwidth (hsbw) for better precision and the result don&#039;t match the value in tfm. In such cases, we bite the bullet and fix both tfm and type1 fonts by converting them to text format, process the text by some script and convert them back to tfm/type1. Luckily such fonts are not very common (so far we have encountered only one font xycirc10 from xypic).&lt;br /&gt;
&lt;br /&gt;
===Color===&lt;br /&gt;
to be added...&lt;br /&gt;
&lt;br /&gt;
===Annotation===&lt;br /&gt;
to be added...&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=207</id>
		<title>Generating PDF/A compliant PDFs from pdftex</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=207"/>
		<updated>2008-11-28T08:47:46Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Color */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes necessary steps to create PDF/A compliant PDFs from pdftex and related issues. When we compile a latex document with pdftex, there can be a few issues that can prevents the result from begin pdf/a compliant, such as:&lt;br /&gt;
* problems with fonts:&lt;br /&gt;
** font files are not embedded,&lt;br /&gt;
** mismatch of character widths,&lt;br /&gt;
** characters of zero widths,&lt;br /&gt;
** fonts don&#039;t have a ToUnicode mapping&lt;br /&gt;
* problems with metadata:&lt;br /&gt;
** XMP data not included,&lt;br /&gt;
** XMP data don&#039;t match the info in pdfInfo catalog.&lt;br /&gt;
* problem with interword spacing: pdftex don&#039;t use space to separate words in pdf output.&lt;br /&gt;
* problem with color data.&lt;br /&gt;
&lt;br /&gt;
The usual way to verify if a pdf file is pdf/a compliant is to use a validating tool. There are a few pdf/a checking tools; the most common one is the Preflight tool in Acrobat Professional version 8 or newer. Beware that these checking tools can give very different the result on pdf/a compliance of a given pdf: a pdf file that passes pdf/a compliance checking in acrobat 8 can still fail to pass a check by another tool. In this document, we assume the following:&lt;br /&gt;
* input are latex documents&lt;br /&gt;
* tex live 2008 (which includes pdftex version 1.40.9) is used for latexing&lt;br /&gt;
* Acrobat 8.0 for pdf/a validation&lt;br /&gt;
&lt;br /&gt;
We start by a minimal example, and then move to more complex ones, to illustrate the issues one may encounter when trying to achieve pdf/a compliance.All needed input files for the examples described in this wiki page are included in [[Media:pdfa-supp.zip|this zip]]&lt;br /&gt;
&lt;br /&gt;
==A minimal example==&lt;br /&gt;
Let&#039;s have a minimal document &#039;&#039;&#039;hello.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we compile it with pdflatex and check for pdf/a compliance, we will get a report like this:[[Image:Hello-report.png|Report of checking hello.pdf]]&lt;br /&gt;
&lt;br /&gt;
So it looks like our pdf is missing metadata. To fix this, we make a copy of &#039;&#039;&#039;hello.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
&lt;br /&gt;
%****************&lt;br /&gt;
% define medatata&lt;br /&gt;
%________________&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Some Name}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*********&lt;br /&gt;
% XMP data&lt;br /&gt;
%_________&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some notes on the example:&lt;br /&gt;
* it uses the latex package &#039;&#039;xmpincl&#039;&#039; to include XMP data to the pdf;&lt;br /&gt;
* it assumes there is a file &#039;&#039;&#039;pdfa-1b.xmp&#039;&#039;&#039; in the current directory.&lt;br /&gt;
&lt;br /&gt;
When we check the pdf result using acrobat 8, we got this report:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1b-report.png|Report of checking hello-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
With a little more effort, we can make our example to pass pdf/a-1a checking:&lt;br /&gt;
* use pdftex with a patch available at http://sarovar.org/tracker/index.php?func=detail&amp;amp;aid=945&amp;amp;group_id=106&amp;amp;atid=495&lt;br /&gt;
* make a copy of &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1a.tex&#039;&#039;&#039; and make the following change:&lt;br /&gt;
** replace &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
** add the following code:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
\pdfgeninterwordspace=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the file with patched pdftex, and we should get this report from checking:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1a-report.png|Report of checking hello-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
==Another trivial example==&lt;br /&gt;
Let&#039;s apply what we did above for another example: &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; which is part of standard latex distribution. &lt;br /&gt;
* We put all the additional latex code a file called &#039;&#039;&#039;pdfa-supp.tex&#039;&#039;&#039; which looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax&lt;br /&gt;
    \message{\string\pdfgeninterwordspace\space not supported by this version of pdftex}&lt;br /&gt;
\else&lt;br /&gt;
    \pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
    \pdfgeninterwordspace=1&lt;br /&gt;
\fi&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* let&#039;s add to &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; (after the line containing &amp;lt;tt&amp;gt;\documentclass{article}&amp;lt;/tt&amp;gt;) these lines to make it pass pdfa/1b check:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Leslie Lamport}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* to pass pdfa/1a check, we change &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
and compile the file by pdftex with the patch mentioned above.&lt;br /&gt;
&lt;br /&gt;
The result should be the same.&lt;br /&gt;
&lt;br /&gt;
==A less trivial example==&lt;br /&gt;
Now let&#039;s move on to &#039;&#039;&#039;sample2e.tex&#039;&#039;&#039;, which is another sample that is part of latex distribution. Again, let&#039;s start with pdf/a-1b check: we add the same thing as we did for &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; above, and the result is the same. However, with pdf/a-1a check we are not that lucky as before:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Sample2e-pdfa-1a-report.png|Report of checking sample2e-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
To fix this, we need to add these magic lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\input glyphtounicode.tex&lt;br /&gt;
\input glyphtounicode-cmr.tex&lt;br /&gt;
\pdfgentounicode=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code will cause that pdftex will generate ToUnicode mapping for all Type1 embedded fonts.&lt;br /&gt;
&lt;br /&gt;
==A slightly more complex example==&lt;br /&gt;
Let&#039;s continue with the example at http://www.tug.org/pracjourn/2006-2/eglen/. Based on what we did before, our first attempt is to add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Stephen Eglen}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But this time we got more errors than previously:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Intro2-pdfa-1b-report.png|Report from checking intro2-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
There are 2 problems:&lt;br /&gt;
* some fonts are not embedded. This is caused by the included pdf figure in the example. We fix this by loading the pdf in Inkspace, and save it again with all text converted to curves. Not the ideal approach, but it&#039;s a fast solution for the problem we are facing: how to get rid of non-embedded fonts from the pdf figure.&lt;br /&gt;
* the Color profile is not defined.&lt;br /&gt;
&lt;br /&gt;
So we fix the pdf figure, and add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\immediate\pdfobj stream attr{/N 4}  file{sRGBIEC1966-2.1.icm}&lt;br /&gt;
\pdfcatalog{%&lt;br /&gt;
  /OutputIntents [ &amp;lt;&amp;lt;&lt;br /&gt;
  /Type /OutputIntent&lt;br /&gt;
  /S/GTS_PDFA1&lt;br /&gt;
  /DestOutputProfile \the\pdflastobj\space 0 R&lt;br /&gt;
  /OutputConditionIdentifier (sRGB IEC61966-2.1)&lt;br /&gt;
  /Info(sRGB IEC61966-2.1)&lt;br /&gt;
 &amp;gt;&amp;gt; ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step, the output should pass pdf/a-1b check. For pdf/a-1a check, we replace &amp;lt;tt&amp;gt;\includexmp{pdfa-1b}&amp;lt;/tt&amp;gt; by &amp;lt;tt&amp;gt;\includexmp{pdfa-1a}&amp;lt;/tt&amp;gt; and compile by the patched pdftex.&lt;br /&gt;
&lt;br /&gt;
==Further notes==&lt;br /&gt;
It&#039;s hard to ensure pdf/a compliance for an arbitrary latex document. Here is a brief summary of issues we have experienced:&lt;br /&gt;
===Zero charwidth===&lt;br /&gt;
Some fonts have glyphs with zero character widths, which will be reported by Acrobat as &#039;&#039;Width information incomplete&#039;&#039;. Examples of such fonts are:&lt;br /&gt;
* cmsy&lt;br /&gt;
* euler&lt;br /&gt;
* MathTime Plus&lt;br /&gt;
* stmary&lt;br /&gt;
* xypic&lt;br /&gt;
&lt;br /&gt;
Usually we fix the problem by these steps:&lt;br /&gt;
*  convert original tfm to pl by tftopl&lt;br /&gt;
*  fix chars with zero width in pl (0.0 -&amp;gt; 0.001)&lt;br /&gt;
*  converted pl back to tfm by pltotf&lt;br /&gt;
*  convert original pfb to txt by t1disasm&lt;br /&gt;
*  check chars with zero width in *.txt (0 hsbw -&amp;gt; 1 hsbw)&lt;br /&gt;
*  converted txt back to pfb by t1asm&lt;br /&gt;
*  for each original pl, create a vpl which simply maps each char to itself&lt;br /&gt;
*  convert vpl to vf/tfm&lt;br /&gt;
&lt;br /&gt;
Example: let&#039;s have &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039; and &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039; where a few characters have zero widths. Applying the above steps, we get:&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.tfm&#039;&#039;&#039; = original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, except that chars with zero widths are replaced by 0.001&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.pfb&#039;&#039;&#039; = &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039;, except that chars with zero widths (0 hsbw) are replaced by 1 hsbw&lt;br /&gt;
* &#039;&#039;&#039;mtsy.vf&#039;&#039;&#039;: map each char to the same char in &#039;&#039;&#039;mtsy2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;: identical to original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;&lt;br /&gt;
The reason of using virtual fonts is that we don&#039;t want to make any change to &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, so that our workaround doesn&#039;t change the layout at all. TeX still &#039;&#039;sees&#039;&#039; the same font.&lt;br /&gt;
&lt;br /&gt;
===Character width mismatch===&lt;br /&gt;
Sometimes a Type1 font can use the &#039;&#039;&#039;div&#039;&#039;&#039; operator for specifying charwidth (hsbw) for better precision and the result don&#039;t match the value in tfm. In such cases, we bite the bullet and fix both tfm and type1 fonts by converting them to text format, process the text by some script and convert them back to tfm/type1. Luckily such fonts are not very common (so far we have encountered only one font xycirc10 from xypic).&lt;br /&gt;
&lt;br /&gt;
===Color===&lt;br /&gt;
to be added...&lt;br /&gt;
&lt;br /&gt;
===Annotation===&lt;br /&gt;
to be added....&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=206</id>
		<title>Generating PDF/A compliant PDFs from pdftex</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=206"/>
		<updated>2008-11-28T08:47:37Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Annotation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes necessary steps to create PDF/A compliant PDFs from pdftex and related issues. When we compile a latex document with pdftex, there can be a few issues that can prevents the result from begin pdf/a compliant, such as:&lt;br /&gt;
* problems with fonts:&lt;br /&gt;
** font files are not embedded,&lt;br /&gt;
** mismatch of character widths,&lt;br /&gt;
** characters of zero widths,&lt;br /&gt;
** fonts don&#039;t have a ToUnicode mapping&lt;br /&gt;
* problems with metadata:&lt;br /&gt;
** XMP data not included,&lt;br /&gt;
** XMP data don&#039;t match the info in pdfInfo catalog.&lt;br /&gt;
* problem with interword spacing: pdftex don&#039;t use space to separate words in pdf output.&lt;br /&gt;
* problem with color data.&lt;br /&gt;
&lt;br /&gt;
The usual way to verify if a pdf file is pdf/a compliant is to use a validating tool. There are a few pdf/a checking tools; the most common one is the Preflight tool in Acrobat Professional version 8 or newer. Beware that these checking tools can give very different the result on pdf/a compliance of a given pdf: a pdf file that passes pdf/a compliance checking in acrobat 8 can still fail to pass a check by another tool. In this document, we assume the following:&lt;br /&gt;
* input are latex documents&lt;br /&gt;
* tex live 2008 (which includes pdftex version 1.40.9) is used for latexing&lt;br /&gt;
* Acrobat 8.0 for pdf/a validation&lt;br /&gt;
&lt;br /&gt;
We start by a minimal example, and then move to more complex ones, to illustrate the issues one may encounter when trying to achieve pdf/a compliance.All needed input files for the examples described in this wiki page are included in [[Media:pdfa-supp.zip|this zip]]&lt;br /&gt;
&lt;br /&gt;
==A minimal example==&lt;br /&gt;
Let&#039;s have a minimal document &#039;&#039;&#039;hello.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we compile it with pdflatex and check for pdf/a compliance, we will get a report like this:[[Image:Hello-report.png|Report of checking hello.pdf]]&lt;br /&gt;
&lt;br /&gt;
So it looks like our pdf is missing metadata. To fix this, we make a copy of &#039;&#039;&#039;hello.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
&lt;br /&gt;
%****************&lt;br /&gt;
% define medatata&lt;br /&gt;
%________________&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Some Name}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*********&lt;br /&gt;
% XMP data&lt;br /&gt;
%_________&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some notes on the example:&lt;br /&gt;
* it uses the latex package &#039;&#039;xmpincl&#039;&#039; to include XMP data to the pdf;&lt;br /&gt;
* it assumes there is a file &#039;&#039;&#039;pdfa-1b.xmp&#039;&#039;&#039; in the current directory.&lt;br /&gt;
&lt;br /&gt;
When we check the pdf result using acrobat 8, we got this report:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1b-report.png|Report of checking hello-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
With a little more effort, we can make our example to pass pdf/a-1a checking:&lt;br /&gt;
* use pdftex with a patch available at http://sarovar.org/tracker/index.php?func=detail&amp;amp;aid=945&amp;amp;group_id=106&amp;amp;atid=495&lt;br /&gt;
* make a copy of &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1a.tex&#039;&#039;&#039; and make the following change:&lt;br /&gt;
** replace &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
** add the following code:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
\pdfgeninterwordspace=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the file with patched pdftex, and we should get this report from checking:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1a-report.png|Report of checking hello-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
==Another trivial example==&lt;br /&gt;
Let&#039;s apply what we did above for another example: &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; which is part of standard latex distribution. &lt;br /&gt;
* We put all the additional latex code a file called &#039;&#039;&#039;pdfa-supp.tex&#039;&#039;&#039; which looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax&lt;br /&gt;
    \message{\string\pdfgeninterwordspace\space not supported by this version of pdftex}&lt;br /&gt;
\else&lt;br /&gt;
    \pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
    \pdfgeninterwordspace=1&lt;br /&gt;
\fi&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* let&#039;s add to &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; (after the line containing &amp;lt;tt&amp;gt;\documentclass{article}&amp;lt;/tt&amp;gt;) these lines to make it pass pdfa/1b check:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Leslie Lamport}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* to pass pdfa/1a check, we change &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
and compile the file by pdftex with the patch mentioned above.&lt;br /&gt;
&lt;br /&gt;
The result should be the same.&lt;br /&gt;
&lt;br /&gt;
==A less trivial example==&lt;br /&gt;
Now let&#039;s move on to &#039;&#039;&#039;sample2e.tex&#039;&#039;&#039;, which is another sample that is part of latex distribution. Again, let&#039;s start with pdf/a-1b check: we add the same thing as we did for &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; above, and the result is the same. However, with pdf/a-1a check we are not that lucky as before:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Sample2e-pdfa-1a-report.png|Report of checking sample2e-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
To fix this, we need to add these magic lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\input glyphtounicode.tex&lt;br /&gt;
\input glyphtounicode-cmr.tex&lt;br /&gt;
\pdfgentounicode=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code will cause that pdftex will generate ToUnicode mapping for all Type1 embedded fonts.&lt;br /&gt;
&lt;br /&gt;
==A slightly more complex example==&lt;br /&gt;
Let&#039;s continue with the example at http://www.tug.org/pracjourn/2006-2/eglen/. Based on what we did before, our first attempt is to add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Stephen Eglen}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But this time we got more errors than previously:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Intro2-pdfa-1b-report.png|Report from checking intro2-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
There are 2 problems:&lt;br /&gt;
* some fonts are not embedded. This is caused by the included pdf figure in the example. We fix this by loading the pdf in Inkspace, and save it again with all text converted to curves. Not the ideal approach, but it&#039;s a fast solution for the problem we are facing: how to get rid of non-embedded fonts from the pdf figure.&lt;br /&gt;
* the Color profile is not defined.&lt;br /&gt;
&lt;br /&gt;
So we fix the pdf figure, and add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\immediate\pdfobj stream attr{/N 4}  file{sRGBIEC1966-2.1.icm}&lt;br /&gt;
\pdfcatalog{%&lt;br /&gt;
  /OutputIntents [ &amp;lt;&amp;lt;&lt;br /&gt;
  /Type /OutputIntent&lt;br /&gt;
  /S/GTS_PDFA1&lt;br /&gt;
  /DestOutputProfile \the\pdflastobj\space 0 R&lt;br /&gt;
  /OutputConditionIdentifier (sRGB IEC61966-2.1)&lt;br /&gt;
  /Info(sRGB IEC61966-2.1)&lt;br /&gt;
 &amp;gt;&amp;gt; ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step, the output should pass pdf/a-1b check. For pdf/a-1a check, we replace &amp;lt;tt&amp;gt;\includexmp{pdfa-1b}&amp;lt;/tt&amp;gt; by &amp;lt;tt&amp;gt;\includexmp{pdfa-1a}&amp;lt;/tt&amp;gt; and compile by the patched pdftex.&lt;br /&gt;
&lt;br /&gt;
==Further notes==&lt;br /&gt;
It&#039;s hard to ensure pdf/a compliance for an arbitrary latex document. Here is a brief summary of issues we have experienced:&lt;br /&gt;
===Zero charwidth===&lt;br /&gt;
Some fonts have glyphs with zero character widths, which will be reported by Acrobat as &#039;&#039;Width information incomplete&#039;&#039;. Examples of such fonts are:&lt;br /&gt;
* cmsy&lt;br /&gt;
* euler&lt;br /&gt;
* MathTime Plus&lt;br /&gt;
* stmary&lt;br /&gt;
* xypic&lt;br /&gt;
&lt;br /&gt;
Usually we fix the problem by these steps:&lt;br /&gt;
*  convert original tfm to pl by tftopl&lt;br /&gt;
*  fix chars with zero width in pl (0.0 -&amp;gt; 0.001)&lt;br /&gt;
*  converted pl back to tfm by pltotf&lt;br /&gt;
*  convert original pfb to txt by t1disasm&lt;br /&gt;
*  check chars with zero width in *.txt (0 hsbw -&amp;gt; 1 hsbw)&lt;br /&gt;
*  converted txt back to pfb by t1asm&lt;br /&gt;
*  for each original pl, create a vpl which simply maps each char to itself&lt;br /&gt;
*  convert vpl to vf/tfm&lt;br /&gt;
&lt;br /&gt;
Example: let&#039;s have &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039; and &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039; where a few characters have zero widths. Applying the above steps, we get:&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.tfm&#039;&#039;&#039; = original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, except that chars with zero widths are replaced by 0.001&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.pfb&#039;&#039;&#039; = &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039;, except that chars with zero widths (0 hsbw) are replaced by 1 hsbw&lt;br /&gt;
* &#039;&#039;&#039;mtsy.vf&#039;&#039;&#039;: map each char to the same char in &#039;&#039;&#039;mtsy2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;: identical to original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;&lt;br /&gt;
The reason of using virtual fonts is that we don&#039;t want to make any change to &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, so that our workaround doesn&#039;t change the layout at all. TeX still &#039;&#039;sees&#039;&#039; the same font.&lt;br /&gt;
&lt;br /&gt;
===Character width mismatch===&lt;br /&gt;
Sometimes a Type1 font can use the &#039;&#039;&#039;div&#039;&#039;&#039; operator for specifying charwidth (hsbw) for better precision and the result don&#039;t match the value in tfm. In such cases, we bite the bullet and fix both tfm and type1 fonts by converting them to text format, process the text by some script and convert them back to tfm/type1. Luckily such fonts are not very common (so far we have encountered only one font xycirc10 from xypic).&lt;br /&gt;
&lt;br /&gt;
===Color===&lt;br /&gt;
to be added....&lt;br /&gt;
&lt;br /&gt;
===Annotation===&lt;br /&gt;
to be added....&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=205</id>
		<title>Generating PDF/A compliant PDFs from pdftex</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=205"/>
		<updated>2008-11-28T08:46:31Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Annotation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes necessary steps to create PDF/A compliant PDFs from pdftex and related issues. When we compile a latex document with pdftex, there can be a few issues that can prevents the result from begin pdf/a compliant, such as:&lt;br /&gt;
* problems with fonts:&lt;br /&gt;
** font files are not embedded,&lt;br /&gt;
** mismatch of character widths,&lt;br /&gt;
** characters of zero widths,&lt;br /&gt;
** fonts don&#039;t have a ToUnicode mapping&lt;br /&gt;
* problems with metadata:&lt;br /&gt;
** XMP data not included,&lt;br /&gt;
** XMP data don&#039;t match the info in pdfInfo catalog.&lt;br /&gt;
* problem with interword spacing: pdftex don&#039;t use space to separate words in pdf output.&lt;br /&gt;
* problem with color data.&lt;br /&gt;
&lt;br /&gt;
The usual way to verify if a pdf file is pdf/a compliant is to use a validating tool. There are a few pdf/a checking tools; the most common one is the Preflight tool in Acrobat Professional version 8 or newer. Beware that these checking tools can give very different the result on pdf/a compliance of a given pdf: a pdf file that passes pdf/a compliance checking in acrobat 8 can still fail to pass a check by another tool. In this document, we assume the following:&lt;br /&gt;
* input are latex documents&lt;br /&gt;
* tex live 2008 (which includes pdftex version 1.40.9) is used for latexing&lt;br /&gt;
* Acrobat 8.0 for pdf/a validation&lt;br /&gt;
&lt;br /&gt;
We start by a minimal example, and then move to more complex ones, to illustrate the issues one may encounter when trying to achieve pdf/a compliance.All needed input files for the examples described in this wiki page are included in [[Media:pdfa-supp.zip|this zip]]&lt;br /&gt;
&lt;br /&gt;
==A minimal example==&lt;br /&gt;
Let&#039;s have a minimal document &#039;&#039;&#039;hello.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we compile it with pdflatex and check for pdf/a compliance, we will get a report like this:[[Image:Hello-report.png|Report of checking hello.pdf]]&lt;br /&gt;
&lt;br /&gt;
So it looks like our pdf is missing metadata. To fix this, we make a copy of &#039;&#039;&#039;hello.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
&lt;br /&gt;
%****************&lt;br /&gt;
% define medatata&lt;br /&gt;
%________________&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Some Name}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*********&lt;br /&gt;
% XMP data&lt;br /&gt;
%_________&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some notes on the example:&lt;br /&gt;
* it uses the latex package &#039;&#039;xmpincl&#039;&#039; to include XMP data to the pdf;&lt;br /&gt;
* it assumes there is a file &#039;&#039;&#039;pdfa-1b.xmp&#039;&#039;&#039; in the current directory.&lt;br /&gt;
&lt;br /&gt;
When we check the pdf result using acrobat 8, we got this report:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1b-report.png|Report of checking hello-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
With a little more effort, we can make our example to pass pdf/a-1a checking:&lt;br /&gt;
* use pdftex with a patch available at http://sarovar.org/tracker/index.php?func=detail&amp;amp;aid=945&amp;amp;group_id=106&amp;amp;atid=495&lt;br /&gt;
* make a copy of &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1a.tex&#039;&#039;&#039; and make the following change:&lt;br /&gt;
** replace &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
** add the following code:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
\pdfgeninterwordspace=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the file with patched pdftex, and we should get this report from checking:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1a-report.png|Report of checking hello-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
==Another trivial example==&lt;br /&gt;
Let&#039;s apply what we did above for another example: &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; which is part of standard latex distribution. &lt;br /&gt;
* We put all the additional latex code a file called &#039;&#039;&#039;pdfa-supp.tex&#039;&#039;&#039; which looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax&lt;br /&gt;
    \message{\string\pdfgeninterwordspace\space not supported by this version of pdftex}&lt;br /&gt;
\else&lt;br /&gt;
    \pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
    \pdfgeninterwordspace=1&lt;br /&gt;
\fi&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* let&#039;s add to &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; (after the line containing &amp;lt;tt&amp;gt;\documentclass{article}&amp;lt;/tt&amp;gt;) these lines to make it pass pdfa/1b check:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Leslie Lamport}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* to pass pdfa/1a check, we change &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
and compile the file by pdftex with the patch mentioned above.&lt;br /&gt;
&lt;br /&gt;
The result should be the same.&lt;br /&gt;
&lt;br /&gt;
==A less trivial example==&lt;br /&gt;
Now let&#039;s move on to &#039;&#039;&#039;sample2e.tex&#039;&#039;&#039;, which is another sample that is part of latex distribution. Again, let&#039;s start with pdf/a-1b check: we add the same thing as we did for &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; above, and the result is the same. However, with pdf/a-1a check we are not that lucky as before:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Sample2e-pdfa-1a-report.png|Report of checking sample2e-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
To fix this, we need to add these magic lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\input glyphtounicode.tex&lt;br /&gt;
\input glyphtounicode-cmr.tex&lt;br /&gt;
\pdfgentounicode=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code will cause that pdftex will generate ToUnicode mapping for all Type1 embedded fonts.&lt;br /&gt;
&lt;br /&gt;
==A slightly more complex example==&lt;br /&gt;
Let&#039;s continue with the example at http://www.tug.org/pracjourn/2006-2/eglen/. Based on what we did before, our first attempt is to add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Stephen Eglen}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But this time we got more errors than previously:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Intro2-pdfa-1b-report.png|Report from checking intro2-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
There are 2 problems:&lt;br /&gt;
* some fonts are not embedded. This is caused by the included pdf figure in the example. We fix this by loading the pdf in Inkspace, and save it again with all text converted to curves. Not the ideal approach, but it&#039;s a fast solution for the problem we are facing: how to get rid of non-embedded fonts from the pdf figure.&lt;br /&gt;
* the Color profile is not defined.&lt;br /&gt;
&lt;br /&gt;
So we fix the pdf figure, and add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\immediate\pdfobj stream attr{/N 4}  file{sRGBIEC1966-2.1.icm}&lt;br /&gt;
\pdfcatalog{%&lt;br /&gt;
  /OutputIntents [ &amp;lt;&amp;lt;&lt;br /&gt;
  /Type /OutputIntent&lt;br /&gt;
  /S/GTS_PDFA1&lt;br /&gt;
  /DestOutputProfile \the\pdflastobj\space 0 R&lt;br /&gt;
  /OutputConditionIdentifier (sRGB IEC61966-2.1)&lt;br /&gt;
  /Info(sRGB IEC61966-2.1)&lt;br /&gt;
 &amp;gt;&amp;gt; ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step, the output should pass pdf/a-1b check. For pdf/a-1a check, we replace &amp;lt;tt&amp;gt;\includexmp{pdfa-1b}&amp;lt;/tt&amp;gt; by &amp;lt;tt&amp;gt;\includexmp{pdfa-1a}&amp;lt;/tt&amp;gt; and compile by the patched pdftex.&lt;br /&gt;
&lt;br /&gt;
==Further notes==&lt;br /&gt;
It&#039;s hard to ensure pdf/a compliance for an arbitrary latex document. Here is a brief summary of issues we have experienced:&lt;br /&gt;
===Zero charwidth===&lt;br /&gt;
Some fonts have glyphs with zero character widths, which will be reported by Acrobat as &#039;&#039;Width information incomplete&#039;&#039;. Examples of such fonts are:&lt;br /&gt;
* cmsy&lt;br /&gt;
* euler&lt;br /&gt;
* MathTime Plus&lt;br /&gt;
* stmary&lt;br /&gt;
* xypic&lt;br /&gt;
&lt;br /&gt;
Usually we fix the problem by these steps:&lt;br /&gt;
*  convert original tfm to pl by tftopl&lt;br /&gt;
*  fix chars with zero width in pl (0.0 -&amp;gt; 0.001)&lt;br /&gt;
*  converted pl back to tfm by pltotf&lt;br /&gt;
*  convert original pfb to txt by t1disasm&lt;br /&gt;
*  check chars with zero width in *.txt (0 hsbw -&amp;gt; 1 hsbw)&lt;br /&gt;
*  converted txt back to pfb by t1asm&lt;br /&gt;
*  for each original pl, create a vpl which simply maps each char to itself&lt;br /&gt;
*  convert vpl to vf/tfm&lt;br /&gt;
&lt;br /&gt;
Example: let&#039;s have &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039; and &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039; where a few characters have zero widths. Applying the above steps, we get:&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.tfm&#039;&#039;&#039; = original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, except that chars with zero widths are replaced by 0.001&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.pfb&#039;&#039;&#039; = &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039;, except that chars with zero widths (0 hsbw) are replaced by 1 hsbw&lt;br /&gt;
* &#039;&#039;&#039;mtsy.vf&#039;&#039;&#039;: map each char to the same char in &#039;&#039;&#039;mtsy2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;: identical to original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;&lt;br /&gt;
The reason of using virtual fonts is that we don&#039;t want to make any change to &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, so that our workaround doesn&#039;t change the layout at all. TeX still &#039;&#039;sees&#039;&#039; the same font.&lt;br /&gt;
&lt;br /&gt;
===Character width mismatch===&lt;br /&gt;
Sometimes a Type1 font can use the &#039;&#039;&#039;div&#039;&#039;&#039; operator for specifying charwidth (hsbw) for better precision and the result don&#039;t match the value in tfm. In such cases, we bite the bullet and fix both tfm and type1 fonts by converting them to text format, process the text by some script and convert them back to tfm/type1. Luckily such fonts are not very common (so far we have encountered only one font xycirc10 from xypic).&lt;br /&gt;
&lt;br /&gt;
===Color===&lt;br /&gt;
to be added....&lt;br /&gt;
&lt;br /&gt;
===Annotation===&lt;br /&gt;
to be added...&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=204</id>
		<title>Generating PDF/A compliant PDFs from pdftex</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=204"/>
		<updated>2008-11-27T17:39:13Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Annotation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes necessary steps to create PDF/A compliant PDFs from pdftex and related issues. When we compile a latex document with pdftex, there can be a few issues that can prevents the result from begin pdf/a compliant, such as:&lt;br /&gt;
* problems with fonts:&lt;br /&gt;
** font files are not embedded,&lt;br /&gt;
** mismatch of character widths,&lt;br /&gt;
** characters of zero widths,&lt;br /&gt;
** fonts don&#039;t have a ToUnicode mapping&lt;br /&gt;
* problems with metadata:&lt;br /&gt;
** XMP data not included,&lt;br /&gt;
** XMP data don&#039;t match the info in pdfInfo catalog.&lt;br /&gt;
* problem with interword spacing: pdftex don&#039;t use space to separate words in pdf output.&lt;br /&gt;
* problem with color data.&lt;br /&gt;
&lt;br /&gt;
The usual way to verify if a pdf file is pdf/a compliant is to use a validating tool. There are a few pdf/a checking tools; the most common one is the Preflight tool in Acrobat Professional version 8 or newer. Beware that these checking tools can give very different the result on pdf/a compliance of a given pdf: a pdf file that passes pdf/a compliance checking in acrobat 8 can still fail to pass a check by another tool. In this document, we assume the following:&lt;br /&gt;
* input are latex documents&lt;br /&gt;
* tex live 2008 (which includes pdftex version 1.40.9) is used for latexing&lt;br /&gt;
* Acrobat 8.0 for pdf/a validation&lt;br /&gt;
&lt;br /&gt;
We start by a minimal example, and then move to more complex ones, to illustrate the issues one may encounter when trying to achieve pdf/a compliance.All needed input files for the examples described in this wiki page are included in [[Media:pdfa-supp.zip|this zip]]&lt;br /&gt;
&lt;br /&gt;
==A minimal example==&lt;br /&gt;
Let&#039;s have a minimal document &#039;&#039;&#039;hello.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we compile it with pdflatex and check for pdf/a compliance, we will get a report like this:[[Image:Hello-report.png|Report of checking hello.pdf]]&lt;br /&gt;
&lt;br /&gt;
So it looks like our pdf is missing metadata. To fix this, we make a copy of &#039;&#039;&#039;hello.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
&lt;br /&gt;
%****************&lt;br /&gt;
% define medatata&lt;br /&gt;
%________________&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Some Name}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*********&lt;br /&gt;
% XMP data&lt;br /&gt;
%_________&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some notes on the example:&lt;br /&gt;
* it uses the latex package &#039;&#039;xmpincl&#039;&#039; to include XMP data to the pdf;&lt;br /&gt;
* it assumes there is a file &#039;&#039;&#039;pdfa-1b.xmp&#039;&#039;&#039; in the current directory.&lt;br /&gt;
&lt;br /&gt;
When we check the pdf result using acrobat 8, we got this report:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1b-report.png|Report of checking hello-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
With a little more effort, we can make our example to pass pdf/a-1a checking:&lt;br /&gt;
* use pdftex with a patch available at http://sarovar.org/tracker/index.php?func=detail&amp;amp;aid=945&amp;amp;group_id=106&amp;amp;atid=495&lt;br /&gt;
* make a copy of &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1a.tex&#039;&#039;&#039; and make the following change:&lt;br /&gt;
** replace &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
** add the following code:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
\pdfgeninterwordspace=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the file with patched pdftex, and we should get this report from checking:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1a-report.png|Report of checking hello-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
==Another trivial example==&lt;br /&gt;
Let&#039;s apply what we did above for another example: &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; which is part of standard latex distribution. &lt;br /&gt;
* We put all the additional latex code a file called &#039;&#039;&#039;pdfa-supp.tex&#039;&#039;&#039; which looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax&lt;br /&gt;
    \message{\string\pdfgeninterwordspace\space not supported by this version of pdftex}&lt;br /&gt;
\else&lt;br /&gt;
    \pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
    \pdfgeninterwordspace=1&lt;br /&gt;
\fi&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* let&#039;s add to &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; (after the line containing &amp;lt;tt&amp;gt;\documentclass{article}&amp;lt;/tt&amp;gt;) these lines to make it pass pdfa/1b check:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Leslie Lamport}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* to pass pdfa/1a check, we change &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
and compile the file by pdftex with the patch mentioned above.&lt;br /&gt;
&lt;br /&gt;
The result should be the same.&lt;br /&gt;
&lt;br /&gt;
==A less trivial example==&lt;br /&gt;
Now let&#039;s move on to &#039;&#039;&#039;sample2e.tex&#039;&#039;&#039;, which is another sample that is part of latex distribution. Again, let&#039;s start with pdf/a-1b check: we add the same thing as we did for &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; above, and the result is the same. However, with pdf/a-1a check we are not that lucky as before:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Sample2e-pdfa-1a-report.png|Report of checking sample2e-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
To fix this, we need to add these magic lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\input glyphtounicode.tex&lt;br /&gt;
\input glyphtounicode-cmr.tex&lt;br /&gt;
\pdfgentounicode=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code will cause that pdftex will generate ToUnicode mapping for all Type1 embedded fonts.&lt;br /&gt;
&lt;br /&gt;
==A slightly more complex example==&lt;br /&gt;
Let&#039;s continue with the example at http://www.tug.org/pracjourn/2006-2/eglen/. Based on what we did before, our first attempt is to add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Stephen Eglen}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But this time we got more errors than previously:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Intro2-pdfa-1b-report.png|Report from checking intro2-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
There are 2 problems:&lt;br /&gt;
* some fonts are not embedded. This is caused by the included pdf figure in the example. We fix this by loading the pdf in Inkspace, and save it again with all text converted to curves. Not the ideal approach, but it&#039;s a fast solution for the problem we are facing: how to get rid of non-embedded fonts from the pdf figure.&lt;br /&gt;
* the Color profile is not defined.&lt;br /&gt;
&lt;br /&gt;
So we fix the pdf figure, and add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\immediate\pdfobj stream attr{/N 4}  file{sRGBIEC1966-2.1.icm}&lt;br /&gt;
\pdfcatalog{%&lt;br /&gt;
  /OutputIntents [ &amp;lt;&amp;lt;&lt;br /&gt;
  /Type /OutputIntent&lt;br /&gt;
  /S/GTS_PDFA1&lt;br /&gt;
  /DestOutputProfile \the\pdflastobj\space 0 R&lt;br /&gt;
  /OutputConditionIdentifier (sRGB IEC61966-2.1)&lt;br /&gt;
  /Info(sRGB IEC61966-2.1)&lt;br /&gt;
 &amp;gt;&amp;gt; ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step, the output should pass pdf/a-1b check. For pdf/a-1a check, we replace &amp;lt;tt&amp;gt;\includexmp{pdfa-1b}&amp;lt;/tt&amp;gt; by &amp;lt;tt&amp;gt;\includexmp{pdfa-1a}&amp;lt;/tt&amp;gt; and compile by the patched pdftex.&lt;br /&gt;
&lt;br /&gt;
==Further notes==&lt;br /&gt;
It&#039;s hard to ensure pdf/a compliance for an arbitrary latex document. Here is a brief summary of issues we have experienced:&lt;br /&gt;
===Zero charwidth===&lt;br /&gt;
Some fonts have glyphs with zero character widths, which will be reported by Acrobat as &#039;&#039;Width information incomplete&#039;&#039;. Examples of such fonts are:&lt;br /&gt;
* cmsy&lt;br /&gt;
* euler&lt;br /&gt;
* MathTime Plus&lt;br /&gt;
* stmary&lt;br /&gt;
* xypic&lt;br /&gt;
&lt;br /&gt;
Usually we fix the problem by these steps:&lt;br /&gt;
*  convert original tfm to pl by tftopl&lt;br /&gt;
*  fix chars with zero width in pl (0.0 -&amp;gt; 0.001)&lt;br /&gt;
*  converted pl back to tfm by pltotf&lt;br /&gt;
*  convert original pfb to txt by t1disasm&lt;br /&gt;
*  check chars with zero width in *.txt (0 hsbw -&amp;gt; 1 hsbw)&lt;br /&gt;
*  converted txt back to pfb by t1asm&lt;br /&gt;
*  for each original pl, create a vpl which simply maps each char to itself&lt;br /&gt;
*  convert vpl to vf/tfm&lt;br /&gt;
&lt;br /&gt;
Example: let&#039;s have &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039; and &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039; where a few characters have zero widths. Applying the above steps, we get:&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.tfm&#039;&#039;&#039; = original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, except that chars with zero widths are replaced by 0.001&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.pfb&#039;&#039;&#039; = &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039;, except that chars with zero widths (0 hsbw) are replaced by 1 hsbw&lt;br /&gt;
* &#039;&#039;&#039;mtsy.vf&#039;&#039;&#039;: map each char to the same char in &#039;&#039;&#039;mtsy2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;: identical to original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;&lt;br /&gt;
The reason of using virtual fonts is that we don&#039;t want to make any change to &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, so that our workaround doesn&#039;t change the layout at all. TeX still &#039;&#039;sees&#039;&#039; the same font.&lt;br /&gt;
&lt;br /&gt;
===Character width mismatch===&lt;br /&gt;
Sometimes a Type1 font can use the &#039;&#039;&#039;div&#039;&#039;&#039; operator for specifying charwidth (hsbw) for better precision and the result don&#039;t match the value in tfm. In such cases, we bite the bullet and fix both tfm and type1 fonts by converting them to text format, process the text by some script and convert them back to tfm/type1. Luckily such fonts are not very common (so far we have encountered only one font xycirc10 from xypic).&lt;br /&gt;
&lt;br /&gt;
===Color===&lt;br /&gt;
to be added....&lt;br /&gt;
&lt;br /&gt;
===Annotation===&lt;br /&gt;
to be added....&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
	<entry>
		<id>https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=203</id>
		<title>Generating PDF/A compliant PDFs from pdftex</title>
		<link rel="alternate" type="text/html" href="https://els-support4.river-valley.com/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex&amp;diff=203"/>
		<updated>2008-11-27T14:20:50Z</updated>

		<summary type="html">&lt;p&gt;Thanh: /* Annotation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page describes necessary steps to create PDF/A compliant PDFs from pdftex and related issues. When we compile a latex document with pdftex, there can be a few issues that can prevents the result from begin pdf/a compliant, such as:&lt;br /&gt;
* problems with fonts:&lt;br /&gt;
** font files are not embedded,&lt;br /&gt;
** mismatch of character widths,&lt;br /&gt;
** characters of zero widths,&lt;br /&gt;
** fonts don&#039;t have a ToUnicode mapping&lt;br /&gt;
* problems with metadata:&lt;br /&gt;
** XMP data not included,&lt;br /&gt;
** XMP data don&#039;t match the info in pdfInfo catalog.&lt;br /&gt;
* problem with interword spacing: pdftex don&#039;t use space to separate words in pdf output.&lt;br /&gt;
* problem with color data.&lt;br /&gt;
&lt;br /&gt;
The usual way to verify if a pdf file is pdf/a compliant is to use a validating tool. There are a few pdf/a checking tools; the most common one is the Preflight tool in Acrobat Professional version 8 or newer. Beware that these checking tools can give very different the result on pdf/a compliance of a given pdf: a pdf file that passes pdf/a compliance checking in acrobat 8 can still fail to pass a check by another tool. In this document, we assume the following:&lt;br /&gt;
* input are latex documents&lt;br /&gt;
* tex live 2008 (which includes pdftex version 1.40.9) is used for latexing&lt;br /&gt;
* Acrobat 8.0 for pdf/a validation&lt;br /&gt;
&lt;br /&gt;
We start by a minimal example, and then move to more complex ones, to illustrate the issues one may encounter when trying to achieve pdf/a compliance.All needed input files for the examples described in this wiki page are included in [[Media:pdfa-supp.zip|this zip]]&lt;br /&gt;
&lt;br /&gt;
==A minimal example==&lt;br /&gt;
Let&#039;s have a minimal document &#039;&#039;&#039;hello.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we compile it with pdflatex and check for pdf/a compliance, we will get a report like this:[[Image:Hello-report.png|Report of checking hello.pdf]]&lt;br /&gt;
&lt;br /&gt;
So it looks like our pdf is missing metadata. To fix this, we make a copy of &#039;&#039;&#039;hello.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; that looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\documentclass{report}&lt;br /&gt;
&lt;br /&gt;
%****************&lt;br /&gt;
% define medatata&lt;br /&gt;
%________________&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Some Name}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*********&lt;br /&gt;
% XMP data&lt;br /&gt;
%_________&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{document}&lt;br /&gt;
Hello, world!&lt;br /&gt;
\end{document}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some notes on the example:&lt;br /&gt;
* it uses the latex package &#039;&#039;xmpincl&#039;&#039; to include XMP data to the pdf;&lt;br /&gt;
* it assumes there is a file &#039;&#039;&#039;pdfa-1b.xmp&#039;&#039;&#039; in the current directory.&lt;br /&gt;
&lt;br /&gt;
When we check the pdf result using acrobat 8, we got this report:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1b-report.png|Report of checking hello-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
With a little more effort, we can make our example to pass pdf/a-1a checking:&lt;br /&gt;
* use pdftex with a patch available at http://sarovar.org/tracker/index.php?func=detail&amp;amp;aid=945&amp;amp;group_id=106&amp;amp;atid=495&lt;br /&gt;
* make a copy of &#039;&#039;&#039;hello-pdfa-1b.tex&#039;&#039;&#039; named &#039;&#039;&#039;hello-pdfa-1a.tex&#039;&#039;&#039; and make the following change:&lt;br /&gt;
** replace &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
** add the following code:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
\pdfgeninterwordspace=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the file with patched pdftex, and we should get this report from checking:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Hello-pdfa-1a-report.png|Report of checking hello-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
==Another trivial example==&lt;br /&gt;
Let&#039;s apply what we did above for another example: &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; which is part of standard latex distribution. &lt;br /&gt;
* We put all the additional latex code a file called &#039;&#039;&#039;pdfa-supp.tex&#039;&#039;&#039; which looks as follows:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
%***************************************************************************&lt;br /&gt;
% \convertDate converts D:20080419103507+02&#039;00&#039; to 2008-04-19T10:35:07+02:00&lt;br /&gt;
%___________________________________________________________________________&lt;br /&gt;
\def\convertDate{%&lt;br /&gt;
    \getYear&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{\catcode`\D=12&lt;br /&gt;
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}&lt;br /&gt;
}&lt;br /&gt;
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}&lt;br /&gt;
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}&lt;br /&gt;
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}&lt;br /&gt;
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}&lt;br /&gt;
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}&lt;br /&gt;
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}&lt;br /&gt;
\def\getTZm &#039;#1#2&#039;{%&lt;br /&gt;
    \edef\xTZm{#1#2}%&lt;br /&gt;
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\expandafter\convertDate\pdfcreationdate &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%**************************&lt;br /&gt;
% get pdftex version string&lt;br /&gt;
%__________________________&lt;br /&gt;
\newcount\countA&lt;br /&gt;
\countA=\pdftexversion&lt;br /&gt;
\advance \countA by -100&lt;br /&gt;
\def\pdftexVersionStr{pdfTeX-1.\the\countA.\pdftexrevision}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%********&lt;br /&gt;
% pdfInfo&lt;br /&gt;
%________&lt;br /&gt;
\pdfinfo{%&lt;br /&gt;
    /Title    (\Title)&lt;br /&gt;
    /Author   (\Author)&lt;br /&gt;
    /Subject  (\Subject)&lt;br /&gt;
    /Keywords (\Keywords)&lt;br /&gt;
    /ModDate  (\pdfcreationdate)&lt;br /&gt;
    /Trapped  /False&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%*************************&lt;br /&gt;
% explicit interword space&lt;br /&gt;
%_________________________&lt;br /&gt;
\expandafter\ifx\csname pdfgeninterwordspace\endcsname\relax&lt;br /&gt;
    \message{\string\pdfgeninterwordspace\space not supported by this version of pdftex}&lt;br /&gt;
\else&lt;br /&gt;
    \pdfmapline{+dummy-space &amp;lt;dummy-space.pfb}&lt;br /&gt;
    \pdfgeninterwordspace=1&lt;br /&gt;
\fi&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* let&#039;s add to &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; (after the line containing &amp;lt;tt&amp;gt;\documentclass{article}&amp;lt;/tt&amp;gt;) these lines to make it pass pdfa/1b check:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Leslie Lamport}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
* to pass pdfa/1a check, we change &lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\includexmp{pdfa-1a}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
and compile the file by pdftex with the patch mentioned above.&lt;br /&gt;
&lt;br /&gt;
The result should be the same.&lt;br /&gt;
&lt;br /&gt;
==A less trivial example==&lt;br /&gt;
Now let&#039;s move on to &#039;&#039;&#039;sample2e.tex&#039;&#039;&#039;, which is another sample that is part of latex distribution. Again, let&#039;s start with pdf/a-1b check: we add the same thing as we did for &#039;&#039;&#039;small2e.tex&#039;&#039;&#039; above, and the result is the same. However, with pdf/a-1a check we are not that lucky as before:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Sample2e-pdfa-1a-report.png|Report of checking sample2e-pdfa-1a.pdf]]&lt;br /&gt;
&lt;br /&gt;
To fix this, we need to add these magic lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\input glyphtounicode.tex&lt;br /&gt;
\input glyphtounicode-cmr.tex&lt;br /&gt;
\pdfgentounicode=1&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code will cause that pdftex will generate ToUnicode mapping for all Type1 embedded fonts.&lt;br /&gt;
&lt;br /&gt;
==A slightly more complex example==&lt;br /&gt;
Let&#039;s continue with the example at http://www.tug.org/pracjourn/2006-2/eglen/. Based on what we did before, our first attempt is to add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\def\Title{An Example Document}&lt;br /&gt;
\def\Author{Stephen Eglen}&lt;br /&gt;
\def\Subject{An Example Document}&lt;br /&gt;
\def\Keywords{LaTeX,Example,Document}&lt;br /&gt;
\input{pdfa-supp}&lt;br /&gt;
\usepackage{xmpincl}&lt;br /&gt;
\includexmp{pdfa-1b}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But this time we got more errors than previously:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Intro2-pdfa-1b-report.png|Report from checking intro2-pdfa-1b.pdf]]&lt;br /&gt;
&lt;br /&gt;
There are 2 problems:&lt;br /&gt;
* some fonts are not embedded. This is caused by the included pdf figure in the example. We fix this by loading the pdf in Inkspace, and save it again with all text converted to curves. Not the ideal approach, but it&#039;s a fast solution for the problem we are facing: how to get rid of non-embedded fonts from the pdf figure.&lt;br /&gt;
* the Color profile is not defined.&lt;br /&gt;
&lt;br /&gt;
So we fix the pdf figure, and add to the preamble these lines:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;latex&amp;quot;&amp;gt;&lt;br /&gt;
\immediate\pdfobj stream attr{/N 4}  file{sRGBIEC1966-2.1.icm}&lt;br /&gt;
\pdfcatalog{%&lt;br /&gt;
  /OutputIntents [ &amp;lt;&amp;lt;&lt;br /&gt;
  /Type /OutputIntent&lt;br /&gt;
  /S/GTS_PDFA1&lt;br /&gt;
  /DestOutputProfile \the\pdflastobj\space 0 R&lt;br /&gt;
  /OutputConditionIdentifier (sRGB IEC61966-2.1)&lt;br /&gt;
  /Info(sRGB IEC61966-2.1)&lt;br /&gt;
 &amp;gt;&amp;gt; ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step, the output should pass pdf/a-1b check. For pdf/a-1a check, we replace &amp;lt;tt&amp;gt;\includexmp{pdfa-1b}&amp;lt;/tt&amp;gt; by &amp;lt;tt&amp;gt;\includexmp{pdfa-1a}&amp;lt;/tt&amp;gt; and compile by the patched pdftex.&lt;br /&gt;
&lt;br /&gt;
==Further notes==&lt;br /&gt;
It&#039;s hard to ensure pdf/a compliance for an arbitrary latex document. Here is a brief summary of issues we have experienced:&lt;br /&gt;
===Zero charwidth===&lt;br /&gt;
Some fonts have glyphs with zero character widths, which will be reported by Acrobat as &#039;&#039;Width information incomplete&#039;&#039;. Examples of such fonts are:&lt;br /&gt;
* cmsy&lt;br /&gt;
* euler&lt;br /&gt;
* MathTime Plus&lt;br /&gt;
* stmary&lt;br /&gt;
* xypic&lt;br /&gt;
&lt;br /&gt;
Usually we fix the problem by these steps:&lt;br /&gt;
*  convert original tfm to pl by tftopl&lt;br /&gt;
*  fix chars with zero width in pl (0.0 -&amp;gt; 0.001)&lt;br /&gt;
*  converted pl back to tfm by pltotf&lt;br /&gt;
*  convert original pfb to txt by t1disasm&lt;br /&gt;
*  check chars with zero width in *.txt (0 hsbw -&amp;gt; 1 hsbw)&lt;br /&gt;
*  converted txt back to pfb by t1asm&lt;br /&gt;
*  for each original pl, create a vpl which simply maps each char to itself&lt;br /&gt;
*  convert vpl to vf/tfm&lt;br /&gt;
&lt;br /&gt;
Example: let&#039;s have &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039; and &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039; where a few characters have zero widths. Applying the above steps, we get:&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.tfm&#039;&#039;&#039; = original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, except that chars with zero widths are replaced by 0.001&lt;br /&gt;
* &#039;&#039;&#039;mtsy2.pfb&#039;&#039;&#039; = &#039;&#039;&#039;mtsy.pfb&#039;&#039;&#039;, except that chars with zero widths (0 hsbw) are replaced by 1 hsbw&lt;br /&gt;
* &#039;&#039;&#039;mtsy.vf&#039;&#039;&#039;: map each char to the same char in &#039;&#039;&#039;mtsy2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;: identical to original &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;&lt;br /&gt;
The reason of using virtual fonts is that we don&#039;t want to make any change to &#039;&#039;&#039;mtsy.tfm&#039;&#039;&#039;, so that our workaround doesn&#039;t change the layout at all. TeX still &#039;&#039;sees&#039;&#039; the same font.&lt;br /&gt;
&lt;br /&gt;
===Character width mismatch===&lt;br /&gt;
Sometimes a Type1 font can use the &#039;&#039;&#039;div&#039;&#039;&#039; operator for specifying charwidth (hsbw) for better precision and the result don&#039;t match the value in tfm. In such cases, we bite the bullet and fix both tfm and type1 fonts by converting them to text format, process the text by some script and convert them back to tfm/type1. Luckily such fonts are not very common (so far we have encountered only one font xycirc10 from xypic).&lt;br /&gt;
&lt;br /&gt;
===Color===&lt;br /&gt;
to be added....&lt;br /&gt;
&lt;br /&gt;
===Annotation===&lt;br /&gt;
to be added...&lt;/div&gt;</summary>
		<author><name>Thanh</name></author>
	</entry>
</feed>