2010-10-18– Ace – blog bus
October 18, 2010
For some reason, the weekend started with TeX for typesetting. Oh, of course, is not directly DonaldKnuth his old design of the most primitive TeX commands. After years of development, TeX has already appeared in various areas of TeX-based higher level of development, ease of use and better, more attention to the content author a good tool. In Ubuntu, I chose the “TeXLive”.
weekend more fragmented (with fruit, in addition to outside during the day and at night is difficult to come up with a long period of time studying these things), TeXLive installation and experience of the process is tortuous. TeXLive support a variety of installation, at first I chose network installation, network setup, but TeXLive needs more than 2,000 small files, I 1M broadband is too slow, then give up. TeXLive to replace the iso file, the iso actually have 1.9G, really surprised me is not small. While only one. Iso file, but the process is time-consuming and network installation did not estimate the number of poor. I do not know how long to wait, TeXLive2010iso finally completed. Installation procedures refer to some of the information online, roughly:
1, install perl-tk, TeXLive graphical package installation requires the support of
sudoapt-getinstallperl-tk
2, mount iso, run the installation program
sudomount-olooptexlive2010.iso/cdrom
sudo / cdrom / install-tl-gui < br />
TexLive package indeed very large, fully installed to more than 2.5 G of space, but unfortunately the book disk is too small, it needs to do some cutting in the installation window, click the “LanguageCollections” button, open the In addition to the dialog box to cancel all the other Chinese and English language pack, as long as the other relevant documents are in English, other languages, nothing to cancel the installation. This can save hundreds of M space. TeXLive default installation directory is “/ usr / local / texlive”, the root directory of my available space has been left soon after, and do not want to TeXLive installation to the default directory, then find another FAT32 partition, built a texlive, , modified TexLive the installation path, click “Install.” People see is the loss of a failed installation, the installation log prompt in the target file does not seem to control a certain authority, it is confusing, the command sudo earlier, the subject can not be solved. Back to the installation directory the default directory, try the installation again, this is actually very well, after I installed the root directory of the space of only 3G: (.
Oh, seems to have forgotten that :
Before installing be sure to “create a symbolic link points to the system directory” option set to “Yes / Yes”, this installer will automatically set up for you a variety of TeX
Live environment variable to the province after a lot of trouble.
3, test results of the installation is correct
TeXLive The Official Guide (by texdoc
texlive-zh-cn open) gives Testing the installation steps, not go into here. test, you will receive a post-layout documents with Tex: sample2e.pdf, you can At the same time to open the file with sample2e.pdf sample2e.tex do something visual comparison, look at the role of syntax macros.
if you just do the plain English of the document layout, then you may well stop here, saw no need to continue downward, due to the back to say is how TeXLive Chinese support.
TeXLive Chinese typesetting support a variety of ways, it is very easy to be a bunch of beginner concepts and tools package names do too confusing (until now, I just know some fur) where a fixed choice one way: Use xelatex command xeCJK macro package combination. xelatex command used to compile the tex file written in LaTeX format, and supports Unicode encoding and direct access to the system font. TeXLive2010 package contains xelatex and xeCJK macro package, so we need not separately installed.
begin testing the Chinese TeX support, the following is a Chinese character that contains the tex source file:
% HelloTeX.tex
\ documentclass {article}
\ usepackage {xeCJK}
\ setmainfont {SimSun}
\ begin {document}
Hello, TeX!
\ end {document}
use xelatex command to compile the tex file-xelatexHelloTeX.tex, perform the following results:
……
OutputwrittenonHelloTeX.pdf (1page).
TranscriptwrittenonHelloTeX. log.
xelatex the tex output directly into a pdf format and the conversion process in the log output to HelloTeX.log. with a document viewer open HelloTeX.pdf, found that Chinese characters display as garbage, It seems that the conversion was not successful. Open HelloTeX.log try to analyze the conversion log and found this error message:
InvalidUTF-8byteorsequenceatline5replacedbyU FFFD.
InvalidUTF- 8byteorsequenceatline5replacedbyU FFFD.
Missingcharacter: Thereisno? infontSimSun / ICU!
Missingcharacter: Thereisno? infontSimSun / ICU!
xelatex actually in HelloTeX.tex found illegal UTF-8 bytes! suddenly came to understand, I will file VIM configuration file for the GBK code set, the data stored within this HelloTeX.tex code is GBK, instead of UTF-8, and xelatex seems to default in UTF-8 analysis. tex file, no error will be strange.
temporary modification. vimrc, re-edit HelloTeX.tex (or use iconv to convert HelloTeX.tex from GBK encoding UTF-8 encoding ), re-run xelatexHelloTeX.tex, this time successful, “Hello, TeX!” is the correct output to pdf file in the.
xelatex GBK should also support the resolution within the code file fishes, turn a turn to online information, sure enough, by increasing the line \ XeTeXinputencoding
“GBK” to inform xelatex the tex file using GBK encoding:
% HelloTeX.tex
\ documentclass {article}
\ usepackage {xeCJK}
\ XeTeXinputencoding “GBK”
\ setmainfont {SimSun}
\ begin {document}
Hello, TeX!
\ end {document}
in the experience TeXLive period also met xelatex find the system font (such as SimSun) case, and found my system did not install these fonts, Ubuntu10.04 font seems very easy to install, the system will simsun.ttc from Windows “System drive \ Windows \ Fonts “directory put out a copy to your ~ /. fonts below can, then you through the” fc-list: lang = zh-cn “command to view the list of fonts installed on the system, not in the list before the Copy fonts SimSun, Copy after we found traces of the SimSun: “Times New Roman, SimSun: style = Regular”.
want to make good use of TeXLive, do not see Manual is not enough, if you and I will use the same xelatex and xeCJK combination, then XeTex (texdocxetex) and xeCJK (texdocxeCJK) of the Manual is a must promise to read the.


No Comments
No comments yet.
Sorry, the comment form is closed at this time.