LingExRef
Insert references to surrounding LaTeX linguistic examples
Details
Installs
- Total 4
- Win 0
- Mac 4
- Linux 0
Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | Aug 1 | Jul 31 | Jul 30 | Jul 29 | Jul 28 | Jul 27 | Jul 26 | Jul 25 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
LingExRef plugin
This Sublime Text 3 and 4 plugin allows you quickly insert references to surrounding LaTeX linguistic examples. Inspired by quick-latex-ref which offers a similar functionality for Emacs.
Usage
Press Ctrl + Alt + Down to insert a reference to the next example. Press Ctrl + Alt + Up to insert a reference to the previous example.
If the example already has a \label{someexample}
, a reference to \cref{someexample}
is inserted where the cursor is ; if it does not, a label is inserted right after \ex
with name example
and reference is inserted with name example
and both names are then selected so you can change the name of the reference.
Installation
(Instructions shamelessly adapted from this README)
Option 1: Install Using Package Control (Recommended)
- Install Package Control: If you haven't already, follow the installation instructions to install Package Control.
- Open Command Palette: Use
Shift+Ctrl+P
on Windows/Linux orCmd+Shift+P
on macOS to open the Command Palette. - Install Package: Type
Package Control: Install Package
and press Enter. - Find and Install: Search for “LingExRef” in the list, then press Enter to install it.
- Restart Sublime Text: Ensure the plugin is properly loaded.
Option 2: Manual Installation
- Download the Plugin: Clone this repository or download the ZIP file and extract it.
- Locate Sublime Text Packages Directory:
- On Windows, the path is usually
C:\Users\<Your Username>\AppData\Roaming\Sublime Text 3\Packages\
- On macOS, the path is usually
/Users/<Your Username>/Library/Application Support/Sublime Text 3/Packages/
- On Linux, the path is usually
~/.config/sublime-text-3/Packages/
- On Windows, the path is usually
- Install the Plugin: Copy the plugin directory (containing
LingExRef.py
andDefault.sublime-commands
files) into the Sublime Text Packages directory. - Restart Sublime Text: This ensures the plugin is loaded and ready to use.
Why not use \nextx
or \Next
?
The following works and achieves the same result after compilation, so why do we need a plugin?
Example (\nextx) shows that subjunctive conditionals need not be counterfactual
\ex
If Alice was allergic to penicillin, she would show exactly the symptoms she's showing right now.
\xe
Answer from enricoflor:
this is somewhat of an antipattern: it is a convenient feature (because so often you want to refer to something close to point), but it can cause serious headaches if you happen to restructure the text where these references occur. It may be very hard to notice that the reference you intended is now different because a different \label than the one you intended to refer to intervenes between the \Next macro and the item it should refer to. The convenience provided by these macros is better delivered by your text editor (ideally, GNU Emacs).
Configuration options
Options from LingExRef.sublime-settings
ex_start_delimiter
: regex matching the beginning of an example ; the newly created\label{..}
will be placed just after that point.ex_start_delimiter
: regex matching the end of an example or the beginning of a sub-example (or anything that may change what\label{..}
will refer to). Any existing label will be looked for betweenex_start_delimiter
andex_stop_delimiter
.LingExRef/LingExRef.sublime-settings
contains the regex for common packages.label_command
: LateX command to create label, place a$
where you want the label name to be (default:\label{$}
)ref_command
: LateX command to create a reference to a label, place a$
where you want the reference name to be (default:\ref{$}
)
Limitations
- Does not allow to cycle through next examples with repeated keystrokes