如何安装打印机 WinEditLine

Redirecting Git for Windows' homepage...
Redirecting to the Git for Windows homepage
If you are not redirected automatically, please click .当前位置: >>
Winedt最新指南
WinEdtQuick Guideˇ Aleksander Simonic?
WinEdt Version 9.1 () A Typeset with L TEX 2ε and KOMA-Script class using Palatino and Bera fonts.generated:
ContentsList of Figures Acknowledgements 1 Installing WinEdt and TEXv vii 11.1 1.2 1.3 1.42Installing WinEdt is easy What about TEX? . . . . What Next? . . . . . . . Upgrading . . . . . . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .1 2 3 45Getting Started2.1 2.2 2.3 2.4 2.5 2.63Setting up a TEX project in WinEdt Compile and Preview . . . . . . . . PDF Viewer and inverse search . . Toolbar Alternatives . . . . . . . . TEX AUX Output Folder . . . . . . Execution Modes . . . . . . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. . . . . .. 6 . 7 . 8 . 9 . 10 . 1013WinEdt Help System3.1 3.2 3.34WinEdt Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Con?guration Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Macro Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1617WinEdt and Unicode (UTF-8) encoding4.1 4.2 4.3 4.4 4.55Code Page Converter . . . . . . . . . . . . TEX and International Characters (UTF-8) Translation Tables . . . . . . . . . . . . . . TEX and UTF-8 . . . . . . . . . . . . . . . . Modes and Submodes . . . . . . . . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .. . . . .18 19 20 21 2223A L TEX Demo: Non-WinEdt-Related Bonus5.1 5.2 5.3Graphics Inclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Color Package Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Rotated objects examples . . . . . . . . . . . . . . . . . . . . . . . . . . 26iii Contents 5.4 5.5 5.6 5.7 5.8 5.9 Landscape mode page example . . . . . . Another landscape page example . . . . . A Presentations in L TEX . . . . . . . . . . . . A L TEX and paper size . . . . . . . . . . . . A Simple Revision Control System (RCS) Useful TEX-ing Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 28 29 29 30 32iv List of Figures1 1.1 1.2 1.3 1.4 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.1 3.2 3.3 4.1 4.2 4.3 5.1 5.2 5.3 5.4 5.5 5.6 5.7TEX Lion: ready and willing. . . . . . . . . . . . . . . . . . . . . . . . . . viii WinEdt Setup UAC Warning WinEdt Setup . . . . . . . . . Execution Modes: TEX System Preferences: Wrapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 3 4WinEdt running for the ?rst time . . . . . . . . . . . . . . . . Set and Remove Main File Buttons . . . . . . . . . . . . . . . WinEdt ready to compile . . . . . . . . . . . . . . . . . . . . . This document displayed in SumatraPDF viewer . . . . . . . Execution Modes: PDF Viewer Alternatives . . . . . . . . . . Toolbar Alternatives . . . . . . . . . . . . . . . . . . . . . . . Customized WinEdt in action working on this document. . . Execution Modes Dialog . . . . . . . . . . . . . . . . . . . . . Execution Modes’s Context-sensitive Help . . . . . . . . . .. 5 . 6 . 6 . 7 . 8 . 9 . 10 . 12 . 12WinEdt’s On-line HTML Help System . . . . . . . . . . . . . . . . . . . 14 WinEdt Options Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 15 WinEdt Macro Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Preferences: Unicode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Document Settings: Code Page Converter . . . . . . . . . . . . . . . . . 18 Execution Modes: TeX Options . . . . . . . . . . . . . . . . . . . . . . . 21 WinEdt classic and new-style logo . . . . . . . . SV Adriana docked . . . . . . . . . . . . . . . . . About WinEdt Dialog . . . . . . . . . . . . . . . A L TEX Logo . . . . . . . . . . . . . . . . . . . . . . Rotated circles . . . . . . . . . . . . . . . . . . . . Mathematica 3D-objects in landscape mode . . . Happy TEX-ing from TUG and the WinEdt Team . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 24 24 26 26 28 33v vi AcknowledgementsA Ralf Heckmann supplied the template for L TEX and KOMA-Script package using Palatino and Bera fonts. This template is used to typeset this document.1Luca introduced and applied text styling commands, ?xed a few inaccuracies, and improved a few TEX examples. Adriana proofread and edited the draft version. She ?xed numerous language mistakes, cut out some fat, and slightly rearranged the text in order to improve the ?ow (for those that notice such things).Here is where you will be acknowledged if you contribute a chapter (or a section) of general interest that will improve this manual and help other users (new and experienced) to learn how to better use WinEdt. There is plenty of room for improvements and additional information but it will require the involvement of the WinEdt Community. This is your chance to do something about it!AT 1. L EX sources for this guide are available for download in a self-contained zipped archive. Unpack its contents in a directory of your choice, open the main document QuickGuide.tex and set it as the main ?le in WinEdt’s tree interface. Now you are ready to compile it with PDFTeXify button (or the universal compile shortcut F9). After the compilation is complete the resulting pdf document will be opened in your PDF Viewer (such as Adobe Reader or SumatraPDF). Please think about the environment before you decide to print the whole document. . .vii AcknowledgementsFigure 1: TEX Lion: ready and willing. . .viii 1 Installing WinEdt and TEX1.1 Installing WinEdt is easyDownload and execute the setup ?le winedt91-64.exe (or winedt91-32.exe if you choose to install a 32-bit version).1 As long as you’ve downloaded a legitimate copy of WinEdt (eg. from our web site ) you will receive the standard Windows User Account Control warning that displays WinEdt Inc. as the veri?ed publisher of this product.Figure 1.1: WinEdt Setup UAC Warning It is now safe to proceed with the installation. The Installer Wizard will guide you. For most users the default options in the Wizard should be used. If you are creating a portable installation, however, disable User Pro?le Creation: this way WinEdt will create a Local folder inside its install folder and this folder will contain all your custom settings. . . During the installation you can decide if you want this version of WinEdt associated with TEX ?les (and friends).2 Filetype associations can later be made, removed, or repaired (on a selective basis) through WinEdt’s Options -& Con?guration Wizard. However, on Windows with UAC-enabled this will require starting WinEdt with elevated privileges (which are already in effect during the installation).1. It is recommended that you download and install the latest version from our web site. Ordering a CD is not necessary as no extras are included on it. If you really need or want a physical copy you can save yourself some money by burning your own CD. 2. This is the default and recommended for most users.1Chapter 1 1 Installing WinEdt and TEXFigure 1.2: WinEdt Setup After the installation is completed start WinEdt from the shortcut on your desktop: now you are ready to go. If you are planning to use WinEdt on a regular basis you should consider pinning it to your taskbar. This is done from the Windows popup menu that is displayed when you right-click on the WinEdt icon on your desktop. The same menu can also be used to unpin the program if you ?nd your taskbar overloaded with applications.1.2 What about TEX?A If you are planning to use WinEdt for writing L TEX documents you must also install a TEX System such as MiKTEX or TEX L both TEX Systems run well on Windows, the choice is yours.3 If you haven’t done it yet this would be a good time! After the TEX installation is successfully completed restart WinEdt and it will automatically detect your TEX System and connect with its accessories.If in doubt, you can always start Execution Modes dialog in WinEdt’s Options menu and check the last page: Diagnosis. It explains everything. Help in this dialog offers a guide on how to manually ?x any problems in a rare situation when automatic detection fails.3. MiKTEX download is considerably smaller and the installation is faster. MiKTEX also has its Package Manager and Update Wizard to help you keep it current. However, MiKTEX may have to use its install-on-demand feature during a compilation in order to download and install missing packages that you may be using in your documents. This can make compilation slow until all missing packages have been installed. TEX Live, on the other hand, comes loaded with just AT about every supported L EX package. This makes the download huge and the installation slower than MiKTEX. It also requires an annual update in order to keep its large package repository up-to-date. However, once it is installed it runs fast.2 1.3 What Next?Figure 1.3: Execution Modes: TEX System Some users may also choose to install additional accessories such as Ghostscript and GSView. However, for those of us that do not intend to work with legacy postscript output format the only thing missing is a suitable PDF Viewer. SumatraPDF allows trouble-free previewing of compiled pdf documents with support for Forward and Inverse Search to switch between sources and the compiled pdf document. This is further explained in the next chapter. . .1.3 What Next?If you have a properly installed TEX system you are ready to proceed to the next chapter and see WinEdt in action working on this document. The default settings use Notepad-like Soft Wrapping and UTF-8 encoding for TEX Documents, as expected by new users. If these are not not your preferences you should make some changes now before starting to work on your documents (this can save you from a lot of problems and confusion later)! The Options -& Preferences dialog offers some basic choices pertaining to your preferred Wrapping, Unicode, and Backup strategy. Help in the dialog explains how.3Chapter 1 1 Installing WinEdt and TEXFigure 1.4: Preferences: Wrapping1.4 UpgradingUpgrading from WinEdt 9 series is easy! You don’t have to uninstall the previous build of WinEdt 9 in order to upgrade to the latest version. In fact you should not uninstall it if you want to preserve custom settings in your Application Data or Local folder. Here are the steps that you should perform for smooth upgrading: ? Install the new version (over the old one). ? Restart WinE new default settings are used and your last project is loaded. . . ? Execute Options -& Maintenance -& Upgrade Personal Con?guration menu command (to merge your personal settings with the new defaults). The &What’s New?& section in WinEdt’s Manual explains what has been added, changed, or ?xed for the latest build. Check it out!4 2 Getting StartedSo you’ve downloaded and installed WinEdt and started it for the ?rst time. This is what you see:Figure 2.1: WinEdt running for the ?rst time Not particularly impressive or useful as is. On the left is an empty tree control that will later be used to display the project structure, Table of Contents, and other items collected in the relevant documents. On top is the default 2-row toolbar with many buttons disabled (grayed out). There’s more to say about the toolbar interface, but for now let us point out that while many such buttons are currently disabled that does not mean there’s a bug or indicate something’s wrong with your WinEdt/TEX installation. That the TEX compiler, converters and previewer buttons are disabled simply indicates that currently there is nothing to compile, convert, or preview.11. If at this stage you have any doubt about what TEX System and other accessories WinEdt detected on your computer, start the Options -& Execution Modes dialog and check the last, Diagnosis, tab page. The report produced there will clearly indicate whether you forgot to install a TEX system such as MiKTEX or TEX Live (in which case, now is the time to do it!). . .5Chapter 2 2 Getting Started2.1 Setting up a TEX project in WinEdtNow we open the main ?le used to create this document: QuickGuide.tex. Use the button on the left of the toolbar in the tree interface to set this document as the main ?le for this WinEdt TEX project.Figure 2.2: Set and Remove Main File Buttons With the main ?le set, WinEdt builds the project tree with all included chapters and displays the TOC branch for this document.2 This main ?le consists of the preamble required for TEX-ing the entire project and at the end it lists all chapters. Use the TOC to open any chapter with actual contents: once the main ?le has been set, WinEdt knows to use that ?le for compilers and previewers even if you are currently working on a subdocument (or even on an unrelated ?le).3Figure 2.3: WinEdt ready to compile Note that many buttons in the toolbar are still disabled. TEX compilers such as the default PDFTeXify button4 are enabled but converters such as dvi2pdf and all2. Also, the name of the main document now shows in the last panel in the status line. 3. If you want to work on another project you will have to set its own main ? or, if you are working on a simple one-?le project with no need for navigation, remove any selected main ?le. 4. If you let the mouse cursor hover over each button you will see a hint giving a brief description of the action associated with this button.6 2.2 Compile and Preview previewers are still grayed out. But perhaps now you see the logic: no intermediate or ?nal (pdf) format has been created yet and these actions still don’t make any sense and that’s why they are still disabled (there is nothing to convert or preview).2.2 Compile and PreviewTo compile the document press the PDFTeXify button or use the universal compile shortcut F9. At the bottom of the screen WinEdt’s console will display the TEX output during the compilation. The whole process should only take a few seconds. However, if you are doing this for the ?rst time with the small MiKTEX installation it may take considerably longer because MiKTEX will have to install a few extra packages on the ?y. Be patient! The compilation will eventually end with zero errors and warnings. . . When the compilation is done the compiled pdf document will be displayed in the default PDF Viewer on your computer.Figure 2.4: This document displayed in SumatraPDF viewer7Chapter 2 2 Getting Started2.3 PDF Viewer and inverse searchMost users have Adobe Reader or Acrobat as the default pdf viewer on their computer. That is ?ne. However, Adobe is not the most suitable working previewer for pdf ?les generated externally (eg. by PDFLaTEX). SumatraPDF is a light-weight PDF Viewer that does not lock the pdf ?les it is previewing: it automatically refreshes their contents when they are recompiled, and it supports forward and inverse search, described below, based on synctex technology.5 It is strongly recommended that you install this application for TEXing.6 In fact SumatraPDF may be the only external application besides your TEX System that you need in order to make compiling and previewing problem-free. It is easy to use alternative PDF Viewers in WinEdt: start Options -& Execution Modes dialog, go to the PDF Viewer page, the click on the Help button for details. . .Figure 2.5: Execution Modes: PDF Viewer Alternatives In SumatraPDF you can double-click anywhere in the document and WinEdt will display the corresponding source. This is called Inverse Search and is implemented in the PDF Viewer. Forward Search is started in the editor and results in the PDF Viewer displaying the compiled text corresponding to the source position. In WinEdt you5. This functionality is superior to the older dvi src specials used by DVI Viewers such as YAP. 6. You don’t have to replace Adobe as your default pdf viewer8 2.4 Toolbar Alternatives have a button or shortcut to initiate this action. It can also be done by clicking on the current line bookmark in the left margin (or double-clicking on the left margin in front of the desired line). If you are not familiar with these concepts7 try it: it works very well!2.4 Toolbar AlternativesNotice that many buttons in the toolbar are still disabled: converters like DVIPS, dvi2pdf, ps2pdf and also Dvi Preview or GSView are still greyed out. This makes sense since we did not create any intermediate (legacy) output formats such as dvi or ps! Those who are used to such legacy formats have their reasons8 for sticking to them but creating pdf output with one of the PDF engines is all the TEX-ing most of us will ever want. And with vertical space being such a precious commodity on most wide screens we don’t really need or want a two-row toolbar where one-row will do just as well (see Figure 2.7). Many users will use F9 for compiling. And, as pointed out above, forward PDF search from WinEdt 9 can be initiated by clicking on the current line bookmark in the left margin (or double-clicking on the left margin in front of the desired line).9 This practically eliminates the need for the Forward PDF Search button in the toolbar. It can be useful to show whether this command is currently enabled C eg. the existence of pdf and synctex ?les, and many of us use such buttons for feedback like this rather than actually clicking on them on a regular basis: another argument for a smaller 1-row toolbar! The Options -& Toolbar menu contains a few prede?ned alternatives for toolbars.Figure 2.6: Toolbar Alternatives Try them and see which one best ?ts your needs. They can be further customized by adding or removing a particular button. In WinEdt’s Help -& Index, type the keyword Toolbar Alternatives and you will learn how!7. Help in the Execution Modes dialog explains the Forward/Inverse search fun read it up as it is very useful and will save you a lot of time. AT 8. See Chapter 5 to learn how to import images or control paper size in L EX without the need for intermediate formats. For example, most users do not have to install Ghostscript or GSView unless they really want to work with postscript output format. Beware though: this document cannot be compiled into dvi or ps because we did not provide any legacy eps version of graphics. . . 9. This is customizable by &event handlers& but for most users the default settings will be enough.9Chapter 2 2 Getting StartedFigure 2.7: Customized WinEdt in action working on this document. . .2.5 TEX AUX Output FolderIf you take a look at the folder where you unpacked this project you may be pleasantly surprised to ?nd that no TEX auxiliary and numerous temporary ?les are polluting the source or the Chapters folders. Your source folders are junk-free! In fact, all TEX output ?les are stored in a TeXAux directory that has been created for this purpose through the de?nition made in the Execution Modes dialog. As a result, only your sources and compiled pdf and synctex10 ?les are placed next to the main ?le: nice and neat!112.6 Execution ModesThe settings and de?nitions in the Execution Modes dialog govern how your compilers and accessories (TEX and friends) associated with WinEdt will behave. To illustrate another practical use of the Execution Modes dialog in connection with10. This ?le is there only to allow you to use forward and inverse search and it is not a part of your compiled pdf document. . . 11. For the more discerning, this feature can be further con?gured in the TeX Options page of Execution Modes. As always, clicking on Help in that dialog will explain the details.10 2.6 Execution Modes this project, notice that its source folder, while clean of TEX auxiliary and temporary ?les, does contain two non-standard packages: chapterthumb.sty and xrcs.sty. If you need to share the project with other people that also don’t have them installed, it’s best to leave them in your source document folder. If, on the other hand, you’re working on your own project which you don’t need to share with anyone (apart from the ?nal result), and you want to keep your source folder as neat as possible, you can place those ?les in a Packages subfolder. But then TEX will not ?nd them unless we inform it where to look for them. To do that, use the TEXINPUTS variable to let TEX know that Packages subfolder should be searched for such packages. In the Variables page of Execution Modes you can de?ne TEXINPUTS as:.;./Packages//;Now you can move them into the Packages subfolder and TEX will ?nd them without any other effort.TEXINPUTS and BIBINPUTS environment variables can be used to incorporate yourprivate (relative or ?xed) locations for sty or bib ?les into TEX’s input search path. If too many packages are installed using this method TEX will become slow but for a few private packages or bibliography databases this is an admissible and simple solution that will allow you to keep your source directory free of such ?les and also share bibliography databases among different projects. The Execution Modes dialog offers many possibilities that you may have not been aware of. You are urged to become familiar with this dialog and take advantage of what can be done, from de?ning an alternative, TEX-friendly, PDF Viewer to checking that your TEX system is properly installed, and lots in between. . . Help in the Execution Modes dialog is thorough and in-depth. It explains how WinEdt interacts with external accessories12 and what available alternatives13 can be easily incorporated in your custom version. If you are new to TEX-ing or WinEdt you will greatly bene?t from reading the dozen (or so) illustrated pages of Help associated with this dialog. . .12. Including and especially your TEX System and friends. 13. Including PDF Viewers, pdf converters, etc. . .11Chapter 2 2 Getting StartedFigure 2.8: Execution Modes DialogFigure 2.9: Execution Modes’s Context-sensitive Help12 3 WinEdt Help SystemChapter 3As already heavily hinted, WinEdt comes with extensive, detailed, and up-to-date documentation in its on-line HTML-Help manual. It is easily opened by pressing F1, and here you will ?nd the description of all available WinEdt options and macro functions. Help is also indexed1 to allow quick access to certain topics that might be of interest to you. You should ?nd it de?nitely worthwhile to spend a few minutes investigating what’s there and how it’s organized. However, with the possible exception of a few sections in the WinEdt Manual, the on-line documentation was not written as a gentle introduction for ?rst-time users. This guide is an attempt to be just that and to provide examples and hands-on guidance for setting up TEX projects with WinEdt as the center of control. In this guide we have tried to avoid duplicating information that is already available in the Help Manual. And as you have seen, you don’t have to study WinEdt’s documentation in order to start working on your TEX documents. The program is ready to go, by default con?gured for MiKTEX or TEX Live accessories. That being said let us brie?y describe what you will ?nd in WinEdt’s Help. It is organized in three parts as described below, starting with the most accessible one.3.1 WinEdt ManualAmong the main topics in the Manual you will see the User’s Guide, which explains some important concepts (such as modes, con?gurations, active strings) that make WinEdt more than just a simple (Notepad-like) editor with a few TEX-related buttons. Many sections in this part are heavily illustrated and written with a ?rst-time user in mind.2 The User’s Guide section of the Manual also contains a section, Default Shortcuts Overview, that lists all keyboard shortcuts used in the default settings.31. The Index can be used to quickly ?nd the information linked to a common keyword. If you still cannot ?nd the relevant information, use the third tab page of the navigation bar to perform a full search through the manual. Do not expect WinEdt’s documentation to deal with MiKTEX- or AT L EX-speci?c issues. Such information can be found in your TEX System’s doc folder. 2. Still, if (for the time being) you are not interested in such functionality you can ignore these concepts and simply use WinEdt as is. 3. Shortcuts, too, are customizable. . .13 3 WinEdt Help SystemFigure 3.1: WinEdt’s On-line HTML Help System There are Help topics for the Con?guration Wizard, Execution Modes and Preferences dialogs, all of which can be used to accomplish the most commonly requested customizations.4 And if you scroll through the menus, you will see many other dialogs, such as Search Menu -& Find dialog, or Tool -& Spell Checking dialog, which offer options for you to enable your preferred strategies. . . These and other WinEdt dialogs provide a context-sensitive help. Press the Help button in such dialogs and you’ll get relevant information pertaining to the contents of the dialog and the meaning of the available options. This information can be also accessed through the navigation bar (Dialogs. . . ) in the WinEdt Manual. Again, you don’t have to read it until you encounter the need to change something in the defaults. . . Dialogs aside, managing the majority of WinEdt options and customizing the program to any speci?c needs you have, will require the use of the Options Interface. . .4. It is strongly recommended that you take a look at those dialogs in order to get an idea of what can be easily accomplished. In particular, the Diagnosis tab page in the Execution Modes dialog will help you correctly diagnose and ?x any problems with external accessories (such as your TEX System).14 3.2 Con?guration Manual3.2 Con?guration ManualThe Options Interface has all the branches of WinEdt’s customizable con?gurations:Figure 3.2: WinEdt Options Interface The Con?guration Manual explains how to use this interface, lists all con?guration sections, and describes their properties. You should read the preface and possibly the Introduction to the Con?guration Manual before you attempt customizations through the Options Interface.5 As mentioned, the most commonly required customizations - such as wrapping, font, etc. - can be done through the Options -& Preferences dialog. However, advanced customizations - such as adding menu items, making changes to the toolbar, adding dictionaries - have to be done through the Options Interface, for which the Con?guration Manual should be consulted.5. Many users are initially intimidated by the numerous options and possibilities and are afraid of breaking something. However, if you approach it with an open mind you will soon realize that this is actually a very good way to manage your customizations even if you are not a WinEdt expert. Should something go wrong the Options Menu -& Maintenance menu has a command Rebuild Default which will restore
you can then return and ?x any mistake and then use Rebuild Local settings.15Chapter 3 3 WinEdt Help System3.3 Macro ManualAdditional information for more demanding and advanced users is available through the Macro Manual. The manual explains the syntax of WinEdt’s macro language and describes all available functions, together with their parameters. The topics in the Macro Manual also cover some other advanced issues, most notably: ? Command Line Switches ? Registers and Variables (such as %N, %T, %P. . . ) ? Regular Expressions ? etc. . . An in-depth understanding of WinEdt’s macro language is not required to add extra accessories or slightly modify the existing behavior. Numerous examples in this manual explain how. Comments and existing de?nitions in the con?guration ?les also provide additional guidance.Figure 3.3: WinEdt Macro Manual16 4 WinEdt and Unicode (UTF-8) encodingWinEdt is a unicode editor with support for UTF-8 or code page-speci?c encoding. UTF-8 is the default format for TEX documents. This can be con?gured through the Unicode section of the Options Interface - or through the Unicode page in the Preferences dialog (Help explains the details):Figure 4.1: Preferences: UnicodeUTF-8 is the best choice for TEX documents encoding. However, if you have to work with legacy documents that were created in your default code page-speci?c format WinEdt will treat such documents properly and will preserve their encoding. Users that have to deal with code pages that are not native to their version of Windows will have to use the CP converter to tell WinEdt how to treat such documents. WinEdt is capable of handling both Unicode and (legacy) code page-speci?c documents.17Chapter 4 4 WinEdt and Unicode (UTF-8) encoding4.1 Code Page ConverterIf a document’s mode ends with the submode :CPnum then the indicated code page is used to load the ?le in unicode format. For example: TeX:CP1251 uses Cyrillic code page. A comment in the beginning of a TEX document:% !Mode:: &TeX:UTF-8&will ensure that a document is properly loaded and saved. A similar convention is used by emacs:% -*-coding: utf-8 -*-WinEdt understands emacs coding directive for UTF-8. Some unicode or UTF-8 documents start with a Byte Order Mark (BOM). Unicodeaware applications can determine the coding of a document from its BOM. Windows Notepad always includes BOM in unicode or UTF documents. Unfortunately, the BOM signature also causes problems with many applications and compilers (including TEX with UTF-8 encoding) and that makes it rather useless. . . Without BOM and without any convention as described above it is sometimes hard to distinguish between UTF-8 and ANSI (code page-speci?c) documents. The Document Settings dialog has a CP Converter tab page. It can be used to change a document’s format or reload the document in the proper code page in the rare case of WinEdt not being able to automatically determine the correct encoding.Figure 4.2: Document Settings: Code Page ConverterHelp in the dialog explains how to use this functionality.18 4.2 TEX and International Characters (UTF-8)4.2 TEX and International Characters (UTF-8)Putting\usepackage[utf8]{inputenc}A enables you to use UTF-8 (unicode) coding in L TEX documents. As long as you open the document in WinEdt in UTF-8 mode you see the same characters in WinEdt as in your compiled document (as is the case with this UTF-8 document):? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? à á ? ? ? ? ? ? è é ê ? ì í ? ? ? ò ó ? ? ? ? ? ù ú ? ü ? ? ?
? ? ? § ? ? ? ˇ C ? ? ˇ c ? ?A Not all UTF-8 characters are currently supported by L TEX unless you load extra packages. For example the e () symbol requires:\usepackage{textcomp} % \usepackage{eurosym} % % get a &nicer& looking %\let\texteuro\euro %required for \texteuro required for \euro euro symbol: if you want \texteuro=\euroNote the difference between the shape of the \euro (e) and \texteuro () symbols. Such issues are non-WinEdt related and you will have to consult TEX’s documentation or, if needed, seek help on the appropriate forum (such as TEX Newsgroup A where L TEX related topics are discussed). You might have noticed that the preamble of this document also contains:\catcode‘\?=13 \def?{?} % WinEdt bullet (U+007F)-& Unicode Bullet (U+2022)This allows TEX to process an empty tabular environment as inserted by WinEdt’s auto-completion functionality.1 Bullets are represented by ?: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?In WinEdt the shortcut Ctrl+Space (Tools menu -& Next Bullet) lets you move through placeholders and ?ll in the actual data.1. New in WinEdt 9.1.19Chapter 4????????????????????????????????? àá??????èéê?ìí???òó?????ùú?ü???? ˇ ??c ??§???C ˇ?? 4 WinEdt and Unicode (UTF-8) encoding4.3 Translation TablesIf you prefer your documents to contain plain TEX notation for international characters (eg. \‘{A} stands for ?) then you should consider applying WinEdt’s read and write translation tables. This will make working with WinEdt more comfortable and it is required if you want to take advantage of WinEdt’s spell checking ability with international dictionaries. UTF-8 encoding is a better solution in most cases! WinEdt can convert certain strings into their unicode equivalents when the ?le is being read and then translate these characters back to the original strings representing international characters in TEX notation. Suitable translation tables for TeX mode are already de?ned (but not enabled) in the default settings: see Options Interface. The help in this interface provides the details. For example, the default TeX_Read and TeX_Write translation tables contain de?nitions like:&{\ss}& -& &?& &{\AA}& -& &?& &{\AE}& -& &?& &{\aa}& -& &?& &{\ae}& -& &?& &{\OE}& -& &?& &{\oe}& -& &?& &{\O}& -& &?& &{\o}& -& &?& &\c{C}& -& &?& &\c{c}& -& &?& &\^{A}& -& &?& &\~{A}& -& &?& &\&&{A}& -& &?& ... &?& &?& &?& &?& &?& &?& &?& &?& &?& &?& &?& &?& &?& &?& -& -& -& -& -& -& -& -& -& -& -& -& -& -& &{\ss}& &{\AA}& &{\AE}& &{\aa}& &{\ae}& &{\OE}& &{\oe}& &{\O}& &{\o}& &\c{C}& &\c{c}& &\^{A}& &\~{A}& &\&&{A}&Note that the last item is not a typo! To specify double quotes inside a double-quoted string they have to be repeated twice! Failing to observe this convention may completely corrupt WinEdt’s translation table. The read translation table supports two notations (eg. \^{A} and {\^A}). The write translation table TeX_Write is the inverse of the read translation table (except that it uses the ?rst, preferable, notation where applicable). You should use translation tables with some care: make a backup copy of your documents until you verify that the tables are set up correctly. Careless application of translation tables may irreversibly corrupt your documents (just like a global replace)!20 4.4 TEX and UTF-84.4 TEX and UTF-8While WinEdt supports unicode pretty well2 this is not necessarily the case for all TEX engines. For example, pdfTeX is not a unicode application and supports only limited unicode ranges, which may be enough for most international users that use the Latin alphabet but certainly is not suf?cient for CJK or Middle East users. But any TEX engine’s limitation in this respect is not a WinEdt-related issue and you A should seek information or help with this on L TEX forums. Happily TEX Systems such as MiKTEX and TEX Live include alternative TEX engines that have a better (or different) approach to handling UTF-8 documents containing characters outside the range supported by pdfTeX. And WinEdt provides an easy interface to alternative TEX engines such as XeTeX and LuaTeX. All you do is select your alternative from the drop-down button that lists different TEX compilers. Once an alternative has been selected you do not have use the drop-down portion of the button to activate the selected compiler until you want to change it again. Furthermore, if you want to make XeLaTeX or LuaLaTeX your default PDFTeXify engine you can easily do so in the TeX Options page of the Execution Modes dialog.Figure 4.3: Execution Modes: TeX Options2. Support for Bidirectional text and complex text processing is currently lacking in WinEdt. However, the work on a new version that uses MS Uniscribe library and can handle such text is on the way and should be completed sometime next year. . .21Chapter 4 4 WinEdt and Unicode (UTF-8) encoding4.5 Modes and SubmodesA document’s mode is initially determined from its ?letype and is stored as a local attribute of the ?le in WinEdt’s File List (Project File). This works in most cases for the main mode. However, bilingual users might want to tie certain attributes (such as dictionaries) to submodes that may not be apparent from the ?letype. Instead of setting such modes through the Document Settings dialog or adopting a practice to name your ?les with more than one ?letype (eg. Paper.fr.tex) it is possible to enter submodes (as comments) in the ?rst (or second) line of a document. WinEdt modes can be speci?ed as a comment:% !Mode:: &Mode:Submode:Submode&WinEdt also recognizes mode speci?cation as used by emacs:% -*- mode: TeX -*% -*- coding: utf-8 -*-It is also possible to specify mode and submode in a single comment:% -*- TeX:DE:Soft:UTF-8 -*-However, as Emacs might not recognize such speci?cation, it is better to use WinEdt’s convention !Mode:: &TeX:DE:Soft:UTF-8& as described above. Furthermore, for TEX documents WinEdt also detects the language submode from babel and UTF-8 coding from the inputenc package:// Determine Language Submodes from babel: // \usepackage[french,german,italian,spanish]{babel} // Determine Coding (UTF-8) from the preamble: // \usepackage[utf8]{inputenc}This functionality is implemented through event handler macros that are executed before a document is loaded into WinEdt, and which ensure that WinEdt opens and treats the document properly.3 The actual macro that is by default called from this event handler is%b\Macros\Events\GetMode.edtIf for some reason mode detection (or some portion of it) from comments is unwanted for your style of work you can edit this macro and comment out unwanted portions or make any other desirable changes. However, note that this macro is executed frequently and it has to be fast or else you’ll notice delays when opening documents or even when collecting data in previously un-opened documents. . .3. Event handlers are de?ned in the Advanced section of the Options Interface. Modes and submodes are explained further in WinEdt’s Help Manual -& User Guide. . .22 A 5 L TEX Demo: Non-WinEdt-Related Bonus5.1 Graphics InclusionGraphics inclusion in TEX documents is not WinEdt-related and the documentation that comes with your TEX System (eg. graphicx package) should be consulted. However, below are a few examples that show that it can be done! These work with my (default) version of MiKTEX 2.9 compiled with PDFLaTeX but come with no guarantee and no support from the WinEdt Team. The ?rst thing to know is that different graphic formats are supported by TEX depending on the intended output format (dvi or pdf). Here we will only focus on pdf because dvi format is seldom used these days and using intermediate formats like dvi and ps in order to create a pdf ?le via converters is not a good practice.1 PDFLaTeX supports pdf, png, and jpeg graphics formats.Figure 5.1: WinEdt classic and new-style logo in a suitable png format1. This document cannot be compiled to dvi format because we did not provide alternative (legacy) graphic formats like eps for the included images (on purpose!). Should you create an eps image for each graphic ?le in the Images folder you will be able to compile it to dvi format. But YAP (and other DVI viewers) will not properly display landscape pages or rotated tables. Although some users may disagree, using dvipdf or dvips+pspdf to create pdf ?les with eps images is not very ef?cient: eps images have to be converted to pdf every time the source is compiled. Converters usually degrade the graphics quality and can result in other problems such as misaligned or improperly placed images. It is much better to create images that can be included in pdf documents and convert non-supported formats once and forever! They are not supported because they are deemed obsolete and this will not change. If intermediate formats work for you that’s ?ne. If not there is no point complaining to the WinEdt Team since now you know how we feel about it. Besides WinEdt is completely irrelevant to such issues. . .23Chapter 5 A 5 L TEX Demo: Non-WinEdt-Related BonusFigure 5.2: SV Adriana dockedJPEG is a good format for pictures (non-vector graphics) like the one above. PNG format is suitable for vector graphics or computer screenshots like the one below:Figure 5.3: About WinEdt DialogNow you know it can be done! Learn how to use graphicx package if you need to do something more sophisticated. . .24 5.2 Color Package Example5.2 Color Package ExampleThis section is borrowed from MiKTEX’s Samples folder. You should de?nitely consult more documentation and examples that come with your TEX System. . . Text starts off in green a little red nested blue text returning to green 1. magenta cmyk black 2. prede?ned blue gray text Black text on red background Light background Dark background Black text, blue background, red frame White text, blue background, red frameThis is how it is done:\usepackage{color} ... \begin{enumerate} \item \textcolor[cmyk]{0,1,0,0}{magenta cmyk} black \item \color[gray]{0.5} \textcolor{blue}{predefined blue} gray text \end{enumerate} \definecolor{Light}{gray}{.80} \definecolor{Dark}{gray}{.20} \colorbox{red}{Black text on red background} \par\colorbox{Light}{% \textcolor{Dark}{Light background}} \par\colorbox{Dark}{% \textcolor{white}{Dark background}} \fcolorbox{red}{blue}{Black text, blue background, red frame} \fcolorbox{red}{blue}{\color{white}% White text, blue background, red frame}Chapter 525 A 5 L TEX Demo: Non-WinEdt-Related Bonus5.3 Rotated objects examplesa rot 1n tio 2 B a=330° 4 D c5 E d e a1 A brot at 2 B c Cion 3=4330 ° 5 EC bD d eATable 5.1: Rotated tablesA Figure 5.4: L TEX Logo rotated by ±15°Figure 5.5: Rotated circles26 5.4 Landscape mode page exampleThe preamble must load the following package for this to work:\usepackage{lscape} %landscape pages supportNamergb cmy cmyk hsb Hsb tHsb gray RGB HTML HSB Gray waveDefaultH = 360 H = 360 L = 255 M = 240 N = 15Base colors/notions red, green, blue cyan, magenta, yellow cyan, magenta, yellow, black hue, saturation, brightness hue?, saturation, brightness hue?, saturation, brightness gray Red, Green, Blue RRGGBB Hue, Saturation, Brightness Gray lambda (nm) L, M, N a H is a positive real numberParameter range [0, 1]3 [0, 1]3 [0, 1]4 [0, 1]3 [0, H ] × [0, 1]2 [0, H ] × [0, 1]2 [0, 1] {0, 1, . . . , L}3 {000000, . . . , FFFFFF} {0, 1, . . . , M}3 {0, 1, . . . , N } [363, 814]Table 5.2: Table in landscape mode example (from xcolor’s documentation)5.4 Landscape mode page example27Chapter 5 A 5 L TEX Demo: Non-WinEdt-Related Bonus28 Figure 5.6: Mathematica 3D-objects in landscape mode5.5 Another landscape page exampleThe preamble must load the following package for this to work:\usepackage{lscape} %landscape pages support A 5.6 Presentations in L TEXA 5.6 Presentations in L TEXA Presentation packages and software that can be used with L TEX are not WinEdtrelated topics. However, since we frequently get asked about such things we posted a question to WinEdt’s Mailing List and the response was overwhelming.Most users were of the opinion that beamer is currently the best when it comes to ease of use and the quality of the output. Alternatives texpower and seminar have also been mentioned. . . You can use MiKTEX’s Package Manager to install beamer. MiKTEX’s doc folder has all the documentation and examples that will help you start working on your own presentations. Some users mentioned that they had to upgrade their MiKTEX in order to be able to compile the examples, which rely on up-to-date packages. If you encounter any such problems you may have to do the same. . .A 5.7 L TEX and paper sizeA The best way to set the paper size in L TEX documents is to use the geometry package. TEX itself does not have a notion of output paper size and this package is essential if you need to change the paper size. The following will properly handle paper size in the printed document:\usepackage[letterpaper]{geometry} % or a4paperSome users use dvi2pdf or even dvips and then ps2pdf because these conversions seem to handle their choice of paper size correctly while PDFLaTeX does not. However, this does not make much sense as default paper size settings in these converters may change in future versions. Furthermore, and as already mentioned, using intermediate formats to produce a pdf document is not very ef?cient and tends to result in problems. Learning how to use the geometry package is a much better way to handle paper size issues. And this package can do much more. You should read its documentation to learn about it. Type geometry in the interface that can be started from WinEdt’s Help Menu -& LaTeX Doc (or Shift+Ctrl+F1 shortcut) and you can open the pdf manual describing this package2 in detail.2. Both the package and its documentation are, of course, a part of your TEX system and not WinEdt! In fact WinEdt is completely irrelevant when it comes to such issues. If you need assistance you should seek help on TEX forums.29Chapter 5 A 5 L TEX Demo: Non-WinEdt-Related Bonus5.8 A Simple Revision Control System (RCS)On www.winedt.org you’ll ?nd a link to the page that describes how to use RCS or CS-RCS with WinEdt. RCS (Revision Control System) is the proper way to deal with revisions. . . However, simple revisions or corrections done by the copy editor and intended for the authors can be handled in a much simpler manner. WinEdt provides a sample A L TEX package xrcs.sty that can be used for such editing. The package de?nes two macros \RCSAdd{...} and \RCSDel{...}. These two macros can be used to mark simple additions and deletions, respectively. In WinEdt the environments are colored in blue and red (as de?ned in the Switches section of the Options Interface). Depending on the options the compiled document can contain additions and/or deletions (in color or plain text). Furthermore, the package also provides a tag \RCSMark{...} which can be used to mark the argument with a yellow marker and \RCSRem{...} which can be used to include remarks. All four RCS tags are de?ned as switches in WinEdt’s default highlighting scheme for TeX mode. The xrcs.sty package provides the following options (with the default values displayed in red):active marker remarks new old inactive nomarker noremarks nonew nooldExamples of usage:\usepackage[active,new,old,remarks,marker]{xrcs} \usepackage[active]{xrcs} % Only Additions- in blue colors \usepackagep[active,old,nonew]{xrcs} % Only old text - in red \usepackage[nomarker}{xrcs} % Only Additions: final versionIn your preamble you have to also include the color package:\usepackage{color}Text example:\RCSMark{IMPORTANT:} WinEdt’s \RCSDel{menu}\RCSRem{use capitals!} \RCSAdd{Menu} should be thought of as an Action List...with \usepackage[active,new,noold,marker]{xrcs} is processed as: IMPORTANT: WinEdt’s Menu should be thought of as an Action List. . .30 5.8 A Simple Revision Control System (RCS) Beside the highlighting de?nitions for switches \RCS*{...} WinEdt also has a popup menu Edt RCS containing some commands that can make the revisions easier. This popup menu is displayed in response to the Alt+R keystroke. The properties of the popup can be adjusted through the Options Interface (Popup Menus). . . The xrcs.sty ?le is included with this document’s sources. Feel free to make changes and improvements. . . Note that the WinEdt Team does not provide support for this package: it’s take it or leave it. . .% ------------------------------------------------------------% File: xrcs.sty % % A (very) simple Revision Control System for LaTeX2e/WinEdt % ************************************************************* \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{xrcs}[ v0.002 RCS] \RequirePackage{color} \newif\ifMarker \Markertrue \newif\ifRemarks\Remarkstrue \newif\ifAddDel \AddDeltrue \newif\ifAddNew \AddNewtrue \newif\ifAddOld \AddOldfalse \DeclareOption{active}{\AddDeltrue} \DeclareOption{inactive}{\AddDelfalse} \DeclareOption{marker}{\Markertrue} \DeclareOption{nomarker}{\Markerfalse} \DeclareOption{remarks}{\Remarkstrue} \DeclareOption{noremarks}{\Remarksfalse} \DeclareOption{new}{\AddNewtrue} \DeclareOption{nonew}{\AddNewfalse} \DeclareOption{old}{\AddOldtrue} \DeclareOption{noold}{\AddOldfalse} \ExecuteOptions{inactive,noold,noremarks,new,marker} \ProcessOptions % ------------------------------------------------------------\def\RCSMark#1{\ifMarker{\colorbox{yellow}{#1}}\else#1\fi} \def\RCSRem#1{\ifRemarks{\textsf{#1}}\fi} \def\RCSDel#1{\ifAddOld\ifAddDel{\color{red}#1}\else#1\fi\fi} \def\RCSAdd#1{\ifAddNew\ifAddDel{\color{blue}#1}\else#1\fi\fi} %--------------------------------------------------------------Once again, this is a very simpli? it is somewhat primitive and it is lacking all the features available in proper RCS. . . However, it may be of some interest since it is very simple to use: in any text editor it is easy to search for \RCS. . .31Chapter 5 A 5 L TEX Demo: Non-WinEdt-Related Bonus5.9 Useful TEX-ing HintsCheck the source code of this document in WinEdt. Pay attention to comments included in the preamble. . . For author-year references use:\usepackage{natbib}Specify your bibliography database in a different folder:\bibliography{Biblio/articles.bib}Note that you have to specify the path UNIX-style (using forward instead of backward slash as folder separator). Avoid spaces in ?lenames (some TEX accessories may not work properly with spaces in the ?lename speci?cation). Most TEX Systems allow you to place your bib ?les in a separate folder on your localtexmf tree. For details consult the documentation that comes with your TEX System. MiKTEX users can create a bibtex folder in their localtexmf tree, place their bib ?les there, and refresh the FNDB in MiKTEX’s Options interface. For fancy pdf ?les use:\usepackage{hyperref} \hypersetup{ pdftitle={Shown in AR File Information}, pdfstartview=FitH, % Fit the page horizontally bookmarks=true, % Open Bookmarks in AR } % more options can be found in % TEXMF/doc/latex/hyperref/manual.pdfTo manually correct the hyphenation of a word that was not properly handled by TEX (eg. Weltauffassung) put the following in the preamble:\hyphenation{Welt-auf-fas-sung}A To prevent long titles in your table of contents (generated by L TEX) use alternative short title:\section[Short Title for TOC]{Long long long title}A You can ?nd everything about TEX and L TEX on: TUG. . .32 5.9 Useful TEX-ing HintsFigure 5.7: Happy TEX-ing from TUG and the WinEdt Team33Chapter 5 34
更多搜索:
All rights reserved Powered by
文档资料库内容来自网络,如有侵犯请联系客服。}

我要回帖

更多关于 如何安装win7系统 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信