WinTeX - Documentation
WinTeX is a text editor
which
is optimized for use with TeX. WinTeX offers a
variety of functions to simplify editing of TeX files (e.g. a graphical
table editor,
toolbars for frequently used TeX-commands and syntax completion).
Syntax
highlighting improves the readability of your TeX sources. You can
customize WinTeX to
have every possible TeX-tool just one mouseclick away.
Features include:
- Modern
XP Style MDI Interface
- Individual
Extension of WinTeX possible (VBScript)
- Syntax
Highlighting with font, color and style
- Graphical
user interface to easily manage and edit BiBTeX files
- Easy
management of TeX-Projects with all needed files
- Spellchecking
- Search
& Replace
- Nested
Undo & Redo
- Unlimited
number of connections to external programs
- Buttonbar
for easy access of these connections
- Unlimited
number of Key-Shortcuts to insert any sequence of TeX-commands on one
keystroke or mouseclick
- Toolboxes
for mathematical symbols etc.
- Powerful
Table-editor
- Easily
find TeX-errors and -warnings with integrated Log browser.
- One
mouseclick lists all include'd and input'ed files.
- You
can drop bookmarks in the editor and jump back to this line with one
keystroke
- Syntax
completion for all LaTeX commands
Please also visit the
WinTeX
homepage for the most current information:
http://www.tex-tools.de
The following chapters
will
give a brief description of the features of
WinTeX. In most cases the information provided here will be sufficient
to help
you start with WinTeX or help you with your problems. A detailed
description of
all functions of WinTeX is given in the next part.
WinTeX supports two
command
line switches:
-f
specifies a filename
for the inverse search option of YAP
-l
specifies the line
number for the inverse search option of YAP
For further information
regarding this feature please consult the online
help of YAP (YAP is part of the miktex package
http://www.miktex.org
).
Example: "wintex.exe
–f
d:mytexfilestest.tex –l 4711"
You can open files in
three
different ways:
- By
using the ‘Open File’ dialog
- By
specifying a filename as command line argument (i.e. clicking on a
*.tex file when these are associated with WinTeX)
- Drag&Drop
one or more files from the explorer into the WinTeX window.
You open the properties
dialog
by clicking on the entry in the
"Editor" tab of the options dialog. The details of the properties are
discussed in the next part of this document.

The
‘Options’ tab lets you control the behaviour of the
editor. You can
toggle word wrapping (automated wrapping of long lines), auto indent
(places
the cursor under the first non space character in a new line) and
syntax
highlighting.
Further you can have a
visible
right margin at n chracters and a
‘gutter’ which is a blank space at the left hand
side of the editor where
special icons give further information on some lines (e.g. bookmarks or
wrapped
lines).
You can specify by how
many
characters a block of text is indented if
you press <Ctrl>+K I and have a fixed word wrap column (0
means that the
text is wrapped at the width of the window).
For detailed description
of all
functions see part 3 of this
documentation.

On the
‘Highlighting’ tab you can change colours and text
styles for
special elements of your TeX
file. Simply select an entry in the list (e.g. Comment) and then change
the
settings for this element. You can see the effect of your changes in
the
preview pane.

Here you can change the
shortcut keys for some editing functions like
‘copy’, ‘set bookmark’ or even
‘indent block’, etc.

The auto correct tab lets
you
specify wrong typed phrases, that should
be automatically corrected when typed (e.g. teh ->
the).

Shortcuts provide an easy
way
to insert often used sequences of TeX commands into the
text. If you want to insert a code template into your text simply type
the name
of the template and then press ESC. The cursor will be placed at the
position
of the pipe symbol (‘|’) in the template. If you
don’t remember the name of the
template you can simply press ESC and WinTeX will provide a list of all
templates to choose from.
In WinTeX templates
provide a
convenient way to recycle often used
document structures. Simply create the structure as you need it (e.g.
an
outline for a letter or for a report) and choose ‘File/Save
as template’. The
save dialog will automatically navigate to the templates directory
(which is
the directory where you installed WinTeX +
‘Template’). Now type a name for
your new template and choose ‘Save’. Next time you
open the ‘New file’ dialog
from ‘File/New’ you will have an additional entry
for your new template. Double
clicking this entry will open a new file with the contents of your
template.
Syntax completion is one
of the
editing aids of WinTeX. It is invoked by
the shortcut
<Ctrl>+<Space>.
It completes a TeX
command
(e.g. usep
-> usepackage) or a TeX
environment (e.g. begin{environment} is completed with the
corresponding end{environment}).
If you invoke it on a TeX
command
WinTeX provides a list with TeX
commands where the cursor is placed on the best match. You can accept
it by
pressing <Enter> or scroll through the list and look for
a different
entry which is then inserted into the text.
If you are looking for a
specific line in your code either double click
on the status bar or right click on the editor and chose
‘Goto line’ (you can
also use the shortcut <Ctrl>+G).
WinTeX comes with a built
in
spell checker. If you have checked the
‘Auto Spell’ option in the
‘Edit’ menu every word that is not found in the
defined dictionaries will be underlined. You can then correct this word
by
right clicking on it. Additionally you can use the standard spell
checking
routine which will go through the text and let you choose a replacement
for
every word not found in your dictionaries.
New dictionaries can be
obtained on our website:
http://www.tex-tools.de/
Issues
concerning special characters and spell checking
In native TeX if you want
to
have
special characters in your text (like
ä,â,á,
etc.) you
have to use special TeX
commands instead. This is a problem when you want to use spell checking
because
the spell checker does not recognise these special characters. The
solution is
to use a TeX style that allows you to use the
special characters in your TeX
source. Such a style is inputenc.
You can see it in the ‘special characters example’
installed in your WinTeX home
directory.

