##### TeXShop Changes 2.21 - 2.26

Here are the changes in version 2.26:

- The TeXShop/Engines/Inactive folder contains two scripts from Daniel Becker which call texcount to count active words in a TeX source file. These engines were promised in 2.25 but erroneously omitted. They are in 2.26. To obtain them, quit TeXShop and move the entire Engines folder from ~/Library/TeXShop to the Desktop. Then restart TeXShop. TeXShop will create a new Engines folder. Merge in any changes you have made in the old Engines folder on the desktop to the new folder.

- Juan Luis Varona sent new Program and Encoding macros which display the various choices, so it is not necessarily to look up the wording of these choices. A few days later, Ramon M. Figueroa-Centeno send similar but fancier macros. Ramon's macros are now in TeXShop. To obtain them, quit TeXShop and move the entire Macros folder from ~/Library/TeXShop to the Desktop. Then restart TeXShop. TeXShop will create a new Macros folder. Merge in any changes you made to the old Macros on the desktop to the new copy, using the Macro Editor.

- A memory leak introduced by the code to split the Preview window in 2.25 is fixed. The bug was similar to the old flaw in PDFKit which caused memory to be gradually used up when typesetting a document many times, but this time the bug was caused by me.

- A bug in the zoom code for the preview window when using multiple monitors is fixed.

- A bug which caused TeXShop to ignore a "% !TEX TS-program = ..." command when typesetting from a file with an associated root file is fixed.

- The French localization is improved.

- A localization error caused the "Split Window" icon on the Preview Window toolbar to display strange text. This is fixed.

- A bug caused the Preview Window's toolbar to vanish temporarily if the user tried to move certain text portions of the toolbar. This is fixed.

- One of the keyboard zoom shortcuts acted only on the top portion of the Preview window when split. This is fixed.

- The TeX mdimporter code distributed with TeXShop in 2.25 contained only i386 code. Now it contains code for both PPC and i386.

Version 2.21 - 2.24 were internal versions, never released. Here are the changes in version 2.25:

- Split window, previously available for the source window, now also works for the Preview window. Buttons and tools which interact with the Preview window are applied to the active portion of the Preview window when split. To activate the other portion, click on it. To avoid cluttering the interface, the active portion of the Preview window is not marked. Note that it is possible to use different Display formats in the two views. For instance, after splitting the window you can activate the lower portion and select Double Multiple Page in the Display Format menu to obtain a single page view in the top half and a double page view in the lower half.

- Syncing from source to Preview now scrolls the selection to the visible portion of the window. When the Preview is split, syncing from source to preview goes to the active portion of the Preview window.

- A new menu command, Show Log File, opens the log file. This file is updated after typesetting. If a source file has a root file, the menu command opens the log file of the root file, rather than the nonexistent root file of the input file.

  If the command key is held down while choosing this menu item, a dialog will appear asking for the extension of the file to be opened. For instance, typing "aux" into the dialog opens the aux file rather than the log file. The requested extension can be typed with or without an opening period.

- A new Help menu command, "Show Package Documentation", opens a dialog which requests the name of a package in TeX Live. It then opens the TeX Live documentation for this package, using the command line program "texdoc." This improvement was suggested by Juan Luis Varona.

  TeX Live has a vast amount of documentation; go to /usr/local/texlive/2008/texmf-dist/doc/latex to see some (but not all) of this documentation. Note that almost all documentation folders have lower case names; therefore it is best to name packages in lower case when requesting documentation: pdftex, latex, graphicx, geometry, texdoc. But there are exceptions: IEEEtran.

  Documentation is sometimes available in several different forms: pdf, html, etc. Add the extension to the request to see a particular form of the documentation. For instance, enter "pdftex.pdf" or "pdftex.html" to see these forms of the pdftex documentation. Texdoc will choose a convenient form on its own if the extension is omitted.

  Texdoc does not open the documentation in TeXShop; instead it uses the Mac's default application for a given extension. By default, the Macintosh opens pdf files in Preview and html files in Safari, so texdoc will use those viewers. There is a standard way to redefine the default application for an extension. If you change the default, texdoc will use the new default application.

  It is also possible to directly configure texdoc to use particular viewers; see the texdoc documentation for details.

  Sometimes texdoc will not find documentation for a package, style file, or program. In that case, nothing will appear. In particular, TeXShop does not put up a warning dialog when documentation is not found. Although such a dialog would be useful at first, in the end it might become annoying.

- It is possible to set the foreground color of the Console window in Preferences. This was requested by users who prefer white characters on black backgrounds for the console.

- A new menu command opens the console if it has been closed.

- The menu items to change the text color in the source, to justify right, left, or center in the source, and to bring up the ruler in the source have been removed, since they make no sense in TeX.

- There are localization improvements in French, Spanish, and Japanese.

- This version fixes a bug which ignored Console Preferences when using external editors.

- TeXShop can now create and edit asy files.

- Added a contextual menu item to the Source and Preview windows: Sync. Some users may prefer this menu item for synchronization because using it avoids the command key.

- The TeXShop/Engines/Inactive folder now contains two scripts from Daniel Becker to call texcount to count active words in a TeX source file. The output may be more accurate than the output from detex, which is currently called by TeXShop's "statistics" command.

  Users who upgrade TeXShop can get the new Inactive folder by quitting TeXShop, moving ~/Library/TeXShop/Engines to the desktop, and then restarting TeXShop. The new default Engines folder will be created by TeXShop. After it is created, merge extra items in your old copy on the desktop back into the ~/Library/TeXShop/Engines folder.

- The Inactive folder also contains a "sage.engine" file. This engine makes it possible to use the open source mathematical software Sage, a replacement for Maple, Mathematica, and MatLab, directly from within a TeX source file. For instance, a single TeX line can ask Sage to plot a function; in the typeset output, this plot will appear at that spot. Or a single line can ask Sage to integrate a complicated expression symbolically; in the typeset output, the answer will be shown, typeset consistently with other mathematical expressions in the document. The inactive folder contains an example document typeset in this way. Sage is available free at http://www.sagemath.org/.

- There was discussion on one of the mailing lists about the logic behind TeXShop's "Typeset" menu command, the "%!TEX program" mechanism, and the fact that "BibTeX" and "MakeIndex" are not really typesetting commands. Members of the list tried to understand the logic behind fine details of TeXShop's operation, but this was a hopeless task because there wasn't much logic present.

  An attempt has been made in version 2.25 to provide consistent behavior, but without a complete overhaul of the interface. The code now works in the following way:

  The "Typeset" command in the Typesetting menu always does exactly the same thing as the "Typeset" button in the source window toolbar. Both commands call the typesetting command listed in the drop down menu next to the toolbar button, unless the first few lines of the source file contain a line of the form

    %!TEX TS-program = ...

  If such a line is present, then the Typeset command uses the indicated program instead (unless the drop down menu is set to bibtex or makeindex; see comments below). The selected item in the drop down menu does not change, so commenting out the source line will cause typesetting to revert back to the method indicated in the drop down menu. Incidentally, TeXShop ignores extra comment characters at the beginning of the above source line, so it cannot be commented out by adding an extra comment. I prefer to add a space between the "TS" letters.

  In previous versions of TeXShop, it was not possible to select bibtex, makeindex, metapost, context, or metafont in the "%!TEX TS-program" line, for purely historical reasons. This anomaly has been fixed, and any engine can be selected:

    tex, pdftex, latex, pdflatex, bibtex, makeindex, metapost, context, metafont, or a user defined engine

  There should be one space after the equal sign before the program name, and case is important.

  Selecting bibtex or makeindex in the drop down menu causes these programs to be called even if a "%!TEX TS-program" line is present, since these two programs aren't really typesetting engines and a user may need to call them even when an unusual typesetting engine is being used.

  So much for the basic "Typeset" command. The TeXShop "Typeset" menu also contains items to call TeX, LaTeX, BibTeX, MakeIndex, MetaPost, ConTeXt, and MetaFont. These items are present mainly for historical reasons and most users ignore them. Adding new engines to TeXShop doesn't add extra menu items because the menu would become awkwardly long if a user had a large number of extra engines.

  The BibTeX and MakeIndex items are treated specially. Selecting one of these items causes TeXShop to run the resulting program regardless of the setting of the toolbar's drop down menu and the possible presence of a "%!TEX TS-program" source line. This is probably the most convenient way to call these two commands.

  The remaining TeX, LaTeX, MetaPost, ConTeXt, and MetaFont menu commands behave in a slightly different way. Selecting one of these menu items causes TeXShop to run the resulting command, regardless of the toolbar's drop-down menu selection and regardless of any "%!TEX TS-program" line. Moreover, selecting one of these menu commands changes the toolbar's drop-down menu selection to the engine chosen in the menu command. The idea behind this design is that beginning users may first find the menu commands and typeset using them. If such a user later uses the "Typeset" button in the toolbar, it should cause the same behavior as the earlier menu command.

  Sorry for this complexity; I'm trying to balance leaving the interface unchanged for users set in their ways with easier use of the BibTeX and MakeIndex commands.

