| Using Tex/latex connector as a Chinese PDF example Li guozheng Edward G. J. Lee Contents
- 1 Preface
- 2 tool
- 2.1 CJK Kit
- 2.2 kernel Tex System
- 2.3 hyperref suite
- 3-font Security
- 3.1 General precautions for the reserved Fonts
- 3.2 fonts used in this article
- 4. Workflow
- 4.1 dvips/ps2pdf
- 4.2 dvipdfm
- 4.3 effectex/pdflatex
- 4.4 hyperref settings
- 5. Mobile implementation
- 5.1 architecture in the document
- 5.2 cross-reference)
- 5.3 hyperlink)
- 5.4 is the result?
- 6. Conclusion
- 7. permission granting
- About this document...
1 PrefaceTEX/LATEMany of my friends are reluctant to use the xcommand. If it is not often used, it will be very tiring, but I love the excellent quality of its typographical products, and you probably didn't think of it. I also used his typographical music for five times, as well as the architecture of chess games and chemistry ......, it is really cute and hateful. However, there is a way to save time, that is, to sort out some common structures when you are free, or compile a new format article, retained the structure of the answer case, as if it was a templet. You just need to fill in the article when necessary. This is a convenient method. The following describes how to useCJK1 suite for Chinese PDF. The tools used are general tEX/LATEThe X system has its roots, rather than creating a set of non-commercial business entities. Of course, some kits may need to be updated based on the guidelines in this article, so it should not be too difficult, isn't DIY popular now? Basically, TEX/LATEX system is used as a PDF file, which is mainly written by PS, unless it is usedPdftEXSystem, so the following are all about type1 or TTF. It is best not to use the PK font. Otherwise, the PDF representation made by the author will be poor in quality. 2 tool 2.1CJKKitIf yourCJKYes4.2.0Version, it is best to update it, you can go to the following website:
Ftp://ftp.ffii.org/pub/cjk/devel/cjk-current.tar.gz
As this is a development version, everything may be successful. The remarks attached to the examination can be used out, replacing the original system. Important:$ Texmf/tex/CJK2. the case under the heading should be converted into a new one, that is, the original scheme./TexinputAll cases under the project. UpdateCJKThe purpose of the suite is to work togetherHyperrefBookmarks, a Chinese product developed by the kit industry, was previously only available for commercial entities. Moreover, there is no commercial entity in the Unix-like system that supports bookmarks. 2.2PdftEXSystemThis is not just a collection kit, but a tEX/LATEReplacement product of X, which can be*. TexInto a PDF file. This is also possible without updating, but it is impossible to directly use TTF fonts. In the original system, only updates are allowed.PdftEX, You can go to the following websites to find the rows that can be pinged:
Http://www.tug.org/texlive/tlprod/Master/bin/
Do not forget some necessary cases, suchVertex Tex. Def, *. PoolWait.Texconfig init. Can be used to test the Network Description of 3rd million yuan. The following is a list of required cases:
Table:
PdftEXList of required cases
| Case |
Location |
| Vertex Tex |
/Usr/bin |
| Pdfetex |
/Usr/bin |
| Ttf2ibs |
/Usr/bin |
| Pdftosrc |
/Usr/bin |
| Vertex Tex. Pool |
/Usr/share/texmf/web2c |
| Pdfetex. Pool |
/Usr/share/texmf/web2c |
| Supp-mis.tex |
/Usr/share/texmf/tex/Context/base |
| Supp-pdf.tex |
/Usr/share/texmf/tex/Context/base |
| Vertex Tex. Def |
/Usr/share/texmf/tex/latex/graphics |
Different distribution or OS may have different locations. For example, slackware is concentrated in$ Texmf/bin. Windows SystemMikTEX willTexmf/miktex/bin. 2.3HyperrefKitThis collection kit mainly embeds some PDF Functions*. TexInternal. It does not matter if it is not updated, but there is no way to make the Chinese bookmarks in the PDF example. Of course, Chinese bookmarks must be used with the new version.CJKKit. Refer to the following website:
Ftp://ftp.tug.org/pub/tex/hyperref/
The version must be higher2002/04/12 v6.72lOtherwise, Chinese bookmarks cannot be processed. The original author of this suite isSebastian rahtzCurrentlyHeiko oberdiekThe specified region. In the actual example, please refer to the "5th Tips" section. It is suggested that you can refer to the "4.4 Tips" section. 3-font Security 3.1 General precautions for the reserved FontsThis part should be used in the post posted before the examination.PdftEX/PdflATEXEmbed Chinese TTF/TTC ''in the PDF file '':
Http://www.study-area.org/tips/latex/pdftex.html
What needs to be filled here is that there are still some friends with TTF of the previous big-5 release, which can be usedOto3. This program is added to the Unicode name/cmap table, so that it can be used as a unicode font. However, the map table does not match the Japanese part in the big-5 environment we use. I made a patch, as long asBig5.txtYou do not need to repeat the program. You can download it on the study-area Website:
Http://www.study-area.org/tips/latex/oto-BIG5.diff.gz
The patch method is as follows: cd /usr/local/share/oto/ gzip -dc oto-BIG5.diff.gz | patch -s -p0
To use type1,$ Texmf/dvips/config. PsIt is recommended to modify the settings below (here, your Chinese type1 or TTF fonts are installed and properly configured ): % The following settings are bound to use the type1 font of bluesky, equivalent to the-PPDF font of dvips. P + BSR. Map % cm/ams Fonts Bsr-interpolated.map % additional sizes P + hoekwater. Map % additional fonts from Taco hoekwater H Tex. Pro H alt-rule.pro % The following o should remove the previous %; otherwise, the setting of a row of dvips will be directed to the printer. O
If you do not add these settings, replace them with the following commands: dvips -Ppdf -G0 -o your.ps your.dvi
Do not omit this-G0Data, or you have$ Texmf/tex/dvips/config.pdfGThis setting is set to %. This is an oldVolume readThe compatibility issues produced by bugs.Volume readThere should be no such situation, but the addition will have other side effects. 3.2 fonts used in this articleThe fonts used in the PDF format in this article are both free trial or public domain. We are very grateful to all the companies and individuals provided by them for their attention, make this file a free file. Tables List in table 2:
Table:Fonts used in PDF
| Font Name |
Usage |
Font Name |
Provider |
Copyright |
| (LR) 1-5 bsmi00lp. TTF |
Content |
Wen DING Yu Shanghai song |
Winding Company |
GPL-like |
| Wcl-02.ttf |
Subject |
Wang zhengzong tuming |
Dr. Wang shudong |
GPL |
| Wcl-07.ttf |
Title |
Wang zhengzong's rough understanding |
Dr. Wang shudong |
GPL |
| Cm *. pfb |
Chinese and English characters |
Cm ps Fonts |
Blue Sky Research |
Public Domain |
The program used isOtoAndTtf2pt1. If you usePdftEXYou can directly capture TTF without converting it to type1. 4. WorkflowThe methods discussed below should be the most common.EX/LATEThe world of X is no strangerPerlThe world, a lot of current forms can be used ). However, in terms of processing Chinese characters, unless it is a self-developed program, it should be the most convenient method. The following examples are as follows:Chpdf. TexFor example, it is also the legal name of the document published in this article. 4.1Dvips/Ps2pdf This can be said to be the most consistent and oldest method. Recently causedGhostscriptGreatly improved, has made this pipeline method more and more perfect.GhostscriptTo6.51Only later versions have better results. In fact, this method is generally tEX/LATEThe normal process of X-train, from tEX/LATEX command to obtain*. DVIByDvipsComplete*. PsThenPs2pdfPending*. PsSuccess success*. PDF. Of course, in Chinese, we useCJKIn the big-5 scenario, the command isBg5latex. The actual execution command is as follows: bg5latex chpdf.tex dvips -t a4 -Ppdf -G0 chpdf ps2pdf13 chpdf.ps
WherePs238513Refers to the use of the PDF-1.3 format, it is recommended to use this format, than the upper limit, than the lower there is a lower limit. Personal experience, using this method for PDF writing, will be larger, but the quality will be better, and, in useGzipAfter renewalDvipdfmOrPdftEXIt's a little bit small. It's strange! This is also an example of the PDF format in this article. However, no matter how it works, the Chinese fonts in this article are embedded in the content. This will be more reliable, but the case will be larger. 4.2Dvipdfm This process is one fewer method than the first 4.1.*. Ps.DvipdfmMeeting*. DVIGenerate token directly*. PDF. DvipdfmIt is loyal to the original tEX, but in this way, the PDF features that can be added are much less and can be relied onHyperrefThe suite is used for Refresh. The actual execution line command is as follows: bg5latex chpdf.tex dvipdfm chpdf
4.3PdftEX/PdflATEX HyperrefThe suite can also add a lot of PDF features,PdftEX/PdflATEXIt can be said that it is a heavy attention, and can be used as a tEX/LATEX is used and added to a large number of PDF features. If the target is PDF,PdftEX/PdflATEXIt is undoubtedly the first choice tool. In this part, you can first test the network operators mentioned in section 3rd, and then apply them manually. The version must be at least0.14 hThe above versions can directly capture TTF. Of coursePdftEX/PdflATEXIn this article, I did not provide a brief description of the functions. You can use your hands to take the next test. 4.4HyperrefSettingsIn the current situation,HyperrefThe use of cipher packages may be comparablePdftEX/PdflATEXStill need to renew. He can work with the original T.EX/LATEThe X system can bePdftEX/PdflATEXTherefore, it is necessary to know more about this suite. 4.4.1HyperrefParameterIn principle, set whetherHyperref. cfg, UseHyperrefWhen using this tool, Macro will look for this tool. The sort order of the tool is as follows:
- Whether there are any settings in the document. This is the most advanced option. Other settings will be used.
- Are there current job targets?Hyperref. cfg.
- The identifier of the system, such as the Unix-like$ Texmf/tex/latex/hyperref. cfg. WindowsMikTEIn system X$ Texmf/tex/latex/00 miktex/hyperref. cfg.
4.4.2HyperrefSet the categoryHere I use my ownHyperref. cfgLet's say: 1 /hypersetup{backref, 2 dvips, 3 bookmarks=true, 4 pdfauthor=Edward G.J. Lee, 5 colorlinks=true, 6 breaklinks=true, 7 hyperfigures=true, 8 pdfstartview=FitH, 9 linkcolor=blue}
Basically, the original document is used./Label // refAnd the contents and indexes can be automatically interacted with others.2Is to use otherDvipdfm,PdftEXOr set it in the document. 3Indicates whether to use bookmarks,4Is the name of the author.Xpdf4 attachedPdfinfoThe command line will be displayed. Or useVolume readNameDocument infoAnd cannot be displayed in the PDF text.5And9Do you want to show the colors and colors when setting the superlinks. 8Is usedVolume readDisplay Mode of the PDF file, for example, yesFit widthOrFit in window. InXpdfAndGS/gvThis function is not available to determine the setting. Which of the following isFit widthHowever, this is the key for storing data to the PDF view. It seems that the control is not very good for individual users. Finally, please forgive me! Do not include the Arabic numerals in the example in your settings. 5. Mobile implementationThis part can be said to be the essence of this Article. To add the unique functions of PDF, it is not necessary to rely solely on traditional methods and tools, for example, some links and bookmarks functions, unless you understand some of the PDF's instructions, TEX commands/SpecialBring in*. TexIn the document, but this may be exhausting. It's just a few minutes.EX/LATEThe X-ray method, coupled with the instructions in PDF, has not been completed yet, and is probably out of the box. Don't explain it first. I have not explained it in depth in this article, but this live example in this article is your templet. Just apply it directly! The actual article and the completed PDF file can be posted on the study-area Website:
Http://www.study-area.org/tips/latex/chpdf.tex Http://www.study-area.org/tips/latex/chpdf.pdf
In this way, you can read the article and view the typographical result of the article. WhereChpdf. TexSince many annotations have been added, it is better than others, and individual annotations*. TexAll the documents are confidential. Please be patient. This article does not provide a clear description.Chpdf. TexIn the annotations will be slightly explained. Of course, you must have the most basic LATEIn the example of X-ray typographical processing, we have already used the simplified method, but there is a small part, in order to achieve the desired effect, we still have to use special suites. 5.1 architecture in the document1/documentclass [12pt, a4paper] {Article} 2/usepackage {CJK} 3/usepackage [dvips, cjkbookmarks] {hyperref} 4/begin {document} 5/begin {CJK *} {bg5} {aming} 6/cjktilde
...... This article
7/end {CJK *} 8/end {document}
Focus on2And3. If you want to usePdftEX, You haveDvipsChangeVertex Tex, Because of myHyperref. cfgPresetDvips, SoDvipsIt can also be omitted. And pay attention to thisCjkbookmarksSo that the PDF can be set up with Chinese bookmarks. Otherwise, some of the standards of the topic have been updated, in the end, if there is no such change, it will become a pile of dirty data. Thanks to the help of Werner Lemberg and heiko oberdiek, Werner proposed a patch to solve the question of Chinese bookmarks, then heiko makes some modifications and then releases them. Of course, this is currently only available in Windows systemsVolume readTo get the Chinese bookmarks and the Unix-lke SystemVolume readThere will still be a bunch of dynamic images, which isVolume read, Rather than PDF. For other topics, interactive photo taking, text injection, examination documents, indexes, etc., you only need to useHyperrefThe suite will be handled automatically, so you don't have to worry about it. However, this article does not cover the examination documents and indexes. This is a more advanced issue, so I will wait for a moment to explore. 5.2 cross-reference)Basically lATEX itself has an interactive snapshot command available, which is/label and/Ref,/pageref. Of course, this command can only be shown, no way to jump back and forth when the mouse clicks. That is, you only need to useHyperrefPlug-ins and tags are not added to the new tags. They also have the basic text link function. Of courseHyperrefThe suite also provides additional functions in this regard. Please refer to Table 3:
Table:Interaction photo
| Kit |
Command |
Function Description |
| LATEX |
/Label {Name} |
ToNameTo locate |
| |
/Ref {Name} |
DisplayNameChapter ‑ and ‑ tables |
| |
/Pageref {Name} |
DisplayNameRegion where it is located |
| Hyperref |
/Hypertarget {Name}{Text} |
ToNameTo locate |
| |
/Hyperlink {Name}{Text} |
Click hyperlink to jump |
| |
|
Location of hypertarget |
5.3 hyperlink)In the original LATEX is not available, TEX/LATEX is based on the flat Layout System, and the application on the Web is only available after the PDF format is used. I am afraid this is also tEThe reason why the X system is able to maintain a certain proportion of users for a long time is that its features and functions are large, and the product quality is also guaranteed, and the cost is not easily eliminated by time. The following table is still used to explain clearly. Please refer to Table 4:
Table:Method for over-peak website access
| Kit |
Addressing |
Description |
| PdftEX |
|
For compatibility, please use it directly |
| |
|
HyperrefMethod |
| Hyperref |
/Href {URL}{Text} |
WhenURLLocation |
| |
/Hyperref {URL}{Category}{Name}{Text} |
WhenURL#{Category} Location |
| LATEX2html |
/Htmladdnormallink {Text}{URL} |
WhenURLLocation |
5.4 is the result?Nowadays, it is very popular with ''as seen as wysiwyth''. I don't want to introduce any comments or discussions here, but the current environment for a person is the GNU/Linux system, I just said, "How can I handle it. First, I opened two hosts (rxvt). My Memory Window Management Program is icewm, I have already set up a "by" option to facilitate the movement between the two "window. The volume generator used isVim. An sh script has been written in the job categoryCompileThe content is as follows: #!/bin/sh if [ $# -ne 1 ] then echo "Usage: `basename $0` your.tex" exit 1 fi FNAME=$1 rmtextmp bg5latex $FNAME && / bg5latex $FNAME && / dvips -t a4 -Ppdf -G0 ${FNAME%.tex} && / ps2pdf ${FNAME%.tex}.ps && / xpdf ${FNAME%.tex}.pdf
WhereRmtextmpIs another sh script with the following content: #!/bin/sh rm -f *.aux *.toc *.log *.dvi *.cjk *.out / *.brf *.idx *.ind *.lof *.lot
It is mainly to remove some historical cases, which can be placed at the bottom of the road. Otherwise, we need to clarify the path. HereBg5latexThe second operation is required because the interaction screenshot is completed only after the second operation. Left Navigation PaneVimIf you want to renew your subscription, you can immediately move it to the right-hand Navigation Pane: ./compile chpdf.tex
That's enough. The article is not big, and type1 is used, the speed is quite fast, andVimYou can also use plain colors to help control whether the legal statement is correct. The premise is that the entire structure of the document must be established first, otherwise, it is easy to generate a Failover and stop. The large text version should be cut into several parts and controlled by make and makefile. Of course, we need to make everything happen.VimIt is also possible to control, so it will not be more convenient to view the points and points held by a person. InEmacsCompiler (system ?) There are also achievementsPreview-latexYes. Isn't it another WYSIWYG? In my experience, this kind of production won't lead to the MS word, especially the article size, such as hundreds of bytes of content, we don't need to talk about the micro-engine control in the internal department. Even developed by Chinese peopleCWTEX andChiTEX currently has a combination of GUI tools, which are quite convenient. Unfortunately, it focuses on Windows systems, and you still have to click it on Unix-like systems. I would like to remind you that tEThe X system layout is an on-screen layout system. Moreover, the typographical layout is an extremely elegant solution, and the size of the layout must be able to grasp the quality requirements, we don't want wtgiwyg (what they give is what you get ). 6. ConclusionOkay, the article is coming to an end. I have to confirm in advance that I am not something tEX/LATEThe author of X is only often in use and will have some experiences in use. In this article, I did not dare to prove it completely, but at least I did it myself, if there is any inaccuracy, I hope you can correct it. If there is any 'unexpected ', I will not accept it. You will not think that the content after reading these 10 bytes will become TEX/LATEX's home is gone! There is no such idea in Qianyi. There is still a high level in the mountains ....... In addition, many friends sent a message to TEX/LATEX-Related File problems, which are generally tEIn the X system, a large number of files are attached, but some files may not be exported.*. TexOr*. DVIAs long as they are moved out. In addition, some*. StyThere will be some explanations in the beginning, but this is first-hand information! Of course, these are all in English, but as long as the related commands are found, it will become a matter of fact when the operator moves hands according to the instruction format. Of course, the current FAQ cannot be forgotten:
Http://www.tex.ac.uk/faq
There are not many new versions in Chinese, but Professor Min's 《CWTEX typographical system should be taken as an example. This is one of the most important tools for manual analysis.CWTEX, but in fact it's almost the same, lATEThe setting method of X is fixed, so this website can be downloaded. Professor Yan Hongyi'sChiTEThe X system also has some documents that can be used for examination or online examination.CJKIn itself, the attached file also contains Chinese characters, that isReadmeb5.texIf there is no manual output, manually change the Chinese font used in the script.CJKThe Chinese language is replaced by a manual. 7. permission grantingCopyright 2002 Li guozheng Edward G. J. Lee In addition to the sh script, this file is a free file (FDL) and can be freely renewed, modified, or hashed. However, please retain the copyright notice. The part of SH script is public domain. The commercial standards mentioned in the document are all owned by the company's legal license. About this document... Using Tex/latex connector as a Chinese PDF example This document was generated usingLatex2HtmlTranslator version 2002 (1.62) Copyright 1993,199 4, 1995,199 6, Nikos drakos, Computer Based Learning Unit, University of Leeds. Copyright 1997,199 8, 1999, Ross Moore, mathematics department, Macquarie University, sysydney. The command line arguments were: Latex2html -Split 0-show_section_number-ascii_mode-noimages chpdf. Tex The translation was initiated by on 2002-04-27 Footnotes
-
...
CJK1
-
This is caused
Werner LembergAn L
AT
EX kit, which is used to print Chinese and Japanese documents.
-
... $ Texmf/tex/CJK2
-
This refers to the Unix-like system, generally in /Usr/share/texmf/tex/CJK. In Windows Texmf/tex/latex/CJK.
-
... Href = "http://sourceforge.net/projects/oto/"> oto3
-
This program is developed by Yao Zhang and does not use other functions. It is a small program that can be used independently, in the past, the big-5 middleware TTF was introduced to the Unicode table by using this program and sent to X or
Ttf2pt1To use
-
... Http://www.foolabs.com/xpdf/4
-
XpdfIs a PDF generator developed by Derek B. noonburg.
Volume readThe function is complete, but in free trial,
GhostscriptThe only ''professional ''' PDF recorder.
Compiled by Edward G. J. Lee (2002-04-27) |