WinTeX provides a GUI
(graphical user interface) for creating tables in TeX. Creating tables
in TeX is a little bit tricky and if you want your table to
look a little bit different than the TeX
standard you will have a lot of work.
The table GUI in WinTeX
lets
you paint you table as you know from Excel
or Word. You can resize your cells with the mouse and add or remove
every
single line in the table. Also you can specify the horizontal and
vertical
alignment of every single cell. When you are finished the table will be
translated into TeX
code and inserted into your text. Don’t be scared by the
strange looking code
which is generated. As we said: Creating custom tables in TeX is a
little bit tricky
...
If you want to modify the
table
later on simply mark the code of the
table in your text. The selection must reach from the comment at the
beginning
of the table (e.g. ‘% Table generated by
WinTeX...’) to the ‘end{tabular}’
statement. Then press the ‘Create table’
button on the toolbar. Instead of creating a new table WinTeX reads in
the
selected one and displays it in the gui for editing.
An alternative is to use
a
plugin for creating tables and implement them
into WinTeX using a makro. Plugins can be found on our homepage.
WinTeX has three buttons
on the
TeX
toolbar that facilitate formatting of text. They are labeled
‘B’, ‘I’ and
‘U’.
Simply select the portion of text that should be formatted and press
one of the
buttons. The selected text will get surrounded by the corresponding TeX
statements. The buttons are:
- ‘B’
– Boldface
- ‘I’
– Italic or Emphasised
- ‘U’
– Underlined
When you load a TeX
file into the editor that contains a structure a new widow will open on
the
left hand side of WinTeX showing this structure. This structure window
provides
easy access to certain parts of the TeX
source. On the TeX-structure tab in the options dialog you specify a
hierarchy
of TeX-commands that mark the beginning of such a part. The hierarchy
is
preconfigured with the standard structuring commands of TeX:
part
chapter
section
subsection
subsubsection
paragraph
subparagraph
According to this
hierarchy the
TeX
file is scanned and the structure window is generated. By clicking on
an item
WinTeX jumps to the line where this section starts. This way you have
an easy
and fast access to specific parts of your document.

Large documents should be
structured into some smaller files for easier
editing and faster access. For example if a book is split into
different parts
you could create a separate file for every part. You will then need a
‘frame’
where you put those files together to form your document. It could for
example
look like this:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% My Book %
% %
% Title %
% %
% Author %
% Creation date %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
documentclass[a4paper,12pt,fleqn,openright,titlepage]{book}
usepackage{latexsym}
usepackage{epsf}
bibliographystyle{newapa}
begin{document}
tableofcontents
part{Part I}
input{part1.tex}
chapter{Chapter I}
input{chapter1-1.tex}
chapter{Chapter II}
input{chapter1-2.tex}
part{Part II}
input{part2.tex}
chapter{Chapter 1}
input{chapter2-1.tex}
end{document}
In WinTeX you can create
a
project file where you put all those files together
for easier access by choosing ‘Project/New’. On the
left hand side of the
editor you now see the project pane with one root node. You can add
files to a
node in your project by right clicking on the node and choosing
‘Add file’. A
new node will be added as a child node to the selected one and will be
labelled
with the filename. You can open the file by double clicking on the
node. You
can add further children to the new child node and so on. That way the
project
can get as nested as you need it.
In your project you will
have
one main file (as seen above). If you edit
for example part II and invoke the TeX
compiler you don’t want it to operate on the file part2.tex
but on the main
file. Otherwise you will get several errors because the file part2.tex
is not a
complete document and is missing some very important TeX commands. You
specify the main file of
your project by right clicking on the node and choosing ‘Main
file’ from the
menu. The little smiley will become red to indicate the status of this
node.

