TeXShop Changes 2.31
- Goto Error is improved. It now highlights the text just before the error (as reported by TeX in the console) rather than an entire line containing the error. When searching for errors, users should first look at the spot where the highlighting ends. This change was requested by users who let TeXShop automatically soft wrap lines; to TeX, these source files appear to contain whole paragraphs rather than individual lines. In earlier versions of TeXShop, Goto Error highlighted these entire paragraphs, making the error hard to spot.
- Fixed the notorious "toolbar incorrectly drawn bug". This bug occurred when the Preview toolbar contained the "mouse mode matrix" but this
matrix was forced offscreen when the Preview window appeared because the window was too narrow to contain it. In that situation, the tools in the toolbar were drawn too high and partially cutoff, or so high that they were invisible. The bug is fixed.
- Fixed an obscure bug reported by Jean-Michel Bismut: he got intermittent crashes when closing the Preview window with command-W or
the red close circle. The bug mainly appeared when TeXShop was used with an external editor. Fixed.
- Fixed a bug reported by Cesar Rivas: when the Default Page Style was "Single Page", the toolbar scale reported the wrong value,
and thus zoom in and zoom out started from the wrong values. The bug fix solved another problem: previously if the user picked a mouse tool
like "magnify" that was not the default and then typeset, the toolbar would still show the magnify tool active, but the actual tool would change to its default value. Fixed.
- TeXShop has a new SageTeX engine by Dan Drake. This engine is easier to install because SageTeX is now part of Sage rather than an extra download. The engine no longer reruns Sage when typesetting a source in which the sage commands have not changed.
For a brief time, SageTeX was part of TeX Live 2009. This is no longer true because SageTeX is closely tied to Sage and needs to be updated when Sage is updated. SageTeX users should carefully read the short document in ~/Library/TeXShop/Engines/Inactive/Sage before installing the new engine; the document explains the simple step required when upgrading Sage.
- The internal TeXShop script which calls ConTeXt was modified to make the Abort command work. Although it worked for other engines, it recently stopped working for ConTeXT. Steffen Wolfrum reported the bug and was instrumental in finding a fix. The broken script was a tcsh script, and Wolfrum discovered that Abort worked when the internal script was rewritten as a bash script.
- Added a new menu item, "Abort Typesetting", with a keyboard shortcut. This makes it possible to call abort from the keyboard without using the mouse. The shortcut works regardless of which window is active.
- The pdf file is now closed when the Preview window is closed. In version 2.30, the entire document had to be closed to close the pdf file. In 2.29, TeXShop itself had to quit to close the file. So we are making incremental progress.
- Improvements in French localization by Rene Fritz.
- Slight improvements in ConTeXt and MetaPost help sections.
- Slight improvements in latexmk.
- Better error detection in the "Paste Spreadsheet Cells" macro.
- The default KeyEquivalents.plist in ~/Library/TeXShop/Menus was defective; among other things, it had comments
within comments, which is illegal. The file has been fixed.
KeyEquivalents.plist doesn't actually change any keyboard shortcuts because the changes it illustrates are commented out. But users can change TeXShop's default keyboard shortcuts by editing the file. However, there are some limitations. The OgreKit Find Panel menu items are handled in a special manner and cannot be changed with KeyEquivalents. The Macro menu items are also handling in a special way and cannot be changed with KeyEquivalents, although they can be changed with TeXShop's built-in Macro Editor. Finally, File menu items are sometimes overridden by Cocoa, so shortcut changes in that menu can have unintended consequences.
TeXShop Changes 2.30
- TeXShop has a new item in the Help Menu named "About This Release." This item will be revised for each release, and explains any steps needed to activate new features. Users should form a habit of reading this short file after upgrading.
New users get the latest defaults and can ignore the step. But older users may need to make small changes in Preferences, and regenerate certain subfolders in ~/Library/TeXShop. These locations allow users to modify the default behavior of TeXShop, so the program does not automatically update them because it does not want to deactivate user choices behind the user's back.
- This version fixes a crucial crash bug involving synctex, searching pdf documents, and related notifications. Some users ran into the bug when attempting to search pdf documents. Others had crashes immediately after syncing. Many users avoided the crash entirely. Now it should be fixed for everyone.
- TeXShop has a "Goto Error" menu command, mirrored on the console window. Until this version, the command only worked on individual files. But the command now works with projects controlled by a root file. If an error occurs in an included source file not open on the desktop, that source will open and the line with the error will be highlighted. This change
requires a new flag in all engines: " --file-line-error". In TeXShop default preferences, this is set for pdftex, pdflatex, simpdftex, and xetex. If users wrote other engines, they will need to add the flag for these.
- New MetaPost and MetaFun engines by Nicola Vitacolonna are included. The engines are called "nv-metapost" and "nv-metafun." To prepare for these engines, the operation of TeXShop when using MetaPost and MetaFont has been revised. The built-in MetaFont command has been removed entirely; Vitacolonna's nv-metapost works much better for that purpose. The buildin MetaPost command has been retained for compatibility with projects by current users. This command just calls mpost directly. The preference item which switched this command between MetaPost and mptopdf has been removed.
Users working with MetaPost for illustrations, or MetaFont, users will want to use nv-metapost and nv-metafun instead. Minimal documentation for these commands is available in TeXShop Help's advanced section on ConTeXt and MetaPost. But a more extensive README by Vitacolonna is available in ~/Library/TeXShop/Engines/Inactive/MetaPost.
- Very important improvements to command completion by Herbert Schulz are now included. These improvements allow "tags" in completed commands with parameters. When a command is completed, the entire command, including tags where the required parameters go, appears in the source file, and the first tag is selected. The user can type the parameter, replacing the tag. A keyboard shortcut then activates a new menu item which jumps to the next tag. The user can thus fill in all parameters without removing their hands from the keyboard.
A greatly expanded command completion file by Herbert Schulz is included in this release. For detailed instructions, read the document about command completion written by Schulz and available in ~/Library/TeXShop/CommandCompletion.
- A new "Paste Spreadsheet Cells" macro by Alan Munn has been added to the Macro menu. This wonderful macro allows users to copy an array of cells from a spreadsheet and paste the array, properly formatted with TeX commands, in the TeX source code. Munn wrote instructions for this command, which are in TeXShop Help's Macro section, in Default AppleScript Macros.
- A new latexmk engine, version 4.13a, is included.
- The right justification feature introduced in TeXShop 2.28 for Arabic, Hebrew, and Persian has been improved. Now a line must start with a character from one of these languages before it is right justified. Thus
lines containing TeX commands with embedded Arabic, Hebrew, or Persian will still be left justified.
- Added Windows Latin 1 to the list of supported encodings.
- Added "ctx" to list of extensions which are regarded as TeX files and can be syntax colored and typeset.
- In 2.29, closing a document left the associated pdf file open until TeXShop quit. This bug is fixed; the pdf file is closed when the source document closes.
TeXShop Changes 2.15 - 2.29
TeXShop Changes 2.27 - 2.29
Here are the changes:
- There are many changes in TeXShop Help, to remove all references to teTeX, to add a help section on encoding, and to separate the section on Engine files into one section on General Engine Files and a second section on XeTeX.
- There are slight improvements in the Program, Encoding, and Root macro files by Ramon M. Figueroa-Centeno.
- The -synctex=1 flag was added to the XeTeX and XeLaTeX engines.
- A bug was fixed which broke SyncTeX when filenames contained unicode characters.
- Trash AUX files now trashes .synctex and .synctex.gz files.
- The script for mptopdf changed to much more extensive script by Nicola Vitacolonna. This script, and one for metafun, are in the inactive folder of the Engines folder. But the metapost script is also used internally, replacing the original naive script.
- An extra source preference named "Arabic, Persian, Hebrew" has been added. This item only works if Syntax Coloring is active. When the new item is activated, lines in the source which contain characters from these languages --- i.e., characters in the range 0x0590 - 0x06FF -- are right justified on the screen. This does not affect actual typesetting of the file.
- Removed command line equivalents for "Bold" and "Italic".
- Removed "package" check for file types tex, ctx, bst, drv, abc, ly, texi, Rnw. Now no file types have "package" checked. The reason this obscure bug got into the code is unclear; it caused some folders on the desktop to appear as packages for TeXShop.
- There are a small number of German localization corrections.
- The keyboard command to trash AUX files also works if the console or preview window are active.
- If the shift key is held down while selecting "Trash AUX Files", the pdf preview file is also trashed. This key can be held in combination with option or not, depending on the choice of aggressive trash. However, aggressive trashing with the shift key down will NOT remove other pdf files (!)
- The code for SyncTeX is revised. TeXShop used to call a script in TeX Live by Jerome Laurens to interprete .synctex files. This script changed in TeX Live 2009, breaking synctex operation. Now TeXShop embeds the script in TeXShop itself (as it should have from the beginning), making it immune to changes in the script. This makes it possible for Laurens to improve the script, and then for TeXShop to adopt these changes as its code is revised.
In the original TeXShop for TeX Live 2009, the embedded code didn't have POWERPC code, causing crashes on powerpc. This is fixed. The INTEL version of the embedded file also has information to interprete files produced by dvips.
TeXShop Changes 2.26
Version 2.26 is a minor upgrade to fix several bugs in 2.25. Here are the changes:
- 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 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.
TeXShop Changes 2.21 - 2.25
Versions 2.21 - 2.24 were internal builds, never released. Here are the changes in them and 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.
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
- pdftex --shell-escape --synctex=1
- pdflatex --shell-escape --synctex=1
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
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)
- Mac Central European Roman
- IsoLatinGreek
- Mac Central European Roman
- ISOLatin2
- WindowsCentralEurRoman
- Mac Central European Roman
- Greek (ISO 8859-7)
- In
- %!TEX encoding =
- %!TEX root =
- %!TEX TS-program =
- %!TEX projectfile =
- %!TEX root =
- %!TEX encoding =
- 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
- 1 to never release the data
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.
- 0 to release the data on system 10.4.3 or higher
- 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"
- defaults TeXShop OtherTeXExtensions -array
- The Beamer template can certainly be improved. I'd appreciate help from experts.
Richard Koch
Department of Mathematics
University of Oregon
Eugene, Oregon 97403
TeXShop