Quick Guide
Quick Guide
Quick Guide
Aleksander Simonič
© 1993–2017
Contents
List of Figures iv
Acknowledgements v
2 Getting Started 5
2.1 Setting up a TEX project in WinEdt . . . . . . . . . . . . . . . . . . . . . 6
2.2 Compile and Preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 PDF Viewer and inverse search . . . . . . . . . . . . . . . . . . . . . . . 8
2.4 Toolbar Alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.5 TEX AUX Output Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6 Execution Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
ii
Contents
Bibliography 37
iii
List of Figures
iv
Acknowledgements
Ralf Heckmann supplied the template for LATEX and KOMA-Script package using
Palatino and Bera fonts. This template is used to typeset this document.1
Luca introduced and applied text styling commands, fixed a few inaccuracies,
and improved a few TEX examples.
Adriana proofread and edited the draft version. She fixed numerous language
mistakes, cut out some fat, and slightly rearranged the text in order to improve the
flow (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!
1. LATEX 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 file 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. . .
v
Acknowledgements
vi
Chapter 1
1 Installing WinEdt and TEX
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 Profile 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 associa-
ted with TEX files (and friends).2 Filetype associations can later be made, removed,
or repaired (on a selective basis) through WinEdt’s Options -> Configuration 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.
1
1 Installing WinEdt and TEX
Chapter 1
Figure 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 find your taskbar
overloaded with applications.
If you are planning to use WinEdt for writing LATEX documents you must also install
a TEX System such as MiKTEX or TEX Live; 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.
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
about every supported LATEX 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 Installing WinEdt and TEX
Chapter 1
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. . .
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.
3
1 Installing WinEdt and TEX
Chapter 1
Figure 1.4: Preferences: Wrapping
1.4 Upgrading
You don’t have to uninstall the previous build of WinEdt 10 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:
• Restart WinEdt; new default settings are used and your last project is loaded. . .
The "What’s New?" section in WinEdt’s Manual explains what has been added,
changed, or fixed for the latest build. Check it out!
4
2 Getting Started
Chapter 2
So you’ve downloaded and installed WinEdt and started it for the first time. This is
what you see:
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 (legacy) 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.1
1. 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!). . .
5
2 Getting Started
Now we open the main file 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
file for this WinEdt TEX project.
Chapter 2
Figure 2.2: Set and Remove Main File Buttons
With the main file set, WinEdt builds the project tree with all included chapters and
displays the TOC branch for this document.2 This main file 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 file has been set,
WinEdt knows to use that file for compilers and previewers even if you are currently
working on a subdocument (or even on an unrelated file).3
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 all
2. 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 file; or, if you are
working on a simple one-file project with no need for navigation, remove any selected main file.
4. If you let the mouse cursor hover over each button you will see the hint giving a brief description
of the action associated with this button.
6
2 Getting Started
previewers are still grayed out. But perhaps now you see the logic: no intermediate
or final (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).
Chapter 2
To 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 first time with the small MiKTEX installation
it may take considerably longer because MiKTEX will have to install a few extra
packages on the fly. 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.
7
2 Getting Started
Most users have Adobe Reader or Acrobat as the default pdf viewer on their
computer. That is fine. However, Adobe is not the most suitable working previewer
for pdf files generated externally (eg. by PDFLaTEX).
Chapter 2
SumatraPDF is a light-weight PDF Viewer that does not lock the pdf files 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 TEX-
ing.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. . .
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 you
5. 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 viewer
8
2 Getting Started
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!
Chapter 2
2.4 Toolbar Alternatives
Notice 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 10 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 – eg.
the existence of pdf and synctex files, 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 predefined
alternatives for toolbars.
Try them and see which one best fits 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 functionality in detail;
read it up as it is very useful and will save you a lot of time.
8. See Chapter 5 to learn how to import images or control paper size in LATEX 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.
9
2 Getting Started
Chapter 2
Figure 2.7: Customized WinEdt in action working on this document. . .
If you take a look at the folder where you unpacked this project you may be
pleasantly surprised to find that no TEX auxiliary and numerous temporary files are
polluting the source or the Chapters folders. Your source folders are junk-free!
In fact, all TEX output files are stored in a TeXAux directory that has been created
for this purpose through the definition made in the Execution Modes dialog. As a
result, only your sources and compiled pdf and synctex10 files are placed next to the
main file: nice and neat!11
The settings and definitions in the Execution Modes dialog govern how your com-
pilers and accessories (TEX and friends) associated with WinEdt will behave. To
10. This file 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 configured in the TeX Options page of
Execution Modes. As always, clicking on Help in that dialog will explain the details.
10
2 Getting Started
illustrate another practical use of the Execution Modes dialog in connection with
this project, notice that its source folder, while clean of TEX auxiliary and temporary
files, 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.
Chapter 2
If, on the other hand, you’re working on your own project which you don’t need
to share with anyone (apart from the final result), and you want to keep your source
folder as neat as possible, you can place those files in a Packages subfolder.
But then TEX will not find 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 Varia-
bles page of Execution Modes you can define TEXINPUTS as:
.;./Packages//;
Now you can move them into the Packages subfolder and TEX will find
them without any other effort.
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 defining 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 benefit from reading the dozen (or so) illustrated pages
of Help associated with this dialog. . .
11
2 Getting Started
Chapter 2
Figure 2.8: Execution Modes Dialog
12
3 WinEdt Help System
As 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 find the description of all available WinEdt options and macro
Chapter 3
functions. Help is also indexed1 to allow quick access to certain topics that might be
of interest to you. You should find it definitely 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 first-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
configured for MiKTEX or TEX Live accessories.
That being said let us briefly describe what you will find in WinEdt’s Help. It is
organized in three parts as described below, starting with the most accessible one.
Among the main topics in the Manual you will see the User’s Guide, which explains
some important concepts (such as modes, configurations, 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 first-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.3
1. The Index can be used to quickly find the information linked to a common keyword. If you still
cannot find 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
LATEX-specific 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 System
Chapter 3
Figure 3.1: WinEdt’s On-line HTML Help System
There are Help topics for the Configuration Wizard, Execution Modes and Preferen-
ces 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. . .
Dialogs aside, managing the majority of WinEdt options and customizing the pro-
gram to any specific 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 fix any problems with external accessories (such as your
TEX System).
14
3 WinEdt Help System
The Options Interface has all the branches of WinEdt’s customizable configurations:
Chapter 3
Figure 3.2: WinEdt Options Interface
The Configuration Manual explains how to use this interface, lists all configuration
sections, and describes their properties. You should read the preface and possibly
the Introduction to the Configuration Manual before you attempt customizations
through the Options Interface.5
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 the default settings; you can then return and fix any mistake
and then use Rebuild Local settings.
15
3 WinEdt Help System
Additional 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:
• Regular Expressions
Chapter 3
• etc. . .
16
4 WinEdt and Unicode (UTF-8) encoding
WinEdt is a unicode editor with support for UTF-8 or code page-specific encoding.
UTF-8 is the default format for TEX documents. This can be configured through
the Unicode section of the Options Interface - or through the Unicode page in the
Preferences dialog (Help explains the details):
Chapter 4
Figure 4.1: Preferences: Unicode
UTF-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-specific 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-specific documents.
17
4 WinEdt and Unicode (UTF-8) encoding
If a document’s mode ends with the submode :CPnum then the indicated code page
is used to load the file 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:
Chapter 4
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-specific) 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.
18
4 WinEdt and Unicode (UTF-8) encoding
Putting
\usepackage[utf8]{inputenc}
enables you to use UTF-8 (unicode) coding in LATEX 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):
À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ñ Ò Ó Ô Õ Ö Ø Œ Ù Ú Û Ü Ý Ÿ Š ß ¡
à á â ã ä å æ ç è é ê ë ì í î ï ñ ò ó ô õ ö ø œ ù ú û ü ý ÿ š € ¿
† ‡ § ¶ © ® Č Š Ž č š ž
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØŒÙÚÛÜÝŸŠß¡
àáâãäåæçèéêëìíîïñòóôõöøœùúûüýÿš€¿
† ‡ § ¶ © ® Č Š Ž č š ž
Not all UTF-8 characters are currently supported by LATEX unless you load extra
Chapter 4
packages. For example the e (€) symbol requires:
Note 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 documen-
tation or, if needed, seek help on the appropriate forum (such as TEX Newsgroup
where LATEX 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)
• • • • •
• • • • •
• • • • •
• • • • •
In WinEdt the shortcut Ctrl+Space (Tools menu -> Next Bullet) lets you move through
placeholders and fill in the actual data.
19
4 WinEdt and Unicode (UTF-8) encoding
If you prefer your documents to contain plain TEX notation for international charac-
ters (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 file 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 defined (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
definitions like:
Chapter 4
"{\ss}" -> "ß" "ß" -> "{\ss}"
"{\AA}" -> "Å" "Å" -> "{\AA}"
"{\AE}" -> "Æ" "Æ" -> "{\AE}"
"{\aa}" -> "å" "å" -> "{\aa}"
"{\ae}" -> "æ" "æ" -> "{\ae}"
"{\OE}" -> "Œ" "Œ" -> "{\OE}"
"{\oe}" -> "œ" "œ" -> "{\oe}"
"{\O}" -> "Ø" "Ø" -> "{\O}"
"{\o}" -> "ø" "ø" -> "{\o}"
"\c{C}" -> "Ç" "Ç" -> "\c{C}"
"\c{c}" -> "ç" "ç" -> "\c{c}"
"\^{A}" -> "Â" "Â" -> "\^{A}"
"\~{A}" -> "Ã" "Ã" -> "\~{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 first, 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 WinEdt and Unicode (UTF-8) encoding
While WinEdt supports unicode pretty well1 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 sufficient for CJK or Middle East users. But
any TEX engine’s limitation in this respect is not a WinEdt-related issue and you
should seek information or help with this on LATEX forums.
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.
Chapter 4
1. WinEdt uses the powerful MS Uniscribe library with support for bidirectional text and complex
text processing.
21
4 WinEdt and Unicode (UTF-8) encoding
A document’s mode is initially determined from its filetype and is stored as a local
attribute of the file 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 filetype.
Instead of setting such modes through the Document Settings dialog or adopting
a practice to name your files with more than one filetype (eg. Paper.fr.tex) it is
possible to enter submodes (as comments) in the first (or second) line of a document.
Chapter 4
% -*- TeX:DE:Soft:UTF-8 -*-
However, as Emacs might not recognize such specification, 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:
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.2 The actual macro that is by default called from this
event handler is
%b\Macros\Events\GetMode.edt
If for some reason mode detection (or some portion of it) from comments is un-
wanted 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 unopened documents. . .
2. Event handlers are defined in the Advanced section of the Options Interface. Modes and
submodes are explained further in WinEdt’s Help Manual -> User Guide. . .
22
4 WinEdt and Unicode (UTF-8) encoding
Chapter 4
they may not contain plain text. WinEdt can be configured to turn spell checking
off in such places. By default it is already loaded with an extensive list of such
exceptions for TeX documents. More can be added by users with special needs. . .
23
4 WinEdt and Unicode (UTF-8) encoding
When adding a word to the dictionary or performing a Global Replace while spell checking a
document one is strongly advised to pay attention. Here is a true cautionary tale illustrating
how things can and did go wrong.
We’ll omit the names and places, but let’s say a well known astronomer was
writing an article on blueshift. The word blueshift is not in WinEdt’s dictionaries. This
would not be a real problem for us simple down-to-earth types, as it is easy to add
a word to the User Dictionary during spell checking (eg. by right-clicking on an
underlined word). This could and should be the end of it...
Alas, apparently this is not how our universe works. For reasons that could not be
completely fathomed by our less sophisticated minds, the esteemed user in question
decided to perform a Global Replace with the first suggestion offered by WinEdt.
The picture is worth a thousand words:
Chapter 4
Figure 4.4: Blueshift gone bad...
The nuisance of an underlined (misspelled) word was gone and no further atten-
tion was paid to the issue. That is, until the final draft was received by a (I can only
assume somewhat puzzled) co-author. At first, I received an angry email about the
whole incident. However, after some explanations and reflection on the actions taken,
we eventually shared a laugh. The problem was easily fixed by replacing the word
bullshit back to blueshift and this saved the day without the potential embarrassment
that would have resulted had the “spell-checked” article been submitted to higher
authorities for consideration.
Since those days, the algorithm used by WinEdt to compile a list of suggestions for
misspelled words has been improved and refined (bullshit and bluefish are no longer
the top two suggestions in this case). However, the first suggestion is not always
the correct one: especially if the correct word is not present in WinEdt dictionaries
(word lists). Keep this in mind when performing spelling replacements!
24
5 LATEX Demo: Non-WinEdt-Related Bonus
Chapter 5
Figure 5.1: WinEdt classic and new-style logo in a suitable png format
1. 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 file 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 files with eps
images is not very efficient: 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 fine. 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. . .
25
5 LATEX Demo: Non-WinEdt-Related Bonus
JPEG 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:
Chapter 5
Figure 5.3: About WinEdt Dialog
Now you know it can be done! Learn how to use graphicx package if you need to do
something more sophisticated. . .
26
5 LATEX Demo: Non-WinEdt-Related Bonus
This section is borrowed from MiKTEX’s Samples folder. You should definitely
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
\usepackage{color}
...
\begin{enumerate}
Chapter 5
\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}
27
5 LATEX Demo: Non-WinEdt-Related Bonus
rot
30° ati
on
= 5 1
=
t i on A 2 330
ta 4 E °
ro 3 D a B 3
e C 4
2 C d b
1 B c D 5
c E
A b d
a e
28
5.4 Landscape mode page example
The preamble must load the following package for this to work:
29
tHsb hue◦, saturation, brightness [0, H ] × [0, 1]2 H = 360
gray gray [0, 1]
RGB Red, Green, Blue {0, 1, . . . , L}3 L = 255
HTML RRGGBB {000000, . . . , FFFFFF}
HSB Hue, Saturation, Brightness {0, 1, . . . , M}3 M = 240
Gray Gray {0, 1, . . . , N } N = 15
wave lambda (nm) [363, 814]
5 LATEX Demo: Non-WinEdt-Related Bonus
Chapter 5
5.5 Another landscape page example
The preamble must load the following package for this to work:
30
5 LATEX Demo: Non-WinEdt-Related Bonus
Chapter 5
5 LATEX Demo: Non-WinEdt-Related Bonus
Presentation packages and software that can be used with LATEX are not WinEdt-
related 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. . .
The best way to set the paper size in LATEX 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:
Chapter 5
\usepackage[letterpaper]{geometry} % or a4paper
Some 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 efficient 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.
31
5 LATEX Demo: Non-WinEdt-Related Bonus
On www.winedt.org you’ll find 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
LATEX package xrcs.sty that can be used for such editing. The package defines
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 defined 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 defined 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 inactive
marker nomarker
remarks noremarks
Chapter 5
new nonew
old noold
Examples 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 version
\usepackage{color}
Text example:
32
5 LATEX Demo: Non-WinEdt-Related Bonus
Beside the highlighting definitions 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 file 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}[2005/01/30 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}
Chapter 5
\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 simplified revision system; 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. . .
33
5 LATEX Demo: Non-WinEdt-Related Bonus
Check the source code of this document in WinEdt. Pay attention to comments included in
the preamble. . .
\usepackage{natbib}
\bibliography{Biblio/articles.bib}
Note that you have to specify the path UNIX-style (using forward instead of bac-
kward slash as folder separator). Avoid spaces in filenames (some TEX accessories
may not work properly with spaces in the filename specification).
Most TEX Systems allow you to place your bib files 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 files there, and refresh
the FNDB in MiKTEX’s Options interface.
\usepackage{hyperref}
\hypersetup{
Chapter 5
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.pdf
To 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}
To prevent long titles in your table of contents (generated by LATEX) use alternative
short title:
You can find everything about TEX and LATEX on: TUG. . .
34
5 LATEX Demo: Non-WinEdt-Related Bonus
Chapter 5
Figure 5.7: Happy TEX-ing from TUG and the WinEdt Team
35
5 LATEX Demo: Non-WinEdt-Related Bonus
Echo, our faithful companion and a long-time CSO (Chief Security Officer) at
WinEdt HQ, passed away on January 21, 2016 (just over a month short of her
eleventh birthday).
36
Bibliography
TUG Online Book Catalogue. Books about TEX and Friends. TUG Web Site, 2017. URL
https://www.tug.org/books.
Everybody loves books, and everybody loves TEX. On this url you’ll find it all...
Helmut Kopka and Patrick Daly. A Guide to LATEX2e. Addison-Wesley, fourth edition,
2003. ISBN 0-321-17385-6. Covers core LATEX from the ground up, and discusses
commonly used packages for graphics, web integration, and more.
Frank Mittelbach, Michel Goossens, Johannes Braams,and Chris Rowley. The LATEX
Companion. Addison-Wesley, second edition, 2004. ISBN 0-201-36299-6.
Covers core LATEX, plus a vast array of additional packages.
David Griffiths and Desmond Higham. Learning LATEX. SIAM, second edition, 1997.
ISBN 978-0-898713-83-1. A short example-based book covering core LATEX and a few
packages.
Herbert Voß. Typesetting Mathematics with LATEX. UIT Cambridge, 2010. ISBN 978-1-
906860-17-2. A practical book on typesetting mathematics with LATEX, covering many
packages.
Herbert Voß. Typesetting tables with LATEX. UIT Cambridge, 2011. ISBN 978-1-906860-
25-7. A practical book on typesetting tables with LATEX, covering many packages.
George Grätzer. Math into LATEX. Birkhauser Boston and Springer Verlag New York,
2000. ISBN 0-8176-4131-9 and 3-7648-4131-9.
George Grätzer. More Math into LATEX. Birkhauser, 2007. ISBN 978-0-387-32289-6.
37