Few customisation is
needed to
use WinTeX with
your local TeX
environment. In fact if you use mikTeX and have the mikTeX binaries
directory
(e.g. c:texmfmiktexbin) in your PATH, WinTeX comes preconfigured and
you can
skip this chapter.
Adding external programs
to
WinTeX is done in the TeX-programs tab of
the options dialog.
Simply add an entry to
the list
by clicking on ‘add’ and fill out the
properties for the new entry. The properties are:
- Menu
Specifies the caption that will appear in the TeX menu and on the
toolbar.
- Commandline
This is the command that will be executed if this entry is invoked. If
you have the program in your PATH variable you my specify it as shown
here, otherwise specify the full pathname (e.g.
‘c:texmfmiktexbinlatex.exe %f.tex’). The tag
‘%f’ will be replaced by the current filename (if
you use a TeX project with a main file it will be replaced with the
main file instead) and the tag ‘%n’ with the line
number where the cursor was.
- Shortcut
Here you can choose a function key to invoke the command with one
keystroke.
- Icon
Choose an icon for your new TeX program link.
- Force
execution on current file
If you have checked this box the tag ‘%f’ of the
command line will always be replaced with the current file, no matter
if you use a project or not.
WinTeX can be extended by
own
features using VBScript. In order to
implement a makro do the following:
- Create
a new document and add your code:
sub MyFirstMakro()
MsgBox "Hello World!!!"
end sub
- Save
your new makro as a WinTeX makro file (Extension *:WTM) and place it in
the MAKROS directory located either in the directory where you
installed WinTeX (Windows 98/ME) or in your personal profile under the
WinTeX directory (Windows NT//XP). Only makros that are located in this
directory can be accessed from WinTeX.
- Either
restart WinTeX to activate the new makro or use the 'Reload' button on
the 'Makros' tab in the options dialog.
- Now
you can add the new makro using the 'Add' button on the 'Makros' tab in
the options dialog and filling the input fields on the right hand side:

- Menu
Specifies the caption that will appear in the Makros menu and on the
toolbar.
- Module
Choose a module from the list. The list contains all *.WTM files in the
MAKROS directory (except for the GLOBAL.WTM file which plays a special
role).
- Procedure
This list schows all procedures that are defined within the chosen
Makro. Choose the procedure that shall be executed.
- Shortcut
Here you can choose a function key to invoke the makro with one
keystroke.
- Icon
Choose an icon for your new makro.
After you have defined
your TeX
programs in WinTeX you can use them to compile and view your TeX file.
Simply open the file and then
click on the ‘LaTeX’ button on the toolbar or in
the TeX menu. You can also use the shortcut key
you have defined for LaTeX (e.g. F5). Now WinTeX calls LaTeX to compile
your
file. You can see how a DOS box is opened and LaTeX does it’s
work. If errors occur during compilation you can see the output in the
DOS box
and have to react on it (e.g. press ‘q’ to continue
compiling in quiet mode
(i.e. without any further error messages) and then use the
‘Errors &
Warnings’ dialog (see TeX Errors & Warnings) in
WinTeX to locate the errors
and fix them.
After you have compiled
your
TeX
file you can call the DVI viewer to view the results. Simply click on
the
‘DVIWIN’ or ‘YAP’ button on the
toolbar.
WinTeX provides an easy
way to
work with errors and warnings that come
from LaTeX. As soon as you start any TeX
program a window will show you the output of that program. After the
program
has ended one of three things will happen:
1. If the program did not
produce a log file you will simply see the
output of the program in the 'Shell' tab:

2. If the program
produced a
log file but the log browser of WinTeX did
not find any errors in it, you will see the log file in the 'Log' tab:

3. If the program
produced a
log file and the log browser of WinTeX
found errors of warnings in it, you will see the log browser in the
'All
Errors' tab:

The first column shows
the file
in which the error occurred, the second
column shows the error description, the third column shows the line
number in
which the error occurred and the last column shows the error type. You
can sort
the list by clicking on a column caption. If you double click on a line
the
affected file will be opened in the editor (if it isn’t
opened already) and the
cursor jumps to the line in which the error occurred. You can also
filter the
log browser by any error type by simply clicking on the desired tab.
With the built in editor
for
BiBTeX databases you can easily manage and
edit even large bibliography files. You can add, edit, delete and even
convert
entries from one type to another (e.g. Unpublished -> INBOOK) -
just
drag&drop the entry from one folder to another one. For each
type and field
WinTeX gives a brief description of it’s purpose.
Each type has an
additional
editing pane where you can add user defined
fields to your entry (e.g. ABSTRACT). You have to enter these user
fields as
complete BiBTeX syntax:
ABSTRACT={This book is on
TeX}
How often did it happen
that
you wanted to cite an item of your
bibliography file and did not remember the key? With WinTeX that is no
problem
any more. Simply press
<Shift>+<ESC>
in the editor. A popup
appears
with all cite keys of all BIB files that are currently opened by
WinTeX. Simply
choose an entry from the list and press <ENTER>. WinTeX
inserts the
corresponding cite{SOMEKEY} into your
text.
When you use TeX
you will soon end up with a huge number of temporary files that you
don’t need
any longer. For example
TeX creates
- log
files
- auxiliary
files
- contents
files
- etc.
After you have finished
your
TeX
file these files are no longer needed (since you have the DVI file). If
you
need to compile your TeX
file again later these files are rebuilt which only takes a little bit
longer
for the first compilation run.

WinTeX can search special
parts
of your harddisk and delete those files
for you. You start this task by choosing ‘Cleanup’
from the file menu. Which
directories are searched and which files are deleted is controlled via
the
options dialog.
In the left list you
enter the
extensions which are to be deleted and in
the right list you enter the directories that are to be cleaned. You
can append
a ‘//’ to the path to tell WinTeX to also clean all
subdirectories.
The TeX-Programs and
Makro
options show a list of icons that you can use
for your menu items and toolbar buttons. You can easily extend this
list with
your own images by simply placing the image (16x16 pixel bitmap) in the
BITMAPS
directory under the WinTeX install path.
This Chapter gives a
detailed
description of every function in WinTeX.

This dialog displays all
files
that reside in the ‘TEMPLATE’ directory
under your install directory plus three icons for an empty document, a
new
WinTeX project and a BiBTeX file. Choose one with a double click or
select an
item and then press OK.
Displays the standard
Windows
open dialog to open a file.
Provides a list of the
last 15
files that were edited with WinTeX with
the least recently used one at the bottom.
Closes the
current file. This
can also be done by clicking on the small x in the upper right hand
corner of
WinTeX or by pressing <Ctrl>+<F4>.
Closes all open files.
Saves the current file.
If the
file
has no name yet, the ‘Save as...’ dialog will be
displayed to chose a name.
Saves all open files in
case
they are modified.
Displays the
‘Save
as...’ dialog to choose a new name
for the current file.
Saves the current file as
a
template. The
‘Save as...’ dialog will be displayed with the
templates directory opened. Simply
choose a name for your template and then click OK. The next time you
open the
‘File new...’ dialog the template you just saved
will be available.
Starts the
cleanup process. All
directories specified in the options dialog (see Options/Cleanup)
will be cleaned from all files with an extension listed also in the
options
dialog.
If you have a BIB file
open you
can merge the contents of another one
into your current file by choosing this menu item.
Exits the program.
Undoes the latest changes
step
by step. The undo buffer is cleared every
time you save your file.
Redoes undone changes.
Cuts the selected text to
the
Windows clipboard.
Copy’s the
selected
text to the Windows clipboard.
Pastes the contents of
the
Windows clipboard into the
text.
Finds phrases in the
current
file. In the find dialog you can enter a
phrase you want to find. Click Search to find the next occurrence. You
can do a
case sensitive or case insensitive search and search for whole words or
parts
of words.
After you have found
something
the ‘Replace’ and ‘Replace all’
buttons
become active. You can now type in text to replace the found text with
and
click on ‘Replace’ to replace this occurrence and
find the next one or ‘Replace
all’ to replace all occurrences in the whole file.
Find again repeats the
last
find operation with the same settings.

You can check the
spelling of
your text with the dictionary you have
specified in the options dialog (see Options/General). WinTeX searches
your
text for a word that is not in your dictionary and suggests the correct
spelling.
If this menu is checked
WinTeX
will automatically underline every word
in your text that is not in your dictionary.

The Thesaurus suggests
alternatives for the word the cursor is placed
in.
This will remove all hard
line
breaks from the selected block of text.
This will toggle the
automatic
wrapping of text at the window border on
and off.
This menu displays all
TeX
programs that you
have defined in the options dialog. If you click an item the
corresponding
program is executed.
This menu displays all
makros
that you have defined in the options
dialog. If you click an item the corresponding makro function is
executed.
Saves the current project.
Saves the current project
under
a different name.
Closes the
currently open project.
Starts the cleanup
process only
for the current
project. All files with an extension listed in the
options dialog will be deleted from the project directories.
Adds a file
to the current project.
Removes the
selected file from the current project.
Defines the
selected file as the main file for the project. See section 'Adding New TeX
Programs' for details on this.
Applies the bold format
to the
selected text.
Applies the italic format
to
the selected text.
Applies the underline
format to
the selected text.
Opens the create table
dialog
to create a new table. If you have
selected a formerly created table in the text that table is opened in
the table
editor to be modified. See section 'Tables
in
TeX'
for details.
A click on this menu item
opens
the output / log / log browser window of
WinTeX.
This builds or rebuilds
the
structure tree for the current document
according to the hierarchy defined in the options.
This shows or hides the
structure tree on the left hand side of the
editor.
When this menu item is
checked
the structure and project panel will
automatically hide away giving you more space to edit your text. As
soon as you
move the mouse to the left border of WinTeX the structure panel will
show
again.

This opens the dialog
where you
can show or hide the different toolbars
and add or remove buttons. Simply drag and drop the buttons to or from
the
toolbars.
This is the options
dialog
where you can configure WinTeX. Pressing the
default button will cause WinTeX to import the default settings for
mikTeX. All
your settings will be overwritten! Cancel will undo all your changes
that you
made since you last opened the options dialog.
In the
‘General’ Tab you have the following options:
Use
special BiBTeX viewer
If you uncheck this option WinTeX uses the standard
editor for BiBTeX files instead of the built in BIB editor.
Auto
build structure
Automatically
generates the structure menu for every opened TeX file (which takes
some time for large
files).
Auto
save
editor file
Automatically
saves the current file after the specified amount of time.
Create
backup copies
When this option
is checked WinTeX creates a copy of the current file with the extension
‘.backup’ before saving it. This way you can
recover if you have saved
accidentally.
Reopen
files
If you want
WinTeX to autmatically open the files that were open at your last
session check
this option.
File
Extensions
Here you see which file extensions are associated with WinTeX at the
moment. You can change this by simply clicking an entry in the list.
reclaim file extensions
When this option is checked WinTeX will restore the selected
associations on every program start in case they have been modified by
some other program.
The editor tab lets you
control
the behaviour of the editor. You have
the following options:
Use
key conversion
If this box is
checked the table above this option is used to translate keystrokes
during
editing. This is mainly useful for accentuated characters (e.g. replace
‘ä’
with ‘"a’).
Show
corresponding brace
When you have
checked this option WinTeX jumps to the corresponding opening brace as
you type
‘}’. It stays there for the specified amount of
time and the returns to the
place you entered the closing brace.
Complete
‘*’ with ‘*’
Here you specify if you want WinTeX to automatically
add the corresponding closing brace as you type an opening brace.
Color
for AutoSpell
Lets you control the color of the underlines of misspelled words.

Here you define the TeX
programs that can be
used from within WinTeX. Simply press the ‘Add’
button select the new entry and
fill out it’s properties. An entry can be deleted by
selecting it in the list and then pressing DEL.
Menu
The caption that will appear in the TeX menu and on the toolbar.
Commandline
The command which is executed if the user selects the
entry in the TeX
menu or presses the button on the toolbar. The command is executed in
the
directory of the current file. You must either specify complete
pathnames (e.g.
"C:Program Filesmiktexbinlatex.exe") or add the directory with
your TeX-tool to the path variable (This is automatically done if you
install
mikTeX so you can simply say "latex.exe").
There are two special tags that you can use here. The tag %f will be
replaced
with the name of the file which is currently opened by WinTeX or if you
are
running a project with the name of the main file of the project. The %n
tag
will be replaced with the line number where the cursor is currently
located.
Shortcut
Defines a function key that can be used to
invoke this command.
Icon
Here you can
choose an icon for the menu and toolbar.
Force
execution on current file
Forces the
execution of this command on the file that is currently opened with
WinTeX rather
than the main file of the project

Here you define the TeX
programs that can be used from within WinTeX. Simply press the
‘Add’ button
select the new entry and fill out it’s properties. An
entry can be deleted by selecting it in the list and then pressing DEL.
Menu
Specifies
the caption that will appear in the Makros menu and on the toolbar.
Module
Choose a module from the list. The list contains all
*.WTM files in the MAKROS directory (except for the GLOBAL.WTM file
which plays
a special role). Please see section 'WinTeX
Makros'
for further details.
Procedure
This list schows
all procedures that are defined within the chosen Makro. Choose the
procedure
that shall be executed.
Shortcut
Here you can choose a function key to invoke the makro
with one keystroke.
Icon
Choose an icon for your new makro.
Enable VBScript debugger
If the Script Debugger is installed it can be switched
on and off with this option. With the Script Debugger you can execute
your
makros line by line or inspect and change variables. The Script
Debugger can be
downloaded on the Microsoft
Scripting Homepage.
Reload
This will reload all Makros in the MAKROS directory
and will activate all changes you may have made. It will also reset all
global
variables so you have to know what you are doing when using this
option.

This tab lets you specify
the
parameters for the cleanup process invoked
over the file menu. In the left list you enter the extensions of the
files
which are to be deleted. In the right list you enter the directories
which
shall be searched by WinTeX. Appending a ‘//’ at
the end of a path tells WinTeX
to also search all subdirectories.

Every file you open with
WinTeX
is scanned for it’s
internal structure. The information generated is provided in the
structure
window. Here you specify the hierarchy of TeX commands that define the
structure of
the file. As default we have the standard TeX
commands for structuring TeX
files but you can modify the list to meet your needs.
The very first entry in
the
list marks the top and the last item marks
the lowest level in the structure.

Code templates are
pre-defined
snippets of code that are available for
insertion into a file being edited. Each template is defined by a short
name, a
meaningful description and a replacement specifier. When the short name
is
typed at the keyboard and immediately followed by the pressing of the
Hotkey
(ESC) the short name will be replaced by the replacement specifier. If
the
short name is not clear a popup will appear allowing the user to choose
the
template he thought of.
In this dialog you can
change
specific options of the editing pane of
WinTeX.
The Options tab has quite
a lot
options to control the general behaviour
of the editing pane. The options are:
Word
wrap
Toggles automatic word wrap, which means that the line
is automatically wrapped if it is to long to display it in the editing
pane or
if it has more characters than specified in ‘Word wrap
column’.
Auto
indent
When checked the cursor is automatically placed below
the first non space character when you press <ENTER>.
Only works if word
wrap is disabled.
Smart
tab
TAB key moves to next non space character in line
above. Only works if word wrap is disabled.
Smart
fill
If auto indent or smart tab is enabled the occurring
space is filled with a minimum number of characters made up of tabs and
spaces.
Otherwise the gap is filled with the correct number of spaces.
Use
tab character
Insert a tab character into the text if the user
presses TAB. Otherwise the correct number of spaces is inserted instead.
Line
numbers in gutter
Display the line numbers in the small panel on the
left hand side of the editor.
Mark
wrapped lines
Shows an icon in the gutter if the current line is
wrapped.
Block
cursor for Overwrite
Show a block cursor when the editor is in Overwrite
mode (toggled with the INS key).
Word
select
Double click selects the whole word.
Syntax
highlight
Toggles syntax highlighting.
Show
all chars
Also show
invisible characters (like tab or linebreak) in the editor.
Visible
right margin
Shows a light
line at the position specified by the Right margin option. This margin
does not
affect the text and is for illustration purposes only. You will only
see it if
you set the editor background to a colour other than light grey.
Visible
gutter
The gutter is a
blank space at the left hand side of the editor where special icons
give
further information on some lines (e.g. bookmarks or wrapped lines).
You can
also specify the width of this area.
Block
indent step size
Specifies by how many characters the marked block of
text is indented if you press block indent in the editor
(<Ctrl>+K+I).
Word
wrap column
Setting
this option to zero will cause the text to be wrapped at the width of
the
display area if word wrap is enabled. Entering a number here will cause
the
text to be wrapped at the specified character column.
Show
word wrap column
Enabling
this option will show a dashed line where the text will be wrapped if
the word
wrap option is on. You will only see it if you set the editor
background to a
colour other than light grey.
Tab
columns
Defines tab stops for the editor. The tabs are given
as space or comma separated list. The first column of the display is
column one
(1). Column values of zero will cause an exception to be generated.
Tab
stop
Defines the default tab stop distance when the cursor
is beyond the last defined tab column.

This tab lets you define
colours to be used for special tags in the
text. Choose an item in the list and then define the attributes with
which the
text of this type should be displayed. You can see the effects of your
changes
in the preview pane in the lower part of the dialog.

Here you can change the
key
assignments for the different editing
functions to meet your needs. You can specify different keys for one
function
to use alternatively.

Auto replace definitions
are
provided to assist in editing by replacing
one text item by another. A common use of auto-replace is to
automatically
correct common spelling/typing errors such as 'teh' instead of 'the'.
Keyboard
shortcuts can also be specified such as (c) to be replaced by the
copyright
symbol.
Act key(s) describes the
keyboard keys that can activate an auto-replace
action.
With the
‘window’ menu you can control the child windows of
WinTeX .
Here you can access the
online
help of WinTeX and LaTeX. In the LaTeX
help you can get help on TeX
commands and environments. You also find some other useful resources of
information.
WinTeX can be extended
with
custom makros. These makros are programmed
using Microsofts VBScript.You can use the full range of commands that
are
provided by VBScript plus some functions to access certain elements of
WinTeX. This
documentation only describes the WinTeX specific functions.
Documentation and
tutorials about VBScript are widely available in paper and electronic
form. For
a selection of useful links please visit our homepage.
For some examples please
see
the example makros that come with WinTeX
which are installed in the MAKROS directory.
General
Things To Know
Makros are organized in
*.wtm
files. Each file forms a Module providing
several functions. A special module is the GLOBAL.WTM module. This
module
contains global variables, functions and the implementation for the
different
events provided by WinTeX. Functions implemented in this module can be
accessed
from any other module but are not directly accessable from WinTeX. The
module
files have to be stored in the MAKROS directory located either under
the
Installation directory of WinTeX (for Windows 98/ME) or under the user
profile
directory (for Windows NT//XP).
Events are special makros
that
are executed at certain events in WinTeX.
You can find these events in the GLOBAL.WTM file. Simply located the
desired function
and add your code.
This event is executed
when
WinTeX starts. This is a good place to
initialize global variables.
Example:
sub OnStartApplication()
Dim WScript
Set WScript = CreateObject("WScript.Shell")
sMiktexInstallRoot = ""
sMiktexInstallRoot = WScript.RegRead( _
"HKLMSoftwareMiKMiKTeXCurrentVersionMiKTeXInstall Root" )
if sMiktexInstallRoot = "" then
sMiktexInstallRoot = WScript.RegRead( _
"HKCUSoftwareMiKMiKTeXCurrentVersionMiKTeXInstall Root" )
end if
sMiktexLocalRoot = ""
sMiktexLocalRoot = WScript.RegRead( _
"HKLMSoftwareMiKMiKTeXCurrentVersionMiKTeXLocal Root" )
if sMiktexLocalRoot = "" then
sMiktexLocalRoot = WScript.RegRead( _
"HKCUSoftwareMiKMiKTeXCurrentVersionMiKTeXLocal Root" )
end if
end sub
This event is executed
when
WinTeX is closed.
This event is executed
when a
file is opened. The event receives the
name (incl. path) of the file which is opened.
This event is executed
when a
file is closed.
Besides the full range of
all
VBScript commands you can use the WinTeX
object to access certain functions of WinTeX.
Example:
' Replaces the word left of the caret with some text
sub replaceWord()
dim sTmp
dim iCol
dim iCharsBeforeLine
dim i
dim sWord
' get current line and caret position
sTmp = WinTeX.get_line( WinTeX.get_caret_row() )
iCol = WinTeX.get_caret_offset_col()
iCharsBeforeLine = WinTeX.get_chars_before_line()
' read to the left until a blank is found
i = iCol - 1
do while i >= 1
if mid( sTmp, i, 1 ) = " " then exit do
i = i - 1
loop
sWord = mid( sTmp, i + 1, iCol - i - 1 )
Select case sWord
' replace s with section{}
case "s"
call WinTeX.set_sel_start( i + iCharsBeforeLine )
call WinTeX.set_sel_length( iCol - i - 1 )
call WinTeX.set_sel_text( "section{}" )
call WinTeX.exec_command( "caLEFT", "false" )
' replace ss with subsection{}
case "ss"
call WinTeX.set_sel_start( i + iCharsBeforeLine )
call WinTeX.set_sel_length( iCol - i - 1 )
call WinTeX.set_sel_text( "subsection{}" )
call WinTeX.exec_command( "caLEFT", "false" )
end select
end sub
This function replaces
the
selected text.
|
Parameter
|
Type
|
Description
|
|
Text
|
String
|
Text
to replace the selected text with.
|
Example:
call WinTeX.set_sel_text( "Hello World!" )
This function retrieves
the
selected text.
|
Parameter
|
Type
|
Description
|
|
none
|
|
|
Example:
MySelectedText = WinTeX.get_sel_text()
This function calculates
the
row number of the document where the caret
is positioned.
|
Parameter
|
Type
|
Description
|
|
none
|
|
|
Example:
Your document is (with
cursor
in line 2):
This is
my document (line 1)
This is my document (line 2)
This is my document (line 3)
Your code is (MyCaretRow
will
be 2):
MyCaretRow =
WinTeX.get_caret_row()
This function sets the
caret to
the given row number.
|
Parameter
|
Type
|
Description
|
|
row
|
Integer
|
Row
to position the caret.
|
Example:
Your document is:
This is
my document (line 1)
This is my document (line 2)
This is my document (line 3)
Your code is (the cursor
will
be positioned in line 2):
call
WinTeX.set_caret_row( 2 )
This function calculates
the
column number of the document where the
caret is positioned.
|
Parameter
|
Type
|
Description
|
|
none
|
|
|
Example:
Your document is (with
cursor
in line 2 after the word 'my'):
This is
my document
Your code is
(MyCaretCol will be 11):
MyCaretCol =
WinTeX.get_caret_offset_col()
This function sets the
caret to
the given column number.
|
Parameter
|
Type
|
Description
|
|
column
|
Integer
|
Column
to position the caret.
|
Example:
Your document is:
This is
my document
Your code is
(the cursor will be positioned after the word 'my'):
call
WinTeX.set_caret_offset_col( 11 )
This function retrieves
the
text of the line specified.
|
Parameter
|
Type
|
Description
|
|
line_number
|
Integer
|
Number
of the line to retrieve.
|
Example:
Your document is:
This is
my document (line 1)
This is my document (line 2)
This is my document (line 3)
Your code is (MyText will
be
'This is my document (line 2)'):
MyText =
WinTeX.get_line( 2 )
This function sets the
text of
the line specified.
|
Parameter
|
Type
|
Description
|
|
line_number
|
Integer
|
Number
of the line to change.
|
|
text
|
String
|
Text
to set.
|
Example:
Your document is:
This is
my document (line 1)
This is my document (line 2)
This is my document (line 3)
Your code is:
call WinTeX.set_line( 2,
"Hello World!!!" )
Now your document is:
This is
my document (line 1)
Hello World!!!
This is my document (line 3)
This function inserts the
text
after the line specified.
|
Parameter
|
Type
|
Description
|
|
line_number
|
Integer
|
Number
of the line to insert the text after.
|
|
text
|
String
|
Text
to insert.
|
Example:
Your document is:
This is
my document (line 1)
This is my document (line 2)
This is my document (line 3)
Your code is:
call WinTeX.insert_line(
2, "Hello World!!!" )
Now your document is:
This is
my document (line 1)
This is my document (line 2)
Hello World!!!
This is my document (line 3)
This function deletes the
line
specified.
|
Parameter
|
Type
|
Description
|
|
line_number
|
Integer
|
Number
of the line to be deleted.
|
Example:
Your document is:
This is
my document (line 1)
This is my document (line 2)
This is my document (line 3)
Your code is:
call WinTeX.del_line( 2 )
Now your document is:
This is
my document (line 1)
This is my document (line 3)
This function will
execute some
command on the editor.
|
Parameter
|
Type
|
Description
|
|
command
|
String
|
Command
to be executed
|
|
extend_selection
|
String
|
When
set to "TRUE" the selection will expand depending on the command.
Otherwise the selection will stay as it is.
|
Valid commands are:
|
caLEFT
|
Move
caret one character to the left
|
|
caRIGHT
|
Move
caret one character to the right
|
|
caLINEHOME
|
Move
caret to start of current line
|
|
caLINEEND
|
Move
caret to end of current line
|
|
caUP
|
Move
caret to line above
|
|
caDOWN
|
Move
caret to line below
|
|
caPAGEUP
|
Move
caret up one page
|
|
caPAGEDOWN
|
Move
caret down one page
|
|
caWORDLEFT
|
Move
caret to start of previous word
|
|
caWORDRIGHT
|
Move
caret to start of next word
|
|
caDOCSTART
|
Move
caret to start of document
|
|
caDOCEND
|
Move
caret to end of document
|
|
caCUT
|
Cut
selected text to the clipboard
|
|
caCOPY
|
Copy
selected text to the clipboard
|
|
caPASTE
|
Paste
clipboard into current selection
|
|
caDELETE
|
Delete
character at caret
|
|
caBACKSPACE
|
Delete
character before caret
|
|
caBLOCKIND
|
Indent
selected block
|
|
caBLOCKUND
|
Un-indent
selected block
|
|
caINSTOGGLE
|
Toggle
insert / overwrite mode
|
|
caSETBOOKMARK0
|
Set
system bookmark zero to caret location
|
|
caSETBOOKMARK1
|
Set
system bookmark one to caret location
|
|
caSETBOOKMARK2
|
Set
system bookmark two to caret location
|
|
caSETBOOKMARK3
|
Set
system bookmark three to caret location
|
|
caSETBOOKMARK4
|
Set
system bookmark four to caret location
|
|
caSETBOOKMARK5
|
Set
system bookmark five to caret location
|
|
caSETBOOKMARK6
|
Set
system bookmark six to caret location
|
|
caSETBOOKMARK7
|
Set
system bookmark seven to caret location
|
|
caSETBOOKMARK8
|
Set
system bookmark eight to caret location
|
|
caSETBOOKMARK9
|
Set
system bookmark nine to caret location
|
|
caGOTOBOOKMARK0
|
Move
caret to system bookmark zero
|
|
caGOTOBOOKMARK1
|
Move
caret to system bookmark one
|
|
caGOTOBOOKMARK2
|
Move
caret to system bookmark two
|
|
caGOTOBOOKMARK3
|
Move
caret to system bookmark three
|
|
caGOTOBOOKMARK4
|
Move
caret to system bookmark four
|
|
caGOTOBOOKMARK5
|
Move
caret to system bookmark five
|
|
caGOTOBOOKMARK6
|
Move
caret to system bookmark six
|
|
caGOTOBOOKMARK7
|
Move
caret to system bookmark seven
|
|
caGOTOBOOKMARK8
|
Move
caret to system bookmark eight
|
|
caGOTOBOOKMARK9
|
Move
caret to system bookmark nine
|
|
caUNDO
|
Undo
one action (non grouped)
|
|
caREDO
|
Redo
one action (non grouped)
|
|
caDELETELINE
|
Delete
line of caret
|
Example:
call WinTeX.execute_command( "caBLOCKIND", "FALSE" )
Will indent the selected
block
of text.
This function retrieves
the
start offset of the current selection from
the beginning of the file.
|
Parameter
|
Type
|
Description
|
|
none
|
|
|
Example:
Your document is (with
the the
word 'text' selected):
section{testsection}
some text
Your code is (SelStart
will be
27 - the linebreak counts 2 (CR + LF)):
SelStart =
WinTeX.get_sel_start()
This function sets the
start
offset of the selection from the beginning
of the file. With this command combined with set_sel_length you can
select
text.
|
Parameter
|
Type
|
Description
|
|
offset
|
Integer
|
Offset
from the beginning of the file to set the start of the selection to.
|
Example:
Your document is:
section{testsection}
some text
Your code is (The cursor
will
be set before 'testsection'):
call
WinTeX.set_sel_start( 9 )
This function retrieves
the
length of the current selection.
|
Parameter
|
Type
|
Description
|
|
none
|
|
|
Example:
Your document is (with
the the
word 'test' selected):
section{testsection}
some text
Your code is (SelLength
will be
4):
SelLength =
WinTeX.get_sel_length()
This function sets the
length
of the selection.
|
Parameter
|
Type
|
Description
|
|
length
|
Integer
|
Length
to set the selection to.
|
Example:
Your document is (with
the
cursor before 'testsection'):
section{testsection}
some text
Your code is (The word
'testsection' will be selected):
call
WinTeX.set_sel_length( 11 )
This function retrieves
the
number of characters before the current line
in the file. This is important if you want to convert the offset of
get_sel_start or set_sel_start to a column in the current line.
|
Parameter
|
Type
|
Description
|
|
none
|
|
|
Example:
Your document is (with
the
cursor somewhere in line 2):
section{testsection}
some text
Your code is (CBL will be
22 -
the linebreak counts 2 (CR + LF)):
CBL =
WinTeX.get_chars_before_line()
This function retrieves
the
filename including full path of the current
file.
|
Parameter
|
Type
|
Description
|
|
none
|
|
|
Example:
MyFilename = WinTeX.get_filename()
This function opens the
file
specified in the editor.
|
Parameter
|
Type
|
Description
|
|
filename
|
String
|
Name
and path of the file to open.
|
Example:
call WinTeX.open_file( "d:my_stuffsomefile.tex" )
This function retrieves
the
main file of the current project. If no main
file is defined it will return an empty string.
|
Parameter
|
Type
|
Description
|
|
none
|
|
|
Example:
MyFilename = WinTeX.get_main_file()
This function opens a DDE
communication to a DDE server application.
|
Parameter
|
Type
|
Description
|
|
ServiceApplication
|
String
|
Name
and path of the DDE server application without file extension.
|
|
Service
|
String
|
Service
provided by server application.
|
|
Topic
|
String
|
Topic
provided by server application.
|
Example:
call WinTeX.dde_open( "F:ProgrammeWinTeXtablastablas", _
"tablas", "SirveComandos" )
This function closes the
current DDE communication.
|
Parameter
|
Type
|
Description
|
|
none
|
|
|
Example:
call WinTeX.dde_close()
This function requests
data
from a DDE server application. Before using
this function you have to open a DDE connection! The result is of type
string.
|
Parameter
|
Type
|
Description
|
|
item
|
String
|
DDE
Item to request data of.
|
Example:
MyDDEData = WinTeX.dde_request( "tabledata" )
This function sends a
command
to a DDE server application. Before using
this function you have to open a DDE connection!
|
Parameter
|
Type
|
Description
|
|
command
|
String
|
Command
to send.
|
Example:
call WinTeX.dde_exe( "Pegar:" & WinTeX.get_sel_text() )
|