Home Complexity Research Tcl/Tk Local interest Alphatk Mac Cpptcl
Thesis Canyons Downloads Bibliographies MacBibTeX Pltk Search

BibTeX



Note: the source is available here: source code, if anyone with a recent version of codewarrior wants to re-compile it for OS X.

I've ported BibTeX to run smoothly under the MacOS. It handles apple-events, drag and drop, integrates with the premier MacOS text editor "Alpha", ... It is freeware, system 7 friendly, and is now at version 1.1.7. It also ships with OzTeX.

There is also a version 1.1.8 I made available, which is basically identical to 1.1.7, but recompiled with a newer version of Codewarrior. It should also cope with aliases which 1.1.7 doesn't (however this makes it slower).

I am not actively maintaining this port of BibTeX at the moment. I've made the source available to Andrew Trevorrow (author of OzTeX) who intends to update it. If you are interested in helping or taking over, please contact myself and/or Andrew. Alternatively, the source is available here: source code, if anyone with a recent version of codewarrior wants to re-compile it for OS X.

Download BibTeX 1.1.7 from my site

Download BibTeX 1.1.6 from MIT hyperarchive

finally you can report a bug online.

If you want to run BibTeX with very big internal constants, read the files which come with it, and try this preference file to help you out.


Contents:

  • Description of BibTeX's function and purpose.
  • Feature list for this version of BibTeX for MacOS.
  • How to use BibTeX.
  • Apple-events and BibTeX
  • Using BibTeX with the editor 'Alpha'
  • Technical details, compilation, to-do's,...
  • Version history.
  • What is BibTeX?

    BibTeX is the bibliography handling tool related to the TeX/LaTeX typesetting system (available on almost all conceivable OS platforms). When a document is typeset with LaTeX, an auxiliary file (with extension '.aux') is generated. This auxiliary file contains, amongst other things, a list of references (to books, articles, research reports, web-url's,...) cited in the original document. BibTeX takes this list, together with the name of a style file (extension '.bst') and a list of bibliography databases (extension '.bib') which are also given in the auxiliary file, and produces a wonderfully formatted list of references which the LaTeX system subsequently (and automatically) appends to your typeset document. Hence BibTeX is really not at all useful without TeX/LaTeX (there are several freeware/shareware/commercial versions for the MacOS: OzTeX, CMacTeX, DirecTeX Pro, Textures). In fact this port of BibTeX is now distributed with OzTeX 2.0. It is useful to have a good text editor which knows about the particular format of LaTeX documents: on the Mac, the editor Alpha is indispensible in this regard, both for editing and for its apple-event communication with the various parts of a LaTeX system. For those who think this sounds a bit too complicated, the benefits in terms of quality of output (both textual and mathematical) and automatic generation of all manner of numbering schemes (figures, equations, sections), and document parts (table of contents, index, bibliography), together with cross-platform availability, mean that many people consider it the _best_ current system for producing quality documents. Here are some links for further information:

    Please do not ask me general questions about the use of LaTeX/BibTeX. Such information is readily available from books and/or free documentation from the links above. I'm very happy to answer specfic questions about this particular implementation of BibTeX.

    BibTeX version 1.1.7

    It has no known bugs, however, use at your own risk; there is no warranty....

    Before reporting bugs, please make sure your problem is not really an extension conflict --- restart your machine with extensions off and see if BibTeX works then.

    Features:

    Feature list:

    Basic features

    TeX details:

    Interface details:

    This version of BibTeX is totally free. If you like it, feel free to send email, postcards, cash, registrations to shareware you've written,... but there is no obligation. Note that the memory allocation is reasonably generous at 400k by default. I think it should work with 390k on 680x0 machines, and 300k on PPC machines, so you could lower the application's partition size.

    Version history:

    Recent changes:
    1.1.7
    Many small improvements/fixes to 'bibEngine.tcl'. Increased buffer size of BibTeX at the big setting. Worked around an odd 'longjmp' bug which could cause a crash when the buffer overflowed. Increased a bunch of other 'big' settings. Fixed one bug which could crop up after a fatal error on a .bib file. You can now (if desperate) adjust the size of a number of internal bib constants. See the end of the 'reporting bugs' readme file for details. I now distribute the original BibTeX documentation with my port. See the folder 'BibTeX docs' for that. Added bug report web page. Recompiled with CW Pro 1, updating some powerplant classes. The log window's text manipulation capability should be a little more complete now. Added ability to abort processing, using 'cmd-.', and made sure the log window scrolls as text is added, so you can see what is going on. Fixed some cosmetic scrolling issues with the window too.
    1.1.6
    Numerous small improvements and bug-fixes to the 'bibEngine.tcl' scripts which handle the receiving end of apple-events from BibTeX. Recompiled the application with Codewarrior 11. Updated to MoreFiles 1.4.5, and MSL C/C++. Few other minor code improvements. Click-drag scrolling works in the log window now. Still no drag'n'drop though. Changed app's memory allocation slightly. After a fatal error, memory is freed immediately now, previously allocations would accumulate until the end of a non-fatal run. Rewrote a few code sections so less of the MSL C library is linked in (reduced code size significantly). Now use some styled text in the log window. Improved a couple of error/help messages. Rewrote preferences file code using powerplant rather than a separate, rather old library; makes for a much faster startup.
    1.1.5
    Minor bug-fix in which some sorts of fatal bibtex error would ignore the 'stay open on error' flag. Slight improvements to interaction with Alpha, and minor additions to the log file on some fatal errors. Increased global strings to 15 (so it works with indxcite now).
    1.1.4
    Fixed a couple small GUI buglets. Added processing time message to end of log window. Command clicking in opened .blg files sends correct file information now. Minor changes to about box. Fixed so prefs file has an icon; startup will be slow the first time, because BibTeX will have to rewrite your preferences. Added an icon resource for TEXT files which can be used for .blg log files. Set this up in Internet Config, and you can double click .blg files to launch. Now you can look at old .blg files and decide if you wish to regenerate them (cmd-G = Go will reprocess the corresponding .aux file), or cmd-click to edit problems using your editor. Fixed quite old (I think) bug in which you could have two log windows after hitting 'Cancel' in the options dialog. Feature change: BibTeX now rejects any text file that's not '.aux' or '.blg'; before it would be passed to the core code and of course cause errors. Added more Balloon help. Feature change: type/creator of .blg and .bbl files created are taken from Internet Config if possible, if not then from the .aux file as before. Copes with filenames containing spaces. Remember if you use spaces, your files will not work on other platforms. Fixed a minor buffer-overflow problem in which not all warnings would be given in the log window. Added command-clicking features to the log window (very useful and cool new feature!). Fixed one source of preferences problems (startup with no preferences file, quit and restart => default preferences are garbage).
    1.1.3
    Really fixed end-of-file problem. Other minor changes.
    1.1.2
    Fixed setting end-of-files correctly. I somehow reintroduced this bug when I rewrote all the file i/o stuff. Balloon help in dialogs.
    1.1.1
    Added options 'Stay open on warning', 'Stay open on error' which counter-act the 'Quit when finished' option, and leave BibTeX open if anything went wrong. Fixed the 'text-jumping' visual bug in the log window (thanks to a helpful soul on comp.sys.mac.programmer.codewarrior). Updated to MoreFiles 1.4.3. Preferences file now has its version number updated if necessary when you start BibTeX, and I always create a preferences file now, and any old preferences are updated with any new options. This fixes an old 'bug' in which BibTeX would take a long time starting up, because it's looking for a preferences file, or trying to read information from it which doesn't exist. Fixed a subtle 68k only bug which has been around for a long time, but only now reared its head --- caused horrible crashes on 68k machines, somewhat randomly since useful memory was being over-written. However it's fixed now. Fixed a small bug introduced in 1.1.0, which would show up only after multiple runs, especially after a fatal error, and could result in a crash. Added message to the log window after a fatal error.
    1.1.0
    Did some serious profiling and optimisation. Opening files is really rather slow on MacOS, probably due to the emulated nature of the file-system. Now about 10+ times faster than 1.06. Rough timing is as follows: v1.06 75secs, v1.07 62secs, v1.10 7secs (All using Speed Doubler on a 5300cs on a large BibTeX run) Huge rewrite of all the IO code: uses PowerPlant buffered IO classes, which makes everything rather simpler, and on the whole a lot faster. The code is much, much cleaner now, as I've cleared out a lot of the old vestiges of MakeIndex and the ancient web2c source code has been modernised. Therefore the BibTeX --- Interface links are simple now. Added option to monopolise the CPU. Significant interface improvements: You can now set two folders to search in the options dialog box, (but the old technique of using Resedit still works). Note that by default BibTeX now searches in: € The same folder as the '.aux' file being processed. € The folder 'BibTeX inputs' located wherever the BibTeX application resides on your hard drive. € Any folders you add manually using ResEdit (not normally necessary) € The two folders you specify in your preferences. Added links from the 'about box' to the BibTeX web-page, and to mail me, etc. Recompiled using Codewarrior 10
    1.07
    (Never released publicly) Significant internal changes: (i) Speed increases. (ii) Increased sizes of things for 'Big' mode. This version of BibTeX should support Camel (the up-and-coming LaTeX 2e bibliography system). (iii) Added a couple of options which were requested: 'beep when finished' and 'no log window'.
    1.06
    Now copes with extended character set 'όφι...'. Not all TeX implementations allow them, but if you pass one to BibTeX, it will happily output it, assuming your version of TeX can cope. Changed name of log window.
    1.05
    Recompiled with CW9, updated to take account of Powerplant changes. Cosmetic change when selecting 'go' to re-run a file - the window is now cleared first.
    1.04
    Minor (non-fatal) bug fixes --- all files properly closed and flushed after a bibtex error, file eof's set correctly for .bbl and .blg files. Thanks for the bug reports!
    1.03
    Minor changes --- it now gives a message 'BibTeX run complete.' in the log window, rather than just finishing. Documentation update. I've fixed the FREF/BNDL problems, so drag'n'drop really should work now ;-)
    1.02
    Switchable between Big and Small. Uses new memory allocation scheme from Rick, so temporary memory is used rather than the system heap. This means the application's given partition can be much smaller (300k works for me). Added fref 'TEXT' resource which was missing previously (so drag and drop will work under all circumstances now).
    1.01
    Copes with Unix as well as Mac EOL characters
    1.0
    Original; soon to be distributed with OzTeX 2.0


    Using BibTeX:

    It's easiest just to drop the '.aux' file onto the BibTeX application, or even easier just to use the editor 'Alpha' and select 'bibtex myfile.aux' from the LaTeX menu. A typical .tex document is structured like this:
    \documentclass[11pt]{article}
    % My bibstyle requires the use of 'chicago.sty'
    % which defines '\citeN', 'citeA' etc.
    \usepackage{chicago}
    
    \begin{document}
    
    Here is my document.
    
    % My bibliographies are called 'TheKnowledge.bib' and
    % 'economics.bib'
    \bibliography{TheKnowledge,economics} 
    % I'm using the bib style 'chicago.bst'
    \bibliographystyle{chicago}
    
    \end{document}
    


    Using BibTeX with Alpha

    As well as the scripts which allow command clicking in the log window to send Alpha to the correct file/line/entry/error/... there are other features of Alpha which will make editing LaTeX documents are more pleasant task. First of all there is the TeX mode for Alpha written by Tom Scavo which is great. Second, I've written a package of add-ons for Alpha, called "Vince's Additions". It provides a large number of improvements to TeX mode, including 'completions'. This allows you to type something short, hit 'cmd-Tab' and have Alpha extend what you typed into something more useful. The types of things which can be completed range from: words, TeX-commands, environments ('\begin' is expanded into an entire environment), references ('\ref{my-long-r' is expanded into the name of a nearby '\label'), and even citations: '\cite{Smit' will be expanded into the correct bibliography entry which begins 'Smit'. If multiply entries match, then you are presented with a list of matches, which also contains the title of each match, so you can easily select the correct one, without having to bother opening you bibliography file at all. You can download this package either from Alpha's web site, or from my own 'Downloads' page, which usually contains a more recent version.

    If you don't have or use Alpha, download it immediately! Make sure you pay the shareware fee.


    Apple-events and BibTeX:

    BibTeX can be triggered to process '.aux' files by being sent a standard 'odoc' event. Versions of Alpha newer than 6.2 will do this without any configuration on your part. If you're using an old version of Alpha (pre 6.2), download a new version (see the hyperlinks above); (Also have a look at my package "Vince's Additions" which contains some useful bibliography conversion tools). If you don't have Alpha, download it immediately; it's easily the best editor for TeX, LaTeX, C, C++ etc. (IMHO).

    As of version 1.1.4, command-clicking in the log window will now send GURL 'bibresult' events. To make use of these, open Internet Config, select 'helpers' and 'add' a helper for 'bibresult', and select as helper your editor. Of course your editor needs to be able to receive and interpret GURL bibresults. I've enclosed some procedures for Alpha which do this, but if you use BBEdit/TeXtures or something else, you're currently on your own. The format of the 'bibresult' GURL event is as follows:

    	bibresult:FULLFILENAME:MESSAGE
    
    where FULLFILENAME is a full path description to the base '.aux' file or 'Unknown', and MESSAGE is any of the following:
    	The top-level auxiliary file: FILENAME.aux
    	A level-X auxiliary file: FILENAME.aux
    	Warning--I didn't find a database entry for "ENTRY"
    	Database file #X: FILENAME.bib
    	Warning--WARNING ENTRY
    	The style file: FILENAME.bst
    	ERROR---line LINENUM of file FILENAME a 'UP-TO-ERROR' at POSITION
    
    where X is an integer; FILENAME is a just the name, with no path given; ENTRY is a citation key such as 'Darley1996'; WARNING is a standard BibTeX warning (such as 'empty title in'); ERROR is a standard BibTeX error (such as 'Repeated entry'); LINENUM is the line number of an error; POSITION is the character position in that line at which the error was detected; UP-TO-ERROR is the string of characters from the beginning of the line to the start of the error, with braces {} replaced by ŒΉ because of some IC/AE problem. The Tcl procedures I've written for Alpha interpret these messages and take the appropriate action: opening a file; finding and highlighting an error; adding a '.bib' file to the \bibliography environment; making a new entry in an existing '.bib' file,Š To use these scripts, read the file 'bibEngine.tcl' which gives installation instructions.

    Problems/Bugs:

    Since BibTeX sends actual line numbers and positions, if you're correcting a lot of errors/warnings, those line number can become out of date. The receiving scripts are designed to alleviate this problem (they search locally for something matching the error), but with heavy editing, these problems are not completely avoidable.


    Technical Stuff:

    To Do:

    Any offers for help or suggestions for improvements much appreciated --- in particular if someone wants to get to work on the to-do's, that'd be great. If you have example code which does something similar to any of the to-do's (e.g. asynchronous file i/o), and you're happy to let me use it as a template, then please send me it!


    Sources:

    I'm no longer distributing the sources, since it seems a bit needless, but if you actually want them, just ask.

    Based on the C code of the original MacBibTeX (0.99c) which I grabbed from CTAN, and code generously donated by Rick Zaccone from his 'Makeindex'. Icon adapted from one I grabbed off a folder from some collection on the net. 'IC++' written by Dan Crevier is used for the about box links. I also use LBalloonTracker by Paul Lalonde which is © 1996-7 Corporate Software & Technologies Int. Inc. (CS&T), and very convenient. Many thanks!

    Compilation (with CodeWarrior Pro 1):

    Obtain the library 'MoreFiles' (preferably version 1.4.5 or newer), which should be available from the info-mac archives. Move the resulting application "BibTeX" up one level so it can find 'BibTeX inputs'. You may need to adjust the memory allocation (with Get Info), but beyond that you're set.

    Personalisation:

    You can now set BibTeX search paths using the options dialog, but if for some peculiar reason you want to set more than two different paths, in addition to the defaults, then you can do so using ResEdit:

    You can edit a string resource with ResEdit to specify your own search path. To do this open the app with ResEdit and look at the STR# resource called "Path". You can add entries which look like this: '2:Hard Disk:My Search Path:'; the '2' signifies to BibTeX that this is a complete path specification. If you prefer, '0:' indicates a path relative to the .aux file, and '1:' relative to the BibTeX application.

    You can now (if desperate) adjust the size of a number of internal bib constants. See the end of the 'reporting bugs' readme file for details.


    Mail me:vince@santafe.edu, or go back to the top, or return to the main menu.