##### TeXShop Changes 2.19 - 2.20

Version 2.19 was an internal version, never released. Here are the changes in it and version 2.20:

- Line numbers are displayed in the source file. A preference item turns this feature on or off; a menu item turns it on or off for the currently active window.

  This feature depends on free code by Paul Kim at Noodlesoft. The code is at http://www.noodlesoft.com/blog/; see "Displaying Line Numbers with NSTextView". I don't read this blog, but the code was pointed out to me in an email from Ryan Cuthbertson, who downloaded the TeXShop source code, implemented the change, and sent crystal clear instructions explaining how to add the feature. Kudos to Cuthbertson. Kudos especially to Paul Kim and Noodlesoft; Kim's code is so well written that Cuthbertson had to add only 32 lines of code to TeXShop to make it work.

- TeXShop now uses Sparkle to implement "Check for Updates." This brings many advantages. Rather than directing a user to the TeXShop web page when an update is available, TeXShop now lists new features directly, downloads the update upon request, and even quits TeXShop, installs the new version, and restarts the program upon request.

  Sparkle is another remarkable product from the open source software community. Written by Andy Matuschak and available at http://sparkle.andymatuschak.org/, it provides every feature you'd want in an update mechanism.The documentation for developers available on the web page is a model of clarity and simplicity. Sparkle is used by a number of other GUI programs for TeX, so users for find it familiar.

- The console window has been greatly improved by Will Robertson, who sent a new Nib file containing his changes several months ago. I waited to implement the improvements until I could add a console preference tab to TeXShop Preferences allowing users to modify Robertson's choices.

  The font and background color for the console can be modified in Preferences. Users can adjust the console width to match the number of characters typically output by TeX, and then select a preference allowing the window to be resized only in the vertical direction. Note that preference changes are immediately reflected in the console, so the trick to easy console configuration is to bring a console window to the front, open Preferences, try out various fonts, font sizes, and background colors until satisfied, activate horizontal resizing and adjust the console width, and then, if desired, lock down this width in Preferences.

- A number of items in the Preference panel have been moved to make the operation of the panel more transparent. The most important tab items come first: Source, Preview, Console, Typesetting. In the Preview tab, the "Fixed Magnification Amount" appears immediately following the "Magnification Method" to make it clearer that "Fixed Magnification" only applies when the "Magnification Method" is "Fixed Magnification."

- Previously, clicking the green "Zoom Dot" on TeXShop windows expanded the window to fill the screen. An attempt has been to made this operation more rational. The Source window now expands to fill the left portion of the screen; the console expands only vertically, and the Preview window expands to fill the right portion of the screen. The Preview window expands by the largest amount because users may want to zoom the image and check fine details. I'd appreciate advice on refinement of the zoom behavior. Recall that the behavior must make sense on small portable screens and large Cinema displays.

- For some time, TeXShop recognized hidden preference items to set the background color of the Source and Preview windows. These preference items are now exposed and can be set in the Preference dialog.

- A bug in the MatrixPanel code disabled the hidden preference "matrixsize''. This bug is fixed.

- The name of the alternate typesetting mode "TeX and Ghostscript" has been changed to "TeX and DVI". This fulfills a request of the American Mathematical Society, who have been dealing with users claiming that TeXShop cannot produce dvi files.

##### TeXShop Changes 2.15 - 2.18

###### Changes in TeXShop 2.16 through 2.18:

Versions 2.16 and 2.17 of TeXShop were constructed for test versions of MacTeX-2008, and released only to a few people testing that install package. Version 2.18 is now officially released on the TeXShop site. Here are the changes:

- Added a new Preference item under the Typesetting tab. The preference is called "After Typesetting" and the choices are "Bring Preview Forward"' and "Continue Editing."' The first item activates the Preview window after typesetting and brings it forward, as TeXShop has behaved in the past. When the "Continue Editing" item is activated, typesetting updates the contents of the Preview window but leaves the Edit window active with the editing cursor blinking. This makes it possible to typeset, glance over to check that things look right, and continue editing. This option is particularly useful on large monitors which can show the full contents of both windows.
- Added support for SyncTeX. SyncTeX is new synchronization technology by Jerome Laurens which is included in TeX Live 2008 (but not earlier TeX distributions). The technology is built directly into pdfTeX and XeTeX. In modern TeX distributions, most typesetting actually calls pdfetex (even if using latex to output a dvi file), and thus the technology is available for such typesetting.

  To use the technology, add the flag

    --synctex=1
  to the command line call to TeX. For example, in TeXShop Preferences under the Engine tab, the lines specifying pdfTeX for Tex and pdfLaTeX should read
    pdftex --shell-escape --synctex=1
    pdflatex --shell-escape --synctex=1
  A similar flag should be added to other engine scripts. The TeXShop defaults for these preferences already include this flag for pdftex and pdflatex, but not for other engine files. If the flag is included and an older version of TeX is called, typesetting will still occur (TeX will report to the console that it does not understand the flag.)

  The flag causes TeX to output an additional "synctex" file during typesetting, containing information linking the TeX source file(s) to the TeX pdf file. This file is similar to the old pdfsync file generated by the older PdfSync technology, but with the very significant difference that line and page breaks are no longer changed when outputting the data.

  Laurens also wrote a command line program named "synctex" which is included in TeX Live 2008; when this program is called with a request for appropriate synchronization data, the program parses the synctex file and outputs appropriate data.

  To activate SyncTeX support in TeXShop, go to TeXShop Preferences under the Misc tab and select "SyncTeX" as the "Sync Method." This is the default value if you are installing TeXShop for the first time.

  If SyncTeX synchronization is chosen, user interaction is exactly the same as in the old Search method. Hold down the command key while clicking at a spot in the source document. The Preview window will become active and the corresponding spot will be circled in red. Or hold down the command key while clicking at a spot in the Preview window. The source window will become active and the corresponding TeX input commands will be highlighted in yellow.

  When these commands are used,TeXShop will fall back on the old Search method if SyncTeX does not find an appropriate synchronization. The most common cause for SyncTeX failure is the absence of a synctex file, which will certainly happen when the file is typeset with an older distribution. Thus users can switch between TeX Live 2007 and TeX Live 2008 without changing their synchronization preference.

  A few users might like to test TeXShop's SyncTeX support without being confused by calls to the old Search synchronization method. To simplify this test, there is a new hidden preference which forces synchronization to use only SyncTeX:

    defaults write TeXShop SyncTeXOnly YES
  Support for SyncTeX was added to TeXShop 2.18 at the last moment. Synctex is now used in both directions, and is generally much better than the old search synchronization. But many improvements should be possible as I digest what Jerome has provided.

  Many thanks to Jerome Laurens for this wonderful work. I think you will notice an immediate improvement.

- Added encodings ISOLatinGreek, MacCentralEurRoman, and WindowsLatin2 (i.e., WindowsCentralEurRoman).

  The names of the encodings are

    Greek (ISO 8859-7)
    Mac Central European Roman
    Central European (ISO Latin 2)
    Central European Roman (Windows)
  and the %!TEX encoding = *** abbreviations are
    IsoLatinGreek
    Mac Central European Roman
    ISOLatin2
    WindowsCentralEurRoman
- In
    %!TEX encoding =
    %!TEX root =
    %!TEX TS-program =
    %!TEX projectfile =
  allow a space between % and ! for better formatting, and to remove %! postscript ambiguity. The old syntax without the space is, of course, also supported.
- Added code by Adam Maxwell to permit BibDesk Completions; this is controlled by a new Preference Setting. By default, it is not activated.
- Fixed French nib file so Typeset menu works again (there are no longer simultaneous checks on "PdfTeX" and "TeX \& Ghostscript").
- Fixed tab settings, so now changing tab spacing in Preferences works correctly.
- Command-T now typesets even when the console window is active.
- Fixed pdf updating. If a user has an external editor and uses TeXShop to display pdf output, and if the "Automatic Preview Update" preference is set, then whenever the pdf file is updated, TeXShop reads and displays the latest version, activating the pdf window when it does so. There is a hidden preference item named "BringPdfFrontOnAutomaticUpdate". If this is set to "NO", then the preview window is supposed to be updated but not brought forward. Recently, the preview window did this, but didn't display the new content until the user manually activated it. This is fixed.
- Instead of separate commands to display each of George Gratzer's symbol tables, there is one command to display all of the tables in one document. It is much easier to find a symbol if you can scroll through tables rather than guessing which table has the desired symbol.
- Modified default LaTeX macros to bring them up to date.

