A Sublime Text 2/3 package for PreTeXt files.
- Total 61
- Win 29
- OS X 23
- Linux 9
|Feb 23||Feb 22||Feb 21||Feb 20||Feb 19||Feb 18||Feb 17||Feb 16||Feb 15||Feb 14||Feb 13||Feb 12||Feb 11||Feb 10||Feb 9||Feb 8||Feb 7||Feb 6||Feb 5||Feb 4||Feb 3||Feb 2||Feb 1||Jan 31||Jan 30||Jan 29||Jan 28||Jan 27||Jan 26||Jan 25||Jan 24||Jan 23||Jan 22||Jan 21||Jan 20||Jan 19||Jan 18||Jan 17||Jan 16||Jan 15||Jan 14||Jan 13||Jan 12||Jan 11||Jan 10|
PreTeXtual: a Sublime Text package for PreTeXt
PreTeXtual is a Sublime Text 3 package designed to assist authors using PreTeXt (formerly known as MathBook XML). It is very experimental and may behave unexpectedly.
The package is inspired by the excellent LaTeXTools package, which I have enjoyed using for many years. I have borrowed very liberally from the LaTeXTools codebase in order to implement the features I thought would be most useful to MBX authors. Please let me know of any bugs you find or any features you would like to include.
Support for Sublime Text 2 is limited and there are no plans to extend it.
Note: We assume you are familiar with running Sublime Text commands via the Command Palette. To bring up the palette, hit Ctrl+p (Cmd+p on OS X). Then start typing the name of the command you want to filter the list of results.
It is recommended to install PreTeXtual via Package Control. If you have not installed Package Control yet, you should do that first (and restart Sublime Text afterward).
After Package Control is installed, use the
Install Package command to
search for the PreTeXtual package, and select it from the Quick Panel to
install. This method of installation allows Package Control to automatically
update your installation and show you appropriate release notes.
You may also install PreTeXtual via
git. Change directories into your
Packages folder. To find the
Packages folder, select Browse Packages from
the Preferences menu (from the Sublime Text 3 menu on OS X). Make sure you are
Packages folder and not
git clone https://github.com/daverosoff/PreTeXtual.git
and restart Sublime Text (probably not necessary).
PreTeXtual is inspired by LaTeXTools, and like that package uses a Ctrl+l prefix for many commands. The Expand Selection to Line command is bound to Ctrl+l by default. PreTeXtual rebinds that command to Ctrl+l, Ctrl+l. Note that this is a keyboard shortcut consisting of two separate keystroke combinations. Most PreTeXtual shortcuts are like this.
You can activate the package features by enabling the PreTeXt syntax. The
syntax definition looks for
.ptx or the legacy
.mbx file extension. If
your MathBook XML files end with
.xml (or something else), you have several
Use the Preferences menu or the Command Palette to run the command
Set PreTeXt File Extensions, and use the input panel to add
.xmlor other extensions of your choice to the comma-separated list. Sublime will look for a project settings file first, then update user preferences if it doesn't find one. If you have multiple PreTeXt projects, or if you edit XML other than PreTeXt, it is best to start using Sublime Text projects so that you can have project-specific settings.
Enable the syntax manually using the command palette. To enable it manually, open a PreTeXt file and press Ctrl+Shift+P (Cmd+Shift+P on OS X) and type
Set Syntax: PreTeXtfrom the list of options.
You should see the text
PreTeXt in the lower right corner if you have
the status bar visible (command palette: Toggle Status Bar). Please excuse
the image which still shows the former name
There are only a few features implemented so far.
- If you have some subdivisions (with
xml:id) in your PreTeXt file, hit Ctrl+R (Cmd+R on OS X) to run the Goto Symbol command. You should see a panel showing all your available sections. Select one to jump to it in the active view. This tool does not index subdivisions without an
Open your entire source folder as a project and use Goto Symbol in Project (Ctrl+Shift+R/Cmd+Shift+R) to see all the
xml:idfor all the MathBook XML files in the project (must use
.ptxextension for indexing to succeed).
If you have been using
xml:idto label your stuff, try typing
<xref ref="(the beginning of a cross-reference). Sublime Text should show you a panel containing all xml:id values along with the elements they go with. Choose one to insert it at the caret and close the
xreftag. Alternatively, type
refand hit Tab to activate the
xrefsnippet. Then hit Ctrl+L, X or Ctrl+L, Ctrl+Space to bring up the completions menu. There are several variants of the
If you set a PreTeXt root file, then ref completion as described above will recursively search for
xml:idthrough all your
xi:includesstarting with the indicated root file. Run the command “Set PreTeXt Root File” from the Preferences menu or the Command Palette. Be sure to use an absolute path name for the value of the setting.
Tabto activate the subdivision snippets. A blank
titleelement is provided and the cursor positioned within it. As you type, the
xml:idfield for the subdivision is filled with similar text mirroring the title you are entering.
refsnippet does not bring up the quick panel. Should it?