├── Support ├── lib │ ├── Ruby │ │ ├── lib │ │ │ ├── unf │ │ │ │ ├── normalizer_cruby.rb │ │ │ │ ├── version.rb │ │ │ │ ├── normalizer_jruby.rb │ │ │ │ ├── normalizer.rb │ │ │ │ └── LICENSE.txt │ │ │ ├── unf_ext.bundle │ │ │ ├── unf.rb │ │ │ └── LICENSE.txt │ │ ├── indent.rb │ │ ├── completion │ │ │ └── command.rb │ │ ├── convert.rb │ │ └── configuration.rb │ ├── JavaScript │ │ └── texdoc.js │ └── Python │ │ └── auxiliary.py ├── help │ ├── Help.pdf │ ├── Figures │ │ ├── TextMate.png │ │ ├── Preferences.png │ │ ├── Label Completion.png │ │ ├── Template Chooser.png │ │ ├── Citation Completion.png │ │ ├── Table - Create Table.png │ │ ├── LaTeX Watch - TextMate.png │ │ ├── TeXcount - Custom Options.png │ │ ├── TeXcount - Default Options.png │ │ ├── LaTeX Watch - Notification Window.png │ │ ├── TextMate Preferences - Variables.png │ │ ├── Citation Completion - With Ref-TeX Filter.png │ │ └── Citation Completion - Without Ref-TeX Filter.png │ └── TeX │ │ ├── Table_3_4_t.tex │ │ └── Table_2_3.tex ├── bin │ ├── check_open │ ├── refresh_viewer.scpt │ ├── viewDoc.sh │ ├── citekey_completion.rb │ ├── label_completion.rb │ ├── python │ ├── configure.py │ └── toggle_style.rb ├── nibs │ ├── Templates.nib │ │ └── keyedobjects.nib │ ├── CreateTable.nib │ │ └── keyedobjects.nib │ └── Preferences.nib │ │ └── keyedobjects.nib ├── css │ ├── shiny │ │ └── style.css │ ├── halloween │ │ └── style.css │ ├── bright │ │ └── style.css │ ├── dark │ │ └── style.css │ ├── default │ │ └── style.css │ └── texdoc.css ├── templates │ ├── Article.tex │ ├── Exam.tex │ ├── Letter.tex │ └── Memoir.tex ├── src │ └── refresh_viewer.applescript └── config │ ├── latexmkrc │ ├── conversion.yaml │ └── auxiliary.yaml ├── Tests ├── TeX │ ├── non existent root.tex │ ├── makeindex.idx │ ├── applemac.tex │ ├── missing_cite_key.bib │ ├── input │ │ ├── packages_input2.tex │ │ ├── references_input.tex │ │ └── packages_input1.tex │ ├── root loop.tex │ ├── root lööp.tex │ ├── references.bib │ ├── external_bibliography.aux │ ├── unicode_error.tex │ ├── wrong master path.tex │ ├── missing_cite_key.tex │ ├── c'mplicated filename.tex │ ├── unformatted.bib │ ├── filename with spaces.tex │ ├── makeindex.tex │ ├── packages.tex │ ├── ünicöde.tex │ ├── lualatex.tex │ ├── external_bibliography.tex │ ├── external_bibliography_biber.tex │ ├── makeglossaries.tex │ ├── xelatex.tex │ ├── references.tex │ └── more_references.bib ├── Log │ ├── latexmk.log │ ├── makeindex.log │ ├── chktex.log │ ├── latex_error.log │ ├── bibtex.log │ ├── biber.log │ ├── makeglossaries.log │ ├── latex.log │ └── external_bibliography.log ├── Prysk │ ├── General │ │ ├── grammar.t │ │ └── latex_watch.t │ ├── Python │ │ ├── texparser.t │ │ ├── version.t │ │ ├── bibtex.t │ │ ├── chktex.t │ │ ├── makeindex.t │ │ ├── xelatex.t │ │ ├── latex.t │ │ ├── latexmk.t │ │ ├── unicode.t │ │ ├── view.t │ │ ├── applemac.t │ │ ├── lualatex.t │ │ ├── root.t │ │ ├── makeglossaries.t │ │ ├── filenames.t │ │ ├── unicode_error.t │ │ └── filename with spaces.t │ └── Ruby │ │ └── clean │ │ ├── setup.sh │ │ ├── single_file.t │ │ └── multiple_files.t ├── bin │ ├── nosetests.sh │ └── cramtests.sh ├── lib │ └── setup_cram.sh └── Perl │ └── latex.t ├── .gitignore ├── Snippets ├── Beamer Overlay Specification.tmSnippet ├── Page.tmSnippet ├── Listing.tmSnippet ├── Section.tmSnippet ├── Table.tmSnippet ├── Equation 2.tmSnippet ├── Figure.tmSnippet ├── Split.tmSnippet ├── Equation.tmSnippet ├── Unnumbered Equation.tmSnippet ├── Itemize.tmSnippet ├── Wrap Selection in Double Quotes.tmSnippet ├── Wrap Selection In Math Mode.plist ├── Enumerate.tmSnippet ├── Change Style of selected text.plist ├── Description.tmSnippet ├── Matrix.tmSnippet ├── Item[description].plist ├── Wrap Selection In Left Right.plist ├── Cases.tmSnippet ├── Frame.tmSnippet ├── New Line.tmSnippet ├── Wrap Selection In Display Math.plist ├── Insert Environment.tmSnippet ├── Align.tmSnippet ├── Part.tmSnippet ├── Section.plist ├── Chapter.tmSnippet ├── Gathered.tmSnippet ├── Paragraph.tmSnippet ├── Sub Section.plist ├── Tabular.tmSnippet ├── Sub Paragraph.tmSnippet ├── Sub Sub Section.plist └── Wrap Selection in Environment.plist ├── Preferences ├── Spell Checking in Strings.tmPreferences ├── Spell Checking - Disable for Comments.tmPreferences ├── TexShop comments.plist ├── Folding - TeX.tmPreferences ├── Folding - Log.tmPreferences ├── Indendation.tmPreferences ├── Folding - BibTeX.tmPreferences ├── Disable Smart Typing after Backslashes.tmPreferences ├── Completion - Cite.plist ├── Completion - Label.plist ├── Comments.plist ├── Symbol List - Beamer.tmPreferences ├── Completion - General.tmPreferences ├── Symbol List - LaTeX.tmPreferences ├── Pairs - BibTeX.tmPreferences ├── Folding - LaTeX.tmPreferences ├── Pairs - Strings.tmPreferences └── Pairs - TeX.tmPreferences ├── Commands ├── configure.tmCommand ├── Edit Config File.tmCommand ├── Wrap in Command.tmCommand ├── Insert environment closers.plist ├── Set Engine Parameters for this File.tmCommand ├── Set Engine for this File.tmCommand ├── Jump to Current Line in Viewer.plist ├── Bold.tmCommand ├── Help.plist ├── Italic.tmCommand ├── Verb.tmCommand ├── Create Table.plist ├── Insert LaTeX Template.tmCommand ├── Small Caps.tmCommand ├── Typewriter.tmCommand ├── Underline.tmCommand ├── Convert Symbols in Word.tmCommand ├── Open Master File.tmCommand ├── Show Outline.tmCommand ├── Change Current.tmCommand ├── Show Label as Tool Tip.tmCommand ├── Citation - Ref-TeX Style.tmCommand ├── Reformat.tmCommand ├── Citation Based on Current Word - Selection.plist ├── Label Based on Current Word - Selection.plist ├── Convert Selection to Table.tmCommand ├── Remove Column.tmCommand ├── Add Column.tmCommand ├── Create Index.plist ├── Insert Command Based on Current Word.plist ├── Create Bibliography.plist ├── Clean.plist ├── Lines to List Environment.tmCommand ├── Watch Document.tmCommand ├── TeXcount.plist ├── Set Master File.tmCommand ├── Tidy.plist ├── Command Completion.tmCommand ├── Check LaTeX.tmCommand ├── Documentation for Package.plist ├── Open Included Item.tmCommand ├── Greek letter.plist ├── BibDesk completion.plist ├── Typeset And View PDF.plist ├── Insert Item Based on Current Environment.plist └── Insert LaTeX Command Based on Current Word.plist ├── tox.ini ├── DragCommands ├── Include File.plist ├── Include Image.plist └── Include Code Listing.plist ├── Macros ├── Add Word to Index.plist ├── Next Entry.tmMacro └── Previous Cell.tmMacro ├── .rubocop.yml └── README.mdown /Support/lib/Ruby/lib/unf/normalizer_cruby.rb: -------------------------------------------------------------------------------- 1 | require 'unf_ext' 2 | -------------------------------------------------------------------------------- /Tests/TeX/non existent root.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = I do not exist.tex 2 | -------------------------------------------------------------------------------- /Support/lib/Ruby/lib/unf/version.rb: -------------------------------------------------------------------------------- 1 | module UNF 2 | VERSION = '0.1.4' 3 | end 4 | -------------------------------------------------------------------------------- /Tests/TeX/makeindex.idx: -------------------------------------------------------------------------------- 1 | \indexentry{index entry}{1} 2 | \indexentry{YAE}{1} 3 | -------------------------------------------------------------------------------- /Support/help/Help.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Help.pdf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Do not ignore `.log` files that we use to test the bundle commands 2 | !/Tests/Log/*.log 3 | -------------------------------------------------------------------------------- /Support/bin/check_open: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/bin/check_open -------------------------------------------------------------------------------- /Tests/TeX/applemac.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Tests/TeX/applemac.tex -------------------------------------------------------------------------------- /Support/bin/refresh_viewer.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/bin/refresh_viewer.scpt -------------------------------------------------------------------------------- /Tests/TeX/missing_cite_key.bib: -------------------------------------------------------------------------------- 1 | @article {key, title = "Title Track" } 2 | @misc { , title = "Missing Cite Key!" } 3 | -------------------------------------------------------------------------------- /Support/help/Figures/TextMate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/TextMate.png -------------------------------------------------------------------------------- /Support/help/Figures/Preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/Preferences.png -------------------------------------------------------------------------------- /Support/lib/Ruby/lib/unf_ext.bundle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/lib/Ruby/lib/unf_ext.bundle -------------------------------------------------------------------------------- /Tests/TeX/input/packages_input2.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = ../packages.tex 2 | % Extended color support 3 | \usepackage[x11names]{xcolor} 4 | -------------------------------------------------------------------------------- /Tests/TeX/root loop.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = ./root lööp.tex 2 | 3 | \documentclass{article} 4 | \begin{document} 5 | 6 | \end{document} 7 | -------------------------------------------------------------------------------- /Support/help/Figures/Label Completion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/Label Completion.png -------------------------------------------------------------------------------- /Support/help/Figures/Template Chooser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/Template Chooser.png -------------------------------------------------------------------------------- /Tests/TeX/root lööp.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = ./root loop.tex 2 | 3 | \documentclass{article} 4 | \begin{document} 5 | bla 6 | \end{document} 7 | -------------------------------------------------------------------------------- /Support/nibs/Templates.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/nibs/Templates.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Tests/TeX/references.bib: -------------------------------------------------------------------------------- 1 | @misc{ Deltron3030, 2 | author = "Deltron 3030", 3 | title = "Battlesong", 4 | year = "3030" } 5 | -------------------------------------------------------------------------------- /Support/help/Figures/Citation Completion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/Citation Completion.png -------------------------------------------------------------------------------- /Support/help/Figures/Table - Create Table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/Table - Create Table.png -------------------------------------------------------------------------------- /Support/nibs/CreateTable.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/nibs/CreateTable.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Support/nibs/Preferences.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/nibs/Preferences.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Tests/TeX/external_bibliography.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \citation{Deltron3030} 3 | \bibstyle{plain} 4 | \bibdata{references} 5 | \bibcite{Deltron3030}{1} 6 | -------------------------------------------------------------------------------- /Tests/TeX/input/references_input.tex: -------------------------------------------------------------------------------- 1 | \section{Included Section} % (fold) 2 | \label{sec:included_section} 3 | 4 | % section included_section (end) 5 | -------------------------------------------------------------------------------- /Tests/TeX/unicode_error.tex: -------------------------------------------------------------------------------- 1 | \documentclass{minimal} 2 | \usepackage[utf8]{inputenc} 3 | \begin{document} 4 | \ünderline{test} 5 | \end{document} 6 | -------------------------------------------------------------------------------- /Support/help/Figures/LaTeX Watch - TextMate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/LaTeX Watch - TextMate.png -------------------------------------------------------------------------------- /Support/help/Figures/TeXcount - Custom Options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/TeXcount - Custom Options.png -------------------------------------------------------------------------------- /Support/help/Figures/TeXcount - Default Options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/TeXcount - Default Options.png -------------------------------------------------------------------------------- /Tests/TeX/wrong master path.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = this file does not exist.tex 2 | 3 | \documentclass{article} 4 | \begin{document} 5 | ~ 6 | \end{document} 7 | -------------------------------------------------------------------------------- /Tests/TeX/missing_cite_key.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \usepackage{biblatex} 4 | \addbibresource{missing_cite_key} 5 | 6 | \begin{document} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /Support/help/Figures/LaTeX Watch - Notification Window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/LaTeX Watch - Notification Window.png -------------------------------------------------------------------------------- /Support/help/Figures/TextMate Preferences - Variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/TextMate Preferences - Variables.png -------------------------------------------------------------------------------- /Support/help/TeX/Table_3_4_t.tex: -------------------------------------------------------------------------------- 1 | \begin{tabular}{llll} 2 | r1c1 & r1c2 & r1c3 & r1c4\\ 3 | r2c1 & r2c2 & r2c3 & r2c4\\ 4 | r3c1 & r3c2 & r3c3 & r3c4\\ 5 | \end{tabular} 6 | -------------------------------------------------------------------------------- /Support/help/Figures/Citation Completion - With Ref-TeX Filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/Citation Completion - With Ref-TeX Filter.png -------------------------------------------------------------------------------- /Support/help/Figures/Citation Completion - Without Ref-TeX Filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/latex.tmbundle/master/Support/help/Figures/Citation Completion - Without Ref-TeX Filter.png -------------------------------------------------------------------------------- /Tests/TeX/c'mplicated filename.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \begin{document} 4 | 5 | \begin{quote} 6 | Empty, i, i, i 7 | \end{quote}~Empty, The Cranberries 8 | 9 | \end{document} 10 | -------------------------------------------------------------------------------- /Tests/TeX/unformatted.bib: -------------------------------------------------------------------------------- 1 | @comment{ Unformatted bib entries } 2 | 3 | @article{A, author = {A}} 4 | %@article{B} 5 | 6 | @string { pink_pony = "Pinkie Pie" } 7 | @string { yellow_pony = "Fluttershy" } 8 | @string { white_pony = "Deftones" } 9 | -------------------------------------------------------------------------------- /Tests/TeX/input/packages_input1.tex: -------------------------------------------------------------------------------- 1 | %!TEX root = ./packages_input2.tex 2 | \usepackage{polyglossia} 3 | \setmainlanguage{english} 4 | \setotherlanguage{german} 5 | % Context sensitive quotation and unicode math fonts 6 | \usepackage{csquotes, booktabs} 7 | -------------------------------------------------------------------------------- /Tests/TeX/filename with spaces.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{amsart} 2 | \usepackage{amssymb, amsmath} 3 | \begin{document} 4 | \title{Error Testing} 5 | \maketitle 6 | 7 | \noindent Incorrect: $\apha$\\ 8 | \noindent Correct: $\alpha$ 9 | 10 | \end{document} 11 | -------------------------------------------------------------------------------- /Support/bin/viewDoc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /tmp 4 | fullbase=`basename $1` 5 | filebase=`basename -s .dvi $1` 6 | if [ $filebase.dvi = $fullbase ]; then 7 | dvipdfm $1 8 | open $filebase.pdf 9 | sleep 1 10 | rm $filebase.pdf 11 | else 12 | open $1 13 | fi 14 | -------------------------------------------------------------------------------- /Tests/TeX/makeindex.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \usepackage{makeidx} 4 | \makeindex 5 | 6 | \begin{document} 7 | 8 | \begin{itemize} 9 | \item An {\it index entry}\index{index entry} 10 | \item {Yet another entry}\index{YAE} 11 | \end{itemize} 12 | 13 | \printindex 14 | \end{document} 15 | -------------------------------------------------------------------------------- /Tests/TeX/packages.tex: -------------------------------------------------------------------------------- 1 | %!TEX TS-program = xelatex 2 | 3 | \documentclass{article} 4 | \usepackage{framed} 5 | \usepackage{mathtools} 6 | 7 | \input{input/packages_input1} 8 | \input{input/packages_input2} 9 | 10 | \begin{document} 11 | Hi :) 12 | % \bibliography{does_not_exist} 13 | \end{document} 14 | -------------------------------------------------------------------------------- /Tests/Log/latexmk.log: -------------------------------------------------------------------------------- 1 | Latexmk: This is Latexmk, John Collins, 10 Nov 2013, version: 4.39. 2 | **** Report bugs etc to John Collins . **** 3 | 4 | Overfull \hbox (0.89256pt too wide) in paragraph at lines 157--158 5 | \EU1/AvenirNext(0)/m/n/12 where $[][]$ holds all the time then on all fair path 6 | s there 7 | -------------------------------------------------------------------------------- /Support/lib/JavaScript/texdoc.js: -------------------------------------------------------------------------------- 1 | function dsp(loc) { 2 | if (document.getElementById) { 3 | foc = loc.parentNode.nextSibling.style ? 4 | loc.parentNode.nextSibling : 5 | loc.parentNode.nextSibling.nextSibling; 6 | foc.style.display = (foc.style.display=='block') ? 'none' : 'block'; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Support/bin/citekey_completion.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | 3 | # -- Imports ------------------------------------------------------------------- 4 | 5 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/latex.rb' 6 | 7 | # -- Main ---------------------------------------------------------------------- 8 | 9 | puts(LaTeX.citekeys.join("\n")) 10 | -------------------------------------------------------------------------------- /Support/bin/label_completion.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | 3 | # -- Imports ------------------------------------------------------------------- 4 | 5 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/latex.rb' 6 | 7 | # -- Main ---------------------------------------------------------------------- 8 | 9 | puts(LaTeX.label_names.join("\n")) 10 | -------------------------------------------------------------------------------- /Tests/Prysk/General/grammar.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ cd ../.. 5 | $ source lib/setup_cram.sh 6 | 7 | -- Tests ----------------------------------------------------------------------- 8 | 9 | $ gtm < TeX/text.tex "${grammars[@]}" > /dev/null 10 | -------------------------------------------------------------------------------- /Tests/TeX/ünicöde.tex: -------------------------------------------------------------------------------- 1 | %!TEX TS-program = xelatex 2 | 3 | \documentclass{article} 4 | \usepackage{fontspec} 5 | 6 | \begin{document} 7 | 8 | \noindent\LARGE 9 | Þú hatta fjúka lætur í loft\\ 10 | Þú regnhlíf snú á hvolf allt of oft\\ 11 | Ó nei, ekki, ó…\\ 12 | \hrule~\\[0.5cm] 13 | Gobbledigook — Sigur Rós 14 | 15 | \end{document} 16 | -------------------------------------------------------------------------------- /Support/css/shiny/style.css: -------------------------------------------------------------------------------- 1 | .shiny div.bibtex { 2 | background-color: #999; 3 | color: black; 4 | } 5 | 6 | .shiny a.warning { 7 | color: #FF7F00; 8 | } 9 | 10 | 11 | .shiny div.error a { 12 | color: red; 13 | } 14 | 15 | 16 | .shiny div#commandOutput { 17 | background-color: rgb(40,40,40); 18 | padding: 5px; 19 | } 20 | -------------------------------------------------------------------------------- /Tests/TeX/lualatex.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{fontspec} 3 | \usepackage{luacode} 4 | 5 | \newcommand{\codeinput}[1] 6 | { 7 | \begin{leftbar} 8 | \input{Code/#1} 9 | \end{leftbar} 10 | } 11 | 12 | \begin{document} 13 | \begin{luacode} 14 | tex.print('Hello TextMate!') 15 | \end{luacode} 16 | \end{document} 17 | -------------------------------------------------------------------------------- /Support/css/halloween/style.css: -------------------------------------------------------------------------------- 1 | .halloween div.bibtex { 2 | background-color: #999; 3 | color: black; 4 | } 5 | 6 | .halloween a.warning { 7 | color: #FF7F00; 8 | } 9 | 10 | 11 | .halloween div.error a { 12 | color: red; 13 | } 14 | 15 | .halloween div#commandOutput { 16 | background-color: rgb(40,40,40); 17 | padding: 5px; 18 | } 19 | -------------------------------------------------------------------------------- /Support/help/TeX/Table_2_3.tex: -------------------------------------------------------------------------------- 1 | \begin{table}[htb!] 2 | \caption{Caption} 3 | \label{table:label} 4 | \centering 5 | \begin{tabular}{lll} 6 | \toprule 7 | \textbf{Header 1} & \textbf{Header 2} & \textbf{Header 3}\\ 8 | \midrule 9 | r2c1 & r2c2 & r2c3\\ 10 | \bottomrule 11 | \end{tabular} 12 | \end{table} 13 | -------------------------------------------------------------------------------- /Tests/Log/makeindex.log: -------------------------------------------------------------------------------- 1 | This is makeindex, version 2.15 [TeX Live 2014] (kpathsea + Thai support). 2 | Scanning input file makeindex.idx....done (2 entries accepted, 0 rejected). 3 | Sorting entries....done (2 comparisons). 4 | Generating output file makeindex.ind....done (9 lines written, 0 warnings). 5 | Output written in makeindex.ind. 6 | Transcript written in makeindex.ilg. 7 | -------------------------------------------------------------------------------- /Tests/TeX/external_bibliography.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{cite} 3 | 4 | \begin{document} 5 | 6 | \begin{quote} 7 | Interplanetary adversaries battling for supremacy\\ 8 | Sounds like a good way to build up my infamy\dots~\cite{Deltron3030} 9 | \end{quote} 10 | 11 | \bibliographystyle{plain} 12 | \bibliography{references}{} 13 | \end{document} 14 | -------------------------------------------------------------------------------- /Tests/bin/nosetests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ------------------------------------------------------------------------------ 4 | # Run nose tests for all Python commands 5 | # ------------------------------------------------------------------------------ 6 | 7 | export PATH=/Library/TeX/texbin:$PATH 8 | nosetests --with-doctest Support/lib/Python/*.py Support/bin/*.py 9 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/texparser.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | $ texparser.py ../Log/ünicöde.log ünicöde.tex | \ 10 | > grep '15.*Undefined control sequence.' > /dev/null 11 | -------------------------------------------------------------------------------- /Tests/TeX/external_bibliography_biber.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \usepackage[style=alphabetic, backend=biber]{biblatex} 4 | \addbibresource{references.bib} 5 | 6 | \begin{document} 7 | 8 | \begin{quote} 9 | Interplanetary adversaries battling for supremacy\\ 10 | Sounds like a good way to build up my infamy\dots~\cite{Deltron3030} 11 | \end{quote} 12 | 13 | \printbibliography 14 | \end{document} 15 | -------------------------------------------------------------------------------- /Support/css/bright/style.css: -------------------------------------------------------------------------------- 1 | .warning { 2 | color: #FF7F00; 3 | margin-left: 20px; 4 | } 5 | .bright p.warning a { 6 | color: #FF7F00; 7 | } 8 | .bibtex { 9 | background-color: #CBF4EF; 10 | } 11 | .error { 12 | color: red; 13 | margin-left: 20px; 14 | } 15 | .bright div#commandOutput { 16 | background-color: rgb(240,240,240); 17 | padding: 5px; 18 | } 19 | .bright p.error a { 20 | color: red; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Tests/Prysk/Ruby/clean/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # -- Variables ----------------------------------------------------------------- 4 | 5 | export BUNDLE_DIRECTORY="`cd "${TESTDIR}/../../../../";pwd`"; 6 | export PATH=$PATH:/Library/TeX/texbin:${BUNDLE_DIRECTORY}/Support/bin/ 7 | export TEX_DIRECTORY="${BUNDLE_DIRECTORY}/Tests/TeX" 8 | 9 | # -- Functions ----------------------------------------------------------------- 10 | 11 | trim() { 12 | sed '/^$/d' 13 | } 14 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/version.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | $ export TM_FILEPATH="external_bibliography.tex" 10 | 11 | $ texmate.py version -engine latex 12 | pdfTeX .* (re) 13 | 14 | $ texmate.py version packages.tex 15 | XeTeX .* (re) 16 | -------------------------------------------------------------------------------- /Tests/bin/cramtests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ------------------------------------------------------------------------------ 4 | # Run cram tests for all Python commands 5 | # 6 | # This script will be called by `tox` to test the bundle commands written in 7 | # Python using different versions of `python`. 8 | # ------------------------------------------------------------------------------ 9 | 10 | find Tests/Cram/Python -name '*.t' -type f -exec cram '{}' + 11 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/bibtex.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | $ export TM_FILEPATH="external_bibliography.tex" 10 | 11 | Check if building the bibliography works without producing any error 12 | 13 | $ texmate.py bibtex > /dev/null; exit_success_or_discard 14 | -------------------------------------------------------------------------------- /Support/bin/python: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | function fail { 4 | "$DIALOG" >/dev/null alert \ 5 | --alertStyle error \ 6 | --title 'This command requires PyObjC' \ 7 | --body $'Please run the following command in Terminal and retry:\n 8 | /usr/bin/pip3 install pyobjc' \ 9 | --button1 OK 10 | exit 200 11 | } 12 | 13 | if [ -e /usr/bin/python ]; then 14 | exec /usr/bin/python "$@" 15 | else 16 | /usr/bin/python3 -c "import PyObjCTools" 2>/dev/null || fail 17 | exec /usr/bin/python3 "$@" 18 | fi 19 | -------------------------------------------------------------------------------- /Support/css/dark/style.css: -------------------------------------------------------------------------------- 1 | .dark div.bibtex { 2 | background-color: #999; 3 | color: black; 4 | } 5 | 6 | .warning { 7 | color: #FF7F00; 8 | margin-left: 20px; 9 | } 10 | .dark p.warning a { 11 | color: #FF7F00; 12 | } 13 | 14 | 15 | .dark div.error a { 16 | color: red; 17 | } 18 | 19 | .error { 20 | color: red; 21 | margin-left: 20px; 22 | } 23 | 24 | .dark p.error a { 25 | color: red; 26 | } 27 | 28 | .dark div#commandOutput { 29 | background-color: rgb(40,40,40); 30 | padding: 5px; 31 | } 32 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/chktex.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | If we check the tex file with `chktex` we should not get any warning at all. 10 | This means grep will fail and therefore return the status value 1. 11 | 12 | $ texmate.py 'chktex' external_bibliography.tex | grep 'Warning:' 13 | [1] 14 | -------------------------------------------------------------------------------- /Snippets/Beamer Overlay Specification.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <${1:+-}> 7 | name 8 | Beamer Overlay Specification 9 | scope 10 | text.tex.latex.beamer 11 | uuid 12 | BDA02D31-3097-4726-9A93-7AAA4576F676 13 | 14 | 15 | -------------------------------------------------------------------------------- /Snippets/Page.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${1:page}~\pageref{$2}$0 7 | name 8 | Page 9 | scope 10 | text.tex.latex 11 | tabTrigger 12 | page 13 | uuid 14 | FD59489B-7437-48DD-A4EC-9AF3AB2FCF19 15 | 16 | 17 | -------------------------------------------------------------------------------- /Support/lib/Ruby/indent.rb: -------------------------------------------------------------------------------- 1 | # Return a string representing a certain level of indentation. 2 | # 3 | # This function respects the current tab settings of the user. 4 | # 5 | # = Arguments 6 | # 7 | # [times] The number of times the text following the string returned by this 8 | # function should be indented. 9 | # 10 | # = Output 11 | # 12 | # A string that represents a certain level of indentation 13 | def indent(times = 1) 14 | if ENV['TM_SOFT_TABS'] == 'NO' then "\t" * times 15 | else ' ' * ENV['TM_TAB_SIZE'].to_i * times 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /Snippets/Listing.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${1:Listing}~\ref{${2:lst:}}$0 7 | name 8 | Listing 9 | scope 10 | text.tex.latex 11 | tabTrigger 12 | listing 13 | uuid 14 | 0F8A8F61-0AE1-44F8-B4FA-01D4F877E9EE 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Section.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${1:Section}~\ref{${2:sec:}}$0 7 | name 8 | Section 9 | scope 10 | text.tex.latex 11 | tabTrigger 12 | section 13 | uuid 14 | 5305AE18-1F7F-4284-A537-C0418119D078 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Table.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${1:Table}~\ref{${2:tab:}}$0 7 | name 8 | Table 9 | scope 10 | text.tex.latex 11 | tabTrigger 12 | table 13 | uuid 14 | 84216BD6-F6EB-4325-9485-1665E7364102 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Equation 2.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${1:Equation}~\eqref{${2:eq:}}$0 7 | name 8 | Equation 9 | scope 10 | text.tex.latex 11 | tabTrigger 12 | equation 13 | uuid 14 | 2E6F374A-C713-42BF-A7E9-C8728201A15A 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Figure.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${1:Figure}~\ref{${2:fig:}}$0 7 | name 8 | Figure 9 | scope 10 | text.tex.latex 11 | tabTrigger 12 | figure 13 | uuid 14 | C4288DF5-A4DA-4F35-9AB9-4062EE5B7E61 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Split.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \begin{split} 7 | $0 8 | \end{split} 9 | name 10 | Split 11 | scope 12 | text.tex.latex 13 | tabTrigger 14 | spl 15 | uuid 16 | 66B38313-2239-430C-8DE9-95023BA583C2 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Equation.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \begin{equation} 7 | $0 8 | \end{equation} 9 | name 10 | Equation 11 | scope 12 | text.tex.latex 13 | tabTrigger 14 | eq 15 | uuid 16 | 23B04BBB-ACE7-44A7-B313-09DC4874B2C0 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Unnumbered Equation.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \\[ 7 | $0 8 | \\] 9 | keyEquivalent 10 | ^[ 11 | name 12 | Unnumbered Equation 13 | scope 14 | text.tex.latex 15 | uuid 16 | 7F7578B0-58F3-44B3-9278-1CBEA9C58208 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Itemize.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \\begin{itemize} 7 | \item $0 8 | \\end{itemize} 9 | name 10 | Itemize 11 | scope 12 | text.tex.latex 13 | tabTrigger 14 | item 15 | uuid 16 | CC9CC561-4BD2-4E50-A211-8C6141FFDE69 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Wrap Selection in Double Quotes.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \`\`${TM_SELECTED_TEXT:-$1}''$0 7 | keyEquivalent 8 | ^" 9 | name 10 | Double Quotes 11 | scope 12 | text.tex.latex 13 | uuid 14 | 903B133A-B073-40C2-83DD-7B1E6D435A26 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Wrap Selection In Math Mode.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \( $TM_SELECTED_TEXT$1 \) 7 | keyEquivalent 8 | ^M 9 | name 10 | Math Mode — \( … \) 11 | scope 12 | text.tex.latex 13 | uuid 14 | 445F9B97-7D25-4262-A715-03F9D688856A 15 | 16 | 17 | -------------------------------------------------------------------------------- /Preferences/Spell Checking in Strings.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Spell Checking in Strings 7 | scope 8 | text.tex string.quoted 9 | settings 10 | 11 | spellChecking 12 | 1 13 | 14 | uuid 15 | C6B468AE-5BD0-48D1-9D54-F4D09C42C505 16 | 17 | 18 | -------------------------------------------------------------------------------- /Snippets/Enumerate.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \\begin{enumerate} 7 | \item $0 8 | \\end{enumerate} 9 | name 10 | Enumerate 11 | scope 12 | text.tex.latex 13 | tabTrigger 14 | enum 15 | uuid 16 | 03F30619-2739-447F-953D-DB225185E4D2 17 | 18 | 19 | -------------------------------------------------------------------------------- /Tests/TeX/makeglossaries.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper, 12pt]{report} 2 | 3 | \usepackage[acronym,toc]{glossaries} 4 | \makeglossaries 5 | 6 | \newglossaryentry{Marceline}{ 7 | name = Marceline the Vampire Queen, 8 | description = {A thousand year old Vampire}} 9 | 10 | \newacronym{PB}{PB}{Princess Bubblegum} 11 | 12 | \begin{document} 13 | 14 | \chapter{Adventure Time} 15 | 16 | \section{Overview} 17 | 18 | The TV show centers around the adventures of Finn and Jake. Other important characters include \gls{PB} and \gls{Marceline}. 19 | 20 | \printglossaries 21 | 22 | \end{document} 23 | -------------------------------------------------------------------------------- /Snippets/Change Style of selected text.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \\${1:text${2:bf}}{$TM_SELECTED_TEXT} 7 | keyEquivalent 8 | ^E 9 | name 10 | Command — \command{…} 11 | scope 12 | text.tex.latex 13 | uuid 14 | 7D3548FA-AE80-11D9-8B45-000D93B6E43C 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Description.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \\begin{description} 7 | \item[$1] $0 8 | \\end{description} 9 | name 10 | Description 11 | scope 12 | text.tex.latex 13 | tabTrigger 14 | desc 15 | uuid 16 | 2F926912-E5E6-4965-8E50-0603765DD0E6 17 | 18 | 19 | -------------------------------------------------------------------------------- /Preferences/Spell Checking - Disable for Comments.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Spell Checking: Disable for Comments 7 | scope 8 | text.tex comment 9 | settings 10 | 11 | spellChecking 12 | 0 13 | 14 | uuid 15 | B4EEDFA2-5AD3-4F15-875A-6D3498ED1477 16 | 17 | 18 | -------------------------------------------------------------------------------- /Preferences/TexShop comments.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | TexShop %: comments 7 | scope 8 | text.tex.latex comment.line.percentage.semicolon.texshop.tex 9 | settings 10 | 11 | showInSymbolList 12 | 1 13 | 14 | uuid 15 | 955AA9F7-F8BA-4A46-9A8D-F7C88DB3FB26 16 | 17 | 18 | -------------------------------------------------------------------------------- /Snippets/Matrix.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \begin{${1:p/b/v/V/B/small}matrix} 7 | $0 8 | \end{${1:p/b/v/V/B/small}matrix} 9 | name 10 | Matrix 11 | scope 12 | text.tex.latex 13 | tabTrigger 14 | mat 15 | uuid 16 | 66265AD6-3D2A-4888-9A9B-2B37860C79F3 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Item[description].plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \\item[${1:description}] ${0:item} 7 | name 8 | \item[description] 9 | scope 10 | text.tex.latex meta.function.environment.list 11 | tabTrigger 12 | itd 13 | uuid 14 | BC8B98E2-5F16-11D9-B9C3-000D93589AF6 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Wrap Selection In Left Right.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${TM_SELECTED_TEXT/(.*)(.)/\\left$1\\right$2/} 7 | keyEquivalent 8 | ^L 9 | name 10 | left…right — \left…\right 11 | scope 12 | text.tex.latex 13 | uuid 14 | 2BCB6911-2FE8-4D28-9E9C-4AE5F54F6E72 15 | 16 | 17 | -------------------------------------------------------------------------------- /Tests/Log/chktex.log: -------------------------------------------------------------------------------- 1 | ChkTeX v1.7.2 - Copyright 1995-96 Jens T. Berger Thielemann. 2 | Compiled with POSIX extended regex support. 3 | Warning 1 in makeglossaries.tex line 4: Command terminated with space. 4 | \makeglossaries 5 | ^ 6 | Warning 1 in makeglossaries.tex line 23: Command terminated with space. 7 | \printglossaries 8 | ^ 9 | 10 | Error 14 in dodo.tex line 4: Could not find argument for command. 11 | \verb*!something! 12 | ^^^^^ 13 | 14 | 1 errors printed; 2 warnings printed; No user suppressed warnings; No line suppressed warnings. 15 | 16 | -------------------------------------------------------------------------------- /Snippets/Cases.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \begin{cases} 7 | ${1:equation}, &\text{ if }${2:case}\\\\ 8 | $0 9 | \end{cases} 10 | name 11 | Cases 12 | scope 13 | text.tex.latex 14 | tabTrigger 15 | cas 16 | uuid 17 | EE7D14B5-9620-4A1B-866B-91E26FB481DB 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/Frame.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \begin{frame}[t]{${1:title}} 7 | ${0:$TM_SELECTED_TEXT} 8 | \end{frame} 9 | %--- Next Frame ---% 10 | name 11 | Frame 12 | scope 13 | text.tex.latex.beamer 14 | tabTrigger 15 | frame 16 | uuid 17 | D5598935-ACE9-494D-BB2F-4B85066CBF45 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Folding - TeX.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Folding: TeX 7 | scope 8 | text.tex 9 | settings 10 | 11 | foldingStartMarker 12 | /\*\*|\{\s*$ 13 | foldingStopMarker 14 | \*\*/|^\s*\} 15 | 16 | uuid 17 | 794D9A7A-E3E3-4DFF-8FF9-E2F8F7618BD2 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Folding - Log.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Folding: Log 7 | scope 8 | text.log.latex 9 | settings 10 | 11 | foldingStartMarker 12 | /\*\*|\(\s*$ 13 | foldingStopMarker 14 | \*\*/|^\s*\) 15 | 16 | uuid 17 | 08123B8C-5F5F-4EA9-83BC-1DF01F6E0C0C 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/New Line.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \\\\ 7 | $0${TM_CURRENT_LINE/^[^&]+|[^&]+$|([^&]+)/ (?1: )/g} 8 | keyEquivalent 9 |  10 | name 11 | Add Row 12 | scope 13 | text.tex.latex meta.function.environment.tabular.latex 14 | uuid 15 | F59D0C3A-B5AC-40D6-AB07-05CE8CB784A9 16 | 17 | 18 | -------------------------------------------------------------------------------- /Preferences/Indendation.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Indentation 7 | scope 8 | text.tex.latex 9 | settings 10 | 11 | decreaseIndentPattern 12 | ^\s*\\end(\{.*\})?$ 13 | increaseIndentPattern 14 | ^\s*\\begin\{.*\} 15 | 16 | uuid 17 | 4830CA58-1F08-421C-9703-BE586DC1FE7A 18 | 19 | 20 | -------------------------------------------------------------------------------- /Support/templates/Article.tex: -------------------------------------------------------------------------------- 1 | % !TEX style = snippet 2 | % !TEX TS-program = xelatex 3 | % 4 | % Created by ${TM_FULLNAME} on `date "+%Y-%m-%d"`. 5 | % Copyright (c) `date "+%Y"` ${TM_ORGANIZATION}. 6 | \documentclass{article} 7 | 8 | \usepackage{polyglossia} 9 | \usepackage{hyperref} 10 | 11 | \hypersetup 12 | { 13 | pdftitle = {${1:Title}}, 14 | pdfsubject = {${2:Subject}}, 15 | pdfauthor = {${TM_FULLNAME}} 16 | } 17 | 18 | \title{$1} 19 | \author{${TM_FULLNAME}} 20 | 21 | \begin{document} 22 | 23 | \maketitle 24 | 25 | \begin{abstract} 26 | ${3:Abstract} 27 | \end{abstract} 28 | 29 | \section{Introduction} 30 | $4 31 | \end{document} 32 | -------------------------------------------------------------------------------- /Preferences/Folding - BibTeX.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Folding: BibTeX 7 | scope 8 | text.bibtex 9 | settings 10 | 11 | foldingStartMarker 12 | \@[a-zA-Z]+\s*[{(].+, 13 | foldingStopMarker 14 | ^\s*[)}]\s*$ 15 | 16 | uuid 17 | D67A92D5-BF71-4F97-9A26-67C05956B61F 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/Wrap Selection In Display Math.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \[ 7 | $TM_SELECTED_TEXT$1 8 | \] 9 | keyEquivalent 10 | ^M 11 | name 12 | Display Math — \[ … \] 13 | scope 14 | text.tex.latex 15 | tabTrigger 16 | $$ 17 | uuid 18 | F38DDE93-BF77-449D-A4C9-6C525ECAC6FB 19 | 20 | 21 | -------------------------------------------------------------------------------- /Support/css/default/style.css: -------------------------------------------------------------------------------- 1 | .warning { 2 | color: #FF7F00; 3 | margin-left: 20px; 4 | } 5 | .default p.warning a { 6 | color: #FF7F00; 7 | } 8 | .default .bibtex { 9 | background-color: #CBF4EF; 10 | } 11 | .error { 12 | color: red; 13 | margin-left: 20px; 14 | } 15 | .default p.error a { 16 | color: red; 17 | } 18 | 19 | .ltxmk { 20 | color: green; 21 | display: none; 22 | } 23 | .default div#commandOutput { 24 | background-color: rgb(240,240,240); 25 | padding: 5px; 26 | } 27 | 28 | div#texActions { 29 | padding: 10px; 30 | } 31 | 32 | .fmtWarning { 33 | display: none; 34 | margin-left: 20px; 35 | color:#FF7F00; 36 | } -------------------------------------------------------------------------------- /Snippets/Insert Environment.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \\begin{${1:env}} 7 | ${1/(enumerate|itemize|list)|(description)|.*/(?1:\item )(?2:\item)/}$0 8 | \\end{${1:env}} 9 | name 10 | \begin{}…\end{} 11 | scope 12 | text.tex.latex 13 | tabTrigger 14 | begin 15 | uuid 16 | 688FBE87-D5B4-445D-AD02-231F6E99F9C1 17 | 18 | 19 | -------------------------------------------------------------------------------- /Preferences/Disable Smart Typing after Backslashes.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Disable Smart Typing after Backslashes 7 | scope 8 | text.tex constant.character.escape.tex 9 | settings 10 | 11 | highlightPairs 12 | 13 | smartTypingPairs 14 | 15 | 16 | uuid 17 | C8BC77A9-CF8E-4510-A8C2-F48C6E7BC93E 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/Align.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \begin{align`echo $TM_SCOPE|grep math| 7 | sed -e 's/.*math.*/ed/'`} 8 | $0 9 | \end{align`echo $TM_SCOPE|grep math| 10 | sed -e 's/.*math.*/ed/'`} 11 | name 12 | Align(ed) 13 | scope 14 | text.tex.latex 15 | tabTrigger 16 | ali 17 | uuid 18 | EEAC1CE5-50DD-42B0-96D6-08EB81E58754 19 | 20 | 21 | -------------------------------------------------------------------------------- /Snippets/Part.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \part{${1:part name}} % (fold) 7 | \label{prt:${2:${1/(\w+)(\W+$)?|\W+/${1:?${1:/asciify/downcase}:_}/g}}} 8 | ${0:$TM_SELECTED_TEXT} 9 | % part $2 (end) 10 | name 11 | Part 12 | scope 13 | text.tex.latex 14 | tabTrigger 15 | part 16 | uuid 17 | A3F71E5B-C99E-488D-B1CB-39D588C28A8C 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/Section.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \section{${1:section name}} % (fold) 7 | \label{sec:${2:${1/(\w+)(\W+$)?|\W+/${1:?${1:/asciify/downcase}:_}/g}}} 8 | ${0:$TM_SELECTED_TEXT} 9 | % section $2 (end) 10 | name 11 | Section 12 | scope 13 | text.tex.latex 14 | tabTrigger 15 | sec 16 | uuid 17 | 24282E70-BE2C-11D9-8F93-000D93589AF6 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Completion - Cite.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Completion: Cite 7 | scope 8 | text.tex.latex meta.citation.latex 9 | settings 10 | 11 | completionCommand 12 | "$TM_BUNDLE_SUPPORT/bin/citekey_completion.rb" 13 | disableDefaultCompletion 14 | 1 15 | 16 | uuid 17 | 086F7794-CE1E-423A-9BF2-E27466A56067 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Completion - Label.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Completion: Label 7 | scope 8 | text.tex.latex meta.reference.label 9 | settings 10 | 11 | completionCommand 12 | "$TM_BUNDLE_SUPPORT/bin/label_completion.rb" 13 | disableDefaultCompletion 14 | 1 15 | 16 | uuid 17 | 76086A65-97AA-48FE-B3C6-026B25E15958 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/Chapter.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \chapter{${1:chapter name}} % (fold) 7 | \label{cha:${2:${1/(\w+)(\W+$)?|\W+/${1:?${1:/asciify/downcase}:_}/g}}} 8 | ${0:$TM_SELECTED_TEXT} 9 | % chapter $2 (end) 10 | name 11 | Chapter 12 | scope 13 | text.tex.latex 14 | tabTrigger 15 | cha 16 | uuid 17 | 47FA7321-6BDC-413B-9F59-63ACBB0E2080 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/Gathered.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \begin{gather`echo $TM_SCOPE|grep math| 7 | sed -e 's/.*math.*/ed/'`} 8 | $0 9 | \end{gather`echo $TM_SCOPE|grep math| 10 | sed -e 's/.*math.*/ed/'`} 11 | name 12 | Gather(ed) 13 | scope 14 | text.tex.latex 15 | tabTrigger 16 | gat 17 | uuid 18 | BE56EE31-7C87-43A6-B0ED-7E5C31432C1C 19 | 20 | 21 | -------------------------------------------------------------------------------- /Preferences/Comments.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Comments 7 | scope 8 | text.tex 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | % 18 | 19 | 20 | 21 | uuid 22 | 678850E6-C630-4EEF-B307-14ADEE2B2994 23 | 24 | 25 | -------------------------------------------------------------------------------- /Snippets/Paragraph.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \paragraph{${1:paragraph name}} % (fold) 7 | \label{par:${2:${1/(\w+)(\W+$)?|\W+/${1:?${1:/asciify/downcase}:_}/g}}} 8 | ${0:$TM_SELECTED_TEXT} 9 | % paragraph $2 (end) 10 | name 11 | Paragraph 12 | scope 13 | text.tex.latex 14 | tabTrigger 15 | par 16 | uuid 17 | 76987ABA-D716-4F75-ADC1-5FB767FC460E 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/Sub Section.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \subsection{${1:subsection name}} % (fold) 7 | \label{sub:${2:${1/(\w+)(\W+$)?|\W+/${1:?${1:/asciify/downcase}:_}/g}}} 8 | ${0:$TM_SELECTED_TEXT} 9 | % subsection $2 (end) 10 | name 11 | Sub Section 12 | scope 13 | text.tex.latex 14 | tabTrigger 15 | sub 16 | uuid 17 | 4B41348F-BE2C-11D9-8F93-000D93589AF6 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/Tabular.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}} 7 | $0${2/((?<=[clr])([ |]*(c|l|r)))|./(?1: & )/g} 8 | \\end{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}} 9 | name 10 | Tabular 11 | scope 12 | text.tex.latex 13 | tabTrigger 14 | tab 15 | uuid 16 | 0E817E24-DC11-42A5-BBBD-EEF1FD282B2F 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Sub Paragraph.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \subparagraph{${1:subparagraph name}} % (fold) 7 | \label{subp:${2:${1/(\w+)(\W+$)?|\W+/${1:?${1:/asciify/downcase}:_}/g}}} 8 | ${0:$TM_SELECTED_TEXT} 9 | % subparagraph $2 (end) 10 | name 11 | Sub Paragraph 12 | scope 13 | text.tex.latex 14 | tabTrigger 15 | subp 16 | uuid 17 | 1475649F-2577-4BF0-A392-DD8D4B64DA91 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/Sub Sub Section.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \subsubsection{${1:subsubsection name}} % (fold) 7 | \label{ssub:${2:${1/(\w+)(\W+$)?|\W+/${1:?${1:/asciify/downcase}:_}/g}}} 8 | ${0:$TM_SELECTED_TEXT} 9 | % subsubsection $2 (end) 10 | name 11 | Sub Sub Section 12 | scope 13 | text.tex.latex 14 | tabTrigger 15 | subs 16 | uuid 17 | DF92968D-BF59-11D9-A668-000A95C0F626 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/Wrap Selection in Environment.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${TM_SELECTED_TEXT/(\s*).*/$1/m}\begin{${1:center}} 7 | ${TM_SELECTED_TEXT/(.+)|\n\z/(?1:\t$0)/g} 8 | ${TM_SELECTED_TEXT/(\s*).*/$1/m}\end{${1:center}} 9 | 10 | keyEquivalent 11 | ^@W 12 | name 13 | Environment — \begin{}…\end{} 14 | scope 15 | text.tex.latex 16 | uuid 17 | 2D7B6866-400B-4120-9EC1-0397E33169A1 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Symbol List - Beamer.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Symbol List: Beamer 7 | scope 8 | text.tex.latex.beamer meta.function.frametitle.latex 9 | settings 10 | 11 | showInSymbolList 12 | 1 13 | symbolTransformation 14 | 15 | s/^\\frametitle\*?(?:\[[^]]*\])?\{(.+)\}/    fr: $1/; # \frametitle 16 | 17 | 18 | uuid 19 | 4192C345-63CB-4B38-A873-6C185E377C71 20 | 21 | 22 | -------------------------------------------------------------------------------- /Tests/TeX/xelatex.tex: -------------------------------------------------------------------------------- 1 | % !TeX program = xelatex 2 | % !TEX encoding = UTF-8 Unicode 3 | % !TEX spellcheck = en-US 4 | 5 | \documentclass[a4paper, 12pt]{report} 6 | 7 | % Language 8 | \usepackage{polyglossia} 9 | \setmainlanguage{english} 10 | % Extras for XƎTEX 11 | \usepackage{xltxtra} 12 | 13 | \setmainfont[Mapping=tex-text]{Cochin} 14 | \setsansfont[Mapping=tex-text]{Avenir} 15 | \setmonofont[Scale=MatchLowercase]{Menlo} 16 | 17 | \begin{document} 18 | 19 | \hrule 20 | {\Large\begin{quote} 21 | Oh, precious Distance,\\ 22 | Oh, precious Pain,\\ 23 | You’ve given me a name and\\ 24 | Etched it in the stones of the river bank. 25 | \end{quote}} 26 | \hrule~\\ 27 | La Dispute: “Said The King To The River” 28 | 29 | \end{document} 30 | -------------------------------------------------------------------------------- /Support/bin/configure.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S "${TM_BUNDLE_SUPPORT}/bin/python" 2 | 3 | # -- Imports ------------------------------------------------------------------ 4 | 5 | from os import sys, path 6 | 7 | sys.path.insert( 8 | 1, 9 | path.dirname(path.dirname(path.abspath(__file__))) + "/lib/Python") 10 | 11 | from subprocess import Popen, PIPE, STDOUT 12 | 13 | from tmprefs import Preferences 14 | 15 | # -- Main --------------------------------------------------------------------- 16 | 17 | if __name__ == '__main__': 18 | prefs = Preferences() 19 | command = ('"$DIALOG" -mp "" -d \'{}\' '.format(prefs.defaults()) + 20 | '"$TM_BUNDLE_SUPPORT"/nibs/Preferences') 21 | Popen(command, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT) 22 | -------------------------------------------------------------------------------- /Support/lib/Ruby/lib/unf/normalizer_jruby.rb: -------------------------------------------------------------------------------- 1 | require 'java' 2 | 3 | module UNF # :nodoc: all 4 | class Normalizer 5 | def initialize() 6 | @normalizer = java.text.Normalizer 7 | end 8 | 9 | def normalize(string, normalization_form) 10 | @normalizer.normalize(string, form(normalization_form)) 11 | end 12 | 13 | private 14 | 15 | def form(symbol) 16 | case symbol 17 | when :nfc 18 | @normalizer::Form::NFC 19 | when :nfd 20 | @normalizer::Form::NFD 21 | when :nfkc 22 | @normalizer::Form::NFKC 23 | when :nfkd 24 | @normalizer::Form::NFKD 25 | else 26 | raise ArgumentError, "unknown normalization form: #{symbol.inspect}" 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/makeindex.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | $ export TM_FILEPATH="makeindex.tex" 10 | 11 | Generate the index for the file 12 | 13 | $ texmate.py index | grep 'Output written' | countlines 14 | 1 15 | 16 | Translate the LaTeX file 17 | 18 | $ texmate.py -s latex -e pdflatex -l no 2>&- | grep 'Output written' | \ 19 | > countlines 20 | 1 21 | 22 | -- Cleanup -------------------------------------------------------------------- 23 | 24 | Remove the generated files 25 | 26 | $ rm -f *.dvi *.ilg *.ind *.log *.pdf *.ps 27 | 28 | -------------------------------------------------------------------------------- /Commands/configure.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | # just to remind you of some useful environment variables 9 | # see Help / Environment Variables for the full list 10 | configure.py 11 | input 12 | none 13 | keyEquivalent 14 | ~@, 15 | name 16 | Preferences… 17 | output 18 | showAsTooltip 19 | scope 20 | text.tex.latex 21 | uuid 22 | 8F41368E-4E01-41A9-8FCF-19D4A4032AE2 23 | 24 | 25 | -------------------------------------------------------------------------------- /Support/templates/Exam.tex: -------------------------------------------------------------------------------- 1 | % !TEX style = snippet 2 | % !TEX TS-program = xelatex 3 | % 4 | % Created by ${TM_FULLNAME} on `date "+%Y-%m-%d"`. 5 | % Copyright (c) `date "+%Y"` ${TM_ORGANIZATION}. 6 | \documentclass[addpoints]{exam} 7 | 8 | \usepackage{polyglossia} 9 | 10 | \firstpageheader{${1:Course}}{Exam}{Page \thepage\ of \numpages} 11 | \firstpageheadrule 12 | 13 | \begin{document} 14 | 15 | \begin{center} 16 | \fbox{\parbox{0.9\textwidth}{\centering 17 | Answer the questions in the spaces provided on the 18 | question sheets. If you run out of room for an answer, 19 | continue on the back of the page.}} 20 | \end{center} 21 | 22 | \vspace{0.5cm} 23 | \makebox[0.9\textwidth]{Name:\enspace\hrulefill} 24 | 25 | \begin{questions} 26 | \question[${2:5}] ${3:First question} 27 | \end{questions} 28 | $4 29 | \end{document} 30 | -------------------------------------------------------------------------------- /Tests/Prysk/Ruby/clean/single_file.t: -------------------------------------------------------------------------------- 1 | -- Setup ----------------------------------------------------------------------- 2 | 3 | $ source "${TESTDIR}/setup.sh" 4 | $ cp "${TEX_DIRECTORY}/makeglossaries.tex" . 5 | 6 | -- Test ------------------------------------------------------------------------ 7 | 8 | Create some auxiliary files 9 | 10 | $ latexmk -pdf makeglossaries.tex 2>&- | trim | 11 | > tail -n 1 12 | Latexmk: All targets (.+) are up-to-date (re) 13 | 14 | Delete all auxiliary files in the current directory 15 | 16 | $ clean.rb 17 | makeglossaries.acn 18 | makeglossaries.aux 19 | makeglossaries.fdb_latexmk 20 | makeglossaries.fls 21 | makeglossaries.glo 22 | makeglossaries.ist 23 | makeglossaries.log 24 | 25 | The folder now only contains the PDF and the TeX file 26 | 27 | $ ls 28 | makeglossaries.pdf 29 | makeglossaries.tex 30 | -------------------------------------------------------------------------------- /Support/css/texdoc.css: -------------------------------------------------------------------------------- 1 | a.dsphead { 2 | text-decoration: none; 3 | font-family: "Lucida Grande", sans-serif; 4 | font-size: 120%; 5 | font-weight: bold; 6 | margin-left: .5em; 7 | } 8 | a.dsphead:hover { 9 | text-decoration: underline; 10 | } 11 | .dspcont { 12 | display: none; 13 | text-decoration: none; 14 | font-family: "Bitstream Vera Sans Mono", "Monaco", monospace; 15 | margin: 0 20px 0 20px; 16 | } 17 | .dspcont a { 18 | text-decoration: none; 19 | } 20 | .dspcont a:hover { 21 | text-decoration: underline; 22 | } 23 | div#mypkg { 24 | text-decoration: none; 25 | font-family: "Bitstream Vera Sans Mono", "Monaco", monospace; 26 | } 27 | div#mypkg a { 28 | text-decoration: none; 29 | font-family: "Bitstream Vera Sans Mono", "Monaco", monospace; 30 | } 31 | div#mypkg a:hover { 32 | text-decoration: none; 33 | } 34 | -------------------------------------------------------------------------------- /Support/bin/toggle_style.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 -s 2 | $: << ENV['TM_SUPPORT_PATH'] + '/lib' 3 | require 'escape' 4 | def esc(str) 5 | e_sn(str).gsub(/\}/, '\\}') # escaping inside a placeholder 6 | end 7 | 8 | is_math = !ENV['TM_SCOPE'].match(/math/).nil? 9 | style = $style || 'texttt' 10 | # The following line might be problematic if the command is used elsewhere 11 | style = style.sub(/^text/,'math').sub(/^emph$/,'mathit') if is_math 12 | s = STDIN.read 13 | # All the formatting commands except for \verb us {} \verb can use any delimeter as long as 14 | # the opening delimiter matches the closing. 15 | oc = '{' 16 | cc = '}' 17 | if style == 'verb' 18 | oc = '!' 19 | cc = '!' 20 | end 21 | if s.empty? then 22 | print "\\#{style}"+oc+"$1"+cc 23 | elsif s =~ /^\\#{Regexp.escape style}\{(.*)\}$/ then 24 | print "${1:#{esc $1}}" 25 | else 26 | print "\\#{style}"+oc+"#{e_sn s}"+cc 27 | end -------------------------------------------------------------------------------- /Preferences/Completion - General.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Completion: General 7 | scope 8 | text.tex.latex 9 | settings 10 | 11 | completions 12 | 13 | corollary 14 | definition 15 | description 16 | enumerate 17 | equation 18 | itemize 19 | lemma 20 | proof 21 | proposition 22 | verbatim 23 | 24 | 25 | uuid 26 | 5345F5C9-8066-449E-9EB8-46F749865E57 27 | 28 | 29 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/xelatex.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | $ export TM_FILEPATH="xelatex.tex" 10 | 11 | Just try to translate the program using `latex` 12 | 13 | $ texmate.py -s latex -latexmk no | grep 'Output written' | countlines 14 | 1 15 | 16 | Check if clean removes all auxiliary files. 17 | 18 | $ texmate.py clean > /dev/null; exit_success_or_discard 19 | $ ls | grep -E $auxiliary_files_regex 20 | [1] 21 | 22 | -- Cleanup -------------------------------------------------------------------- 23 | 24 | Restore the file changes made by previous commands. 25 | 26 | $ restore_aux_files_git 27 | 28 | Remove the generated PDF files 29 | 30 | $ rm -f *.pdf 31 | -------------------------------------------------------------------------------- /Commands/Edit Config File.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | AccountFile="$HOME/Library/Preferences/com.macromates.textmate.latex_config.plist" 9 | if [[ ! -e "$AccountFile" ]]; then 10 | cat "$TM_BUNDLE_SUPPORT/config/latex.config" > "$AccountFile" 11 | fi 12 | open txmt://open?url=file://$AccountFile 13 | input 14 | none 15 | name 16 | Edit Configuration File 17 | output 18 | discard 19 | scope 20 | text.tex.latex 21 | uuid 22 | D10F1CAC-BF1D-456D-B1E5-6AA5E3DD40ED 23 | 24 | 25 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Config file for `tox` 3 | # 4 | # [Tox](http://tox.testrun.org/) is a tool for running tests in multiple 5 | # virtualenvs. Tox uses this configuration file to run tests for the Python code 6 | # inside this bundle on all supported Python versions. 7 | # ------------------------------------------------------------------------------ 8 | 9 | [tox] 10 | envlist = py27, py37 11 | setupdir = {toxinidir} 12 | skipsdist = True 13 | toxworkdir = {homedir}/.tox 14 | 15 | [testenv] 16 | commands = '{toxinidir}/Tests/bin/nosetests.sh' 17 | '{toxinidir}/Tests/bin/cramtests.sh' 18 | passenv = DIALOG* HOME LANG TM_* 19 | deps = cram 20 | nose 21 | pyobjc-framework-SystemConfiguration 22 | 23 | [flake8] 24 | # Disable warnings about imports not being at top of the file 25 | extend-ignore = E402 26 | -------------------------------------------------------------------------------- /DragCommands/Include File.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | #!/usr/bin/env ruby18 7 | 8 | # -- Imports ------------------------------------------------------------------- 9 | 10 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command.rb' 11 | 12 | # -- Main ---------------------------------------------------------------------- 13 | 14 | include_file 15 | draggedFileExtensions 16 | 17 | tex 18 | 19 | name 20 | Include File 21 | output 22 | insertAsSnippet 23 | scope 24 | text.tex.latex 25 | uuid 26 | 5C321350-C9CD-11D9-B88C-000A95C0F626 27 | 28 | 29 | -------------------------------------------------------------------------------- /Tests/Log/latex_error.log: -------------------------------------------------------------------------------- 1 | This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex) 2 | restricted \write18 enabled. 3 | entering extended mode 4 | (./makeglossaries.tex 5 | LaTeX2e <2014/05/01> 6 | Babel <3.9k> and hyphenation patterns for 78 languages loaded. 7 | 8 | ! LaTeX Error: File `Word.sty' not found. 9 | 10 | Type X to quit or to proceed, 11 | or enter new name. (Default extension: sty) 12 | 13 | Runaway argument? 14 | { \par bla \par \printglossaries \par \end {document} 15 | ! File ended while scanning use of \@xdblarg. 16 | 17 | \par 18 | <*> makeglossaries.tex 19 | 20 | ! LaTeX Error: There's no line here to end 21 | 22 | Enter file name: 23 | ./makeglossaries.tex:6: Emergency stop. 24 | 25 | 26 | l.6 ^^M 27 | 28 | ./makeglossaries.tex:6: ==> Fatal error occurred, no output PDF file produced! 29 | Transcript written on makeglossaries.log. 30 | -------------------------------------------------------------------------------- /Commands/Wrap in Command.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require ENV['TM_SUPPORT_PATH'] +'/lib/escape.rb' 10 | print "\\\\${1:emph}{#{if s = ENV['TM_SELECTED_TEXT'] then e_sn(s) else '$2' end}}" 11 | fallbackInput 12 | word 13 | input 14 | none 15 | keyEquivalent 16 | ^W 17 | name 18 | Command — \command{…} 19 | output 20 | insertAsSnippet 21 | scope 22 | text.tex.latex 23 | uuid 24 | C3C8F3A3-C90E-4DA3-8AB3-DB7BDA73355C 25 | 26 | 27 | -------------------------------------------------------------------------------- /Support/lib/Ruby/lib/unf.rb: -------------------------------------------------------------------------------- 1 | # Add this directory to load path 2 | $LOAD_PATH.unshift(File.dirname File.absolute_path(__FILE__)) 3 | 4 | require 'unf/version' 5 | 6 | module UNF 7 | autoload :Normalizer, 'unf/normalizer' 8 | end 9 | 10 | class String 11 | ascii_only = 12 | if method_defined?(:ascii_only?) 13 | 'ascii_only?' 14 | else 15 | '/[^\x00-\x7f]/ !~ self' 16 | end 17 | 18 | # :method: to_nfc 19 | # Converts the string to NFC. 20 | 21 | # :method: to_nfd 22 | # Converts the string to NFD. 23 | 24 | # :method: to_nfkc 25 | # Converts the string to NFKC. 26 | 27 | # :method: to_nfkd 28 | # Converts the string to NFKD. 29 | 30 | [:nfc, :nfd, :nfkc, :nfkd].each { |form| 31 | eval %{ 32 | def to_#{form.to_s} 33 | if #{ascii_only} 34 | self 35 | else 36 | UNF::Normalizer.normalize(self, #{form.inspect}) 37 | end 38 | end 39 | } 40 | } 41 | end 42 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/latex.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | $ export TM_FILEPATH="external_bibliography.tex" 10 | 11 | Just try to translate the program using `latex` 12 | 13 | $ texmate.py -suppressview latex -latexmk no -engine pdflatex \ 14 | > | grep 'Output written' | countlines 15 | 1 16 | 17 | Check if clean removes all auxiliary files. 18 | 19 | $ texmate.py clean > /dev/null; exit_success_or_discard 20 | $ ls | grep -E $auxiliary_files_regex 21 | [1] 22 | 23 | -- Cleanup -------------------------------------------------------------------- 24 | 25 | Restore the file changes made by previous commands. 26 | 27 | $ restore_aux_files_git 28 | 29 | Remove the generated PDF files 30 | 31 | $ rm -f *.pdf 32 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/latexmk.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | $ export TM_FILEPATH="external_bibliography.tex" 10 | 11 | We try to process the files using `latexmk`. 12 | 13 | $ texmate.py -suppressview latex -latexmk yes -e pdflatex -options ' -8bit' \ 14 | > | grep -e 'All.*up-to-date' | countlines 15 | 1 16 | 17 | Check if clean removes all auxiliary files. 18 | 19 | $ texmate.py clean > /dev/null; exit_success_or_discard 20 | $ ls | grep -E $auxiliary_files_regex 21 | [1] 22 | 23 | -- Cleanup -------------------------------------------------------------------- 24 | 25 | Restore the file changes made by previous commands. 26 | 27 | $ restore_aux_files_git 28 | 29 | Remove the generated PDF files 30 | 31 | $ rm -f *.pdf 32 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/unicode.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | Try to translate a file that contains non ASCII characters. 10 | 11 | $ export TM_FILEPATH="ünicöde.tex" 12 | 13 | Just try to translate the program using `latexmk` 14 | 15 | $ texmate.py -s latex -latexmk yes | grep 'Output written' | countlines 16 | 1 17 | 18 | Check if clean removes all auxiliary files. 19 | 20 | $ texmate.py clean > /dev/null; exit_success_or_discard 21 | $ ls | grep -E $auxiliary_files_regex 22 | [1] 23 | 24 | -- Cleanup -------------------------------------------------------------------- 25 | 26 | Restore the file changes made by previous commands. 27 | 28 | $ restore_aux_files_git 29 | 30 | Remove the generated PDF files 31 | 32 | $ rm -f *.pdf 33 | -------------------------------------------------------------------------------- /Support/lib/Ruby/lib/unf/normalizer.rb: -------------------------------------------------------------------------------- 1 | require 'singleton' 2 | if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' 3 | require 'unf/normalizer_jruby' 4 | else 5 | require 'unf/normalizer_cruby' 6 | end 7 | 8 | # UTF-8 string normalizer class. Implementations may vary depending 9 | # on the platform. 10 | class UNF::Normalizer 11 | include Singleton 12 | 13 | class << self 14 | # :singleton-method: instance 15 | # 16 | # Returns a singleton normalizer instance. 17 | 18 | # :singleton-method: new 19 | # 20 | # Returns a new normalizer instance. Use +singleton+ instead. 21 | public :new 22 | 23 | # A shortcut for instance.normalize(string, form). 24 | def normalize(string, form) 25 | instance.normalize(string, form) 26 | end 27 | end 28 | 29 | # :method: normalize 30 | # :call-seq: 31 | # normalize(string, form) 32 | # 33 | # Normalizes a UTF-8 string into a given form (:nfc, :nfd, :nfkc or 34 | # :nfkd). 35 | end 36 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/view.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | $ export TM_FILEPATH="external_bibliography.tex" 8 | 9 | Generate the PDF 10 | 11 | $ pdflatex "$TM_FILEPATH" > /dev/null 2>&1 12 | 13 | -- Tests ---------------------------------------------------------------------- 14 | 15 | Check if opening the PDF works with the current viewer 16 | 17 | $ texmate.py view > /dev/null; exit_success_or_discard 18 | 19 | Check if clean removes all auxiliary files. 20 | 21 | $ texmate.py clean > /dev/null; exit_success_or_discard 22 | $ ls | grep -E $auxiliary_files_regex 23 | [1] 24 | 25 | -- Cleanup -------------------------------------------------------------------- 26 | 27 | Restore the file changes made by previous commands. 28 | 29 | $ restore_aux_files_git 30 | 31 | Remove the generated files 32 | 33 | $ rm -f *.ilg *.ind *.pdf 34 | -------------------------------------------------------------------------------- /Tests/Log/bibtex.log: -------------------------------------------------------------------------------- 1 | This is BibTeX, Version 0.99d (TeX Live 2014) 2 | The top-level auxiliary file: Embedded Operating Systems.aux 3 | The style file: alpha.bst 4 | Database file #1: References.bib 5 | --line 45 of file References.bib 6 | Warning--entry type for "Life_With_Adeos" isn't style-file defined 7 | Warning--empty journal in Real-Time_Linux_Manifesto 8 | Warning--I didn't find a database entry for "Haggarty:01" 9 | Warning--to sort, need author or key in IEEE_1003_26 10 | Warning--entry type for "Realtime_Linux_Academic_Vs_Reality" isn't style-file defined 11 | --line 263 of file References.bib 12 | I was expecting a `,' or a `}'---line 25 of file biblio.bib 13 | Too many commas in name 1 of "S.R.~Arridge, S.R.~Grindrod, A.D.~Linney, P.S.~Tofts, D.~Wicks" for entry Arridge89 14 | You're missing a field name---line 5 of file biblio.bib 15 | I found no \bibdata command---while reading file Thesis_Final_ps_11142012a.aux 16 | I couldn't open style file natbib.bst 17 | (There were 4 warnings) 18 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/applemac.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | Try to translate a file with the encoding “Mac OS Roman” 10 | 11 | $ export TM_FILEPATH="applemac.tex" 12 | 13 | Just try to translate the program using `pdflatex` 14 | 15 | $ texmate.py -suppressview latex -latexmk no -engine pdflatex | \ 16 | > grep 'Output written' > /dev/null 17 | 18 | Check if clean removes all auxiliary files. 19 | 20 | $ texmate.py clean > /dev/null; exit_success_or_discard 21 | $ ls | grep -E $auxiliary_files_regex 22 | [1] 23 | 24 | -- Cleanup -------------------------------------------------------------------- 25 | 26 | Restore the file changes made by previous commands. 27 | 28 | $ restore_aux_files_git 29 | 30 | Remove the generated PDF 31 | 32 | $ rm -f *.pdf 33 | -------------------------------------------------------------------------------- /Commands/Insert environment closers.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | # This command inserts any missing \end{environment} at the caret position 9 | # It is analogous with Insert Closing Tag for HTML. 10 | 11 | ruby18 -- "$TM_SUPPORT_PATH/bin/checknest.rb" '\\begin(?>\{(.+?)\})' '\\end(?>\{(.+?)\})' '\end{$1}' -n$TM_LINE_NUMBER 12 | input 13 | document 14 | keyEquivalent 15 | ~@. 16 | name 17 | Environment Closer — \end{…} 18 | output 19 | afterSelectedText 20 | scope 21 | text.tex.latex 22 | uuid 23 | D52CA669-A6DA-4CF1-BDF5-522D591D7E7D 24 | 25 | 26 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/lualatex.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | Just try to translate the program using `latex` 10 | 11 | $ texmate.py version lualatex.tex 12 | This is Lua(HB)?TeX, Version .* (re) 13 | 14 | $ texmate.py -suppressview latex -latexmk no -engine lualatex lualatex.tex \ 15 | > | grep 'Output written' | countlines 16 | 1 17 | 18 | Check if clean removes all auxiliary files. 19 | 20 | $ texmate.py clean lualatex.tex > /dev/null; exit_success_or_discard 21 | $ ls | grep -E $auxiliary_files_regex 22 | [1] 23 | 24 | -- Cleanup -------------------------------------------------------------------- 25 | 26 | Restore the file changes made by previous commands. 27 | 28 | $ restore_aux_files_git 29 | 30 | Remove the generated PDF files 31 | 32 | $ rm -f *.pdf 33 | -------------------------------------------------------------------------------- /Support/templates/Letter.tex: -------------------------------------------------------------------------------- 1 | % !TEX style = snippet 2 | % !TEX TS-program = xelatex 3 | % 4 | % Created by ${TM_FULLNAME} on `date "+%Y-%m-%d"`. 5 | % Copyright (c) `date "+%Y"` ${TM_ORGANIZATION}. 6 | \documentclass[foldmarks=false, fromalign=center, fromemail, fromrule=afteraddress, 7 | refline=wide, subject=titled]{scrlttr2} 8 | 9 | \usepackage{polyglossia} 10 | \usepackage{hyperref} 11 | 12 | \hypersetup 13 | { 14 | pdftitle = {${1:Title}}, 15 | pdfsubject = {${2:Subject}}, 16 | pdfauthor = {${TM_FULLNAME}} 17 | } 18 | 19 | \setkomavar{fromname}{${TM_FULLNAME}} 20 | \setkomavar{fromaddress}{${TM_ADDRESS}} 21 | \setkomavar{fromemail}{${TM_MAIL}} 22 | \setkomavar{fromphone}{${TM_PHONE}} 23 | \setkomavar{place}{${TM_CITY}} 24 | \setkomavar{title}{${1:Title}} 25 | \setkomavar{subject}{${2:Subject}} 26 | 27 | \begin{document} 28 | \begin{letter}{${3:Address Recipient}} 29 | 30 | \opening{Dear Recipient,} 31 | $4 32 | \closing{Yours Faithfully,} 33 | 34 | \end{letter} 35 | 36 | \end{document} 37 | -------------------------------------------------------------------------------- /Support/src/refresh_viewer.applescript: -------------------------------------------------------------------------------- 1 | #!/usr/bin/osascript 2 | 3 | -------------------------------------------------------------------------------- 4 | -- Author: René Schwaiger 5 | -- 6 | -- Refresh the given PDF in the specified viewer application. The PDF 7 | -- needs to be already open in the viewer application for this to work. 8 | -- 9 | -- Usage: refresh_viewer viewer path_to_pdf 10 | -- 11 | -- viewer - The name of the viewer which should be opened 12 | -- path_to_pdf - The path to the PDF file which should be refreshed 13 | -------------------------------------------------------------------------------- 14 | 15 | on run {viewer, path_to_pdf} 16 | if viewer is "Skim" then 17 | tell application "Skim" 18 | revert (documents whose path is path_to_pdf as text) 19 | end tell 20 | else if viewer is "TeXShop" then 21 | tell application "TeXShop" 22 | tell documents whose path is path_to_pdf as text to refreshpdf 23 | end tell 24 | end if 25 | end run 26 | -------------------------------------------------------------------------------- /DragCommands/Include Image.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | #!/usr/bin/env ruby18 7 | 8 | # -- Imports ------------------------------------------------------------------- 9 | 10 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command.rb' 11 | 12 | # -- Main ---------------------------------------------------------------------- 13 | 14 | include_image 15 | draggedFileExtensions 16 | 17 | jpg 18 | jpeg 19 | pdf 20 | eps 21 | png 22 | 23 | name 24 | Include Image 25 | output 26 | insertAsSnippet 27 | scope 28 | text.tex.latex 29 | uuid 30 | 2C5B80BC-C9C8-11D9-B88C-000A95C0F626 31 | 32 | 33 | -------------------------------------------------------------------------------- /Tests/Log/biber.log: -------------------------------------------------------------------------------- 1 | INFO - This is Biber 1.8 2 | INFO - Logfile is 'Computer Aided Verification [Exercises 2014].blg' 3 | INFO - Reading 'Computer Aided Verification [Exercises 2014].bcf' 4 | INFO - Found 2 citekeys in bib section 0 5 | INFO - Processing section 0 6 | INFO - Looking for bibtex format file 'References.bib' for section 0 7 | INFO - Decoding LaTeX character macros into UTF-8 8 | INFO - Found BibTeX data source 'References.bib' 9 | INFO - Overriding locale 'en_US.UTF-8' default tailoring 'variable = shifted' with 'variable = non-ignorable' 10 | INFO - Sorting 'entry' list 'anyt' keys 11 | INFO - No sort tailoring available for locale 'en_US.UTF-8' 12 | INFO - Writing 'Computer Aided Verification [Exercises 2014].bbl' with encoding 'UTF-8' 13 | WARN - Warning: Found biblatex control file version 2.6, expected version 2.5 14 | FATAL - Cannot find control file 'myfile.bcf'! - did you pass the "backend=biber" option to BibLaTeX? 15 | ERROR - Cannot find file 'References/References1'! 16 | INFO - Output to Computer Aided Verification [Exercises 2014].bbl 17 | -------------------------------------------------------------------------------- /Commands/Set Engine Parameters for this File.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb' 10 | require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb' 11 | 12 | doc = STDIN.read(); 13 | 14 | parms = TextMate::UI.request_string :prompt => "Enter the parameters for the typesetting engine" 15 | 16 | if parms != nil then 17 | puts '%!TEX TS-options = ' + parms 18 | end 19 | puts doc 20 | input 21 | document 22 | name 23 | Set Typesetting Parameters 24 | output 25 | replaceDocument 26 | scope 27 | text.tex.latex 28 | uuid 29 | 85A5D4B0-1657-40E8-881A-8DA0381D2977 30 | 31 | 32 | -------------------------------------------------------------------------------- /Commands/Set Engine for this File.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb' 10 | require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb' 11 | 12 | doc = STDIN.read(); 13 | engine = TextMate::UI.request_string :prompt => "Enter the typesetting command you want to use \n(without parameters)" 14 | 15 | if engine != nil then 16 | puts '%!TEX TS-program = ' + engine 17 | end 18 | puts doc 19 | input 20 | document 21 | name 22 | Set Typesetting Engine 23 | output 24 | replaceDocument 25 | scope 26 | text.tex.latex 27 | uuid 28 | 87D82153-769C-45B9-A33C-F29C9121B67E 29 | 30 | 31 | -------------------------------------------------------------------------------- /Macros/Add Word to Index.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | command 9 | selectWord: 10 | 11 | 12 | argument 13 | 14 | command 15 | echo -n "$TM_SELECTED_TEXT\$0\\index{$TM_SELECTED_TEXT}" 16 | input 17 | none 18 | output 19 | insertAsSnippet 20 | 21 | command 22 | executeCommandWithOptions: 23 | 24 | 25 | keyEquivalent 26 | ^I 27 | name 28 | Add Word to Index 29 | scope 30 | text.tex.latex 31 | scopeType 32 | local 33 | uuid 34 | D4C49CB2-EDA3-4C48-8467-D37D79D6AFAF 35 | 36 | 37 | -------------------------------------------------------------------------------- /Commands/Jump to Current Line in Viewer.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | texmate.py sync 9 | input 10 | none 11 | keyEquivalent 12 | ^~@o 13 | name 14 | Jump to Current Line in Viewer 15 | output 16 | discard 17 | requiredCommands 18 | 19 | 20 | command 21 | kpsewhich 22 | locations 23 | 24 | /Library/TeX/texbin/kpsewhich 25 | /usr/texbin/kpsewhich 26 | /opt/local/bin/kpsewhich 27 | 28 | 29 | 30 | scope 31 | text.tex.latex 32 | uuid 33 | D8B2D295-AD3C-11D9-BD97-000D93B6E43C 34 | 35 | 36 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/root.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | We test if the root directive (%!TEX root) works. This means that although we 10 | call typesetting on a certain file, we translate the file specified as 11 | `root`. 12 | 13 | $ export TM_FILEPATH="input/packages_input1.tex" 14 | 15 | Just try to translate the program using `latex`. The root file is 16 | `packages.tex` 17 | 18 | $ texmate.py -s latex -latexmk no | grep 'packages.tex' | countlines 19 | 1 20 | 21 | Check if clean removes all auxiliary files. 22 | 23 | $ texmate.py clean > /dev/null; exit_success_or_discard 24 | $ ls | grep -E $auxiliary_files_regex 25 | [1] 26 | 27 | -- Cleanup -------------------------------------------------------------------- 28 | 29 | Restore the file changes made by previous commands. 30 | 31 | $ restore_aux_files_git 32 | 33 | Remove the generated PDF files 34 | 35 | $ rm -f *.pdf 36 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/makeglossaries.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | $ export TM_FILEPATH="makeglossaries.tex" 10 | 11 | Translate the file to create the files needed by `makeglossaries` 12 | 13 | $ texmate.py -suppressview latex -latexmk yes -engine latex 2>&- \ 14 | > | grep "All targets .* are up-to-date" | countlines 15 | 1 16 | 17 | Generate the index for the file 18 | 19 | $ texmate.py index | grep "Output written in .*.gls" | countlines 20 | 1 21 | 22 | Check if clean removes all auxiliary files. 23 | 24 | $ texmate.py clean > /dev/null; exit_success_or_discard 25 | $ ls | grep -E $auxiliary_files_regex 26 | [1] 27 | 28 | -- Cleanup -------------------------------------------------------------------- 29 | 30 | Restore the file changes made by previous commands. 31 | 32 | $ restore_aux_files_git 33 | 34 | Remove the generated files 35 | 36 | $ rm -f *.dvi *.pdf *.ps 37 | 38 | -------------------------------------------------------------------------------- /Support/lib/Ruby/completion/command.rb: -------------------------------------------------------------------------------- 1 | # -- Imports ------------------------------------------------------------------- 2 | 3 | require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes' 4 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command' 5 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/latex' 6 | 7 | # -- Functions ----------------------------------------------------------------- 8 | 9 | # Insert a command based on the current word into the document. 10 | def command_completion 11 | print(menu_choice_exit_if_empty(completions)) 12 | rescue RuntimeError => e 13 | TextMate.exit_show_tool_tip(e.message) 14 | end 15 | 16 | # This function returns a list of completion commands for the current file. 17 | # 18 | # = Output 19 | # 20 | # The function returns a list of strings. Each item of the list represents a 21 | # LaTeX command. 22 | def completions 23 | completions = (File.open(ENV['TM_BUNDLE_SUPPORT'] + '/config/completions.txt', 24 | 'r').read.split("\n") + LaTeX.commands).uniq 25 | current_word = ENV['TM_CURRENT_WORD'] 26 | completions.delete(current_word) 27 | completions.grep(/^#{current_word}/).sort 28 | end 29 | -------------------------------------------------------------------------------- /Tests/TeX/references.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{luacode} 3 | \usepackage[style=alphabetic, backend=biber]{biblatex} 4 | \addbibresource{references.bib} 5 | \addbibresource{more_references.bib} 6 | 7 | \begin{document} 8 | 9 | \section{First Section} % (fold) 10 | \label{sec:first_section} 11 | 12 | Super awesome text. 13 | 14 | % section first_section (end) 15 | 16 | \section{Second Section} % (fold) 17 | \label{sec:second_section} 18 | 19 | % section second_section (end) 20 | 21 | \begin{table}[htbp] 22 | \caption{Fluffy table stuff} 23 | \begin{center} 24 | \begin{tabular}{c} 25 | Cell 26 | \end{tabular} 27 | \end{center} 28 | \label{table:a_table_label} 29 | \end{table} 30 | 31 | \input{input/references_input} 32 | 33 | Oh, a reference to an included section~\ref{sec:included_section}. Wow, look at 34 | table~\ref{table:a_table_label}, isn't it super gorgeous and totally not boring in 35 | any way? 36 | 37 | \begin{thebibliography}{9} 38 | \bibitem{embedded_bibitem} 39 | Author of embedded bib-item, 40 | Description of embedded bib-item. 41 | 2015. 42 | \end{thebibliography} 43 | \end{document} 44 | -------------------------------------------------------------------------------- /Support/config/latexmkrc: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # The following code is used by `latexmk` when typesetting a file. 3 | # This code will be invoked by 4 | # - “Watch Document” and 5 | # - “Run & Typeset (PDF)” when the option “Use Latexmk” is checked 6 | # ------------------------------------------------------------------------------ 7 | 8 | # Add dependencies for `makeglossaries` 9 | # Source: http://tex.stackexchange.com/posts/21088/revisions 10 | add_cus_dep('glo', 'gls', 0, 'makeglo2gls'); 11 | add_cus_dep('acn', 'acr', 0, 'makeglo2gls'); 12 | sub makeglo2gls { 13 | return system("makeglossaries '$_[0]'"); 14 | } 15 | 16 | # Add dependencies for `nomencl` 17 | # Source: http://tex.stackexchange.com/posts/105978/revisions 18 | add_cus_dep('nlo', 'nls', 0, 'makenlo2nls'); 19 | sub makenlo2nls { 20 | return system("makeindex -s nomencl.ist -o '$_[0]'.nls '$_[0]'.nlo"); 21 | } 22 | 23 | # Add dependencies for `pythontex` 24 | # Source: http://mirrors.ctan.org/macros/latex/contrib/pythontex/pythontex.pdf 25 | add_cus_dep('pytxcode', 'tex', 0, 'pythontex'); 26 | sub pythontex { 27 | return system("pythontex '$_[0]'"); 28 | } 29 | -------------------------------------------------------------------------------- /Commands/Bold.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/bin/bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | toggle_style.rb -style=textbf 12 | fallbackInput 13 | word 14 | input 15 | selection 16 | inputFormat 17 | text 18 | keyEquivalent 19 | @b 20 | name 21 | Bold 22 | outputCaret 23 | afterOutput 24 | outputFormat 25 | snippet 26 | outputLocation 27 | replaceInput 28 | scope 29 | text.tex.latex - source 30 | semanticClass 31 | style.strong.latex 32 | uuid 33 | 5F0E6093-660C-4018-B664-4264FFA4BDE1 34 | version 35 | 2 36 | 37 | 38 | -------------------------------------------------------------------------------- /Commands/Help.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/bin/bash 9 | 10 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && \ 11 | . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 12 | 13 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 14 | 15 | html_header "LaTeX Bundle Help" "LaTeX" 16 | echo "<meta http-equiv='refresh' content='0; 17 | file:///${TM_BUNDLE_SUPPORT}/help/Help.pdf'>" 18 | html_footer 19 | 20 | input 21 | none 22 | inputFormat 23 | text 24 | name 25 | Help 26 | outputCaret 27 | afterOutput 28 | outputFormat 29 | html 30 | outputLocation 31 | newWindow 32 | scope 33 | text.tex.latex 34 | uuid 35 | 37B43A9E-AD5E-11D9-97B0-000D93B6E43C 36 | version 37 | 2 38 | 39 | 40 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/filenames.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | Test if using file names containing special characters works 10 | 11 | $ texmate.py -suppressview latex -latexmk yes -engine pdflatex \ 12 | > c\'mplicated\ filename.tex | grep 'Output written' | countlines 13 | 1 14 | 15 | $ touch \"balanced\ quotes\".tex 16 | $ texmate.py -suppressview latex \"balanced\ quotes\".tex \ 17 | > | grep '"balanced quotes".tex contains a problematic character: "' \ 18 | > | countlines 19 | 1 20 | $ rm \"balanced\ quotes\".tex 21 | 22 | Check if clean removes all auxiliary files. 23 | 24 | $ texmate.py clean c\'mplicated\ filename.tex > /dev/null; \ 25 | > exit_success_or_discard 26 | $ ls | grep -E $auxiliary_files_regex 27 | [1] 28 | 29 | -- Cleanup -------------------------------------------------------------------- 30 | 31 | Restore the file changes made by previous commands. 32 | 33 | $ restore_aux_files_git 34 | 35 | Remove the generated PDF 36 | 37 | $ rm -f *.pdf 38 | -------------------------------------------------------------------------------- /Commands/Italic.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/bin/bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | toggle_style.rb -style=emph 12 | fallbackInput 13 | word 14 | input 15 | selection 16 | inputFormat 17 | text 18 | keyEquivalent 19 | @i 20 | name 21 | Italic 22 | outputCaret 23 | afterOutput 24 | outputFormat 25 | snippet 26 | outputLocation 27 | replaceInput 28 | scope 29 | text.tex.latex - source 30 | semanticClass 31 | style.emphasis.latex 32 | uuid 33 | 4F91DE78-EA89-48A0-98E4-7A1CB64C7D87 34 | version 35 | 2 36 | 37 | 38 | -------------------------------------------------------------------------------- /Commands/Verb.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/bin/bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | toggle_style.rb -style=verb 12 | fallbackInput 13 | word 14 | input 15 | selection 16 | inputFormat 17 | text 18 | keyEquivalent 19 | ~@k 20 | name 21 | Verb 22 | outputCaret 23 | afterOutput 24 | outputFormat 25 | snippet 26 | outputLocation 27 | replaceInput 28 | scope 29 | text.tex.latex - source 30 | semanticClass 31 | style.alternate.verb.latex 32 | uuid 33 | 6B5C138A-1951-4AD2-BE95-52E498661029 34 | version 35 | 2 36 | 37 | 38 | -------------------------------------------------------------------------------- /Commands/Create Table.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/table.rb' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | puts Table.new 17 | input 18 | none 19 | inputFormat 20 | text 21 | keyEquivalent 22 | ^@T 23 | name 24 | Create Table 25 | outputCaret 26 | afterOutput 27 | outputFormat 28 | snippet 29 | outputLocation 30 | replaceSelection 31 | scope 32 | text.tex.latex 33 | uuid 34 | 7190DABA-FE8B-4DC7-9D31-3A727A8647CD 35 | version 36 | 2 37 | 38 | 39 | -------------------------------------------------------------------------------- /Commands/Insert LaTeX Template.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command.rb' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | insert_template 17 | input 18 | none 19 | inputFormat 20 | text 21 | name 22 | LaTeX Template 23 | outputCaret 24 | afterOutput 25 | outputFormat 26 | text 27 | outputLocation 28 | atCaret 29 | scope 30 | text.tex.latex 31 | tabTrigger 32 | temp 33 | uuid 34 | 0E901597-FFB6-4D81-A57D-821A9B5089A5 35 | version 36 | 2 37 | 38 | 39 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/unicode_error.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | Try to translate a file that contains non ASCII characters, uses the utf-8 10 | inputencoding and contains an error. 11 | 12 | $ export TM_FILEPATH="unicode_error.tex" 13 | 14 | Just try to translate the program using `latexmk` 15 | 16 | $ texmate.py -s latex -latexmk yes | grep 'Output written' | countlines 17 | 1 18 | 19 | Check if texparser is able to parse the resulting log file 20 | 21 | $ texparser.py unicode_error.log unicode_error.tex | \ 22 | > grep '4.*Undefined control sequence.' > /dev/null 23 | 24 | Check if clean removes all auxiliary files. 25 | 26 | $ texmate.py clean > /dev/null; exit_success_or_discard 27 | $ ls | grep -E $auxiliary_files_regex 28 | [1] 29 | 30 | -- Cleanup -------------------------------------------------------------------- 31 | 32 | Restore the file changes made by previous commands. 33 | 34 | $ restore_aux_files_git 35 | 36 | Remove the generated PDF 37 | 38 | $ rm -f *.dvi *.pdf *.ps 39 | -------------------------------------------------------------------------------- /Commands/Small Caps.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/bin/bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | toggle_style.rb -style=textsc 12 | fallbackInput 13 | word 14 | input 15 | selection 16 | inputFormat 17 | text 18 | keyEquivalent 19 | @K 20 | name 21 | Small Caps 22 | outputCaret 23 | afterOutput 24 | outputFormat 25 | snippet 26 | outputLocation 27 | replaceInput 28 | scope 29 | text.tex.latex - source 30 | semanticClass 31 | style.alternate.small_caps.latex 32 | uuid 33 | 9B3C2535-5CB7-43B8-9A8E-BCAB1085A245 34 | version 35 | 2 36 | 37 | 38 | -------------------------------------------------------------------------------- /Commands/Typewriter.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/bin/bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | toggle_style.rb -style=texttt 12 | fallbackInput 13 | word 14 | input 15 | selection 16 | inputFormat 17 | text 18 | keyEquivalent 19 | @k 20 | name 21 | Typewriter 22 | outputCaret 23 | afterOutput 24 | outputFormat 25 | snippet 26 | outputLocation 27 | replaceInput 28 | scope 29 | text.tex.latex - source 30 | semanticClass 31 | style.alternate.typewriter.latex 32 | uuid 33 | 17A74DB2-7B65-4083-A091-AD51023DA8D7 34 | version 35 | 2 36 | 37 | 38 | -------------------------------------------------------------------------------- /Commands/Underline.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/bin/bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | toggle_style.rb -style=underline 12 | fallbackInput 13 | word 14 | input 15 | selection 16 | inputFormat 17 | text 18 | keyEquivalent 19 | @u 20 | name 21 | Underline 22 | outputCaret 23 | afterOutput 24 | outputFormat 25 | snippet 26 | outputLocation 27 | replaceInput 28 | scope 29 | text.tex.latex - source 30 | semanticClass 31 | style.alternate.underline.latex 32 | uuid 33 | 4473F4D4-A7A1-4EA5-B418-0A194A7A3DE1 34 | version 35 | 2 36 | 37 | 38 | -------------------------------------------------------------------------------- /Macros/Next Entry.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | 10 | action 11 | findNext 12 | findInProjectIgnoreCase 13 | 14 | findString 15 | (?<=& )|(<=&)(?! )|(?<=\n)|(?<=\\end\{[^}]\}) 16 | ignoreCase 17 | 18 | regularExpression 19 | 20 | replaceAllScope 21 | document 22 | replaceString 23 | , 24 | wrapAround 25 | 26 | 27 | command 28 | findWithOptions: 29 | 30 | 31 | keyEquivalent 32 | ^ 33 | name 34 | Next Cell 35 | scope 36 | text.tex.latex meta.row.environment.tabular.latex 37 | uuid 38 | DE9EAA9B-066B-4677-84AA-98B7D52F6223 39 | 40 | 41 | -------------------------------------------------------------------------------- /Macros/Previous Cell.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | 10 | action 11 | findPrevious 12 | findInProjectIgnoreCase 13 | 14 | findString 15 | ^|(?<=& )|(?<=&)(?! )|(?=\\begin\{(?:tabular|array)) 16 | ignoreCase 17 | 18 | regularExpression 19 | 20 | replaceAllScope 21 | document 22 | replaceString 23 | , 24 | wrapAround 25 | 26 | 27 | command 28 | findWithOptions: 29 | 30 | 31 | keyEquivalent 32 | ^$ 33 | name 34 | Previous Cell 35 | scope 36 | text.tex.latex meta.row.environment.tabular.latex 37 | uuid 38 | 00C8CABF-24A3-4EB0-BC86-B670F3CC95D6 39 | 40 | 41 | -------------------------------------------------------------------------------- /Preferences/Symbol List - LaTeX.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Symbol List: LaTeX 7 | scope 8 | text.tex.latex meta.function.section.*.latex 9 | settings 10 | 11 | showInSymbolList 12 | 1 13 | symbolTransformation 14 | 15 | # Transform part-, chapter-, section- and paragraph-headings 16 | s/^\\part\*?(?:\[[^]]*\]){0,2}\{(.+)\}/$1/; 17 | s/^\\chapter\*?(?:\[[^]]*\]){0,2}\{(.+)\}/ $1/; 18 | s/^\\section\*?(?:\[[^]]*\]){0,2}\{(.+)\}/  $1/; 19 | s/^\\subsection\*?(?:\[[^]]*\]){0,2}\{(.+)\}/   $1/; 20 | s/^\\subsubsection\*?(?:\[[^]]*\]){0,2}\{(.+)\}/    $1/; 21 | s/^\\paragraph\*?(?:\[[^]]*\]){0,2}\{(.+)\}/     $1/; 22 | s/^\\subparagraph\*?(?:\[[^]]*\]){0,2}\{(.+)\}/      $1/; 23 | # Take care of everything else 24 | s/^\\.*\{(.+)\}/$1/; 25 | 26 | 27 | uuid 28 | AF20835B-CB64-46F3-9E91-F3330378C4AE 29 | 30 | 31 | -------------------------------------------------------------------------------- /Commands/Convert Symbols in Word.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/ruby 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/convert.rb' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | print(STDIN.read.convert) 17 | input 18 | word 19 | inputFormat 20 | text 21 | keyEquivalent 22 | @& 23 | name 24 | Convert Symbols in Word / Selection 25 | outputCaret 26 | afterOutput 27 | outputFormat 28 | text 29 | outputLocation 30 | replaceInput 31 | scope 32 | text.tex.latex 33 | uuid 34 | 97ED3976-0BB0-444D-89C4-A2709F4A35AC 35 | version 36 | 2 37 | 38 | 39 | -------------------------------------------------------------------------------- /Support/lib/Ruby/lib/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010 Takeru Ohta 4 | Copyright (c) 2011-2015 Akinori MUSHA (extended Ruby support) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Support/lib/Ruby/lib/unf/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010 Takeru Ohta 4 | Copyright (c) 2011-2015 Akinori MUSHA (extended Ruby support) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Commands/Open Master File.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/ruby 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command.rb' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | open_master_file 17 | fallbackInput 18 | line 19 | input 20 | selection 21 | inputFormat 22 | text 23 | keyEquivalent 24 | ^@l 25 | name 26 | Open Master File 27 | outputCaret 28 | afterOutput 29 | outputFormat 30 | text 31 | outputLocation 32 | toolTip 33 | scope 34 | text.tex.latex 35 | uuid 36 | BC36A3C7-F9B2-47D4-83FB-2BEB93F14889 37 | version 38 | 2 39 | 40 | 41 | -------------------------------------------------------------------------------- /Commands/Show Outline.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/ruby 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/project_management/outline' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | show_outline 17 | fallbackInput 18 | word 19 | input 20 | document 21 | inputFormat 22 | text 23 | keyEquivalent 24 | ~@o 25 | name 26 | Show Outline 27 | outputCaret 28 | afterOutput 29 | outputFormat 30 | html 31 | outputLocation 32 | newWindow 33 | scope 34 | text.tex.latex 35 | uuid 36 | 5AED5DFA-F084-4F12-8A06-D51C78E91D05 37 | version 38 | 2 39 | 40 | 41 | -------------------------------------------------------------------------------- /Tests/Prysk/Python/filename with spaces.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ source ../../lib/setup_cram.sh 5 | $ cd ../../TeX/ 6 | 7 | -- Tests ---------------------------------------------------------------------- 8 | 9 | Try to translate a file with spaces in the filename. The file contains one error 10 | 11 | $ export TM_FILEPATH="filename with spaces.tex" 12 | 13 | Just try to translate the program using `pdflatex` 14 | 15 | $ texmate.py -suppressview latex -latexmk no -engine pdflatex | \ 16 | > grep '.*filename with spaces.tex:7.*Undefined control sequence.' > /dev/null 17 | 18 | Check if texparser is able to parse the resulting log file 19 | 20 | $ texparser.py 'filename with spaces.log' 'filename with spaces.tex' | \ 21 | > grep '.*:7.*Undefined control sequence.' > /dev/null 22 | 23 | Check if clean removes all auxiliary files. 24 | 25 | $ texmate.py clean > /dev/null; exit_success_or_discard 26 | $ ls | grep -E $auxiliary_files_regex 27 | [1] 28 | 29 | -- Cleanup -------------------------------------------------------------------- 30 | 31 | Restore the file changes made by previous commands. 32 | 33 | $ restore_aux_files_git 34 | 35 | Remove the generated PDF 36 | 37 | $ rm -f *.pdf 38 | -------------------------------------------------------------------------------- /Tests/TeX/more_references.bib: -------------------------------------------------------------------------------- 1 | %% This BibTeX bibliography file was created using BibDesk. 2 | %% http://bibdesk.sourceforge.net/ 3 | 4 | 5 | %% Created for René Schwaiger at 2015-02-19 10:59:38 +0100 6 | 7 | 8 | %% Saved with string encoding Unicode (UTF-8) 9 | 10 | 11 | 12 | @article{robertson2013ponies, 13 | Author = {Robertson, Venetia Laura Delano}, 14 | Date-Added = {2015-02-19 09:57:50 +0000}, 15 | Date-Modified = {2015-02-19 09:57:50 +0000}, 16 | Journal = {International journal of cultural studies}, 17 | Pages = {1367877912464368}, 18 | Publisher = {Sage Publications}, 19 | Title = {Of ponies and men My Little Pony: Friendship is magic and the Brony fandom}, 20 | Year = {2013}} 21 | 22 | @article{pony2010friendship, 23 | Author = {Pony, My Little}, 24 | Date-Added = {2015-02-19 09:57:41 +0000}, 25 | Date-Modified = {2015-02-19 09:57:41 +0000}, 26 | Journal = {The Super Speedy Cider Squeezy}, 27 | Title = {Friendship Is Magic}, 28 | Volume = {6000}, 29 | Year = {2010}} 30 | 31 | @article{hada2013my, 32 | Author = {Hada, Erika}, 33 | Date-Added = {2015-02-19 09:57:36 +0000}, 34 | Date-Modified = {2015-02-19 09:57:36 +0000}, 35 | Journal = {UC Merced Undergraduate Research Journal}, 36 | Number = {1}, 37 | Title = {My Little Pony}, 38 | Volume = {5}, 39 | Year = {2013}} 40 | -------------------------------------------------------------------------------- /Support/config/conversion.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # This file contains two dictionaries. The command “Convert Character / 3 | # Selection to Symbol” uses both of them. 4 | # 5 | # 1. First the command searches for the character sequences specified in the 6 | # keys of `word_to_character` in the current text. It then replaces every 7 | # occurrence of a key with its value (a special character). 8 | # 9 | # 2. After that the command searches for the special characters specified in 10 | # the keys of `character_to_symbol`. It then replaces each of these 11 | # characters with their LaTeX symbol (the value of a key). 12 | # ------------------------------------------------------------------------------ 13 | 14 | word_to_character: 15 | ->: → 16 | -->: ⟶ 17 | =>: ⇒ 18 | ==>: ⟹ 19 | '|->': ↦ 20 | <-: ← 21 | <--: ⟵ 22 | <=: ⇐ 23 | <==: ⟸ 24 | <->: ↔ 25 | <=>: ⇔ 26 | 27 | character_to_symbol: 28 | →: \rightarrow 29 | ⟶: \longrightarrow 30 | ⇒: \Rightarrow 31 | ⟹: \Longrightarrow 32 | ↦: \mapsto 33 | ←: \leftarrow 34 | ⟵: \longleftarrow 35 | ⇐: \Leftarrow 36 | ⟸: \Longleftarrow 37 | ↔: \leftrightarrow 38 | ⇔: \Leftrightarrow 39 | ≤: \leq 40 | ≥: \geq 41 | ¬: \lnot 42 | ∧: \land 43 | ∨: \lor 44 | -------------------------------------------------------------------------------- /Commands/Change Current.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require ENV['TM_SUPPORT_PATH'] + "/lib/escape.rb" 10 | lines = STDIN.readlines 11 | fi = lines.shift 12 | la = lines.pop 13 | lines.map!{|l| e_sn(l)} 14 | [fi,la].each do |l| l.sub!(/(\\(?:begin|end)\{)\w+\*?\}/) do |m| 15 | "#{$1}$1\}" 16 | end 17 | end 18 | l,c = ENV['TM_LINE_NUMBER'].to_i-ENV['TM_INPUT_START_LINE'].to_i, ENV['TM_LINE_INDEX'].to_i-ENV['TM_INPUT_START_LINE_INDEX'].to_i 19 | lines[l-1].sub!(/^(.{#{c}})/,"\\1$0") 20 | print [fi,*lines].join("") 21 | print la 22 | 23 | fallbackInput 24 | scope 25 | input 26 | selection 27 | keyEquivalent 28 | ^~e 29 | name 30 | Change Current 31 | output 32 | insertAsSnippet 33 | scope 34 | text.tex meta.function.environment 35 | uuid 36 | 06BAABEC-B819-4778-94FF-C744CF5DD7CD 37 | 38 | 39 | -------------------------------------------------------------------------------- /Preferences/Pairs - BibTeX.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Pairs: BibTeX 7 | scope 8 | text.bibtex 9 | settings 10 | 11 | highlightPairs 12 | 13 | 14 | ( 15 | ) 16 | 17 | 18 | [ 19 | ] 20 | 21 | 22 | { 23 | } 24 | 25 | 26 | " 27 | " 28 | 29 | 30 | smartTypingPairs 31 | 32 | 33 | ( 34 | ) 35 | 36 | 37 | [ 38 | ] 39 | 40 | 41 | { 42 | } 43 | 44 | 45 | " 46 | " 47 | 48 | 49 | 50 | uuid 51 | 73CE04EB-B78D-456A-AB07-CAED9C4E2BDB 52 | 53 | 54 | -------------------------------------------------------------------------------- /Commands/Show Label as Tool Tip.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/ruby 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command.rb' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | show_label_as_tooltip(STDIN.read) 17 | fallbackInput 18 | word 19 | input 20 | selection 21 | inputFormat 22 | text 23 | keyEquivalent 24 | ^@l 25 | name 26 | Show Label as Tool Tip 27 | outputCaret 28 | afterOutput 29 | outputFormat 30 | text 31 | outputLocation 32 | toolTip 33 | scope 34 | meta.reference.label.latex 35 | uuid 36 | EA8D1116-805A-4583-A028-F5328DDE4B75 37 | version 38 | 2 39 | 40 | 41 | -------------------------------------------------------------------------------- /Commands/Citation - Ref-TeX Style.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command.rb' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | insert_reftex_citation(STDIN.read) 17 | fallbackInput 18 | word 19 | input 20 | selection 21 | inputFormat 22 | text 23 | keyEquivalent 24 | ^{ 25 | name 26 | Citation (Ref-TeX Style) 27 | outputCaret 28 | afterOutput 29 | outputFormat 30 | text 31 | outputLocation 32 | replaceInput 33 | scope 34 | text.tex.latex 35 | uuid 36 | 0E51AD42-17AD-4507-950B-AB114408B58D 37 | version 38 | 2 39 | 40 | 41 | -------------------------------------------------------------------------------- /Commands/Reformat.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/format_table' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | puts(reformat(STDIN.read)) 17 | fallbackInput 18 | scope 19 | input 20 | selection 21 | inputFormat 22 | text 23 | keyEquivalent 24 | ^& 25 | name 26 | Reformat 27 | outputCaret 28 | heuristic 29 | outputFormat 30 | text 31 | outputLocation 32 | replaceInput 33 | scope 34 | text.tex.latex meta.data.environment.tabular.latex 35 | uuid 36 | FB412036-2D62-41A3-BDFA-F897933132AA 37 | version 38 | 2 39 | 40 | 41 | -------------------------------------------------------------------------------- /Commands/Citation Based on Current Word - Selection.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command.rb' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | insert_citation(STDIN.read) 17 | fallbackInput 18 | word 19 | input 20 | selection 21 | inputFormat 22 | text 23 | keyEquivalent 24 | ~ 25 | name 26 | Citation Based on Current Word / Selection… 27 | outputCaret 28 | afterOutput 29 | outputFormat 30 | text 31 | outputLocation 32 | replaceInput 33 | scope 34 | text.tex.latex, meta.citation.latex 35 | uuid 36 | 65E2109C-4309-4079-BD25-17D8B31F03CD 37 | version 38 | 2 39 | 40 | 41 | -------------------------------------------------------------------------------- /Commands/Label Based on Current Word - Selection.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | captureFormatString 8 | $3 9 | command 10 | #!/usr/bin/env ruby18 11 | 12 | # -- Imports ------------------------------------------------------------------- 13 | 14 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command.rb' 15 | 16 | # -- Main ---------------------------------------------------------------------- 17 | 18 | insert_label(STDIN.read) 19 | fallbackInput 20 | word 21 | input 22 | selection 23 | inputFormat 24 | text 25 | keyEquivalent 26 | ~ 27 | name 28 | Label Based on Current Word / Selection… 29 | outputCaret 30 | afterOutput 31 | outputFormat 32 | text 33 | outputLocation 34 | replaceInput 35 | scope 36 | text.tex.latex, meta.reference.label.latex 37 | uuid 38 | 9A3FE182-40AB-4980-AB6C-32DDA22DE41D 39 | version 40 | 2 41 | 42 | 43 | -------------------------------------------------------------------------------- /Tests/Prysk/General/latex_watch.t: -------------------------------------------------------------------------------- 1 | -- Setup ---------------------------------------------------------------------- 2 | 3 | $ cd "$TESTDIR" 4 | $ cd ../../../ 5 | 6 | $ TM_PID=$(pgrep -a TextMate) 7 | $ CURRENT_DIR=$(pwd) 8 | $ FILENAME='makeindex' 9 | $ LOGFILE='/tmp/latex_watch_test.log' 10 | $ TEX_DIR="${CURRENT_DIR}/Tests/TeX" 11 | $ TEXFILE="${TEX_DIR}/${FILENAME}.tex" 12 | $ PATH=/Library/TeX/texbin:$PATH:Support/bin/ 13 | 14 | -- Tests ---------------------------------------------------------------------- 15 | 16 | Run `latex_watch` and check if the log output of the command looks correct. 17 | 18 | $ if [[ $(uname -r | cut -d "." -f 1) == 15 ]]; then # macOS 10.11 19 | > latex_watch.pl -d --textmate-pid=${TM_PID} "${TEXFILE}" > "${LOGFILE}" \ 20 | > 2> /dev/null & 21 | > else 22 | > latex_watch.pl -d --textmate-pid=${TM_PID} "${TEXFILE}" > "${LOGFILE}" & 23 | > fi 24 | $ LATEX_WATCH_PID=$! 25 | $ sleep 10 # Wait until `latex_watch` translated the document 26 | $ kill "$LATEX_WATCH_PID" # Close `latex_watch` 27 | $ sleep 1 # Wait until `latex_watch` terminates 28 | $ grep 'Output written' "${LOGFILE}" > /dev/null 29 | $ grep -E 'Executing\s+check_open' "${LOGFILE}" > /dev/null 30 | 31 | -- Cleanup -------------------------------------------------------------------- 32 | 33 | $ rm "${LOGFILE}" 34 | $ rm "${TEX_DIR}/${FILENAME}.pdf" 35 | $ git checkout -q "${TEX_DIR}/${FILENAME}.idx" 36 | -------------------------------------------------------------------------------- /Commands/Convert Selection to Table.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | def escape(str) 10 | esc_str = str.gsub(/\t/," & ") + "\\\\" 11 | esc_str.gsub(/(\d)E([+-]?)(\d{1,2})/) do |m| 12 | "#{$1} $\\times 10^{#{$2 =="-" ? "-" : ""}#{$3.to_i}}$" 13 | end 14 | end 15 | # First we change all space sequences of length $TM_TAB_SIZE to tabs. 16 | data=STDIN.read.strip.gsub(/ {#{ENV['TM_TAB_SIZE'].to_i}}/,"\t").split("\n") 17 | first_line = data.shift 18 | count=first_line.scan(/\t/).length+1; 19 | result=["\\begin{tabular}{#{"c" * count}}"]; 20 | hl = "\\hline" 21 | result << hl << escape(first_line) << hl 22 | result += data.map{|line| escape(line.strip)} 23 | result << hl << "\\end{tabular}" 24 | puts result.join("\n") 25 | input 26 | selection 27 | keyEquivalent 28 | ^@T 29 | name 30 | Convert Selection to Table 31 | output 32 | replaceSelectedText 33 | scope 34 | text.tex.latex 35 | uuid 36 | 0D4F5C42-210C-4C03-8378-D92FB5D323AF 37 | 38 | 39 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Author: René Schwaiger (sanssecurs@f-m.fm) 3 | # Date: 2015-01-07 4 | # Version: 1 5 | # 6 | # Configuration file for [RuboCop](https://github.com/bbatsov/rubocop) 7 | # ------------------------------------------------------------------------------ 8 | 9 | # Enable most recent rules 10 | Style/HashEachMethods: 11 | Enabled: true 12 | Style/HashTransformKeys: 13 | Enabled: true 14 | Style/HashTransformValues: 15 | Enabled: true 16 | 17 | # -- Ruby 1.8 ------------------------------------------------------------------ 18 | 19 | # We need the following rules to keep compatibility with ruby versions pre 1.9 20 | # shipped with OS X prior to OS X 10.10. The source of the following code is 21 | # http://www.stok.ca/blog/2014/08/24/cleaning. 22 | 23 | # Ruby 1.8.7 needs the . on a chain of method calls at the end of a line. 24 | Layout/DotPosition: 25 | EnforcedStyle: trailing 26 | # Ruby 1.8.7 doesn't have the -> lambda 27 | Style/Lambda: 28 | Enabled: false 29 | # Ruby 1.8.7 doesn't have 1.9 style hash syntax 30 | Style/HashSyntax: 31 | EnforcedStyle: hash_rockets 32 | # Ruby 1.8.7 does not support the `positive?` method 33 | Style/NumericPredicate: 34 | Enabled: false 35 | 36 | # -- Common Rules -------------------------------------------------------------- 37 | 38 | # Allow special characters such as `é` in comments 39 | Style/AsciiComments: 40 | Enabled: false 41 | -------------------------------------------------------------------------------- /Commands/Remove Column.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require 'pp' 10 | require ENV["TM_SUPPORT_PATH"] + "/lib/escape.rb" 11 | data=STDIN.readlines 12 | l,c = ENV['TM_LINE_NUMBER'].to_i-ENV['TM_INPUT_START_LINE'].to_i, ENV['TM_LINE_INDEX'].to_i 13 | col_no = data[l].slice(/^.{#{c}}/).scan("&").length 14 | if col_no == 0 then 15 | data.each do |line| 16 | if line =~ /^[^&]*&(.*)/ then 17 | print $1 18 | else 19 | print line 20 | end 21 | end 22 | else 23 | data.each do |line| 24 | if line =~ /^([^&]*&){#{col_no}}(?:[^&]*&)(.*\n?)/ then 25 | print $1 + $2 26 | else 27 | print line 28 | end 29 | end 30 | end 31 | fallbackInput 32 | scope 33 | input 34 | selection 35 | keyEquivalent 36 | ^~ 37 | name 38 | Remove Column 39 | output 40 | replaceSelectedText 41 | scope 42 | text.tex.latex meta.data.environment.tabular.latex 43 | uuid 44 | 6E70284B-1694-46F5-BA99-FC3CC22705C6 45 | 46 | 47 | -------------------------------------------------------------------------------- /Commands/Add Column.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require 'pp' 10 | require ENV["TM_SUPPORT_PATH"] + "/lib/escape.rb" 11 | data=STDIN.readlines 12 | l,c = ENV['TM_LINE_NUMBER'].to_i-ENV['TM_INPUT_START_LINE'].to_i, ENV['TM_LINE_INDEX'].to_i 13 | # pp [l,c] 14 | col_no = data[l].slice(/^.{#{c}}/).scan("&").length 15 | if col_no == 0 then 16 | data.each do |line| 17 | if line =~ /&/ then 18 | print " & " + line 19 | else 20 | print line 21 | end 22 | end 23 | else 24 | data.each do |line| 25 | if line =~ /^(?:[^&]*&){#{col_no}}/ then 26 | print $& + " &" + $' 27 | else 28 | print line 29 | end 30 | end 31 | end 32 | fallbackInput 33 | scope 34 | input 35 | selection 36 | keyEquivalent 37 | ^~ 38 | name 39 | Add Column 40 | output 41 | replaceSelectedText 42 | scope 43 | text.tex.latex meta.data.environment.tabular.latex 44 | uuid 45 | E70BB4A8-2654-4ED3-A187-9BFD024870E7 46 | 47 | 48 | -------------------------------------------------------------------------------- /Commands/Create Index.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | . "${TM_SUPPORT_PATH}/lib/webpreview.sh" 12 | 13 | # Prepare output window 14 | html_header 'Create Index' 15 | 16 | texmate.py index 17 | 18 | input 19 | none 20 | inputFormat 21 | text 22 | name 23 | Create Index 24 | outputCaret 25 | afterOutput 26 | outputFormat 27 | html 28 | outputLocation 29 | newWindow 30 | requiredCommands 31 | 32 | 33 | command 34 | kpsewhich 35 | locations 36 | 37 | /Library/TeX/texbin/kpsewhich 38 | /usr/texbin/kpsewhich 39 | /opt/local/bin/kpsewhich 40 | 41 | 42 | 43 | scope 44 | text.tex.latex 45 | uuid 46 | 0A27EDBA-2C7C-44CF-B2B0-1B3B7BF8D7D6 47 | version 48 | 2 49 | 50 | 51 | -------------------------------------------------------------------------------- /Commands/Insert Command Based on Current Word.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/Ruby/configuration.rb" 10 | @plist = Configuration.load 11 | shortcuts = @plist['commands'] 12 | if ENV['TM_SCOPE'].match('beamer') then 13 | shortcuts.update(@plist['commands_beamer']) 14 | end 15 | name = STDIN.read 16 | if (shortcuts.has_key?(name)) then 17 | print shortcuts[name] 18 | elsif name.nil? 19 | print "\\${1:cmd}{$2} " 20 | else 21 | print "\\" + name + "{$1} " 22 | end 23 | 24 | fallbackInput 25 | word 26 | input 27 | selection 28 | inputFormat 29 | text 30 | keyEquivalent 31 | ^> 32 | name 33 | Command Based on Current Word / Selection 34 | outputCaret 35 | afterOutput 36 | outputFormat 37 | snippet 38 | outputLocation 39 | replaceInput 40 | scope 41 | text.tex.latex 42 | uuid 43 | 79EBE164-2318-4563-83E5-F337588AAC73 44 | version 45 | 2 46 | 47 | 48 | -------------------------------------------------------------------------------- /Commands/Create Bibliography.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | . "${TM_SUPPORT_PATH}/lib/webpreview.sh" 12 | 13 | # Prepare output window 14 | html_header 'Create Bibliography' 15 | 16 | texmate.py bibtex 17 | input 18 | none 19 | inputFormat 20 | text 21 | name 22 | Create Bibliography 23 | outputCaret 24 | afterOutput 25 | outputFormat 26 | html 27 | outputLocation 28 | newWindow 29 | requiredCommands 30 | 31 | 32 | command 33 | kpsewhich 34 | locations 35 | 36 | /Library/TeX/texbin/kpsewhich 37 | /usr/texbin/kpsewhich 38 | /opt/local/bin/kpsewhich 39 | 40 | 41 | 42 | scope 43 | text.tex.latex 44 | uuid 45 | 4C05FB6C-AA32-4217-8788-D840D49E82CD 46 | version 47 | 2 48 | 49 | 50 | -------------------------------------------------------------------------------- /Commands/Clean.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | . "${TM_SUPPORT_PATH}/lib/webpreview.sh" 12 | 13 | # Prepare output window 14 | html_header 'Clean Auxiliary Files' 15 | 16 | texmate.py clean 17 | input 18 | none 19 | inputFormat 20 | text 21 | keyEquivalent 22 | ^~ 23 | name 24 | Clean 25 | outputCaret 26 | afterOutput 27 | outputFormat 28 | html 29 | outputLocation 30 | newWindow 31 | requiredCommands 32 | 33 | 34 | command 35 | kpsewhich 36 | locations 37 | 38 | /Library/TeX/texbin/kpsewhich 39 | /usr/texbin/kpsewhich 40 | /opt/local/bin/kpsewhich 41 | 42 | 43 | 44 | scope 45 | text.tex.latex 46 | uuid 47 | F330276E-C4B2-11D9-B15D-000D93B6E43C 48 | version 49 | 2 50 | 51 | 52 | -------------------------------------------------------------------------------- /DragCommands/Include Code Listing.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command.rb' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | include_code_listing 17 | draggedFileExtensions 18 | 19 | ada 20 | ant 21 | asm 22 | as 23 | c 24 | cpp 25 | htm 26 | html 27 | java 28 | js 29 | json 30 | pl 31 | php 32 | py 33 | rb 34 | sh 35 | sql 36 | xml 37 | vhdl 38 | 39 | input 40 | selection 41 | name 42 | Include Code Listing 43 | output 44 | insertAsSnippet 45 | scope 46 | text.tex.latex 47 | uuid 48 | 404AC956-0D69-4E51-A0F0-771321A0914F 49 | 50 | 51 | -------------------------------------------------------------------------------- /Support/lib/Ruby/convert.rb: -------------------------------------------------------------------------------- 1 | # -- Imports ------------------------------------------------------------------- 2 | 3 | require 'yaml' 4 | 5 | # -- Class --------------------------------------------------------------------- 6 | 7 | # We extend the string class to support transformation of character sequences. 8 | class String 9 | config = YAML.load_file("#{ENV['TM_BUNDLE_SUPPORT']}/config/conversion.yaml") 10 | 11 | WORD_TO_CHARACTER = config['word_to_character'].freeze 12 | 13 | CHARACTER_TO_SYMBOL = config['character_to_symbol'].freeze 14 | 15 | # This method converts certain sequences of characters to LaTeX symbols. 16 | # 17 | # It replaces special characters like +↔+, and special character sequences 18 | # like +=>+, with their LaTeX command equivalents. 19 | # 20 | # = Output 21 | # 22 | # The function returns a modified copy of the current string. 23 | # 24 | # = Examples 25 | # 26 | # doctest: Convert single arrow character to LaTeX command 27 | # 28 | # >> '[A→B] Life'.convert 29 | # => '[A\rightarrowB] Life' 30 | # 31 | # doctest: Convert “<==”, “⇔” and “<=>” to LaTeX command 32 | # 33 | # >> '<== ⇔ <=>'.convert 34 | # => '\Longleftarrow \Leftrightarrow \Leftrightarrow' 35 | def convert 36 | word_regex = Regexp.union(WORD_TO_CHARACTER.keys.sort_by(&:length).reverse) 37 | converted = gsub(word_regex) { |match| WORD_TO_CHARACTER[match] } 38 | char_regex = Regexp.union(CHARACTER_TO_SYMBOL.keys) 39 | converted.gsub(char_regex) { |match| CHARACTER_TO_SYMBOL[match] } 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /Commands/Lines to List Environment.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env -S "${TM_BUNDLE_SUPPORT}/bin/python" 9 | # coding=utf-8 10 | 11 | # -- Imports ------------------------------------------------------------------ 12 | 13 | from os import environ 14 | from sys import path, stdin, stdout 15 | 16 | path.append(environ['TM_BUNDLE_SUPPORT'] + '/lib/Python') 17 | from itemize import itemize 18 | 19 | # -- Main --------------------------------------------------------------------- 20 | 21 | stdout.write(itemize(text=stdin.read(), 22 | use_spaces_to_indent=environ['TM_SOFT_TABS'] == 'YES', 23 | number_of_spaces_for_indent=int(environ['TM_TAB_SIZE']))) 24 | input 25 | selection 26 | inputFormat 27 | text 28 | keyEquivalent 29 | ^L 30 | name 31 | Itemize Lines in Selection 32 | outputCaret 33 | afterOutput 34 | outputFormat 35 | text 36 | outputLocation 37 | replaceInput 38 | scope 39 | text.tex.latex 40 | uuid 41 | 1108B460-CCDD-4D4A-BFAC-D91B2E1BC2FC 42 | version 43 | 2 44 | 45 | 46 | -------------------------------------------------------------------------------- /Commands/Watch Document.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | bundleUUID 8 | 46788DCE-6227-11D9-BFB1-000D93589AF6 9 | command 10 | #!/usr/bin/env bash 11 | 12 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && \ 13 | . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 14 | 15 | . "${TM_BUNDLE_SUPPORT}/lib/Bash/watch_document.sh" 16 | latex_watch 17 | input 18 | none 19 | inputFormat 20 | text 21 | keyEquivalent 22 | ^@w 23 | name 24 | Watch Document 25 | outputCaret 26 | afterOutput 27 | outputFormat 28 | text 29 | outputLocation 30 | discard 31 | requiredCommands 32 | 33 | 34 | command 35 | latexmk 36 | locations 37 | 38 | /usr/texbin/latexmk 39 | /Library/TeX/texbin/latexmk 40 | /opt/local/bin/latexmk 41 | 42 | 43 | 44 | scope 45 | text.tex.latex 46 | uuid 47 | 4BB11B68-A0F5-4670-A0B9-B3982D10A54B 48 | version 49 | 2 50 | 51 | 52 | -------------------------------------------------------------------------------- /Preferences/Folding - LaTeX.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Folding: LaTeX 7 | scope 8 | text.tex.latex 9 | settings 10 | 11 | foldingIndentedBlockIgnore 12 | (?x) 13 | (?# We ignore everything except the commands listed in 14 | `foldingIndentedBlockStart`. 15 | ) 16 | ^(?!.*\\(?:part|chapter|(?:sub){0,2}section|(?:sub){0,1}paragraph)\*?{).*$ 17 | foldingIndentedBlockStart 18 | (?x) 19 | (?# The following commands introduce a section of a document: 20 | 21 | - \part{part} 22 | - \chapter{chapter} 23 | - \section{section} 24 | - \subsection{subsection} 25 | - \subsubsection{subsubsection} 26 | - \paragraph{paragraph} 27 | - \subparagraph{subparagraph} 28 | 29 | To use a section without including it in the index we can also add a 30 | `*` to the command. E.g.: 31 | 32 | \section*{A Section Not Included in the Index} 33 | ) 34 | \\(?:part|chapter|(?:sub){0,2}section|(?:sub){0,1}paragraph)\*?\{.*\} 35 | foldingStartMarker 36 | \\begin\{.*\}|%.*\(fold\)\s*$ 37 | foldingStopMarker 38 | \\end\{.*\}|%.*\(end\)\s*$ 39 | 40 | uuid 41 | 077E5491-2438-46A4-B150-E9C743EDEE8B 42 | 43 | 44 | -------------------------------------------------------------------------------- /Commands/TeXcount.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && \ 10 | . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 11 | 12 | DIRECTORY=$(dirname "${TM_FILEPATH}") 13 | FILENAME=$(basename "${TM_FILEPATH}") 14 | OPTIONS=($TM_TEXCOUNT_OPTIONS) 15 | cd "$DIRECTORY" 16 | 17 | texcount -nocol -utf8 -inc "${OPTIONS[@]}" "$FILENAME" 18 | input 19 | none 20 | inputFormat 21 | text 22 | keyEquivalent 23 | ^N 24 | name 25 | TeXcount 26 | outputCaret 27 | afterOutput 28 | outputFormat 29 | text 30 | outputLocation 31 | toolTip 32 | requiredCommands 33 | 34 | 35 | command 36 | texcount 37 | locations 38 | 39 | /Library/TeX/texbin/texcount 40 | /usr/texbin/texcount 41 | /opt/local/bin/texcount 42 | 43 | 44 | 45 | scope 46 | text.tex.latex 47 | uuid 48 | 361BC324-8D67-4E03-8939-824D4D65916B 49 | version 50 | 2 51 | 52 | 53 | -------------------------------------------------------------------------------- /Commands/Set Master File.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb'; 10 | require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'; 11 | 12 | module TextMate 13 | module UI 14 | class << self 15 | 16 | def request_file2(options = Hash.new,&block) 17 | options["string-output"] = "" 18 | options['button1'] ||= "OK" 19 | options['button2'] ||= "Cancel" 20 | options["title"] = options[:title] || "Select File" 21 | options["informative-text"] = options[:prompt] || "" 22 | options["text"] = options[:default] || "" 23 | return cocoa_dialog("fileselect", options,&block) 24 | end 25 | 26 | end 27 | end 28 | end 29 | 30 | startDir = ENV['TM_DIRECTORY']; 31 | 32 | doc = STDIN.read(); 33 | master = TextMate::UI.request_file2("with-directory" => startDir, "with-extensions" => ".tex"); 34 | 35 | if master != nil then 36 | puts '%!TEX root = ' + master[0] 37 | end 38 | puts doc 39 | input 40 | document 41 | name 42 | Set Master File 43 | output 44 | replaceDocument 45 | scope 46 | text.tex.latex 47 | uuid 48 | B5E78339-A4E5-4D61-9E4A-B7D725ABA10A 49 | 50 | 51 | -------------------------------------------------------------------------------- /Preferences/Pairs - Strings.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Pairs: Strings 7 | scope 8 | text.tex.latex string.quoted.double, text.tex.latex string.quoted.single 9 | settings 10 | 11 | highlightPairs 12 | 13 | 14 | ( 15 | ) 16 | 17 | 18 | { 19 | } 20 | 21 | 22 | [ 23 | ] 24 | 25 | 26 | 27 | 28 | 29 | 30 | $ 31 | $ 32 | 33 | 34 | smartTypingPairs 35 | 36 | 37 | ( 38 | ) 39 | 40 | 41 | ` 42 | ' 43 | 44 | 45 | { 46 | } 47 | 48 | 49 | [ 50 | ] 51 | 52 | 53 | 54 | 55 | 56 | 57 | $ 58 | $ 59 | 60 | 61 | 62 | uuid 63 | D4961019-E3EF-4D0C-904F-FBE2C74A6DE9 64 | 65 | 66 | -------------------------------------------------------------------------------- /Commands/Tidy.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && \ 10 | . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 11 | 12 | # We use “LaTeX Tidy” as default tex formatting tool. If you want to use 13 | # `latexindent` instead just set `TM_LATEX_FORMATTER` to the value `latexindent` 14 | if [[ "${TM_LATEX_FORMATTER}" != "latexindent" ]]; then 15 | latextidy.pl 16 | else 17 | # Include `YAML::Tiny` required by `latexindent` 18 | export PERL5LIB=$PERL5LIB:"${TM_BUNDLE_SUPPORT}"/lib/Perl 19 | PATH=$PATH:/Library/TeX/texbin 20 | 21 | DIRECTORY=$(dirname "${TM_FILEPATH}") 22 | cd "${DIRECTORY}" 23 | 24 | latexindent -c=/tmp "${TM_FILENAME}" 25 | fi 26 | 27 | 28 | input 29 | document 30 | inputFormat 31 | text 32 | keyEquivalent 33 | ^H 34 | name 35 | Tidy 36 | outputCaret 37 | interpolateByLine 38 | outputFormat 39 | text 40 | outputLocation 41 | replaceDocument 42 | scope 43 | text.tex.latex 44 | uuid 45 | DF9F9DF7-5F85-11D9-97D0-000D9332809C 46 | version 47 | 2 48 | 49 | 50 | -------------------------------------------------------------------------------- /Commands/Command Completion.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | captureFormatString 8 | $3 9 | capturePattern 10 | ^([^:]*):([^:]*):(.*)$ 11 | command 12 | #!/usr/bin/env ruby18 13 | 14 | # -- Imports ------------------------------------------------------------------- 15 | 16 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/completion/command' 17 | 18 | # -- Main ---------------------------------------------------------------------- 19 | 20 | command_completion 21 | fallbackInput 22 | word 23 | fileCaptureRegister 24 | 1 25 | input 26 | selection 27 | inputFormat 28 | text 29 | keyEquivalent 30 | ~ 31 | lineCaptureRegister 32 | 2 33 | name 34 | Command Completion 35 | outputCaret 36 | heuristic 37 | outputFormat 38 | text 39 | outputLocation 40 | replaceInput 41 | scope 42 | text.tex.latex meta.space-after-command.latex, text.tex.latex support.function.general.tex 43 | uuid 44 | 97FDB90C-2CEE-439E-8B01-F892B4ED5E5D 45 | version 46 | 2 47 | 48 | 49 | -------------------------------------------------------------------------------- /Commands/Check LaTeX.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | # Source some support functions we need. 12 | . "${TM_SUPPORT_PATH}/lib/html.sh" 13 | . "${TM_SUPPORT_PATH}/lib/webpreview.sh" 14 | 15 | # Prepare output window. 16 | html_header 'ChkTeX' "$FILE" 17 | 18 | texmate.py chktex 19 | 20 | html_footer 21 | 22 | input 23 | none 24 | inputFormat 25 | text 26 | keyEquivalent 27 | ^V 28 | name 29 | Check LaTeX 30 | outputCaret 31 | afterOutput 32 | outputFormat 33 | html 34 | outputLocation 35 | newWindow 36 | requiredCommands 37 | 38 | 39 | command 40 | kpsewhich 41 | locations 42 | 43 | /Library/TeX/texbin/kpsewhich 44 | /usr/texbin/kpsewhich 45 | /opt/local/bin/kpsewhich 46 | 47 | 48 | 49 | scope 50 | text.tex.latex 51 | uuid 52 | B345876F-1B84-4FF5-A19C-A62ADF121EC8 53 | version 54 | 2 55 | 56 | 57 | -------------------------------------------------------------------------------- /Commands/Documentation for Package.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && \ 10 | . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 11 | 12 | . "${TM_SUPPORT_PATH}/lib/webpreview.sh" 13 | 14 | html_header 'Package Documentation' 15 | echo '<p><small>Hint: Cursor on package name shows doc for package. 16 | Otherwise show package doc browser.</small></p>' 17 | texdoc.py 18 | input 19 | none 20 | inputFormat 21 | text 22 | keyEquivalent 23 | ^h 24 | name 25 | Documentation for Package 26 | outputCaret 27 | afterOutput 28 | outputFormat 29 | html 30 | outputLocation 31 | newWindow 32 | requiredCommands 33 | 34 | 35 | command 36 | kpsewhich 37 | locations 38 | 39 | /Library/TeX/texbin/kpsewhich 40 | /usr/texbin/kpsewhich 41 | /opt/local/bin/kpsewhich 42 | 43 | 44 | 45 | scope 46 | text.tex.latex 47 | uuid 48 | 1A12B844-4074-4655-A45C-18AC8D943267 49 | version 50 | 2 51 | 52 | 53 | -------------------------------------------------------------------------------- /Commands/Open Included Item.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | 10 | # -- Imports ------------------------------------------------------------------- 11 | 12 | require ENV['TM_BUNDLE_SUPPORT'] + '/lib/Ruby/command.rb' 13 | 14 | # -- Main ---------------------------------------------------------------------- 15 | 16 | open_included_item 17 | fallbackInput 18 | line 19 | input 20 | selection 21 | inputFormat 22 | text 23 | keyEquivalent 24 |  25 | name 26 | Open Included Item 27 | outputCaret 28 | afterOutput 29 | outputFormat 30 | text 31 | outputLocation 32 | discard 33 | requiredCommands 34 | 35 | 36 | command 37 | kpsewhich 38 | locations 39 | 40 | /usr/texbin/kpsewhich 41 | /Library/TeX/texbin/kpsewhich 42 | /opt/local/bin/kpsewhich 43 | 44 | 45 | 46 | scope 47 | text.tex.latex meta.include, text.tex.latex meta.function.environment.general.latex meta.group.braces.tex 48 | uuid 49 | B3E6DCF7-6323-4229-94D7-59996BDF07EC 50 | version 51 | 2 52 | 53 | 54 | -------------------------------------------------------------------------------- /Commands/Greek letter.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | 10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes" 11 | require "#{ENV['TM_SUPPORT_PATH']}/lib/current_word" 12 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape" 13 | require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/Ruby/configuration.rb" 14 | 15 | @plist = Configuration.load 16 | shortcutHash = @plist['symbols'] 17 | 18 | match = Word.current_word(/(^\w+)?(.*\n?)/, :hash) 19 | 20 | word = match[:left].to_s + match[:right].to_s 21 | 22 | if (shortcutHash.has_key?(word)) then 23 | # Need to support previously saved latex.config files with leading \ 24 | result = shortcutHash[word].gsub(/^\\/, '') 25 | 26 | print e_sn(match[:before_match].sub(/\\?$/, '\\')) + e_sn(result) + '${0}' + e_sn(match[:after_match]) 27 | else 28 | TextMate.exit_discard 29 | end 30 | fallbackInput 31 | word 32 | input 33 | line 34 | inputFormat 35 | text 36 | keyEquivalent 37 | @\ 38 | name 39 | LaTeX Symbol Based on Current Word / Selection 40 | outputCaret 41 | afterOutput 42 | outputFormat 43 | snippet 44 | outputLocation 45 | replaceInput 46 | scope 47 | text.tex.latex, text.bibtex 48 | uuid 49 | A7D549C1-055E-4181-84F2-BA713EB66341 50 | version 51 | 2 52 | 53 | 54 | -------------------------------------------------------------------------------- /Tests/Prysk/Ruby/clean/multiple_files.t: -------------------------------------------------------------------------------- 1 | -- Setup ----------------------------------------------------------------------- 2 | 3 | $ source "$TESTDIR/setup.sh" 4 | $ cp "$TEX_DIRECTORY/references.tex" \ 5 | > "$TEX_DIRECTORY/"{more_,}references.bib . 6 | $ mkdir input 7 | $ cp "$TEX_DIRECTORY/input/references_input.tex" input 8 | $ cp "$TEX_DIRECTORY/ünicöde.tex" . 9 | 10 | -- Test ------------------------------------------------------------------------ 11 | 12 | Create some auxiliary files 13 | 14 | $ latexmk -lualatex references.tex 2>&- | trim| tail -n 1 15 | Latexmk: All targets (.*) are up-to-date (re) 16 | $ latexmk -xelatex ünicöde.tex 2>&- | trim | tail -n 1 17 | Latexmk: All targets (\xc3\xbcnic\xc3\xb6de.pdf) are up-to-date (esc) 18 | 19 | Delete all auxiliary file created for references.tex 20 | 21 | $ clean.rb references.tex 22 | references.aux 23 | references.bbl 24 | references.bcf 25 | references.blg 26 | references.fdb_latexmk 27 | references.fls 28 | references.log 29 | references.run.xml 30 | 31 | The directory still contains the auxiliary files for ünicöde.tex 32 | 33 | $ find . -name '*nic*de.*' 34 | ./\xc3\xbcnic\xc3\xb6de.log (esc) 35 | ./\xc3\xbcnic\xc3\xb6de.aux (esc) 36 | ./\xc3\xbcnic\xc3\xb6de.fls (esc) 37 | ./\xc3\xbcnic\xc3\xb6de.fdb_latexmk (esc) 38 | ./\xc3\xbcnic\xc3\xb6de.tex (esc) 39 | ./\xc3\xbcnic\xc3\xb6de.xdv (esc) 40 | ./\xc3\xbcnic\xc3\xb6de.pdf (esc) 41 | 42 | Remove the remaining the auxiliary files 43 | 44 | $ clean.rb > /dev/null 45 | 46 | The folder now only contains the DVI, PDF and TeX file 47 | 48 | $ ls 49 | input 50 | more_references.bib 51 | references.bib 52 | references.pdf 53 | references.tex 54 | \xc3\xbcnic\xc3\xb6de.pdf (esc) 55 | \xc3\xbcnic\xc3\xb6de.tex (esc) 56 | \xc3\xbcnic\xc3\xb6de.xdv (esc) 57 | -------------------------------------------------------------------------------- /Support/templates/Memoir.tex: -------------------------------------------------------------------------------- 1 | % !TEX style = snippet 2 | % !TEX TS-program = pdflatex 3 | % 4 | % Created by ${TM_FULLNAME} on `date "+%Y-%m-%d"`. 5 | % Copyright (c) `date "+%Y"` ${TM_ORGANIZATION}. 6 | \documentclass[ 7 | a4paper, % paper size. 8 | 11pt, % type size. 9 | % article, 10 | % oneside, % all pages setup with the same margins. 11 | twoside, % margins change from recto to verso pages. 12 | onecolumn, % only one column of text on a page. 13 | openright, % each chapter will start on a recto page. 14 | % openleft, % each chapter will start on a verso page. 15 | % openany, % chapters may start on either recto or verso pages. 16 | ]{memoir} 17 | 18 | % Enable hyperlinking/hypertext and PDF metadata 19 | \usepackage{hyperref} 20 | 21 | \hypersetup 22 | { 23 | pdftitle = {${1:Title}}, 24 | pdfauthor = {${2:Author}}, 25 | pdfsubject = {${3:Subject}} 26 | } 27 | 28 | \title{$1} 29 | \author{$2} 30 | 31 | \usepackage{lipsum} % to support fake lorem ipsum text 32 | 33 | \begin{document} 34 | 35 | \frontmatter 36 | 37 | \maketitle 38 | 39 | \begin{abstract} 40 | \lipsum[1-2] 41 | \end{abstract} 42 | \clearpage 43 | 44 | \tableofcontents* 45 | \clearpage 46 | 47 | \chapter*[Intro Heading]{Introduction} 48 | 49 | \lipsum[1-12] 50 | 51 | \mainmatter 52 | 53 | \part{Memoir Supported Part I} 54 | 55 | \chapter[Chapter 1 TOC entry][Chapter One Heading]{Chapter One} 56 | 57 | \lipsum[1-13] 58 | 59 | \chapter{Chapter Two} 60 | 61 | \lipsum[1-14] 62 | 63 | \part{Memoir Supported Part II} 64 | 65 | \chapter{Another Part, Another Chapter} 66 | 67 | \lipsum[1-14] 68 | 69 | \appendix 70 | 71 | \part{Appendices go here} 72 | 73 | \chapter{Appendix I am} 74 | 75 | \lipsum[1-9] 76 | 77 | \chapter{Because I am appended} 78 | 79 | \lipsum[1-11] 80 | 81 | \backmatter 82 | 83 | % Bibliography goes here 84 | % ---------------------- 85 | 86 | % \bibliographystyle{ieeetr} 87 | % \bibliography{ref} 88 | 89 | \end{document} 90 | -------------------------------------------------------------------------------- /Tests/lib/setup_cram.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # ----------------------------------------------------------------------------- 4 | # This script setups common variables and aliases for cram tests. 5 | # ----------------------------------------------------------------------------- 6 | 7 | # -- Variables ---------------------------------------------------------------- 8 | 9 | BUNDLE_DIR="$TESTDIR/../../.." 10 | TM_BUNDLE_DIR="$HOME/Library/Application Support/TextMate/Managed/Bundles" 11 | PYTHON_GRAMMAR_DIR="${TM_BUNDLE_DIR}/Python.tmbundle/Syntaxes" 12 | JS_GRAMMAR_DIR="${TM_BUNDLE_DIR}/JavaScript.tmbundle/Syntaxes" 13 | 14 | export TM_SUPPORT_PATH="$TM_BUNDLE_DIR/Bundle Support.tmbundle/Support/shared" 15 | export TM_BUNDLE_SUPPORT="$BUNDLE_DIR/Support" 16 | export PATH=/Library/TeX/texbin:"$BUNDLE_DIR/Support/bin":$PATH 17 | export TM_SELECTION='1:1' 18 | export TM_MATE="/Applications/TextMate.app/Contents/MacOS/mate" 19 | 20 | auxiliary_files_regex='./(aux|acr|alg|bbl|bcf|blg|fdb_latexmk|fls|fmt|glg|gls|' 21 | auxiliary_files_regex+='ini|log|out|maf|mtc|mtc1|pdfsync|run.xml|synctex.gz|' 22 | auxiliary_files_regex+='toc)' 23 | 24 | grammars=( 25 | "${BUNDLE_DIR}/Syntaxes/LaTeX.plist" 26 | "${BUNDLE_DIR}/Syntaxes/TeX.plist" 27 | "${PYTHON_GRAMMAR_DIR}"/{Python,"Regular Expressions (Python)"}.tmlanguage 28 | "${TM_BUNDLE_DIR}/SQL.tmbundle/Syntaxes/SQL.plist" 29 | "${TM_BUNDLE_DIR}/Java.tmbundle/Syntaxes/Java.plist" 30 | "${TM_BUNDLE_DIR}/JavaDoc.tmbundle/Syntaxes/JavaDoc.tmLanguage" 31 | "${TM_BUNDLE_DIR}/HTML.tmbundle/Syntaxes/HTML.plist" 32 | "${TM_BUNDLE_DIR}/CSS.tmbundle/Syntaxes/CSS.plist" 33 | "${JS_GRAMMAR_DIR}/JavaScript.plist" 34 | "${JS_GRAMMAR_DIR}/Regular Expressions (JavaScript).tmLanguage" 35 | "${TM_BUNDLE_DIR}/R.tmbundle/Syntaxes/R.plist" 36 | ) 37 | 38 | # -- Aliases ------------------------------------------------------------------ 39 | 40 | # Remove leading and trailing whitespace 41 | alias strip="sed -e 's/^ *//' -e 's/ *$//'" 42 | alias countlines="wc -l | strip" 43 | alias exit_success_or_discard="echo $? | grep -E '^0|200$' > /dev/null" 44 | alias restore_aux_files_git='git checkout -q *.aux *.idx' 45 | -------------------------------------------------------------------------------- /Tests/Perl/latex.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # -- Imports ------------------------------------------------------------------- 4 | 5 | use strict; 6 | use warnings; 7 | 8 | use Cwd qw(abs_path); 9 | use File::Basename; 10 | use Test::More tests => 8; 11 | 12 | use lib dirname( dirname( dirname abs_path $0) ) . '/Support/lib/Perl'; 13 | use Latex qw(guess_tex_engine master tex_directives); 14 | 15 | # -- Tests --------------------------------------------------------------------- 16 | 17 | my $tex_dir = dirname( dirname abs_path $0) . '/TeX'; 18 | my ( %reference, %output, $error, $output, $regex ); 19 | 20 | ok( guess_tex_engine( $tex_dir . '/xelatex.tex' ) eq 'xelatex', 21 | 'Guess tex engine for xelatex.tex' ); 22 | ok( guess_tex_engine( $tex_dir . '/ünicöde.tex' ) eq 'xelatex', 23 | 'Guess tex engine for ünicöde.tex' ); 24 | ok( guess_tex_engine( $tex_dir . '/text.tex' ) eq '', 25 | 'Guess tex engine for text.tex' ); 26 | 27 | %reference = ( 28 | 'encoding' => 'UTF-8 Unicode', 29 | 'program' => 'xelatex', 30 | 'spellcheck' => 'en-US' 31 | ); 32 | %output = tex_directives( $tex_dir . '/xelatex.tex' ); 33 | 34 | is_deeply( \%reference, \%output, 'Check tex directives for file xelatex.tex' ); 35 | 36 | %reference = ( 'root' => './packages_input2.tex' ); 37 | %output = tex_directives( $tex_dir . '/input/packages_input1.tex' ); 38 | 39 | is_deeply( \%reference, \%output, 40 | 'Check tex directives for file packages_input1.tex' ); 41 | 42 | ( $error, $output ) = master( $tex_dir . '/input/packages_input1.tex' ); 43 | 44 | ok( 45 | !$error && $output =~ m/TeX\/packages\.tex$/x, 46 | 'Get master file for packages_input1.tex' 47 | ); 48 | 49 | ( $error, $output ) = master( $tex_dir . '/root loop.tex' ); 50 | 51 | ok( $error && $output =~ m/root\ loop\.tex\ was\ specified\ twice/x, 52 | 'Detect the %!TEX root loop in root loop.tex' ); 53 | 54 | ( $error, $output ) = master( $tex_dir . '/non existent root.tex' ); 55 | 56 | $regex = 'I\ do\ not\ exist.tex .* in .*' 57 | . 'non\ existent\ root\.tex\ can\ not\ be\ opened'; 58 | 59 | ok( $error && $output =~ qr/$regex/x, 60 | 'Detect the non existent %!TEX root in non existent root.tex' ); 61 | -------------------------------------------------------------------------------- /Support/config/auxiliary.yaml: -------------------------------------------------------------------------------- 1 | # List Of Auxiliary Files 2 | # ======================= 3 | 4 | # The files specified here will be deleted by the commands “Clean”, and by 5 | # “Watch Document” if you close the previewer. 6 | # 7 | # We specify auxiliary files and directories via free-spacing regular 8 | # expressions. Before TextMate matches the regular expression specified here, it 9 | # replaces the variable `${NAME}` with the base-name of the master file (without 10 | # its extension). 11 | # 12 | # For example: Let us assume that your main tex file is called `Sandy.tex`, and 13 | # you specify the pattern `${NAME}\.aux`. In this case the command “Clean” 14 | # will search for a file matching the regex `Sandy\.aux` in the directory where 15 | # `Sandy.tex` is stored. 16 | # 17 | # If you want to match a modified version of the name of the main TeX file use 18 | # the syntax ${NAME/SUBSTRING/REPLACEMENT/}. 19 | # 20 | # For example: If your file is called `Giving Bad People Good Ideas.tex`, then 21 | # the pattern `${NAME/ /_/}\.toc` will result in the regex 22 | # `Giving_Bad_People_Good_Ideas\.toc`. 23 | 24 | files: 25 | - \.${NAME}\.lb$ 26 | - '${NAME}\.(?:acn| 27 | acr| 28 | alg| 29 | aux| 30 | bbl| 31 | bcf| 32 | blg| 33 | fdb_latexmk| 34 | fls| 35 | fmt| 36 | glo| 37 | glg| 38 | gls| 39 | idx| 40 | ilg| 41 | ind| 42 | ini| 43 | ist| 44 | latexmk.log| 45 | lof| 46 | log| 47 | lol| 48 | lot| 49 | maf| 50 | mtc| 51 | mtc1| 52 | mw| 53 | nav| 54 | nlo| 55 | nls| 56 | pytxcode| 57 | out| 58 | pdfsync| 59 | run\.xml| 60 | snm| 61 | synctex\.gz| 62 | toc| 63 | vrb)$' 64 | - '.+/.+\.aux$' 65 | 66 | directories: 67 | - pythontex-files-${NAME/ /-/} 68 | - _minted-${NAME/ /_/} 69 | -------------------------------------------------------------------------------- /Support/lib/Python/auxiliary.py: -------------------------------------------------------------------------------- 1 | """This module contains functions to handle auxiliary files produced by TeX.""" 2 | 3 | # -- Imports ------------------------------------------------------------------ 4 | 5 | from __future__ import absolute_import 6 | from __future__ import print_function 7 | from __future__ import unicode_literals 8 | 9 | from os import getenv 10 | from os.path import join 11 | from pipes import quote 12 | from subprocess import check_output 13 | 14 | # -- Functions ---------------------------------------------------------------- 15 | 16 | 17 | def remove_auxiliary_files(directory='.', 18 | tm_bundle_support=getenv('TM_BUNDLE_SUPPORT')): 19 | """Remove auxiliary files created by TeX commands. 20 | 21 | Arguments: 22 | 23 | directory 24 | 25 | This string specifies the directory that this function cleans from 26 | auxiliary files. 27 | 28 | tm_bundle_support 29 | 30 | This string specifies the bundle support path of the LaTeX bundle. 31 | 32 | Returns: 33 | 34 | The function returns a list of strings. Each item in the list 35 | specifies the location of an auxiliary file removed by this function. 36 | 37 | Examples: 38 | 39 | >>> # Initialize test 40 | >>> from glob import glob 41 | >>> from os import getcwd, mkdir 42 | >>> from os.path import basename, join 43 | >>> from tempfile import mkdtemp 44 | >>> tm_bundle_support = join(getcwd(), "Support") 45 | >>> directory = mkdtemp() 46 | 47 | >>> # Create auxiliary files 48 | >>> for filename in ["test.aux", "test.toc", "test.synctex.gz"]: 49 | ... _ = open(join(directory, filename), 'w') 50 | >>> mkdir(join(directory, "_minted-test")) 51 | >>> # Create non auxiliary files 52 | >>> _ = open(join(directory, '.fslckout'), 'w') 53 | 54 | >>> # Remove auxiliary files 55 | >>> for path in remove_auxiliary_files(directory, 56 | ... tm_bundle_support): 57 | ... print(path) 58 | _minted-test 59 | test.aux 60 | test.synctex.gz 61 | test.toc 62 | 63 | """ 64 | clean_command = join(tm_bundle_support, 'bin/clean.rb') 65 | return check_output('{} {}'.format(quote(clean_command), quote(directory)), 66 | universal_newlines=True, 67 | shell=True).split('\n')[:-1] 68 | -------------------------------------------------------------------------------- /Support/lib/Ruby/configuration.rb: -------------------------------------------------------------------------------- 1 | # -- Imports ------------------------------------------------------------------- 2 | 3 | require ENV['TM_SUPPORT_PATH'] + '/lib/osx/plist' 4 | 5 | # -- Class --------------------------------------------------------------------- 6 | 7 | # Extend the array class so we can easily check all types contained in a list. 8 | class Array 9 | def all_of_type?(type) 10 | entries.all? { |entry| entry.is_a?(type) } 11 | end 12 | end 13 | 14 | # -- Module -------------------------------------------------------------------- 15 | 16 | # This class provides access to the LaTeX configuration files. 17 | module Configuration 18 | class < 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | if [[ -z $TM_SELECTED_TEXT ]] 9 | then 10 | # If the cursor is inside empty braces {}, then offer 11 | # a list of all bibliography items. In that case, 12 | # the variable $phrase is not being set. 13 | prev_ch=${TM_CURRENT_LINE:$TM_LINE_INDEX-1:1} 14 | if [[ $prev_ch != '{' ]] 15 | then phrase=$TM_CURRENT_WORD 16 | fi 17 | else phrase=$TM_SELECTED_TEXT 18 | fi 19 | if [[ -z $phrase ]] 20 | then 21 | # Case where $phrase is not defined 22 | 23 | res=`osascript <<EOF 24 | tell application "Bibdesk" 25 | set publist to get displayed publications of the first item of documents 26 | set candidates to {} 27 | repeat with anItem in publist 28 | set candidates to candidates & ((cite key of anItem) & " % " & (last name of author of anItem) & ", " & (title of anItem)) 29 | end repeat 30 | end tell 31 | tell application "System Events" 32 | activate 33 | choose from list candidates 34 | end tell 35 | EOF` 36 | else 37 | # Case where $phrase is defined 38 | 39 | res=`osascript <<EOF 40 | tell application "Bibdesk" to set candidates to search for "$phrase" with for completion 41 | tell application "System Events" 42 | activate 43 | choose from list candidates 44 | end tell 45 | EOF` 46 | fi 47 | # If an error occurs, $? stores the return code. 48 | errorcode=$? 49 | # return control to TextMate 50 | osascript -e 'tell app "TextMate" to activate' &>/dev/null & 51 | # If user presses Cancel, then applescript returns false. 52 | if [[ (${res:0:5} == false) || ($errorcode != 0) ]] 53 | then exit_discard 54 | fi 55 | 56 | res=`perl -pe <<<$res 's/^(.*?)(\s*)%.*/$1/'` # strip comment 57 | res="${res//\\\\/\\\\}" # \ -> \\ 58 | res="${res//$/\\$}" # $ -> \$ 59 | 60 | echo -n $res 61 | #if [[ -z $TM_SELECTED_TEXT ]] && [[ -n $phrase ]] 62 | # then echo -n ${res:${#TM_CURRENT_WORD}} 63 | # else echo -n ${res} 64 | #fi 65 | # 66 | fallbackInput 67 | word 68 | input 69 | selection 70 | name 71 | BibDesk Completion 72 | output 73 | replaceSelectedText 74 | scope 75 | meta.citation.latex 76 | uuid 77 | F80F9C22-ABB8-11D9-957A-000D93589AF6 78 | 79 | 80 | -------------------------------------------------------------------------------- /Commands/Typeset And View PDF.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | autoScrollOutput 6 | 7 | beforeRunningCommand 8 | saveActiveFile 9 | bundleUUID 10 | 46788DCE-6227-11D9-BFB1-000D93589AF6 11 | command 12 | #!/usr/bin/env ruby18 13 | # coding: utf-8 14 | 15 | require ENV["TM_SUPPORT_PATH"] + "/lib/tm/process" 16 | require ENV["TM_SUPPORT_PATH"] + "/lib/tm/htmloutput" 17 | require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document" 18 | 19 | # To enable the typesetting of unsaved documents, you must change the “Save” setting of 20 | # this command to “Current File” and add the variable TM_LATEX_AUTOSAVE to TextMate's 21 | # Shell Variables preferences. Be warned that your document must be encoded as UTF-8 if 22 | # you exercise this option — becauseTextMate.save_current_document cannot know the file 23 | # encoding you prefer. 24 | 25 | TextMate.save_current_document unless ENV["TM_LATEX_AUTOSAVE"].nil? 26 | 27 | texmate = ENV["TM_BUNDLE_SUPPORT"] + "/bin/texmate.py" 28 | engine_version = TextMate::Process.run(texmate, "version") 29 | TextMate::HTMLOutput.show(:title => "Typesetting “#{ENV["TM_DISPLAYNAME"] || File.basename(ENV["TM_FILEPATH"])}”…", :sub_title => engine_version) do |io| 30 | TextMate::Process.run(texmate, 'latex', :interactive_input => false) do |line| 31 | io << line 32 | end 33 | end 34 | ::Process.exit($?.exitstatus || 0) # exitstatus is nil if our process is prematurely terminated (SIGINT) 35 | 36 | input 37 | document 38 | inputFormat 39 | text 40 | keyEquivalent 41 | @r 42 | name 43 | Typeset & View (PDF) 44 | outputCaret 45 | afterOutput 46 | outputFormat 47 | html 48 | outputLocation 49 | newWindow 50 | requiredCommands 51 | 52 | 53 | command 54 | kpsewhich 55 | locations 56 | 57 | /Library/TeX/texbin/kpsewhich 58 | /usr/texbin/kpsewhich 59 | /opt/local/bin/kpsewhich 60 | 61 | 62 | 63 | scope 64 | text.tex 65 | semanticClass 66 | process.run.tex 67 | uuid 68 | 6177C3DA-C580-11D9-B649-000393D4B5C8 69 | version 70 | 2 71 | 72 | 73 | -------------------------------------------------------------------------------- /Commands/Insert Item Based on Current Environment.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | # 10 | # Produces the right enumeration command for each environment. 11 | # For instance in a itemize environment, will produce \item 12 | # while in a questions environment will produce \question 13 | # 14 | linesbefore = ENV['TM_LINE_NUMBER'].to_i-1 15 | columns = ENV['TM_COLUMN_NUMBER'].to_i-1 16 | textArray = STDIN.readlines 17 | myStr = textArray[0..linesbefore-1].join 18 | myStr << textArray[linesbefore].slice(0..columns-1) 19 | theArray = Array.new 20 | theRegexp = Regexp.new('(\\\begin\{|\\\end\{)(\w+[*]?)(\})') 21 | toInsertNoBeamer = { "itemize" => "\\item $1", "enumerate" => "\\item $1", "description" => "\\item[${1:label}] ${2:description}", "parts" => "\\part $1", "questions" => "\\question $1" } 22 | toInsertBeamer = { "itemize" => "\\item<${1:+-}> $2", "enumerate" => "\\item<${1:+-}> $2", "description" => "\\item<+->[${1:label}] ${2:description}", "overprint" => "\\onslide<${1:+}>\n\t$2", "overlayarea" => "\\only<${1:+}> $2" } 23 | toInsert = /beamer/.match(ENV['TM_SCOPE'].to_s) ? toInsertBeamer : toInsertNoBeamer 24 | results = myStr.scan(theRegexp) 25 | if (results) 26 | results.each{|e| 27 | if (e[0] == "\\begin\{") 28 | theArray << e[1] 29 | elsif (e[0] == "\\end\{") 30 | if (theArray.last == e[1]) 31 | theArray.pop 32 | else 33 | puts("Badly nested begin-end blocks") 34 | exit 1 35 | end 36 | else 37 | puts("Problem:",e[0]) 38 | exit 1 39 | end 40 | } 41 | envName = theArray.pop 42 | str_to_add = "\n" 43 | if (/\\begin\{/.match(textArray[linesbefore])) 44 | str_to_add << "\t" 45 | end 46 | if (toInsert.has_key?(envName)) 47 | str_to_add << toInsert[envName] 48 | elsif ["cases","align","aligned","gather","gathered","split"].include?(envName) 49 | str_to_add = "\\\\\\\\" + str_to_add 50 | else 51 | str_to_add << "\\item " 52 | end 53 | print str_to_add 54 | else 55 | print("\n") 56 | end 57 | input 58 | document 59 | keyEquivalent 60 |  61 | name 62 | New Item 63 | output 64 | insertAsSnippet 65 | scope 66 | text.tex.latex meta.function.environment 67 | uuid 68 | 948DDCF2-0EB5-46A3-B970-09597D268BAF 69 | 70 | 71 | -------------------------------------------------------------------------------- /Commands/Insert LaTeX Command Based on Current Word.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | SUPPORT = ENV['TM_BUNDLE_SUPPORT'] 10 | require ENV['TM_SUPPORT_PATH'] + '/lib/ui' 11 | require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes' 12 | require SUPPORT + '/lib/Ruby/configuration.rb' 13 | @plist = Configuration.load 14 | shortcuts = @plist['environments'] 15 | lshortcuts = @plist['labeled_environments'] 16 | if ENV['TM_SCOPE'].match('beamer') then 17 | shortcuts.update(@plist['environments_beamer']) 18 | lshortcuts.update(@plist['labeled_environments_beamer']) 19 | end 20 | name = STDIN.read 21 | cmd = nil 22 | if name == "" then 23 | arr = ["custom…",nil] + (shortcuts.keys+lshortcuts.keys).sort 24 | ind = TextMate::UI.menu(arr) 25 | TextMate.exit_discard if ind.nil? 26 | if ind == 0 then 27 | name = "" 28 | else 29 | name = arr[ind] 30 | end 31 | end 32 | options = Array.new 33 | for key in shortcuts.keys do 34 | if shortcuts[key]['triggers'].index(name) then 35 | options << {:cmd => key, :setting => :no_label, :content => shortcuts[key]['content']} 36 | end 37 | end 38 | for key in lshortcuts.keys do 39 | if lshortcuts[key]['triggers'].index(name) then 40 | options << {:cmd => key, :setting => :label, :content => lshortcuts[key]['content']} 41 | end 42 | end 43 | opt = case options.length 44 | when 0 45 | nil 46 | when 1 47 | options[0] 48 | else 49 | ind = TextMate::UI.menu(options.map { |opt| opt[:cmd] }) 50 | ind.nil? ? nil : options[ind] 51 | end 52 | if !opt.nil? then 53 | print "\\begin{#{opt[:cmd]}}" 54 | print "\n" if opt[:setting] == :no_label 55 | print opt[:content] || "\t$0" 56 | print "\n\\end{#{opt[:cmd]}}" 57 | elsif name == "" 58 | print "\\begin{${1:env}}\n\t$0\n\\end{${1:env}}" 59 | else 60 | print "\\begin{#{name}}\n\t$0\n\\end{#{name}}" 61 | end 62 | 63 | fallbackInput 64 | word 65 | input 66 | selection 67 | inputFormat 68 | text 69 | keyEquivalent 70 | ^< 71 | name 72 | Environment Based on Current Word / Selection 73 | outputCaret 74 | afterOutput 75 | outputFormat 76 | snippet 77 | outputLocation 78 | replaceInput 79 | scope 80 | text.tex.latex 81 | uuid 82 | 521C9FC0-0B61-48C8-A76B-60A4AE8DF449 83 | version 84 | 2 85 | 86 | 87 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | This is the official repository for [TextMate](http://github.com/textmate/textmate)'s LaTeX bundle. For a description of some of the features provided by this bundle, please take a look at the [help document](Support/help/Help.pdf). 4 | 5 | # Installation 6 | 7 | You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. Please keep in mind that it sometimes takes a little while before [Michael](http://github.com/infininight) or [Allan](http://github.com/sorbits) have time to deploy the changes made to this bundle. 8 | 9 | If there are some changes that you want to test immediately, then please follow these instructions: 10 | 11 | 1. Uninstall the LaTeX bundle inside TextMate's preferences 12 | 2. Open Terminal 13 | 3. Go to the bundle folder: 14 | 15 | ```sh 16 | cd ~/Library/Application\ Support/TextMate/Managed/Bundles 17 | ``` 18 | 19 | 4. Clone the repository: 20 | 21 | ```sh 22 | git clone https://github.com/textmate/latex.tmbundle.git 23 | ``` 24 | 25 | 5. Restart TextMate (^ + + Q) to make sure it registered the changes 26 | 27 | # Feedback 28 | 29 | Before you report an issue please read the [ FAQ](http://github.com/textmate/latex.tmbundle/wiki/FAQ). You can report bugs or feature request via the [issue tracker](https://github.com/textmate/latex.tmbundle/issues). If you have a more general problem, then please use the [mailing list](http://lists.macromates.com/listinfo/textmate). 30 | 31 | # Contribute 32 | 33 | There are many ways in which you can contribute to the bundle: 34 | 35 | * Spread the word 36 | * Report bugs or tell us what features you want to see next 37 | * Show your appreciation by starring this repository 38 | * Improve the bundle by committing your own code 39 | 40 | Before you contribute any code, please read both the [bundle styleguide](http://kb.textmate.org/bundle_styleguide) and the [commit styleguide](http://kb.textmate.org/commit_styleguide). Please also make sure, that your changes do not break any of the [bundle tests](Makefile). 41 | 42 | # License 43 | 44 | If not otherwise specified (see below), files in this repository fall under the following license: 45 | 46 | Permission to copy, use, modify, sell and distribute this 47 | software is granted. This software is provided "as is" without 48 | express or implied warranty, and with no claim as to its 49 | suitability for any purpose. 50 | 51 | An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”. 52 | -------------------------------------------------------------------------------- /Tests/Log/latex.log: -------------------------------------------------------------------------------- 1 | This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex) 2 | restricted \write18 enabled. 3 | entering extended mode 4 | (./Embedded Operating Systems.tex 5 | Document Class: article 2007/10/19 v1.4h Standard LaTeX document class 6 | 7 | 8 | 9 | LaTeX Warning: Reference `figure:Operating_System_Layer' on page 3 undefined on 10 | input line 159. 11 | 12 | 13 | Underfull \hbox (badness 10000) in paragraph at lines 159--160 14 | 15 | 16 | LaTeX Warning: Citation `Software_Entwicklung' on page 3 undefined on input lin 17 | e 161. 18 | 19 | LaTeX Warning: Citation `Embedded_OS_Market_Share_2005' on page 5 undefined on 20 | input line 194. 21 | 22 | [28] (./Embedded Operating Systems.aux) 23 | 24 | Package rerunfilecheck Warning: File `"Embedded Operating Systems".out' has cha 25 | nged. 26 | (rerunfilecheck) Rerun to get outlines right 27 | (rerunfilecheck) or use package `bookmark'. 28 | 29 | LaTeX Font Warning: Font shape `OT1/cmss/m/n' in size <4> not available 30 | 31 | pdfTeX warning: pdflatex (file ./figure/figure_1.pdf): PDF inclusion: found PDF version <1.6>, but at most version <1.5> allowed 32 | 33 | ./makeglossaries.tex:22: Undefined control sequence. 34 | l.22 \blubber 35 | 36 | LaTeX Warning: There were undefined references. 37 | 38 | LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right. 39 | 40 | ) 41 | (see the transcript file for additional information){/usr/local/texlive/2014/te 42 | xmf-dist/fonts/enc/dvips/lm/lm-ec.enc}{/usr/local/texlive/2014/texmf-dist/fonts 43 | /enc/dvips/inconsolata/i4-t1-0.enc}{/usr/local/texlive/2014/texmf-dist/fonts/en 44 | c/dvips/lm/lm-ts1.enc}{/usr/local/texlive/2014/texmf-dist/fonts/enc/dvips/tex-g 45 | yre/q-ts1.enc}{/usr/local/texlive/2014/texmf-dist/fonts/enc/dvips/tex-gyre/q-ec 46 | .enc}{/usr/local/texlive/2014/texmf-dist/fonts/enc/dvips/base/8r.enc}< 48 | /usr/local/texlive/2014/texmf-dist/fonts/type1/public/kpfonts/jkpmi.pfb> 56 | Output written on "Embedded Operating Systems.pdf" (28 pages, 474379 bytes). 57 | Transcript written on "Embedded Operating Systems.log". 58 | -------------------------------------------------------------------------------- /Tests/Log/external_bibliography.log: -------------------------------------------------------------------------------- 1 | This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=latex 2014.7.25) 15 OCT 2014 17:40 2 | entering extended mode 3 | restricted \write18 enabled. 4 | %&-line parsing enabled. 5 | **external_bibliography.tex 6 | (./external_bibliography.tex 7 | LaTeX2e <2014/05/01> 8 | Babel <3.9k> and hyphenation patterns for 78 languages loaded. 9 | (/usr/local/texlive/2014/texmf-dist/tex/latex/base/article.cls 10 | Document Class: article 2007/10/19 v1.4h Standard LaTeX document class 11 | (/usr/local/texlive/2014/texmf-dist/tex/latex/base/size10.clo 12 | File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option) 13 | ) 14 | \c@part=\count79 15 | \c@section=\count80 16 | \c@subsection=\count81 17 | \c@subsubsection=\count82 18 | \c@p 19 | 20 | LaTeX Warning: There were undefined references. 21 | 22 | ) 23 | Output written on external_bibliography.dvi (1 page, 400 bytes). 24 | Transcript written on external_bibliography.log. 25 | exlive/2014/texmf-dist/tex/latex/cite/cite.sty 26 | LaTeX Info: Redefining \cite on input line 302. 27 | LaTeX Info: Redefining \nocite on input line 373. 28 | Package: cite 2010/09/10 v 5.3 29 | ) 30 | No file external_bibliography.aux. 31 | \openout1 = `external_bibliography.aux'. 32 | 33 | LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 4. 34 | LaTeX Font Info: ... okay on input line 4. 35 | LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 4. 36 | LaTeX Font Info: ... okay on input line 4. 37 | LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 4. 38 | LaTeX Font Info: ... okay on input line 4. 39 | LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 4. 40 | LaTeX Font Info: ... okay on input line 4. 41 | LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 4. 42 | LaTeX Font Info: ... okay on input line 4. 43 | LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 4. 44 | LaTeX Font Info: ... okay on input line 4. 45 | 46 | LaTeX Warning: Citation `Deltron3030' on page 1 undefined on input line 8. 47 | 48 | No file external_bibliography.bbl. 49 | [1 50 | 51 | ] (./external_bibliography.aux) 52 | 53 | LaTeX Warning: There were undefined references. 54 | 55 | ) 56 | Here is how much of TeX's memory you used: 57 | 301 strings out of 493118 58 | 3507 string characters out of 6135459 59 | 52906 words of memory out of 5000000 60 | 3847 multiletter control sequences out of 15000+600000 61 | 3948 words of font info for 15 fonts, out of 8000000 for 9000 62 | 1141 hyphenation exceptions out of 8191 63 | 23i,4n,20p,146b,119s stack positions out of 5000i,500n,10000p,200000b,80000s 64 | 65 | Output written on external_bibliography.dvi (1 page, 400 bytes). 66 | 67 | [][][][][] [] [] [] [][][][][]$\EU1/AvenirNext(0)/m/n/12 . From this we get tha 68 | t the union of $[][][][][] [] [][][][][] [] [] [] [][][][][]$ 69 | -------------------------------------------------------------------------------- /Preferences/Pairs - TeX.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Pairs: TeX 7 | scope 8 | text.tex.latex 9 | settings 10 | 11 | highlightPairs 12 | 13 | 14 | " 15 | " 16 | 17 | 18 | ( 19 | ) 20 | 21 | 22 | { 23 | } 24 | 25 | 26 | [ 27 | ] 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | « 47 | » 48 | 49 | 50 | 51 | 52 | 53 | 54 | $ 55 | $ 56 | 57 | 58 | ` 59 | ' 60 | 61 | 62 | | 63 | | 64 | 65 | 66 | smartTypingPairs 67 | 68 | 69 | " 70 | " 71 | 72 | 73 | ( 74 | ) 75 | 76 | 77 | { 78 | } 79 | 80 | 81 | [ 82 | ] 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | « 102 | » 103 | 104 | 105 | 106 | 107 | 108 | 109 | $ 110 | $ 111 | 112 | 113 | ` 114 | ' 115 | 116 | 117 | | 118 | | 119 | 120 | 121 | 122 | uuid 123 | 9DB450FC-3A71-44AF-B51D-4AB83E21A289 124 | 125 | 126 | --------------------------------------------------------------------------------