###### Changes in TeXShop 2.15

TeXShop 2.15 was an experimental release. It lived for a long time on my personal web page with a promise to migrate it to the usual TeXShop site. After the promise didn't materialize for several months, the link on my personal site was noticed by Version Tracker, and for several months that system pointed to the experimental 2.15 as the latest release. At last 2.15 has become "official" with the release of TeXShop 2.18.

Here is a list of new features:

- Fixed severe memory leakage on Leopard; said another way, the hidden preference item ReleaseDocumentClasses is now automatically set correctly on Leopard. This very significant bug, which I listed for a long time as the most significant bug in TeXShop, was caused by an Apple bug in PDFKit. This bug is fixed in Leopard. Consequently, users must be running System 10.5 to obtain the fix.
- Fixed pdf drag and drop on Leopard. In earlier versions on Leopard, a dragged pdf selection had a white background, making the feature problematic for Keynote and other programs. Now a dragged pdf selection has a transparent background, as it always did on Tiger.
- Support for the Hiero package, used to typeset hieroglyphics. See http://www.filipvervloesem.be/hierotexmac/ and the detailed explanation on http://www.filipvervloesem.be/hierotexmac/hierotex.html.
- Support for Sketch, used to construct 3D images in pdf files. See www.frontiernet.net/~eugene.ressler/.
- Generalizing the last two items, support for adding additional extensions to the list of filetypes which can be processed via TeXShop engines.
- The default templates now include a template for Beamer taken directly from the beamer web page. To see it, move the folder ~/Library/TeXShop/Templates to the desktop and restart TeXShop. The default Templates folder will be created. Merge your old Templates folder in with the new one.

Here are more details on each of these items.

- When TeXShop was first released on Tiger, users ran into an annoying bug which caused the program to gradually slow to a crawl after several typesetting actions. The problem occurred when a new pdf file was loaded into PdfKitView for the Preview window. According to Apple documentation, this should have released the previous data from memory. The release did occur, but it caused the program slowdown.

  To fix this problem, I added code to TeXShop which tricked the system into believing that the old data structures were still being used so the system didn't try to release them. This meant that TeXShop gradually used more and more memory over time, and it caused other problems as well. In notes to collaborators, I called this "the single most important bug in the program."

  This was really a PDFKit bug. But although I have reported several bugs to Apple (and they have been very good about fixing them), I didn't report this problem because I needed to make a small demo program illustrated the bug, and never got around to it.

  When system 10.4.3 was released, it looked to me like the problem was resolved, and I modified the TeXShop code to release memory on 10.4.3 and higher. Unfortunately, it soon became apparent that the problem remained, particularly for large pdf files. Luckily, I had added a hidden preference to TeXShop called "ReleaseDocumentClasses"; the value of this preference could be

    0 to release the data on system 10.4.3 or higher
    1 to never release the data
    2 to always release the data
  Initially the default value of this preference was 0, but I soon changed it to 1, restoring the old "kludge behavior."

  But when Leopard came out, several users reported that this preference can safely be set to 2. Further testing showed that the PDFKit bug was fixed in Leopard. Therefore, in TeXShop 2.15 the data is always released on Leopard, regardless of the value of ReleaseDocumentClasses. The old behavior still applies on system 10.4.11 and earlier.

  But just in case, there is another hidden preference called ReleaseDocumentOnLeopard. The default value of this preference is YES. If it is set to NO, the old preference ReleaseDocumentClasses becomes active and behaves as before.

- TeXShop has the ability to select a portion of the pdf image, copy the selection, and paste it into another program. Users can also drag the selection directly to another program. Before the program LaTeXiT was introduced, this feature was often used, but now LaTeXiT is usually the better way to proceed.

  The file format of the copy is controlled by TeXShop preferences; the default value is to copy as pdf with a transparent background, making it easy to use the result in Keynote and similar programs.

  This feature broke in the beta version of Leopard which Apple released at the 2007 Developer Conference. Later I managed to modify my code and fix the problem. But in the release version of Leopard, my fix also broke.

  At the developer conference I spoke to the author of PDFKit, who recommended a different fix. That fix is now in TeXShop 2.15.

  The old code used the NSView method "dataWithPDFInsideRect" directly in the PDFKit View. Before calling this method, it set the background color of the image in PDFKit to be transparent, and it also modified the PDFKit "drawPage" method to skip drawing a background when drawing for a selection. However, PDFKit in Leopard seems to have additional drawing layers which make the individual pages of an image stand out, and these layers add their own backgrounds.

  The new method uses PDFKit's page object and the routine "dataRepresentation"', which I learned at the developer conference does not include background information. This data is then placed in a NSPDFImageRep object, imaged in an offscreen NSView object, and captured with the object's "dataWithPDFInsideRect" method.

  There is a slight change when copying and dragging selections. Earlier, a selection could span more than one page. Now the copy will only include the portion of the selection which is on the page under the cursor.

  By the way, this fixes the last TeXShop Leopard bug known to me.

- TeXShop now contains an engine file in .../Library/TeXShop/Engines/Inactive for use with the Hiero package. An additional README in the folder explains how to install Hiero. The Hiero ".htx" extension is now recognized by TeXShop, and an icon for such files is provided.

  To obtain this engine, it is necessary to move the folder ~/Library/TeXShop/Engines elsewhere, say to the desktop. Then restart TeXShop. The program will create a new Engines folder, containing the new inactive items. Then merge the Engines folder on the desktop into this new default Engines folder.

- The same directory contains an engine file for Sketch. An additional README in the folder explains how to install Sketch. The ".sk" extension is now recognized by TeXShop.
- The previous two items are special cases of a general problem. A number of users have tried to use TeXShop's engine mechanism to process a source file and preview the resulting pdf output in cases where the processing engine isn't TeX at all, but rather some other Unix binary program. In many of these cases the source file has a new extension; for instance, ".htx" in the Hiero case, and ".sk" in the Sketch case.

  There are two problems with this technique, one minor and one major. The minor problem is that when TeXShop creates a file, it always adds an appropriate extension, usually ".tex". In the Save dialog there is a pulldown menu listing all extensions known to TeXShop. By using this menu, files can be created with other extensions like ".ltx", ".ctx", and so forth.

  But if an extension is not in this list, creating it within TeXShop is tricky. Users often try to directly type an extension, saving for example a file with name "myfile.htx". But actually TeXShop will then create "myfile.htx.tex" and even worse, the Finder may then hide the ".tex" extension.

  Luckily, there is a solution. One of the file types which TeXShop can save is named "Plain Text Document". Such a file has no extension. So if the user saves "myfile.htx" after selecting the "Plain Text Document" dropdown menu item, they actually will get "myfile.htx".

  The good news is that when TeXShop opens a file with an unexpected extension, say by dragging the file to the TeXShop icon, it will preserve the correct extension when saving. So this first problem is a minor problem during file creation, but it doesn't interfere with later processing the file.

  The major problem is that TeXShop deactivates the "Typeset" button when a file is opened with an unknown extension, or with an extension which is not used by source files. For example, TeXShop can open pdf files and jpg files, but it doesn't allow the user to typeset such files! Users who wanted to process ".htx" and ".sk" files with an engine found that they could not use the engine because of this behavior.

  TeXShop 2.15 has a new mechanism for such users. A hidden preference allows users to add extensions to the list of legal extensions which activate the Typeset button. For example, the command

    defaults TeXShop OtherTeXExtensions -array-add "htx"
  adds ".htx" to the list. To clear the list and start over with the built-in defaults, use
    defaults TeXShop OtherTeXExtensions -array
  Actually, ".htx" and ".sk" are now built-in, so these users do not need the new mechanism. But it is available for future users.
- The Beamer template can certainly be improved. I'd appreciate help from experts.

##### Versions 1.42 and 2.05 add extra features to TeXShop and fix some bugs.

###### New features in 2.05:

- TeXShop 2.05 is now a Universal Binary, containing code for both the PowerPC and Intel processors. The system automatically runs the correct version of the code.

- The default TeXShop preference for the teTeX binary directory is /usr/local/teTeX/bin/powerpc-apple-darwin-current. But if users have installed Gerben Wierda's latest TeX redistribution, they also have Intel binaries. On Intel machines, the teTeX binary directory should then be /usr/local/teTeX/bin/i386-apple-darwin-current. TeXShop now has code to make this change automatically. When the program first starts, it calls "uname -p" to determine the current processor. If the result is "i386", then TeXShop permanently changes the above preference to /usr/local/teTeX/bin/i386-apple-darwin-current. However this change is not made if the user has manually changed the default /usr/local/teTeX/bin/powerpc-apple-darwin-current to some other location. Thus if a user has the Fink teTeX distribution or some other distribution and has set the teTeX binary directory preference to point to it, the preference will not be changed.

- When TeXShop was first released on Tiger, users ran into an annoying bug which caused the program to gradually slow to a crawl after several typesetting actions. This bug was fixed a couple of days after the release. The problem occurred when a new pdf file was loaded into the PdfKitView in the Preview window. According to Apple documentation, this should have released the previous data structure from memory. The release did occur, but it caused the program slowdown. So the bug fix consisted of tricking the system into believing that the data structures were still being used so the system didn't try to release them.

  A side effect was that memory gradually filled up and some users learned that they needed to quit TeXShop and restart after each day's work.

  Recent investigation seems to show that this bug is fixed in Tiger 10.4.3. Consequently the latest version of TeXShop tests which system is running and releases the old data structures when the system is at least 10.4.3, but not otherwise.

  This behavior is controlled by a new hidden Preference item:

  - defaults write TeXShop ReleaseDocumentClasses 0

  The default value is 0, causing the program to behave as just described. If the value is 1, the old data structures are never released and the program behaves exactly as earlier versions of TeXShop 2. If the value is 2, old data structures are always released.

  Thus if you find that the program becomes sluggish after several typesetting jobs, change ReleaseDocumentClasses to 1 and then report the behavior to me with as many details as possible.

- Michael Witten, a student at MIT, added multiple wrapping modes to TeXShop. Users can choose "no wrapping" so lines continue right until the user pushes ENTER, or "word wrapping" so text is wrapped at word boundaries (this was the prior behavior), or "character wrapping" so text wraps exactly at the last possible character. Not that these wrappings are "soft"; resizing the window will change the wrapping. The default wrapping is "word wrapping" but a menu command allows the wrapping to be changed. Moreover, a hidden preference allows the default wrapping to be changed:

  - defaults write TeXShop LineBreakMode 1

  where "None" = 0, "Word Wrap" = 1, and "Character Wrap" = 2. Wrapping is done at the right side of the window unless the ruler is active; if it is, wrapping is done at the "right marker"

- Witten also added the command "Hard Wrap". If a paragraph is selected, this command inserts hard wrapping commands at the right side of this paragraph. After this step, resizing the window leaves the wraps fixed. This is useful if you send source to a colleague whose editor has fixed width and no wrapping. If the "Hard Wrap" command is chosen but no selection has been made, the hard wrap applies to the entire document. Note that "Hard Wrap" is undoable.

- The TeXShop Application Bundle now contains Norman Gall's TeX-mdimporter Spotlight importer. Files with extensions .tex, .latex, .ltx, .ctx. and .texi will be indexed by Spotlight when saved. In systems 10.4 through 10.4.2, TeXShop files were automatically indexed because they have type TEXT, but Apple changed this procedure in 10.4.3. So the importer is now required to index files. The system automatically recognizes the importer when TeXShop is first installed. It is then used to index .tex, .ltx, etc. files even if TeXShop is not running.

  If Gall later updates the importer and you install the new version in ~/Library/Spotlight or other canonical spots, the updated version will be used rather than the version in the TeXShop bundle because Apple's importer search routines use importers in bundles as a last resort.

  Gall's importer was not written with TeXShop in mind, but is instead designed to be used by all TeX editors and front-ends; the hope is that there will be a universal importer rather than a different one for each front end. For the latest version, see http://www.spookyhill.net/~gall/latex.

- The commands "altpdftex" and "altpdflatex" in Gerben Wierda's TeX distribution have changed to "simpdftex tex" and "simpdftex latex". These are now the default preference values for new TeXShop installations.

  Moreover, the first time a user tries to typeset in the "tex + ghostscript" mode, TeXShop will check these preference items, and change them if necessary. It does this by determining whether "simpdftex" is in the TeX binary directory. If so, and if the command in the TeX + dvips + distiller "TeX Program" field in the TeXShop Engine Preferences is "altpdftex", then this field is changed to "simpdftex tex". Any additional flags in the preference field are retained. At the same time, the "Latex Program" field is changed. If it is "altpdflatex", it is changed to "simpdftex latex", retaining any additional flags.

- Added ISO Latin 9 encoding

- Now (apple)-[ and (apple)-] act differently in the editing window and preview window. In the editing window they are "unindent" and "indent". In the preview window they are "back" and "forward". A disadvantage is that it was not possible to add these commands to the menus, so users need to remember these abbreviations. This change was requested by users with German and other keyboards on which (apple)-< and (apple)-> cycle through windows. Users with English keyboards cycle through windows with (apple)-`.

- Added a new hidden preference

  - defaults write TeXShop LeftRightArrowsAlwaysPage YES

  The default value is NO. When set to YES, the left and right arrows scroll by a page even if the horizontal school bar is active.

- Changed the English under the Preview tab of Preferences from "After Window Review" to "Magnification Style" and changed "Preview Window Magnification" to "Preview Window Fixed Magnification" to more carefully explain the function of these preference items. Notice that TeXShop only uses the Preview Magnification value if the Magnification Style has been set to "Fixed Magnification".

- Added a new item

  - %!TEX projectfive =

  which can be added to the top of TeX source files. This change is primarily for ConTeXt users so they can use the new sync method. When synching from the preview window to the source window, TeXShop needs to know all sources file for the document being previewed so it can open source files not currently open if necessary. It does this by parsing the root document, looking for \include and \input lines. But ConTeXt uses different commands to input files. The new syntax allows ConTeXt users to directly indicate in the root document which additional source files need to be searched. Here are examples:

  - %!TEX projectfile = /Users/koch/MyDoc/chapter1.tex
  - %!TEX projectfile = chapter2.tex
  - %!TEX projectfile = ../chapter3.tex

- Added .Rnw as an extension TeXShop can edit. This was a request of Paolo Bosetti, who uses TeX and R and Sweave together.

- When a user tries to open a .dvi file, TeXShop runs a script to convert the dvi file to a pdf file. In previous versions, it ran a different script when the .dvi was in a writeable directory than when its directory was not writeable. But Gerben Wierda has revised the simpdftex script to handle both cases, so now TeXShop always calls simpdftex to do the conversion. Actually it calls the TeX + dvips + distiller script which is set in Preferences; this preference will be simpdftex if the user has a fairly recent TeX distribution.

- Added a new hidden Preference

  - defaults write TeXShop RedConsoleAfterError NO

  If this default is YES, then after the first error the remaining text in the console will be red. The default value is NO.

- Slightly modified the appearnce of the Console window, particularly in English. More work is needed here. Note that the console window can be resized and relocated, and the system will remember this new size and location when TeXShop is restarted.

- In version 2.05, fixed "undo past a save" using the new Tiger command [textView breakUndoCoalescing]. Previous versions of TeXShop allowed users to undo past a save command. But this required "tricky code" and one effect of the trick was that TeXShop sometimes lost track of whether the current state of the document had previously been saved, and so didn't save the document before typesetting, giving strange results in the preview window.

- Versions 2.00 through 2.04 of TeXShop sometimes had trouble remembering new preference settings; it was necessary to set them several times before they "took." This is fixed.

###### New features in 1.42 and 2.05:

- The commands "altpdftex" and "altpdflatex" in Gerben Wierda's TeX distribution have changed to "simpdftex tex" and "simpdftex latex". These are now the default preference values for new TeXShop installations.

  Moreover, the first time a user tries to typeset in the "tex + ghostscript" mode, TeXShop will check these preference items, and change them if necessary. It does this by determining whether "simpdftex" is in the TeX binary directory. If so, and if the command in the TeX + dvips + distiller "TeX Program" field in the TeXShop Engine Preferences is "altpdftex", then this field is changed to "simpdftex tex". Any additional flags in the preference field are retained. At the same time, the "Latex Program" field is changed. If it is "altpdflatex", it is changed to "simpdftex latex", retaining any additional flags.

- Added ISO Latin 9 encoding

- New German localization and help files.

- New Japanese Help by Yoshihisa Okazaki with help from Seiji Zenitani.

- New Spanish help files and localization.

- Uses version 1.2.4 of OgreKit.

- Conversion of eps, ps, and dvi files to pdf (caused by opening such a file) now works even if the path to the file has folders whose names contain spaces. In all three cases, the file can now be in a folder without write permission.

- Trash AUX files now removes files with more extensions: cos, idv, 4ct, 4tc, lg, xref, ttt, fff, ent, wrm.

- If the user tries to open a file with UTF-8 Unicode encoding, but the file is not a legal utf8 file, a dialog now appears warning of the problem, and the file is opened with MacOSXRoman encoding.

- Bib files are promoted to full class citizens; text can be dragged to them, syntax coloring works, etc.

- A remark: users have reported that they can no longer "find" words in the console window. Actually, they can. This window has two portions. When typesetting ends, the bottom portion is active, so the find panel searches that portion. To activate the top, click on it. Then "find" works.

- Added a preference to control first mouse behavior: "Select on Activate." When this is YES, a click in the source window will also set the insertion point to the click point. If it is NO, a second click is required to change the insertion point.

- Added pdf to the types of files TeXShop can edit, and added a pdf icon. This allows TeXShop to be chosen as the default pdf viewer.

- Added Lilypond, abc, and bst as extensions that can be edited.

- Added code by David Reitter so that selecting the word \int, etc., selects the beginning "\" as well.

###### Bugs fixed:

- Japanese Image Copy Type Preference failed due to incorrect localization. Now fixed.

- Command Completion's configuration file is now loaded and saved in UTF-8 Unicode.

- Errors fixed in pdfsync.

- When typesetting engines are called, they are now passed the program filename with extension, rather than just the filename.

- In 1.35, it was only possible to switch between the OgreKit Find panel and the Apple Find panel in the English localization. This is fixed.

- The menu item to bring up the statistics panel was only in the English version. Now it is in all versions.

- In all display modes except single page mode, a black border is drawn around each pdf page. Previously this border was slightly inside the page, cutting off a slight border around the page. Now it is just outside the page. Thanks to Scott Ranby for pointing out this error.

- The "%!TEX TS-program" and "%!TEX root =" commands now when when used with an external editor.

##### Versions 1.37 and 2.00 add extra features to TeXShop and fix some bugs.

###### New features in 2.00:

- A new synchronization method has been added to TeXShop, using the ability in Tiger to search for strings in pdf files. The new method does not require including a pdfsync.sty file, so it works out of the box on files typeset using any engine: pdftex or pdflatex, TeX + ghoscript or LaTeX + ghostscript, XeTeX, and other engines.

- Click on a word or phrase in the source file. TeXShop will scroll the preview window to the corresponding phrase and circle it in red. Click on a word or phrase in the preview window. TeXShop will open the corresponding source file if it is not already open, scroll the source to the appropriate spot, and highlight the source phrase in yellow.

- A new TeXShop preference item selects the synchronization method to be used: the old pdfsync method, the new search method, or a combination in which the new search is used, but the program falls back on pdfsync if the new search does not succeed.

- TeXShop 2.00 uses Apple's PDFKit to display the pdf preview window. This software is introduced in system 10.4.0 (Tiger), so TeXShop 2.00 requires Tiger. PDFKit makes the following new features possible:

- TeXShop supports hyperlinks. To activate this feature, add the line
  - \usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}
  to the heading of the source document. Links to external web sites can then be added to tex documents using commands like
  - \href{http://www.uoregon.edu/~koch/}{Koch homepage}
  Links to other portions of the tex document can be added using commands like
  - \hyperlink{lemniscate}{Graph of Lemniscate}
  where the tag "lemniscate" is created using a command like
  - \hypertarget{lemniscate}{}

  To navigate with these links, choose the new "text" tool and clink on the colored links.

- The preview window toolbar contains "Back" and "Forward" buttons so one can jump to a spot using a link, and then jump back.

- Hyperref.sty automatically adds links to citations, so readers can rapidly jump from a citation to the corresponding bibliography entry.

- The hyperref package also creates a document outline. For example, the main outline of a book is a list of chapters; each chapter entry contains a list of sections, and so forth. To see this outline and navigate through the document with it, use the new "drawer" tool to display the pdf window's drawer.

- The text tool can be used to select a portion of text in the preview window and copy this selection to an editor. This differs from the "pdf selection tool" which copies a portion of the document as a pdf illustration --- the text tool copies editable text.

- Searching the pdf preview is supported. Use the search tools in the bottom half of the window's drawer.

- PDFKit brings additional polish to the display of pdf documents. It supports documents with isolated rotated pages, and correctly prints rotated pages in landscape mode. It supports liveupdate of window resizing if the magnification preference is set to "fit to window." Etc.

###### New features in 2.00 and 1.37:

The remaining new features are available in both new versions.

- Earlier versions of TeXShop allowed users to set the typesetting engine of a file, its encoding, and its root file by adding appropriate comments to the top of the source file. For example, the following commands set the typesetting engine to xelatex, the encoding to UTF-8 Unicode, and the root file to ../Main.tex:

  - %&xelatex
  - %&encoding= UTF-8 Unicode
  - %SourceDoc ../Main.tex

  But this syntax was a mistake because the symbols "%&" are reserved for the use of TeX.

- In versions 1.37 and 2.00 of TeXShop, the syntax has been changed to the following:

  - %!TEX TS-program = xelatex
  - %!TEX encoding = UTF-8 Unicode
  - %!TEX root = ../Main.tex

  It you used the earlier facility, you need to change your old source files to the new syntax. I'm very sorry to cause this work, but the change is really necessary.

- If you are in the middle of a project and cannot make the change now, you can temporarily set a hidden preference to revert to the old syntax. To do so, open Apple's Terminal program and type

  - defaults write TeXShop UseOldHeadingCommands YES

  Once this is done, the new commands will be recognized but the old commands will also work. However, I recommend turning this preference off as soon as possible.

- Commands have been added to the default Macros menu which insert the symbols "%!TEX TS-program = " and "%!TEX encoding = " and "%!TEX root = " into the source document; new users will see these entries. Users who are upgrading can easily add these symbols as well. To add the program entry, choose "Open Macro Editor" under the Macro menu. Click the "New Item" button, name the item "Program" and set its content to

  - %!TEX TS-program = #INS#

  Repeat for the "Encoding" and "Root" items.

- Martin Kerz added a "Check for Updates..." command to TeXShop. He also designed the new TeXShop web page. Thanks!

- OgreKit for searching has been upgraded to the latest 2.0.1 version.

- Additional filetypes can be edited, including files with extensions "abc", "bst", "bib", "lp", and "pdf". The addition of "pdf" allows TeXShop to be chosen as the default pdf viewer. A new pdf icon has been created so the system can use it on pdf files it will display in TeXShop.

- TeXShop has always had a "Revert To Saved" item under the File menu, but it has never worked! Sorry. This is fixed.

- David Reitter modified the selection code so if the user clicks on a control word like \gamma, the initial "\" symbol will also be chosen.

- A new preference item "Select on Activate" was added. When this item is checked, a mouse click on the text window will select this window and also place the cursor at the spot that was clicked. If the item is not checked, the initial mouse click will only activate the window. A separate click is then needed to position the cursor.

- New hidden preferences were added for users who change the default foreground and background colors of the editing window. These preferences set the color of the insertion point (without these preferences, the insertion point could become invisible). To set the insertion point to white, for example,

- defaults write TeXShop insertionpoint_R 1.0
- defaults write TeXShop insertionpoint_G 1.0
- defaults write TeXShop insertionpoint_B 1.0

- When a file is typeset, all open changed files with the same root are first saved.

- Improvements were made in the pdfsync code.

- In previous versions, it was possible to add a Macro button to the Preview Window Toolbar in English, but not in other localizations. This is fixed thanks to Juan Luis Varona.

- New Japanese Help by Yoshihisa Okazaki with help from Seiji Zenitani.

- A proxy icon is now added to the title of the preview window. This icon can be dragged to the desktop or other folders to create a copy of the pdf file. The source window has always had a proxy icon. Thanks to Rene Donner for suggesting this feature and explaining how to implement it.

##### Version 1.36 was never released.

##### Version 1.35 adds extra features to TeXShop and fixes some bugs.

###### New features:

- An important recent development is the release of XeTeX and XeLaTeX by Jonathan Kew. See

  - http://scripts.sil.org/xetex

  XeTeX is not part of Gerben Wierda's standard installation, but it is available with Wierda's i-Installer as an optional install directly from Jonathan Kew. XeTeX can access Macintosh fonts directly, so TeX documents can be written with Lucida Grande, Zapfino, and any other Mac font. Moreover, XeTeX understands Unicode, so for example users can type Arabic into the source window from right to left, typeset with TeX, and obtain Arabic in the output window. In particular, XeTeX source documents have UTF-8 Unicode encoding.

  TeXShop 1.35 supports XeTeX directly as follows:

  - a) XeTeX and XeLaTeX are now available in the pull-down typesetting menu on the source window
  - b) Using preferences, a user can make XeTeX or XeLaTeX the default typesetting option
  - c) If one of the first ten lines of the source has the form

    - %!TEX encoding = UTF-8 Unicode

    then that file will be loaded and saved with UTF-8 Unicode encoding, regardless of the default encoding chosen for other documents

  - d) If the first line of the source has the form

    - %!TEX TS-program = xetex or %!TEX TS-program = xelatex

    then the appropriate program will be used regardless of the typesetting option chosen.

- These XeTeX features form a special case of a new general method for adding typesetting engines to TeXShop. There is a now a folder in ~/Library/TeXShop named Engines; the files in this folder are shell scripts which call typesetting programs. When TeXShop first starts, it examines this folder and adds the script names of files it contains to the pull-down typesetting menu. Choosing one of these items and pushing the Typeset button calls the script. Users can write their own scripts and add them to the Engines folder.

  Items in ~/Library/TeXShop/Engines can be chosen as default typesetting method in TeXShop Preferences.

  The typesetting program can be set in the source code by writing one of the following on any of the first twenty lines of the source:

    %!TEX TS-program = tex
    %!TEX TS-program = latex
    %!TEX TS-program = pdftex
    %!TEX TS-program = pdflatex
    %!TEX TS-program = personaltex
    %!TEX TS-program = personallatex

  This new syntax also works for any new typesetting engine added to ~/Library/TeXShop/Engines. For example, %!TEX TS-program = xelatex chooses XeLaTeX.

  The encoding used to open or save a file can be set by writing a line of the form

    %!TEX encoding = UTF-8 Unicode

  as one of the first 20 lines of a source document. Any supported encoding is allowed; TeXShop's Help Files list the string which must appear on the right for each of these encodings. To bypass this behavior, hold down the option key while opening a file.

  The old SourceDoc syntax has been modified to conform with the above changes. For example, to set the root file to ../Main.tex, write

    %!TEX root = ../Main.tex

  (The old syntax is still supported for setting the program, encoding, and SourceDoc, but users are urged to switch to this new syntax.)

- TeXShop has a new Find panel by Isao Sonobe. This panel supports regular expressions. Users can switch between the new panel and the original one in Preferences. The Find panel depends on OgreKit, a Cocoa framework for handling regular expressions by Sonobe. See

  - http://www-gauge.scphys.kyoto-u.ac.jp/~sonobe/OgreKit/

  OgreKit is distributed using a slightly modified version of the BSD license. This license can be found in the Documentation included directly in the OgreKit Framework folder in the TeXShop source distribution. OgreKit requires Panther, so the new panel will only appear on machines running Panther.

  There are many nice features in this new Find panel, which users can discover for themselves. OgreKit modifies the "Find" menu submenu of the TeXShop Edit menu, replacing it with a more extensive menu. This might be confusing to Localizers, because the menu in the TeXShop nib file is not the menu they will see when TeXShop is running. The Find menu in the nib file should not be modified because it will be active in system 10.2. Instead the corresponding menu in OgreKit needs to be localized in the TeXShop source. The Find panel presents buttons controlling how it will find words; the settings of the buttons will be remembered from session to session. Adjust them until Find works as expected and then relax.

- TeXShop 1.35 is distributed with the latest pdfsync.sty by Piero d'Ancona and J. Laurens. This fixes typesetting problems caused by the version distributed with TeXShop 1.34. TeXShop did not keep up with the changes by d'Ancona and Laurens for several months; sorry!

  In the new version, \include and \input are supported; to use the second, the syntax \input{thisfile} must be used rather than the syntax \input thisfile. The new version supports \pdfsync, \pdfsyncstart, and \pdfsyncstop. Use the first of these commands at any spot where you want to reference a point. If pdfsync breaks your code, enclose the offending section in a \pdfsyncstop, \pdfsyncstart pair.

- Suppose you are typesetting myfile.tex. Pdfsync creates a file named myfile.pdfsync containing synchronization data. Roughly speaking, each data entry describes a synchronization point as follows:

  - the page number of the output where the point occurs
  - the location on this page
  - the name of the source file producing this particular output
  - the line number in this source file for this particular output

  There is a way to get TeXShop to display these synchronization points. The preview window toolbar has a new checkbox item called SyncMarks. By default, this item is not shown; use Customize Toolbar in the Window menu to select it. When the checkbox is checked, synchornization points are shown.

  By default, this item will not be checked when the Preview window first appears. A hidden preference item can change this:

  - defaults write TeXShop ShowSyncMarks YES

- TeXShop 1.35 has new matrix code by Jonas Zimmermann. The Matrix Panel now makes tables. Examine the panel to find all of the new features. There is a hidden preference to set the default size of the matrix:

  - defaults write TeXShop matrixsize 12

  A very small number of users may have modified "matrixpanel.plist" in ~/Library/TeXShop/MatrixPanel. This plist has been extended; the new list is called "matrixpanel_1.plist". Please edit this file to add your changes.

- In previous versions of TeXShop, if you clicked elsewhere and then clicked on the edit window to edit, you would need to click twice to correctly position the cursor. This is now changed; the first click in the edit text is recognized and positions the cursor.

  When applescript runs under the Macro menu, it starts a small second application embedded in the TeXShop folder to actually run the script. That is because when a command like "latex" runs, and there is an error on the source, the console appears to accept user input, but the TeXShop event loop is not running during the applescript action, so no user input can occur.

  Many applescripts do not have this problem. TeXShop now allows users to begin applescript macros with the command

  - -- applescript direct

  When written this way, the script will be run directly by TeXShop rather than by the second small application.

- Added a menu command "Trash AUX Files" and a button on the console "Trash AUX Files." When involked, these commands move to the trash all files in the current source directory with the same name as the source file and extensions aux, bbl, blg, brf, glo, idx, ilg, ind, ioa, lof, log, lot, mtc, mlf, out, pdfsync, and toc. Thanks to Will Robertson for suggesting this command and producing this list of extensions.

  Additional extensions can be added to this list with a hidden preference. To add "dvi" to the list

  - defaults write TeXShop OtherTrashExtensions -array-add "dvi"

  Several such extensions can be added in this way, one by one. To remove all additions

  - defaults write TeXShop OtherTrashExtensions -array

  The original list of extensions above will always remain active.

  Suppose a book project has a main.tex file in a folder, and then chapters in subfolders which are accessed using commands like \include{chapter1/chapter1.tex}. When this book is typeset, main.aux and other files will appear in the primary folder, and chapter1.aux will appear in a subfolder. So the "Trash AUX Files" command does not do a complete cleanup. But if the option key is pressed when the menu item is chosen or the button on the console window is pressed, then

  - a) SourceDoc and Root File information will be used to find the root document
  - b) All files with appropriate extensions listed above will be moved to the trash from this folder and all subfolders, even if the name does not agree with the name of the root file.

  Some users may want to throw caution to the winds and arrange that "Trash AUX Files" always performs this more extensive cleanup. A hidden preference allows this:

  - defaults write TeXShop AggressiveTrashAUX YES

- Added new templates by Will Robertson. These are heavily commented. It is intended that users will edit them to fit their own requirements. The templates are only installed if TeXShop is running for the first time, or if the Templates folder is completely removed from ~/Library/TeXShop. But Will's templates are in a folder named "More" in the TeXShop distribution; old users can obtain them by moving "More" to ~/Library/TeXShop/Templates.
- Added new macros by Will Robertson to create tables and arrays, to insert a reference, and to open other project files quickly. These macros have been praised on the TeX-On-MacOSX mailing list. The macros are available for new users; older users can obtain them by following simple instructions which come with TeXShop 1.35.
- Added a macro to examine files in the teTeX tree. For example, if "article.sty" is typed in the dialog produced by the Macro, kpsewhich is used to find this file in the tree and open it in TeXShop.
- There are hidden preferences to set the color of the text in the source window

  - defaults write TeXShop foreground_R 0.3
  - defaults write TeXShop foreground_G 0.3
  - defaults write TeXShop foreground_B 0.3

  This color will show if syntax coloring is on; otherwise it will be black and then color can be selected in the Font menu.

  When used with existing hidden preferences to set the source window background color, these commands can be used to write source as white on black, or with other color schemes. TeXShop has new macros to set the source window colors, and to reset to default colors.

- There are hidden preferences to make the source, preview, and console windows partly transparent.

  - defaults write TeXShop ConsoleWindowAlpha 0.75
  - defaults write TeXShop SourceWindowAlpha 0.75
  - defaults write TeXShop PreviewWindowAlpha 0.75

  Here an alpha value of 0.00 is completely transparent and an alpha value of 1.00 is completely opaque. Use these commands cautiously!

- TeXShop now has a Statistics panel, which lists the number of words, lines, and characters in a document. This is obtained by calling

  - detex myfile | wc

  When first called, the document on disk is tested. After changes are made to the document, the "update" button saves the document and calls detex again. The detex command removes tex commands, but the word count is still only approximate. Input and include files are counted by this command.

- New German Help by Martin Kerz. Kerz also redesigned the TeXShop Help Window to follow Apple's current guidelines. These changes appear in English and German, but may not appear in other localizations.
- When a file is drag-and-dropped, any alias is now resolved. Thus alias graphic files (and other files) can be used provided they are dragged and dropped to the source. Alias files will not work if their names are typed directly because the tex engine does not understand aliases (it does understand symbolic links).
- Several changes were made in the Japanese portions of the code by Seiji Zenitani, with help from Yu Itoh and Koichi Inoue. There is a new Japanese encoding, Shift JIS X0213, which will become a new standard in Japan. There is now utf.sty support for pTeX. Before this change, Japanese pTeX supported only 6000 Kanji characters, but utf.sty supports more than 20,300 characters. This support is turned on by a preference item in Misc. When on, TeXShop exports non-ptex chracters as utf.sty codes. For example, unicode characters become \UTF(Hex code) and non-unicode characters become \CID(glyph ID).
- Zenitani also added new Japanese default settings. Previously, Japanese ptex distributors provided their own "altpdflatex" scripts, which was confusing for beginning users. This new version of TeXShop bundles "altpdflatex-for-ptex" scripts and installs them in ~/Library/TeXShop/bin. The new Japanese default settings in Preferences automatically set up TeXShop to use these new scripts.
- Added the following Chinese encodings at the request of Adam Si: Mac Chinese Traditional, Mac Chinese Simplified, DOS Chinese Traditional, DOS Chinese Simplified, GBK, GB 2312, and GB 18030.
- Added a new Japanese help system by Yoshihisa Okazaki.
- Added new Spanish localization and help.
- TeXShop can now open and write files with extension .dn and .engine.
- There is a hidden preference

  - defaults write TeXShop BringPdfFrontOnAutomaticUpdate NO

  which causes the pdf window to remain where it is when it automatically updates and is used with an external editor. This preference was requested by a user with an X11 editor and only seems necessary in this case.

- Users sometimes upgrade Mac OS X via "archive and install". After the installation, TeXShop remains but teTeX is blown away. The first time such users typeset a file, they see an error dialog reporting that "pdflatex cannot be found." This error dialog has been revised to explain more clearly the likely cause, and resolution, of the problem.
- The TeXShop web page now contains a "LaTeX Documentation" section listing recommended books and links to free LaTeX guides on the internet. The web page also makes available a number of short LaTeX example files by Will Robertson.

###### Bugs fixed:

- When a large number of windows were open, switching from one window to another took a long time and yielded a spinning disk; TeXShop was completely unresponsive during this time. This slowdown was caused by a bug in the Macro code. The problem is now fixed.
- If a dvi file was opened in a directory without write permission, TeXShop could not create and display a corresponding pdf file. Now it will create the pdf file in a temporary directory and display it.
- If the abort button was pushed in the console and the user later typed and pushed RETURN, the program crashed. Fixed.
- Two minor error dialogs, which should have appeared in a window, instead appeared on the desktop with an inoperable "OK" button. This is fixed.
- In localizations other than English, attempts to get the applescript dictionary crashed TeXShop. Fixed.
- The Bibtex, etc., tools in the source window did not work if a file had a root file. Fixed.

##### Version 1.34 adds extra features to TeXShop and fixes some bugs.

###### New features:

- Added a Matrix Panel by Jonas Zimmermann, zimmerleut@gmx.de. Many thanks.
- At the request of Claus Gerhardt, added an extra applescript command, "goto line". For instance
    tell front document of application "TeXShop"
    goto line 15
    end tell
- Added a first cut at pdfsync. Clicking on a spot in the pdf file while holding down the command key takes the user to the corresponding point in the source file. If the source file has include files, this operation will open the appropriate include file and take the user to a point in that file. Read the help file "General Help: Pdfsync" for important details. This change depends on pdfsync.sty, a file create by Piero D'Ancona with improvements by Jérôme Laurens.
- Also added pdfsync the other way. Clicking on a spot in the source file (including source files with root files) while holding down the command key will select the corresponding page in the pdf file.

###### Bugs fixed:

- The TeX, Latex, Bibtex, Makeindex, Metapost, Context, and Metafont buttons on the toolbar reset the default typesetting engine. This no longer happens. Thus it is possible to hit the Bibtex button and then hit command-T to typeset again.
- The abort button on the console window did not stay fixed when the window was resized. Thanks to Sean Luke for pointing out these first two errors.
- The command-1 keystroke switches back and forth between the source and preview windows. In previous versions, this did not work when a source window had a root file set by myfile.texshop or %SourceDoc. This is now fixed. Clicking command-1 while in the source brings up the corresponding preview window. Clicking command-1 again brings up the original source file. A given preview window may have several source files. Command-1 will bring up the last source file which was switched to the preview using command-1, or the root source file if there was no previous switch.
- New Spanish help files by Juan Luis Varona Malumbres. Thanks.
- Printing now respects the "scale" setting in Page Setup. It does not respect the "paper size" setting since paper size is set in teTeX. Printing works like this: the dimensions of the printed document are set by tex and encoded in the pdf file; this pdf is resized by the scale factor if this factor is not 100%, but otherwise is placed full size and centered on the printed page; usually the document size and printed page size are the same, but in rare cases when they are not, the edges of the document might be cut off.

##### Version 1.33 adds extra features to TeXShop and fixes some bugs.

###### New features:

- The changes in version 1.33 support improved apple scripting, better macro support, and improved interaction with external editors.
- Improved macro support was prompted by Claus Gerhardt, who wrote several useful scripts included with version 1.33. For example, one script calls htlatex to typeset a latex file for the web. The script saves the source, typesets, and opens the resulting html file in Safari. Thus the script behaves exactly like the Latex typesetting button except that it creates an html rather than a pdf, and displays the html in Safari rather than TeXShop. An advantage of this approach is that users can create their own scripts similarly and thus add features to TeXShop without waiting for new program code.
- TeX typesetting often requires a sequence of operations. To process a file with a bibliography, the source must be run through latex, bibtex must be run, and latex must be run twice more. A script is included to do this automatically. The script saves the source before the first latex run and updates the preview display at the end. Users can easily customize this script for their own workflow.
- Additional scripts convert the tex source file to a file with Windows line feed convention, or a file with Macintosh 9 line feed conventions, or a file with Unix line feed conventions. Mac OS X understands all line feeds without help, but many computers are not so smart; the conversions are useful when sending files to friends. The "flip" binary used to do these conversions was written by Craig Stuart Sapp. See http://ccrma-www.stanford.edu/~craig/utility/flip/ for details.
- A script is included to call pdfselect and extract portions of pdf documents. A user could request one file containing pages 3 through 7 of the tex document, one containing page 29, and one containing pages 31 through 36. The advantage of placing this code in the Macros menu is that a user interface is provided, so users don't need to remember calling conventions for pdfselect and don't need to switch to the Terminal.
- A #DOCUMENTNAME# variable was added to the Macro editor, giving applescript commands the name of the calling document.
- The following applescript commands were added to TeXShop. Consult the TeXShop help files for details about writing your own scripts using these commands.

  - typeset
  - latex
  - tex
  - bibtex
  - context
  - metapost
  - makeindex
  - typesetinteractive
  - latexinteractive
  - texinteractive
  - bibtexinteractive
  - contextinteractive
  - metapostinteractive
  - makeindexinteractive
  - typeset
  - refreshpdf
  - refreshtext
  - taskdone

- Improved support was added for external editors, following prodding by Joachim Kock. Several changes have been made:

  - There is now a preference to turn on continuous updating of the preview window if the user is running in external editor mode. Once each second the program checks to see if the pdf file has been updated. If so, it refreshes the pdf display.

  - The interval between refresh checks is controlled by a hidden preference item named RefreshTime. To reset to another interval in seconds (say every 2.19 seconds)

    defaults write TeXShop RefreshTime 2.19

  - Applescript command support has been added to TeXShop so external applications can send commands to it. For external editors, the important script commands are

    - latexinteractive
    - texinteractive
    - bibtexinteractive
    - contextinteractive
    - metapostinteractive
    - makeindexinteractive
    - typesetinteractive
    - refreshpdf
    - taskdone
    - open_for_externaleditor

    The first seven commands call TeXShop's typesetting engine. When one of these commands is called, control immediately returns to the calling program even though the typesetting operation is not complete. The taskdone command returns FALSE while this operation continues and TRUE when it is done, so a calling program wishing to send several commands can send one command and then test that it has been completed before sending another command.

  - Refreshpdf updates the preview display, and can be used instead of continuous updating to control that display. Typesetting commands automatically update the display upon completion.

  - The open_for_externaleditor command opens a .tex file, calling "Open for Preview..."

- Additional features not related to scripting or external editors have also been added:
- "Select All" can be used to select the full page of pdf output in selection mode. There is one restriction; in Multi-Page and Double-Multi-Page mode, select all is only active if the document has at most 20 pages, since otherwise the selected pdf will be enormous and bring the machine to a crawl.
- A preference item now allows users to distill with Apple's pstopdf rather than ghostscript. This only works in Panther because pstopdf is only in Panther. If the preference is chosen but Panther is not running, the old ghostscript code will be used. When the preference is chosen, ghostscript is no longer needed for internal TeXShop scripts, but it may still be required for teTeX style files. One such case is epstopdf.sty, used to automatically convert eps files to pdf format during typesetting.
- Zenitani provided additional drag and drop support. The new version reports an error if the filename of the dropped file contains a space. The new code also permits customization, in a somewhat strange way. To customize drag and drop code, add a new submenu to the Macros menu titled "Drag & Drop". Inside this folder, insert items for file types and make the text of each item be the code to be produced by drag and drop. For example, one item might be called ".pdf" and the body of this item might be "\includegraphics[#INS#]{%r}" where neither item would include the quotation marks. In these inclusions,

  - %F = full path of an dropped file
  - %f = dropped filename
  - %r = relative path of the dropped file
  - %n = filename without extension
  - %e = extension

- If an extension is not listed in the Drag & Drop menu, or if there is no such menu, then drag and drop behaves as Zenitani proscribed, so most users won't need to customize the code.
- German help has been updated by Martin Kerz, the Italian localization has been updated by Nicola Vitacolonna, the Spanish help was updated by Juan Luis Varona Malumbres, the French localization was updated by Hendrik Chaltin, and a Romanian localization was added by Andrei Teleman. Thanks!
- Macros can now be called when the preview window is active; commands which insert text will be deactivated in this mode. A toolbar item for the Preview window was added so the Preview toolbar can display a Macros button.
- An "Abort" button was added to the console for people who want to stop the typesetting program in midstream. This is a minor change.
- Code by Elliott Hughes was added to clean up some of the code calling a latex, tex, bibtex, etc., task. If the binary file is not found, the program now puts up an error message explaining the error and asking if the preferences bin path is correct. This will be useful for those running fink who forget to change the preference.
- At the request of Joachim Kock, when TeXShop opens a file for Preview, or is in external editor mode and opens a file, the program now compares the dates of the source and preview files. If the preview file is not up to date or does not exist at all, the source file is automatically typeset. There is a hidden preference to turn this behavior off, but it is on by default: To turn it off

  defaults write TeXShop ExternalEditorTypesetAtStart NO

###### Bugs fixed:

- A few users reported that their printers added a slight yellow background to the page. Only a few printers had that problem. Frank Stengel discovered that it was caused by a NSEraseRect call in the print drawing routine. This call has been removed; now TeXShop prints using only one line, the vanilla Cocoa call [myRep draw].
- In Panther, all Text objects offer word completion. If a portion of a word is typed and option-escape is typed, the system will offer a list of possible completions. This works in TeXShop, TextEdit, and other Cocoa programs. But TeXShop's Command completion was broken in Panther, and made it impossible to use this new feature. This is fixed.
- TeXShop has an applescript command to add text, but this command did not update the undo stack. This was fixed by Stefan Walsen; his patch is in version 1.33.
- If the user printed the source and later printed the typeset document, the document would be lowered on the page. This is fixed.
- Jerry Keough found a strange bug when using TeXShop in Jaguar. If the user's preference setting asked that no empty document appear at startup and if the user opened a document, made the pdf window active, and then reached over and closed the source window, the next menu use would crash the program. This bug did not occur in Panther. It is fixed.

##### Version 1.32 adds two extra features to TeXShop and fixes some bugs.

###### New features:

- There is a new menu item, "New Tag", which inserts an empty tag in the source text and positions the cursor so the user can add the name of the tag. As a corollary, there is now a keystroke to add a new tag; the keystroke is command-2.
- In Applescript macros, the terms #LOGPATH#, #AUXPATH#, #INDPATH#, #BBLPATH#, and #HTMLPATH# will now be recognized; this has been added at the request of Claus Gerhardt.
- There is a new option to set the program called by MetaPost. See the TeXShop help file for an explanation.
- The drag and drop code has been improved by Seiji Zenitani. Dropping files of types pdf, jpg, jpeg, tif, tiff, eps, or ps on the source document will produce \includegraphics and a reference to the file. Dropping a file of type cls, sty, or bib will \documentclass, \usepackage, or \bibliographystyle and a file reference. Dropping any other text file will produce \input and a file reference.

###### Bugs fixed:

- Although the magnification level can increase to 1000 in version 1.31, the arrow keys next to the magnification control only allowed values up to 400. This is fixed.
- If the preview window's toolbar was in text-only mode and the magnification panel was selected, the resulting small dialog window would not go away in 1.31. This is fixed.
- In Preferences, if the user set the tab size or the preview window magnification and then cancelled, the new values would still appear when the Preference panel was again displayed. This is fixed.
- Suppose the preference to place the first page on the right side is active. In 1.31, the left arrow key did now work in double page mode, and the right arrow key stopped one page before the end. In double multipage mode, the end key, the page down key, and the right arrow key stopped before displaying the last page. All of these problems are fixed.

##### Version 1.31 adds some extra features to TeXShop and fixes several bugs.

###### New features:

- Macros items are now specific to the typesetting engine set in the current window. Two default sets are created when TeXShop first starts, one for Latex and one for Context. (The Context set was created by Hans Hagen; thanks!). Suppose a different engine is selected, say TeX. When it starts, it will have the default Latex macros. But if this set of Macros is edited with the Macro editor, the new set will always be associated with TeX, while the old Latex macros will continue to be associated with Latex. Of course the Latex macros can also be changed.
- A new preference item allows the first page in the two double page modes to be either on the left or on the right. Books usually put this page on the right, so that is the default preference.
- The preference dialog has a new pulldown menu to reset preferences to default values. This addition was requested by Seiji Zenitani for users in Japan who must cope with three different versions of pTeX. These users can now rapidly set preferences without consulting documentation on web sites.
- The largest possible magnification in the preview window is now 1000 (previously it was 400).
- Additional French menu translations by Hendrik Chaltin; thanks!

###### Bugs fixed:

- Three Panther problems are fixed. A few interface changes were made to improve appearance in Panther. This release is essential for Panther.
  - In Panther, older versions of TeXShop refuse to create new files, although they can open existing files. This was fixed by adding two lines to the "displayName" code.
  - In Panther, the small yellow tags which display the current page when scrolling in multipage and double multipage display formats were blank. Also, the small yellow tags which display the size of a selection rectangle to copy a portion of the pdf window were blank. This is fixed.
  - On my system, Panther spellchecking often fails for all programs. This happens at boot time. The computer boots up, but even if the first program used is TextEdit or Mail, it refuses to "spell check as you type" and the "Spelling dialog" refuses to appear. I suspect this is due to a defective third party program on my disk, since other Panther users haven't seen the problem. But I haven't been able to isolate the bug. Once the problem occurs, TextEdit and Mail have minor text input glitches which are cured by turning off continuous spell checking. TeXShop had more serious glitches in this situation. So in 1.31, extra code has been added to turn off continuous spell checking when TeXShop starts if the spell checker is not available.
- Fixed a bug reported by Luis Sequeira: when text was dragged within the source window, it was always copied and pasted. It should have been cut and pasted unless the option key was down. This is fixed.
- Juan Luis Varona Malumbres slightly improved Spanish help (small icon for the list of help files in the drawer).
- In two page mode, typesetting no longer scrolls to the first page.
- The new page and magnification buttons retain firstResponder status (as before 1.29) so users can experiment with several settings without clicking again for each experiment.
- In version 1.30 and before, if the user input an impossible line into the "Go To Line" dialog, the program could crash; this is fixed. Thanks to Eric Seidel for the bug report.
- Kevin Ballard, kevin@sb.org, contributed a new English.lproj folder with revised placement of interface items in preferences, slightly revised menu items, and other changes to improve the look of the interface in Panther. Many thanks!
- Made spacing changes for Panther in the German preference panel. Thanks to Martin Kerz for the suggestions.
- There is a hidden preference item to turn off tag computation: "defaults write TeXShop TagSections NO" but this preference was disabled somewhere along the line and certainly in 1.30. It is enabled again.
- The Preference window is no longer hidden when the program is deactivated.

What's new?