text:
# SublimeText/LaTeXTools

LaTeX plugin for Sublime Text 2 and 3
Python JavaScript Shell
Latest commit 4093635 Apr 28, 2016 Prepare new release
 Failed to load latest commit information. bibliography_plugins Apr 21, 2016 builders Feb 16, 2016 evince Oct 19, 2012 latex_chars Mar 26, 2016 latextools_plugin_internal Dec 3, 2015 latextools_utils Apr 20, 2016 messages Apr 28, 2016 skim Oct 6, 2012 viewers Apr 28, 2016 .gitignore Jun 21, 2013 .no-sublime-package Sep 10, 2013 00_reload_submodules.py Apr 19, 2016 Beamer boxes.sublime-snippet Apr 4, 2011 Beamer frame.sublime-snippet Apr 4, 2011 Beamer.sublime-completions Apr 23, 2012 Default (Linux).sublime-keymap Apr 19, 2016 Default (Linux).sublime-keymap.OLD Sep 17, 2012 Default (OSX).sublime-keymap Apr 19, 2016 Default (OSX).sublime-keymap.OLD Sep 17, 2012 Default (Windows).sublime-keymap Apr 19, 2016 Default (Windows).sublime-keymap.OLD Sep 17, 2012 LaTeX math.sublime-completions Aug 10, 2015 LaTeX.sublime-build Sep 17, 2013 LaTeX.sublime-build.OLD May 24, 2011 LaTeX.sublime-commands Jan 1, 2016 LaTeX.sublime-completions Jun 21, 2013 LaTeXTools Preferences.sublime-settings.OLD Mar 9, 2014 LaTeXTools.sublime-settings Apr 21, 2016 Main.sublime-menu Jan 1, 2016 README.markdown Apr 28, 2016 Remark.sublime-snippet Mar 12, 2014 Symbol List - Labels.tmPreferences Mar 27, 2011 Symbol List - Sections.tmPreferences Feb 18, 2013 Text boldface.sublime-snippet Oct 21, 2012 Text emphasize.sublime-snippet Oct 22, 2012 Text monospace.sublime-snippet May 21, 2013 Text underline.sublime-snippet Oct 22, 2012 Wrap in command.sublime-snippet Oct 22, 2012 Wrap in environment.sublime-snippet Oct 22, 2012 change_environment.py Nov 19, 2015 delete_temp_files.py Apr 20, 2016 detect_spellcheck.py Feb 5, 2016 figure.sublime-snippet Mar 5, 2015 getRegion.py May 8, 2015 getTeXRoot.py Feb 14, 2016 jumpToPDF.py Mar 1, 2016 jumpto_tex_file.py Dec 14, 2015 kpsewhich.py Dec 9, 2015 latexCommand.py Jul 3, 2013 latexDocumentationViewer.py Dec 8, 2015 latexEnvCloser.py Jul 3, 2013 latexEnvironment.py Oct 21, 2012 latexFillAll.py Dec 12, 2015 latex_cite_completions.py Apr 21, 2016 latex_cwl_completions.py Jan 8, 2016 latex_env_completions.py Dec 12, 2015 latex_input_completions.py Feb 8, 2016 latex_installed_packages.py Dec 8, 2015 latex_ref_cite_completions.py Dec 8, 2015 latex_ref_completions.py Dec 14, 2015 latextools_default_settings.py Dec 17, 2015 latextools_plugin.py Mar 25, 2016 makePDF.py Mar 13, 2016 messages.json Apr 28, 2016 migrate.py Jan 1, 2016 parseTeXlog.py Jan 3, 2016 table.sublime-snippet Mar 5, 2015 texMacro.py Mar 22, 2011 texSections.py Jul 3, 2013 texSyntaxListener.py Apr 28, 2016 toggle_auto.py Dec 8, 2015 toggle_focus.py Dec 8, 2015 toggle_fwdsync.py Dec 8, 2015 toggle_show.py Oct 4, 2015

# LaTeX Plugin for Sublime Text 2 and 3

by Ian Bacher and Marciano Siniscalchi

Marciano's blog: [http://tekonomist.wordpress.com]

Additional contributors (thank you thank you thank you): first of all, Wallace Wu and Juerg Rast, who contributed code for multifile support in ref and cite completions, "new-style" ref/cite completion, and project file support. Also, skuroda (Preferences menu), Sam Finn (initial multifile support for the build command); Daniel Fleischhacker (Linux build fixes), Mads Mobaek (universal newline support), Stefan Ollinger (initial Linux support), RoyalTS (aka Tobias Schidt?) (help with bibtex regexes and citation code, various fixes), Juan Falgueras (latexmk option to handle non-ASCII paths), Jeremy Jay (basic biblatex support), Ray Fang (texttt snippet), Ulrich Gabor (tex engine selection and cleaning aux files), Wes Campaigne and 'jlegewie' (ref/cite completion 2.0!). Huge thanks to Daniel Shannon (aka phyllisstein) who first ported LaTeXTools to ST3. Also thanks for Charley Peng, who has been assisting users and generating great pull requests; I'll merge them as soon as possible. Also William Ledoux (various Windows fixes, env support), Sean Zhu (find Skim.app in non-standard locations), Maximilian Berger (new center/table snippet), Lucas Nanni (recursively delete temp files), Sergey Slipchenko ($ auto-pairing with Vintage) Ian Bacher (use kpsewhich to find bib files in the TEXMF tree; reworked fill-all command; jump to tex files improvements; delete temp files improvements; builder options; improved LaTeX-cwl support), btstream (original fill-all command; LaTeX-cwl support), Richard Stein (auto-hide build panel, jump to included tex files, LaTeX-cwl support config, TEX spellcheck support, functions to analyze LaTeX documents, cache functionality), Dan Schrage (nobibliography command), PoByBolek (more biblatex command), Rafael Lerm (support for multiple lines in \bibliography commands). If you have contributed and I haven't acknowledged you, email me! Latest revision: v3.7.9 (2016-04-26). Headline features: • New viewers for Preview.app and Okular • New bibliography parser available (see the settings file) • Support for most citation commands, especially using BibLaTeX Reminder: See the Settings section for details on the Settings system, which was updated in v3.6.1 (2016-01-01). Note: If you've been following along with the v3.7.x release, v3.7.7 is a major change. I've restored the previous bibliography parsing from v3.6 and earlier as default. If you want to use the new parsing, you need to change the bibliography setting to "new_bibliography". Thanks to everyone who has filed bug reports. At present, all the reported bugs should be resolved, but I'm not certain that some don't remain (BibTeX is a wild world) and the older parsing seems to be substantially faster for those with extremely large bibliographies. ## Introduction This plugin provides several features that simplify working with LaTeX files: • The ST build command takes care of compiling your LaTeX source to PDF using texify (Windows/MikTeX) or latexmk (OSX/MacTeX, Windows/TeXlive, Linux/TeXlive). Then, it parses the log file and lists errors and warning. Finally, it launches (or refreshes) the PDF viewer (SumatraPDF on Windows, Skim on OSX, and Evince on Linux by default) and jumps to the current cursor position. • Forward and inverse search with the named PDF previewers is fully supported • Easy insertion of references and citations (from BibTeX files) • Plugs into the "Goto anything" facility to make jumping to any section or label in your LaTeX file(s) • Smart command completion for a variety of text and math commands is provided • Additional snippets and commands are also provided • The build command is fully customizable, as is the PDF previewer. ## Requirements and Setup First, you need to be running Sublime Text 2 or 3 (ST2 and ST3 henceforth, or simply ST to refer to either ST2 or ST3). For ST3, this has been tested against the latest beta builds. Second, get the LaTeXTools plugin. These days, the easiest way to do so is via Package Control: see here for details on how to set it up (it's very easy). Once you have Package Control up and running, invoke it (via the Command Palette from the Tools menu, or from Preferences), select the Install Package command, and look for LaTeXTools. If you prefer a more hands-on approach, you can always clone the git repository, or else just grab this plugin's .zip file from GitHub and extract it to your Packages directory (you can open it easily from ST, by clicking on Preferences|Browse Packages). Then, (re)launch ST. Please note that if you do a manual installation, the Package must be named "LaTeXTools". I encourage you to install Package Control anyway, because it's awesome, and it makes it easy to keep your installed packages up-to-date (see the aforelinked page for details). Third, follow the OS-specific instructions below. On OSX, you need to be running the MacTeX distribution (which is pretty much the only one available on the Mac anyway). Just download and install it in the usual way. I have tested MacTeX versions 2010--2014, both 32 and 64 bits; these work fine. MacTeX 2015 also works. On the other hand, MacTeX 2008 does not seem to work out of the box (compilation fails), so please upgrade. It is recommended that you install the Skim PDF viewer, as this provides support for forward and inverse search. By default, LaTeXTools assumes that you're using Skim. If you're not using Skim, see the section on viewers below. El Capitan note: sadly, with each OS X release, Apple deviates more and more from established Unix conventions. The latest "innovation" is that, beginning with El Capitan, apps can no longer write to /usr. MacTeX 2015 remedies this by creating a link to TeX binaries in /Library/TeX. The default LaTeXTools settings file now adds /Library/TeX/texbin to the texpath. In practice, this means the following. • If you are running MacTeX 2015 and have not customized the texpath option in your user settings file, you do not need to take further action. • If you are running MacTex 2015 and have customized texpath, open your user settings file (remember, you can do so from the Preferences | Package Settings | LaTeXTools submenu) and add /Library/TeX/texbin as the first entry in texpath. • If you are running earlier MacTeX versions, unfortunately you do not have the /Library/TeX/texbin link at all, so adding that path to texpath would not help. You have two options: create the link yourself, or edit the texpath option to point to the appropriate directory. Check Section 8 of this document for details. Sorry for the complications. It's not my fault. If you don't want to install the entire MacTeX distro, which is pretty big, BasicTeX will also work (of course, as long as the latex packages you need are included). However, you need to explicitly add the latexmk utility, which is not included by default: from the Terminal, type sudo tlmgr install latexmk (you will need to provide your password, assuming you are Administrator on your machine). To configure inverse search, open the Preferences dialog of the Skim app, select the Sync tab, then: • uncheck the "Check for file changes" option • choose the Sublime Text 2 or Sublme Text 3 preset (yes, Skim now supports both ST2 and ST3 by default!) In case you are using an old version of Skim, you can always choose the Custom preset and enter /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl (for ST3) in the Command field, and "%file":%line in the Arguments field. (This is correct as of 7/18/2013; you may want to double-check that ST3 is indeed in /Applications/Sublime Text; just go to the Applications folder in the Finder. Adapt as needed for ST2). Finally, edit the file LaTeXTools.sublime-settings in the User directory to make sure that the configuration reflects your preferred TeX distribution. Open the file and scroll down to the section titled "Platform settings." Look at the block for your OS, namely "osx". Within that block, verify that the "texpath" setting is correct. Note that "texpath" must include $PATH somewhere.

On Windows, both MikTeX and TeXlive are supported. It is recommded that you use the Sumatra PDF viewer, as using another viewer will require more configuration, but see the section on viewers below. If you do use Sumatra, you must be running a current (>=1.4) version. Install these as usual. If you are using Sumatra, add the SumatraPDF directory to your PATH or configure the sumatra setting in the windows platform setting of your LaTeXTools.sublime-settings in your User directory.

You now need to set up inverse search in Sumatra PDF. However, the GUI for doing this is hidden in Sumatra until you open a PDF file that has actual synchronization information (that is, an associated .synctex.gz file): see here. If you have one such file, then open it, go to Settings|Options, and enter "C:\Program Files\Sublime Text 2\sublime_text.exe" "%f:%l" for ST2, and "C:\Program Files\Sublime Text 3\sublime_text.exe" "%f:%l" for ST3, as the inverse-search command line (in the text-entry field at the bottom of the options dialog). If you don't already have a file with sync information, you can easily create one: compile any LaTex file you already have (or create a new one) with pdflatex -synctex=1 <file.tex>, and then open the resulting PDF file in SumatraPDF.

As an alternative, you can open a command-line console (run cmd.exe), and issue the following command:

sumatrapdf.exe -inverse-search "\"C:\Program Files\Sublime Text 2\sublime_text.exe\" \"%f:%l\""

(this assumes that sumatraPDF is in your path; replace 2 with 3 for ST3 of course). I'm sorry this is not straightforward---it's not my fault :-)

Finally, edit the file LaTeXTools.sublime-settings in the User directory to make sure that the configuration reflects your preferred TeX distribution. Open the file and scroll down to the section titled "Platform settings." Look at the block for your OS, namely windows. Within that block, verify that the texpath setting is correct; for MiKTeX, you can leave this empty, i.e., "". If you do specify a path, note that it must include the system path variable, i.e., $PATH (this syntax seems to be OK). Also verify that the distro setting is correct: the possible values are "miktex" and "texlive". TeXlive has one main advantage over MikTeX: it supports file names and paths with spaces. Linux support is coming along nicely. However, as a general rule, you will need to do some customization before things work. This is due to differences across distributions (a.k.a. "fragmentation"). Do not expect things to work out of the box. You need to install TeXlive; if you are on Ubuntu, note that apt-get install texlive will get you a working but incomplete setup. In particular, it will not bring in latexmk, which is essential to LaTeXTools. You need to install it via apt-get install latexmk. If on the other hand you choose to install the TeXlive distro from TUG, latexmk comes with it, so you don't need to do anything else. Also, to get inverse search working on ST3, make sure you set the sublime option in LaTeXTools.sublime-settings correctly; the Ubuntu package from the ST web page uses subl, but check from the command line first. You also need to edit the file LaTeXTools.sublime-settings in the User directory to make sure that the configuration reflects your preferred TeX distribution. Open that file and scroll down to the section titled "Platform settings." Look at the block for your OS, namely "linux". Within that block, verify that the "texpath" setting is correct. Notice that this must include $PATH somewhere, or things will not work.

You may also have to set the command option in "builder_settings", which tells the builder how to invoke latexmk. By default (i.e., if command is empty or not given) it is ["latexmk", "-cd", "-e", "-f", "-pdf", "-interaction=nonstopmode", "-synctex=1"].

If you customize the command to include a custom PDF command, users have reported the following possible issues and fixes (thanks!), so if you get a "Cannot compile!" error, try the following:

• some distros do not want a space before and after the = in $pdflatex = %E. But some do want the space there (sigh!) • sometimes latexmk is not on the PATH, or the path is not correctly picked up by ST. In this case, instead of "latexmk", use "/usr/bin/latexmk" or wherever latexmk is in your system. • some distros require quoting the $pdflatex assignment, as in "$pdflatex = \"'%E -interaction=nonstopmode -synctex=1 %S %O'\"" There are several variants to deal with; each distro is a little bit different, so there are basically no universal defaults. There's not much I can do about it. Good luck! Only support for the Evince PDF viewer is built-in, but see the section on viewers below for details on how to setup other viewers. Evince is installed by default on Ubuntu or, more generally, any distro that provides the Gnome desktop, and you don't need to configure anything. Backward and forward search Work For Me (TM). Hopefully they will work for you, too, but let me know if this is not the case. ## Keybindings Keybindings have been chosen to make them easier to remember, and also to minimize clashes with existing (and standard) ST bindings. I am taking advantage of the fact that ST supports key combinations, i.e. sequences of two (or more) keys. The basic principle is simple: • Most LaTeXTools facilities are triggered using Ctrl+l (Windows, Linux) or Cmd+l (OS X), followed by some other key or key combination • Compilation uses the standard ST "build" keybinding, i.e. Ctrl-b on Windows and Linux and Cmd-b on OS X. So does the "goto anything" facility (though this may change). For example: to jump to the point in the PDF file corresponding to the current cursor position, use Ctrl-l, j: that is, hit Ctrl-l, then release both the Ctrl and the l keys, and quickly type the j key (OS X users: replace Ctrl with Cmd). To wrap the selected text in an \emph{} command, use Ctrl-l, Ctrl-e: that is, hit Ctrl-l, release both keys, then hit Ctrl-e (again, OS X users hit Cmd-l and then Cmd-e). Ctrl-l (Cmd-l on OS X) is the standard ST keybinding for "expand selection to line"; this is remapped to Ctrl-l,Ctrl-l (Cmd-l,Cmd-l on OS X). This is the only standard ST keybinding that is affected by the plugin---an advantage of new-style keybindings. Most plugin facilities are invoked using sequences of 2 keys or key combinations, as in the examples just given. A few use sequences of 3 keys or key combinations. Henceforth, I will write C- to mean Ctrl- for Linux or Windows, and Cmd- for OS X. You know your platform, so you know what you should use. In a few places, to avoid ambiguities, I will spell out which key I mean. ## Compiling LaTeX files Keybinding: C-b (standard ST keybinding) LaTeXTools offers a fully customizable build process. This section describes the default process, also called "traditional" because it is the same (with minor tweaks) as the one used in previous releases. However, see below for how to customize the build process. The default ST Build command takes care of the following: • It saves the current file • It invokes the tex build command (texify for MikTeX; latexmk for TeXlive and MacTeX). • It parses the tex log file and lists all errors, warnings and, if enabled, bad boxes in an output panel at the bottom of the ST window: click on any error/warning/bad boxes to jump to the corresponding line in the text, or use the ST-standard Next Error/Previous Error commands. • It invokes the PDF viewer for your platform and performs a forward search: that is, it displays the PDF page where the text corresponding to the current cursor position is located. Project files are fully supported! Some of the options related to building tex files are described here. However, you should consult the subsection on project-specific settings for further details. Multi-file documents are supported as follows. If the first line in the current file consists of the text %!TEX root = <master file name>, then tex & friends are invoked on the specified master file, instead of the current one. Note: the only file that gets saved automatically is the current one. Also, the master file name must have a valid tex extension (i.e., one configured in the tex_file_exts settings), or it won't be recognized. As an alternative, to using the %!TEX root = <master file name> syntax, if you use a Sublime project, you can set the TEXroot option (under settings): { ... <folder-related settings> ... "settings": { "TEXroot": "yourfilename.tex" } } Note that if you specify a relative path as the TEXroot in the project file, the path is determined relative to the location of the project file itself. It may be less ambiguous to specify an absolute path to the TEXroot if possible. TeX engine selection is supported. If the first line of the current file consists of the text %!TEX program = <program>, where program is pdflatex, lualatex or xelatex, the corresponding engine is selected. If no such directive is specified, pdflatex is the default. Multi-file documents are supported: the directive must be in the root (i.e. master) file. Also, for compatibility with TeXshop, you can use TS-program instead of program. Note: for this to work, you must not customize the command option in LaTeXTools.sublime-settings. If you do, you will not get this functionality. Finally, if you use project files, the program builder setting can also be customized there, under settings. TeX options: you can pass TeX options to your engine in two ways (thanks Ian Bacher!). One is to use a %!TEX options = ... line at the top of your file. The other is to use the options builder setting in your settings file. This can be useful, for instance, if you need to allow shell escape. Finally, if you use project files, the options builder setting can also be customized there (again, under settings). Customizing or replacing the compilation command (latexmk or texify) is also possible by setting the command option under Builder Settings. If you do, the TeX engine selection facility may no longer work because it relies on a specific compilation command. However, if you want to customize or replace latexmk/texify, you probably know how to select the right TeX engine, so this shouldn't be a concern. Also note that if you are using latexmk and you set the $pdflatex variable, the TeX options facility will not function, as latexmk does not support this. See the Settings option below for details. Note: if you change the compilation command, you are responsible for making it work on your setup. Only customize the compilation command if you know what you're doing.

### Toggling window focus following a build

Keybinding: C-l,t,f (yes, this means C-l, then t, then f)

By default, after compilation, the focus stays on the ST window. This is convenient if you like to work with the editor and PDF viewer window open side by side, and just glance at the PDF output to make sure that all is OK. If however the editor and viewer windows overlap (e.g. if you have a small screen), you may prefer the viewer window to get the focus (i.e. become the foremost window) after compiling. To this end, you can use the toggle_focus command to change this behavior. The first time you invoke this command, the focus will shift to the viewer window after compiling the current file; if you invoke the command again, the post-compilation focus reverts to the editor window. Every time you invoke toggle_focus, a message will appear in the status bar.

You can change the default focus behavior via the keep_focus option: see the "Settings" section below.

### Toggling PDF syncing (forward search) following a build

Keybinding: C-l,t,s

By default, after compilation, LaTeXTools performs a 'forward search' so that the PDF viewer shows the point in the PDF file corresponding to the current cursor position in ST (by the way, you can trigger a forward search at any other time, not just when you are compiling: see below). If for whatever reason you don't like this behavior, you can turn it off using the toggle_fwdsync command. As for toggle_focus, a message will appear in the status bar to reflect this.

You can also change the default sync behavior via the forward_sync option: see the "Settings" section below.

### Checking the status of toggles and defaults

Keybinding: C-l,t,?

This causes the status message to list the default settings of the focus and sync options, and their current toggle values. It also display the status of the ref/cite auto trigger toggles (see below).

### Removing temporary files from build

Keybinding: C-l,backspace

This deletes all temporary files from a previous build (the PDF file is kept). Subfolders are traversed recursively.

Two settings allow you to fine-tune the behavior of this command. temp_files_exts allows you to specify which file extensions should be considered temporary, and hence deleted. temp_files_ignored_folders allows you to specify folders that should not be traversed. A good example are .git folders, for people who use git for version control.

### Automatically hide build panel after build finished

To automatically hide the build panel set the option hide_build_panel in the settings file. Possible values are:

• always: always hide the panel even if the build failed
• no_errors: only hide the panel if the build was successful althrough warnings appear
• no_warnings: only hide the build panel if neither errors nor warnings occur
• no_badboxes: only hide the build panel if there are no errors, warnings, or bad boxes
• never: never hide the build panel

## Forward and Inverse Search

Keybinding: C-l,j (for forward search; inverse search depends on the previewer)

When working in an ST view on a TeX document, C-l,j will display the PDF page where the text corresponding to the current cursor position is located; this is called a "forward search". The focus is controlled by the C-l,t,f toggle setting and the keep_focus option.

If you are viewing a PDF file, then hitting CMD+Shift+Click in Skim (OSX), double-clicking in Sumatra (Windows), or hitting Ctrl+click in Evince (Linux) will bring you to the location in the source tex file corresponding to the PDF text you clicked on. This is called "inverse search".

To open a PDF file without performing a forward search, use C-l,v.

For support of forward and inverse search in other viewers, see the viewer section below.

## References and Citations

Keybinding: autotriggered by default (see below). Otherwise, C-l,x for 'cross-reference,' or C-l,C-f (via the Fill Helper facility: see below). These are fully equivalent ways of invoking ref/cite completions.

The basic idea is to help you insert labels in \ref{} commands and bibtex keys in \cite{} commands. The appropriate key combination shows a list of available labels or keys, and you can easily select the appropriate one. Full filtering facilities are provided.

Notes:

1. In order to find all applicable labels and bibtex keys, the plugin looks at the saved file. So, if you invoke this command and do not see the label or key you just entered, perhaps you haven't saved the file.

2. Only bibliographies in external .bib files are supported: no \bibitem.... Sorry. It's hard as it is.

3. Multi-file documents are fully supported.

Now for the details. (Many of these features were contributed by Wes Campaigne and jlewegie, whom I thank profusely.)

By default, as soon as you type, for example, \ref{ or \cite{, a quick panel is shown (this is the fancy drop-down list ST displays at the top of the screen), listing, respectively, all the labels in your files, or all the entries in the bibliographies you reference your file(s) using the \bibliography{} command. This is the default auto-trigger behavior, and it can be a big time saver. You can, however, turn it off, either temporarily using a toggle, or permanently by way of preference settings: see below. Once the quick panel is shown, you can narrow down the entries shown by typing a few characters. As with any ST quick panel, what you type will be fuzzy-matched against the label names or, for citations, the content of the first displayed line in each entry (by default, the author names, year of publication, short title and citation key: see below). This is wildly convenient, and one of the best ST features: try it!

If auto-triggering is off, when you type e.g. \ref{, ST helpfully provides the closing brace, leaving your cursor between the two braces. Now, you need to type C-l,x to get the quick panel showing all labels in the current file. You can also type e.g. \ref{aa [again, the closing brace is provided by ST], then C-l, x, and LaTeXTools will show a list of labels that fuzzy-match the string aa.

In either case, you then select the label you want, hit Return, and LaTeXTools inserts the full ref command, as in \ref{my-label}. The LaTeX command \eqref works the same way. Citations from bibtex files are also supported in a similar way. Use \cite{}, \citet{}, \citeyear{} etc.

One often needs to enter multiple citations, as e.g. in \cite{paper1,paper2}. This is easy to do: either cite the first paper, e.g. \cite{paper1} and then, with your cursor immediately before the right brace, type a comma (,). Again, the default auto-trigger behavior is that the quick panel with appear, and you can select the second paper. If auto-trigger is off, then you enter the comma, then use the shortcut C-l,x to bring up the quick panel (note: you must add the comma before invoking the shortcut, or you won't get the intended result). Of course, you can enter as many citations as you want.

The display of bibliographic entries is customizable. There is a setting, cite-panel-format, that controls exactly what to display in each of the two lines each entry gets in the citation quick panel. Options include author, title, short title, year, bibtex key, and journal. This is useful because people may prefer to use different strategies to refer to papers---author-year, short title-year, bibtex key (!), etc. Since only the first line in each quick panel entry is searchable, how you present the information matters. The default should be useful for most people; if you wish to change the format, check the LaTeXTools.sublime-settings file for detailed information. (As usual, copy that file to the User directory and edit your copy, not the original). s

Thanks to recent contributed code, multi-file documents are fully supported. LaTeXTools looks for references, as well as \bibliography{} commands, in the root file and in all recursively included files. Please see the information on multi-file documents in the section on Compiling LaTeX Files for details on how to setup multi-file documents

LaTeXTools now also looks \addbibresource{} commands, which provides basic compatibility with biblatex.

### Toggle auto trigger mode on/off

Keybinding: C-l,t,a,r for references; C-l,t,a,c for citations

These toggles work just like the sync and focus toggles above. Indeed, C-l,t,? will now also display the status of the auto trigger toggles. Check the status bar for feedback (i.e. to see what the current state of the toggle is), but remember the message stays on for only a few seconds. C-l,t,? is your friend.

### Old-style, deprecated functionality

For now, completions are also injected into the standard ST autocompletion system. Thus, if you hit Ctrl-space immediately after typing, e.g., \ref{}, you get a drop-down menu at the current cursor position (not a quick-panel) showing all labels in your document. However, the width of this menu is OK for (most) labels, but not really for paper titles. In other words, it is workable for references, but not really for citations. Furthermore, there are other limitations dictated by the ST autocompletion system. So, this is deprecated, and I encourage you to use auto-trigger mode or the C-l,x or C-l,C-f keybindings instead.

## Fill Helper: filling in package and file names automatically

Keybinding: autotriggered by default (see below). Otherwise, C-l,C-f.

Thanks to the amazing work by users btstream and Ian Bacher, LaTeXTools now offers a list of available files and packages when using commands such as \usepackage, \include, \includegraphics, \includesvg and \input. Assuming autocompletion is toggled on (the default):

• when you type \usepackage{, a list of available package is displayed in the ST drop-down menu. Pick the one you need, and it will be inserted in your file, with a closing brace.

• when you type any of the file-related input commands, a list of files in the current directory is displayed (suitably filtered, so graphics files are displayed for \includegraphics).

To toggle autocompletion on or off, use the fill_auto_trigger setting, or the c-l,t,a,f toggle.

In order for package autocomplete to work, you need to create a cache first. You can do it using the Command Palette: select LaTeXtools: Build cache for LaTeX packages.

The C-l,C-f keyboard shortcut also works for \ref and \cite completion. Basically, wherever you can use C-l,x, you can also use C-l,C-f.

## Jumping to sections and labels

Keybinding: C-r (standard ST keybinding)

The LaTeXtools plugin integrates with the awesome ST "Goto Anything" facility. Hit C-rto get a list of all section headings, and all labels. You can filter by typing a few initial letters. Note that section headings are preceded by the letter "S", and labels by "L"; so, if you only want section headings, type "S" when the drop-down list appears.

Selecting any entry in the list will take you to the corresponding place in the text.

## Jumping to included files

Keybinding: C-l, C-o (only works if the cursor is in the same line as the include command)

LaTeX files To open a LaTeX file, which is included with \input, \include or \subfile just position the cursor inside the include command and press C-l, C-o. This will open the included file in Sublime Text.

If necessary missing folders and the file will be created. In this case the magic root entry will be written into the file. Hence this command can be used to comfortably create files and open files.

Image files To open an image, which is included with \includegraphics just position the cursor inside the command and press C-l, C-o. This will open the image. The program to open the image can be configured in the LaTeXTools settings in the open_image_command attribute.

The following settings are provided:

• image_types: a list of the image file types used in the \includegraphics command. This list is also used in the Fill Helper and to determine missing extensions to open images. When opening an image the image_types-list will be matched from left to right.
• open_image_command: the command/program to open an image used in the \includegraphics command. This commands can be configured OS-specific. For each OS you can create a list, which will be searched top-down for the matching extension. Each entry in the list has a command and extension field. The command is a string and will be executed with the file path appended, if the extension matches the extension of the file. You can optionally use $file inside the string to insert the file path at an arbitrary position. The extension can either be a string or a list of string. If it is missing, the command will be executed for every file type. ## LaTeX commands and environments Keybindings: C-l,c for commands and C-l,e for environments To insert a LaTeX command such as \color{} or similar, type the command without backslash (i.e. color), then hit C-l,c. This will replace e.g. color with \color{} and place the cursor between the braces. Type the argument of the command, then hit Tab to exit the braces. Similarly, typing C-l,e gives you an environment: e.g. test becomes \begin{test} \end{test}  and the cursor is placed inside the environment thus created. Again, Tab exits the environment. Note that all these commands are undoable: thus, if e.g. you accidentally hit C-l,c but you really meant C-l,e, a quick C-z, followed by C-l,e, will fix things. ## Wrapping existing text in commands and environments Keybindings: C-l,C-c, C-l, C-n, etc. The tab-triggered functionality just described is mostly useful if you are creating a command or environment from scratch. However, you sometimes have existing text, and just want to apply some formatting to it via a LaTeX command or environment, such as \emph or \begin{theorem}...\end{theorem}. LaTeXTools' wrapping facility helps you in just these circumstances. All commands below are activated via a key binding, and require some text to be selected first. Also, as a mnemonic aid, *all wrapping commands involve typing C-l,C-something (which you can achieve by just holding the C- key down after typing l). • C-l,C-c wraps the selected text in a LaTeX command structure. If the currently selected text is blah, you get \cmd{blah}, and the letters cmd are highlighted. Replace them with whatever you want, then hit Tab: the cursor will move to the end of the command. • C-l,C-e gives you \emph{blah}, and the cursor moves to the end of the command. • C-l,C-b gives you \textbf{blah} • C-l,C-u gives you \underline{blah} • C-l,C-t gives you \texttt{blah} • C-l,C-n wraps the selected text in a LaTeX environment structure. You get \begin{env},blah, \end{env} on three separate lines, with env selected. Change env to whatever environment you want, then hit Tab to move to the end of the environment. These commands also work if there is no selection. In this case, they try to do the right thing; for example, C-l,C-e gives \emph{} with the cursor between the curly braces. You can also change the current environment using the C-l,C-Shift-n shortcut. Note well how this works. First, the cursor must be inside the environment you are interested in. Second, the command selects the environment name in the \begin{env} command and also in the \end{env} command (using ST's multiple-selection support). This way you can rename the environment as needed. Remember to exit multiple-selection mode when you are done by pressing the ESC key. ## LaTeX-cwl support LaTeXTools automatically supports the LaTeX-cwl autocompletion package. If the package is installed, support is automatically enabled. By default, as soon as one types, e.g., \te, a popup is shown displaying possible completions, including e.g. \textit and the like. I personally don't use it, but many find it useful. The following settings are provided: • cwl_list: a list of paths to the cwl files • command_completion: when to show that cwl completion popup. The possible values are: • prefixed (default): show completions only if the current word is prefixed with \ • always: always show cwl completions • never: never display the popup • env_auto_trigger: if true, autocomplete environment names upon typing \begin{ or \end{ (default: false) ## Command completion, snippets, etc. By default, ST provides a number of snippets for LaTeX editing; the LaTeXTools plugin adds a few more. You can see what they are, and experiment, by selecting Tools|Snippets|LaTeX and Tools|Snippets|LaTeXTools from the menu. In addition, the LaTeXTools plugin provides useful completions for both regular and math text; check out files LaTeX.sublime-completions and LaTeX math.sublime-completions in the LaTeXTools directory for details. Some of these are semi-intelligent: i.e. bf expands to \textbf{} if you are typing text, and to \mathbf{} if you are in math mode. Others allow you to cycle among different completions: e.g. f in math mode expands to \phi first, but if you hit Tab again you get \varphi; if you hit Tab a third time, you get back \phi. ## Viewers By default, LaTeXTools supports the following viewers, depending on platform: • On OS X, Skim • On Windows, Sumatra • On Linux, Evince However, there is now support for custom viewers, if not a lot of choice available at the moment (patches welcome). Currently the only non-default viewers supported are Preview on OS X and Okular on Linux. Preview can be selected by changing the viewer setting in your LaTeXTools preferences to "preview". Okular can be used by changing the viewer setting in your LaTeXTools preferences to "okular". ### Command Viewer Some support for other viewers is provided via the command viewer, which allows the execution of arbitrary commands to view a pdf or perform a forward search. At the very least this provides a way to use okular. Using the command viewer requires that you configure the command(s) to be run in the platform-specific part of the viewer_settings block in your LaTeXTools preferences. There are three commands available: • forward_sync_command: the command to executing a forward search (ctrl + l, j or cmd + l, j). • view_command: the command to simply view the PDF document. Of these, on view_command needs to be specified, though you will not have forward search capabilities unless you specify a forward_sync_command as well. The following variables will be substitued with appropriate values inside your commands: Variable Description$pdf_file full path of PDF file, e.g. C:\Files\document.pdf
$pdf_file_name name of the PDF file, e.g. document.pdf$pdf_file_ext extension of the PDF file, e.g. pdf
$pdf_file_base_name name of the PDF file without the extension, e.g. document$pdf_file_path full path to directory containing PDF file, e.g. C:\Files
$sublime_binary full path to the Sublime binary In addition, the following variables are available for the forward_sync_command only: Variable Description$src_file full path of the tex file, e.g. C:\Files\document.tex
$src_file_name name of the tex file, e.g., document.tex$src_file_ext extension of the tex file, e.g. tex
$src_file_base_name name of the tex file without the extension, e.g. document$src_file_path full path to directory containing tex file, e.g. C:\Files
$line line to sync to$col column to sync to

If none of these variables occur in the command string, the $pdf_file will be appended to the end of the command. Commands are executed in the $pdf_file_path, i.e., the folder containing the $pdf_file. For example, you can use the command viewer to support Okular with the following settings in your LaTeXTools.sublime-settings file: "viewer": "command", "viewer_settings": { "linux": { "forward_sync_command": "okular --unique$pdf_file#src:$line$src_file",
"view_command": "okular --unique"
}
}

## Support for non-.tex files

LaTeXTools has some degree of support for LaTeX documents that are in files with an extension other than .tex. In particular, this feature is designed to work well with alternative extensions, such as .ltx. Other extensions such as .Rnw and .tikz are supported, but, for now they will be treated as standard LaTeX documents (patches are always welcome!).

This behaviour is controlled through two settings, tex_file_exts and latextools_set_syntax.

• tex_file_exts (['.tex']): a list of extensions that should be considered TeX documents. Any extensions in this list will be treated exactly the same as .tex files: they can serve as the TeX master file, they will be searched (if included) for labels or bibliographies, etc.
• latextools_set_syntax (true): if true LaTeXTools will automatically set the syntax to LaTeX when opening or saving any file with an extension in the tex_file_exts list.

Note that while the extension detection is used by features of LaTeXTools, including, other features---especially the auto-completions---depend on the syntax of the file being set to LaTeX as well.

## Spell-checking

LaTeXTools parses the %!TEX spellcheck directive to set the language for the spell-checker integrated in Sublime Text. The Dictionaries package is recommended and supported. If you have additional dictionaries, you can add them using the tex_spellcheck_paths setting. This is a mapping from the locales to the dictionary paths. Each locale must be lowercase and minus (-) separated and the dictionary paths must be compatible with the Sublime Text spell-checker. For example {"en-us": "Packages/Language - English/en_US.dic"} would be a valid value.

## Miscellaneous

You can consult the documentation for any LaTeX package by invoking the View Package Documentation command via the Command Palette (for now).

## Settings

LaTeXTools supports user-defined settings. The settings file is called LaTeXTools.sublime-settings. A default version resides in the LaTeXTools plugin directory and must not be edited. This contains default settings that will work in many cases, for standard configurations of TeX distros and PDF viewers. You can however create another settings file in your User directory; again, the file must be named LaTeXTools.sublime-settings.

You can create and edit such a file manually. It is a standard Sublime Text JSON file; the settings currently honored by LaTeXTools are listed below. However, the simplest way to create a settings file is to open the Preferences | Package Settings | LaTeXTools submenu and select the Settings - User option. If you do not currently have a LaTeXTools.sublime-settings settings file in your User directory (e.g., if you are installing LaTeXTools for the first time), you will be given the option to create one. The newly created settings file will be an exact copy of the default one, and will open in a tab for you to customize.

If you do already have an existing LaTeXTools.sublime-settings file in your User directory, the Settings - User option will open that file in a tab for you to further customize. Similarly, the Settings - Default option will open the default settings file in a tab, in read-only mode. This may be useful for you to copy from, or if you want to see what other options may be available without consulting this README file.

If at any time you wish to erase your customizations and start afresh, you can simply delete the LaTeXTools.sublime-settings file in your User directory. (Again, warning: do not touch the settings file in the LaTeXTools plugin directory!) Alternatively, from the Preferences | Package Settings | LaTeXTools submenu, or from the Command Palette, you can choose Reset user settings to default. This will delete any existing settings file in User and create a copy of the default one. This will remove all your customizations.

(Historical note: This is no longer relevant in 2016, but just for the record, if you have a pre-2014, old-style settings file, this option will import it).

Warning: in general, tweaking options can cause breakage. For instance, if on Linux you change the default python2 setting (empty by default) to a non-existent binary, forward and inverse search will stop working. With great power comes great responsibility! If you think you have found a bug, delete your settings file in the User directory, or use the Reset user settings to default command before reporting it! Thanks :-)

The following options are currently available (defaults in parentheses):

General settings:

• cite_auto_trigger (true): if true, typing e.g. \cite{ brings up the citation completion quick panel, without the need to type C-l,x. If false, you must explicitly type C-l,x.
• ref_auto_trigger (true): ditto, but for \ref{ and similar reference commands
• fill_auto_trigger (true): ditto, but for package and file inclusion commands (see Fill Helper feature above)
• cwl_completion (prefixed): when to activate the cwl completion poput (see LaTeX-cwl feature above)
• cwl_list (empty): list of paths to cwl files
• keep_focus (true): if true, after compiling a tex file, ST retains the focus; if false, the PDF viewer gets the focus. Also note that you can temporarily toggle this behavior with C-l,t,f. Note: If you are on either Windows or Linux you may need to adjust the sublime_executable setting for this to work properly. See the Platform settings below.
• forward_sync (true): if true, after compiling a tex file, the PDF viewer is asked to sync to the position corresponding to the current cursor location in ST. You can also temporarily toggle this behavior with C-l,t,s.
• temp_files_exts: list of file extensions to be considered temporary, and hence deleted using the C-l, backspace command.
• temp_files_ignored_folders: subdirectories to skip when deleting temp files.
• tex_file_exts (['.tex']): a list of extensions that should be considered TeX documents. Any extensions in this list will be treated exactly the same as .tex files. See the section on Support for non-.tex files.
• latextools_set_syntax (true): if true LaTeXTools will automatically set the syntax to LaTeX when opening or saving any file with an extension in the tex_file_exts list.
• tex_spellcheck_paths ({}): A mapping from the locales to the paths of the dictionaries. See the section Spell-checking
• hide_local_cache (true): Whether the local cache should be hidden in the sublime cache path (true) or in the same directory as the root file (false). See the section Caching.
• local_cache_life_span (30 m): The lifespan of the local cache. See the section Caching.

Platform settings:

• all platforms:
• texpath: the path to TeX & friends
• windows-specific settings:
• distro: either miktex or texlive, depending on your TeX distribution
• sumatra: leave blank or omit if the SumatraPDF executable is in your PATH and is called SumatraPDF.exe, as in a default installation; otherwise, specify the full path and file name of the SumatraPDF executable.
• sublime_executable: this is used if keep_focus is set to true and the path to your sublime_text executable cannot be discovered automatically. It should point to the full path to your executable sublime_text.exe.
• keep_focus_delay: this is used if keep_focus is set to true. It controls how long (in seconds) the delay is between the completion of the jump_to_pdf command and the attempt to refocus on Sublime Text. This may need to be adjusted depending on your machine or configuration.
• linux-specific settings:
• python2 ("", i.e. empty string): name of the Python 2 executable. This is useful for systems that ship with both Python 2 and Python 3. The forward/backward search used with Evince require Python 2.
• sublime (sublime-text): name of the ST executable. Ubuntu supports both sublime-text and subl; other distros may vary.
• sync_wait (1.5): when you ask LaTeXTools to do a forward search, and the PDF file is not yet open (for example, right after compiling a tex file for the first time), LaTeXTools first launches evince, then waits a bit for it to come up, and then it performs the forward search. This parameter controls how long LaTeXTools should wait. If you notice that your machine opens the PDF, then sits there doing nothing, and finally performs the search, you can decrease this value to 1.0 or 0.5; if instead the PDF file comes up but the forward search does not seem to happen, increase it to 2.0.
• sublime_executable: this is used if keep_focus is set to true and the path to your sublime_text executable cannot be discovered automatically. It should point to the full path to your executable sublime_text.
• keep_focus_delay: this is used if keep_focus is set to true. It controls how long (in seconds) the delay is between the completion of the jump_to_pdf command and the attempt to refocus on Sublime Text. This may need to be adjusted depending on your machine or configuration.

Build engine settings:

NOTE: for the time being, you will need to refer to the LaTeXTools.sublime-settings file for detailed explanations. Also, since the new build system is meant to be fully customizable, if you use a third-party builder (which hopefully will become available!), you need to refer to its documentation.

• builder: the builder you want to use. Leave blank ("") or set to "default" or "traditional" for the traditional (latexmk/texify) behavior.
• builder_path: builders can reside anywhere Sublime Text can access. Specify a path relative to the Sublime text Packages directory. In particular, User is a good choice. If you use a third-party builder, specify the builder-provided directory.
• display_bad_boxes (false): if true LaTeXTools will display any bad boxes encountered after a build. Note that this is disabled by default.
• builder-settings: these are builder-specific settings. For the default/traditional builder, the following settings are useful:
• program: one of pdflatex (the default), xelatex or lualatex. This selects the TeX engine.
• command: the precise latexmk or texify command to be invoked. This is specified exactly as in the cmd entry of the old LaTeX.sublime-build file (which is no longer honored): it must be a list of strings. The defaults (hardcoded, not shown in the settings file) are ["latexmk", "-cd", "-e", "$pdflatex = '%E -interaction=nonstopmode -synctex=1 %S %O'", "-f", "-pdf"] for TeXLive, and ["texify", "-b", "-p", "--tex-option=\"--synctex=1\""] for MiKTeX. • options: allows you to specify a TeX option, such as --shell-escape. This must be a tuple: that is, use options: ["--shell-escape"] • In addition, there can be platform-specific settings. An important one for Windows is distro, which must be set to either miktex or texlive. • A platform-specific setting that is common to all builders is env. This can be used to set environment variables before running the actual builder. Setting e.g. TEXINPUTS is a possible use case. Viewer settings: • viewer: the viewer you want to use. Leave blank ("") or set to "default"for the platform-specific viewer. Can also be set to "preview" if you want to use Preview on OS X, "okular" if you want to use Okular on Linux or "command" to run arbitrary commands. For details on the "command" option, see the section of the viewer documentation above. • viewer_settings: these are viewer-specific settings. Please see the viewers documentation above. Bibliographic references settings: • bibliography ("traditional_bibliography"): specifies the bibliography plugin to use to handle extracting entries from a bibliography. • cite-panel-format and cite_autocomplete_format: see the section on ref/cite completion, and the comments in LaTeXTools.sublime-settings ### Project-Specific Settings The above settings can be overridden on a project-specific basis if you are using Sublime Text's project system. To override these settings, simply create a "settings" section in your project file. The structure and format is the same as for the LaTeXTools.sublime-settings file. Here is an example: { ...<folder-related options here>... "settings" : { "TEXroot": "main.tex", "tex_file_exts": [".tex", ".tikz"], "builder_settings": { "program": "xelatex", "options": "--shell-escape" } } }  This sets main.tex as the master tex file (assuming a multi-file project), and allows .tikz files to be recognized as tex files, but only for the current project. Furthermore (using the default, i.e., traditional builder), it forces the use of xelatex instead of the default pdflatex, and also adds the --shell-escape option---again, for the current project only. Note: tweaking settings on a project-specific level can lead to even more subtle issues. If you notice a bug, in addition to resetting your LaTeXTools.sublime-settings file, you should remove at LaTeXTools settings from your project file. ## Customizing the Build System LaTeXTools allows you to fully customize the build process using Python. The default builder (called traditional) works like the one in prior releases. For minor customizations of the default builder, as noted in the Build and Settings sections above, there are three key options. If you want to use, say, xelatex instead of pdflatex (the default), set the program setting, under builder-settings. You can also pass options to the TeX engine, via the options setting. Alternatively, both engine and options can be specified using %!TEX directives at the top of your master file. If instead you want to change the build command completely, set the command option there. Some information on the new flexible builder system: to create and use a new builder, you place the code somewhere off the ST Packages directory (for instance, in User), then set the builder and builder_path options in your LaTeXTools.sublime-settings file accordingly. A builder can define its own options, also in LaTeXTools.sublime-settings, which will be passed whenever a build is invoked. Due to time constraints, I have not yet been able to document how to write a builder. The basic idea is that you subclass the PdfBuilder class in the file LaTeXTools/builders/pdfBuilder.py. The comments in that file describe how builders interact with the build command (hint: they use Pyton's yield command). I provide three builders. The code is in the LaTeXTools/builders directory. You can use them as examples: • traditional is the traditional builder. • simple does not use external tools, but invokes pdflatex and friends, each time checking the log file to figure out what to do next. It is a very, very simple "make" tool, but it demonstrates the back-and-forth interaction between LaTeXTools and a builder. • script (see below) allows the user to specify a list of compilation commands in the settings file, and just execute them in sequence. Let me know if you are interested in writing a custom builder! ## Script Builder LaTeXTools now supports the long-awaited script builder. It has two primary goals: first, to support customization of simple build workflows and second, to enable LaTeXTools to integrate with external build systems in some fashion. Note that the script builder should be considered an advanced feature. Unlike the "traditional" builder it is not designed to "just work," and is not recommend for those new to using TeX and friends. You are responsible for making sure your setup works. Please read this section carefully before using the script builder. For the most part, the script builder works as described in the Compiling LaTeX files section except that instead of invoking either texify or latexmk, it invokes a user-defined series of commands. Note that although the Script Builder supports Multi-file documents, it does not support either the engine selection or passing other options via the %!TEX macros. The script builder is controlled through two settings in the platform-specific part of the builder_settings section of LaTeXTools.sublime-settings, or of the current project file (if any): • script_commands — the command or list of commands to run. This setting must have a value or you will get an error message. • env — a dictionary defining any environment variables to be set for the environment the command is run in. The script_commands setting should be either a string or a list. If it is a string, it represents a single command to be executed. If it is a list, it should be either a list of strings representing single commands or a list of lists, though the two may be mixed. For example: "builder_settings": { "osx": { "script_commands": "pdflatex -synctex=1 -interaction=nonstopmode" } } Will simply run pdflatex against the master document, as will: "builder_settings": { "osx": { "script_commands": ["pdflatex -synctex=1 -interaction=nonstopmode"] } } Or: "builder_settings": { "osx": { "script_commands": [["pdflatex", "-synctex=1 -interaction=nonstopmode"]] } } More interestingly, the main list can be used to supply a series of commands. For example, to use the simple pdflatex -> bibtex -> pdflatex -> pdflatex series, you can use the following settings: "builder_settings": { "osx": { "script_commands": [ "pdflatex -synctex=1 -interaction=nonstopmode", "bibtex", "pdflatex -synctex=1 -interaction=nonstopmode", "pdflatex -synctex=1 -interaction=nonstopmode" ] } } Note, however, that the script builder is quite unintelligent in handling such cases. It will not note any failures nor only execute the rest of the sequence if required. It will simply continue to execute commands until it hits the end of the chain of commands. This means, in the above example, it will run bibtex regardless of whether there are any citations. It is especially important to ensure that, in case of errors, TeX and friends do not stop for user input. For example, if you use pdflatex on either TeXLive or MikTeX, pass the -interaction=nonstopmode option. Each command can use the following variables which will be expanded before it is executed: Variable Description $file The full path to the main file, e.g., C:\Files\document.tex
$file_name The name of the main file, e.g., document.tex $file_ext The extension portion of the main file, e.g., tex
$file_base_name The name portion of the main file without the, e.g., document $file_path The directory of the main file, e.g., C:\Files

For example:

"builder_settings": {
"osx": {
"script_commands": ["pdflatex -synctex=1 -interaction=nonstopmode $file_base_name"] } } Note that if none of these variables occur in the command string, the $file_base_name will be appended to the end of the command. This may mean that a wrapper script is needed if, for example, using make.

• the LaTeX log will be written in the same directory as the main file and named $file_base_name.log • if you change the PATH in the environment (by using the env setting), you need to ensure that the PATH is still sane, e.g., that it contains the path for the TeX executables and other command line resources that may be necessary. In addition, to ensure that forward and backward sync work, you need to ensure that the -synctex=1 flag is set for your latex command. Again, don't forget the -interaction=nonstopmode flag (or whatever is needed for your tex programs not to expect user input in case of error). ## Caching LaTeXTools uses a cache to store relevant information about your document and improve the performance of commands. However the content of the cache might be outdated. Hence you can just clear the local cache by deleting the temp files C-backspace or only the cache C-l,C-d,C-c. The local cache also has a lifespan, after which it will be invalidated. The lifespan starts when the first entry is inserted in the cache and the whole cache will be deleted after the lifespan. This can be set in the local_cache_life_span setting. The format is "X d X h X m X s", where X is a natural number s stands for seconds, m for minutes, h for hours, and d for days. Missing fields will be treated as 0 and white-spaces are optional. Hence you can write "1 h 30 m" to refresh the cached data every one and a half hours. If you use "infinite" the cache will not be invalidated automatically. A lower lifespan will produce results, which are more up to date. However it requires more recalculations and might decrease the performance. The cache uses files to store the entries. These files can either be stored in the same folder as the tex root file or stored "hidden" in the sublime cache path. The setting for this is hide_local_cache and can either be true or false. ## Troubleshooting ### Path issues Many LaTeXTools problems are path-related. The LaTeX.sublime-build file attempts to set up default path locations for MikTeX, TeXlive and MacTeX, but these are not guaranteed to cover all possibilities. Please let me know if you have any difficulties. On Mac OS X, just having your $PATH set up correctly in a shell (i.e., in Terminal) does not guarantee that things will work when you invoke commands from ST. If something seems to work when you invoke pdflatex or latexmk from the Terminal, but building from within ST fails, you most likely have a path configuration issue. One way to test this is to launch ST from the Terminal, typing

/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl

(and then Return; this is for ST2 of course) at the prompt. If things do work when you run ST this way, but they fail if you launch ST from the Dock or the Finder, then there is a path problem. From the Terminal, type

echo \$PATH

and take note of what you get. Then, run ST from the Dock or Finder, open the console (with Ctrl+ ) and type

import os; os.environ['PATH']

and again take note of what you see in the output panel (right above the line where you typed the above command). Finally, look at the path keyword in the osx section of the LaTeX.sublime-build file in the LaTeXTools package directory. For things to work, every directory that you see listed from the Terminal must be either in the list displayed when you type the import os... command in the ST console, or else it must be explicitly specified in LaTeX.sublime-build. If this is not the case, add the relevant paths in LaTeX.sublime-build and please let me know, so I can decide whether to add the path specification to the default build file. Thanks!

### Non-ASCII characters and spaces in path and file names

Another significant source of issues are Unicode characters in path and file names. On TeXLive-based platforms, LaTeXTools tries to handle these by telling latexmk to cd to each source file's directory before running pdflatex. This seems to help some. However, things seem to vary by platform and locale, so I cannot make any guarantees that your Unicode path names will work. Keep in mind that TeX itself has issues with Unicode characters in file names (as a quick Google search will confirm).

Spaces in paths and file names are supported. As far as I know, the only limitation has to do with multifile documents: the root document's file name cannot contain spaces, or the %!TEX = <name> directive will fail. I may fix this at some point, but for now it is a limitation.

### Compilation hangs on Windows

On Windows, sometimes a build seems to succeed, but the PDF file is not updated. This is most often the case if there is a stale pdflatex process running; a symptom is the appearence of a file with extension .synctex.gz(busy). If so, launch the Task Manager and end the pdflatex.exe process; if you see a perl.exe` process, end that, too. This kind of behavior is probably a bug: LaTeXTools should be able to see that something went wrong in the earlier compilation. So, please let me know, and provide me with as much detail as you can (ideally, with a test case). Thanks!

### Log parsing issues, and good vs. bad path/file names (again!)

As noted in the Highlights, the new parser is more robust and flexible than the old one---it "understands" the log file format much, much better. This is the result of manually and painstakingly debugging a fair number of users' log files. The many possible exceptions, idiosyncrasies, warts, etc. displayed by TeX packages is mind-boggling, and the parsing code reflects this :-(

Anyway, hopefully, errors should now occur only in strange edge cases. Please let me know on github if you see an error message. I need a log file to diagnose the problem; please upload it to gist, dropbox, or similar, and paste a link in your message on github. Issue #104 is open for that purpose.

There are two exceptions to this request. First, the xypic package is very, very badly behaved. I have spent more time debugging log files contaminated by xypic than I have spent fixing all other issues. Seriously. Therefore, first, parsing issues are now reported as "warnings" if the xypic package is used (so compilation and previewing continues); second, I cannot promise I will fix the issue even if you report it. Thanks for your understanding.

The second exception has to do with file and path names. In order to accommodate the many possible naming conventions across platforms and packages, as well as the different ways in which file names can occur in logs, I had to make some assumptions. The key one is that extensions cannot contain spaces. The reason is that the regex matching file names uses a period (".") followed by non-space characters, followed by a space as denoting the end of the file name. Trust me, it's the most robust regex I could come up with. So, you can have spaces in your base names, and you can even have multiple extensions; however, you cannot have spaces in your extensions. So, "This is a file.ver-1.tex" is OK; "file.my ext" (where "my ext" is supposed to be the extension) is not OK.

Finally, I have done my best to accommodate non-ASCII characters in logs. I cannot promise that everything works, but I'd like to know if you see issues with this.


text:
Strong convergence of nonlinear finite volumemethods for linear hyperbolic systems - Archive ouverte HAL Access content directly
Conference Papers Year : 2018

## Strong convergence of nonlinear finite volumemethods for linear hyperbolic systems

(1) , (2)
1
2
S. Ngwamou
• Function : Correspondent author
• PersonId : 1060283

Connectez-vous pour contacter l'auteur
M. Ndjinga
• Function : Correspondent author
• PersonId : 865882

Connectez-vous pour contacter l'auteur

#### Abstract

Unlike finite elements methods, finite volume methods are far fromhaving a clear functional analytic setting allowing the proof of generalconvergence results. In, compactness methods were used to deriveconvergence results for the Laplace equation on fairly general meshes.The weak convergence of nonlinear finite volume methods for linear hy-perbolic systems was proven in using the Banach-Alaoglu compactnesstheorem. It allowed the use of general $L^2$ initial data which is consistent with the continuous theory based on the $L^2$ Fourier transform.To our knowledge this was the first convergence results applicable to nondifferentiable initial data. However this weak convergence result seems not optimal with regard of numerical simulations. In this paper we prove that the convergence is indeed strong for a wide class of possibly nonlinear upwinding schemes. The context of our study being multidimensional, we cannot use the spaces $L^1$ and $BV$ classically encountered in the study of 1$D$ hyperbolic systems. We propose instead the use of generalised p-variation function, initially introduced by Wiener and first studied by Young. Thesespaces are compactly embedded in $L^p$. They can therefore fitinto the $L^2$ framework imposed by Brenner obstruction result. Usingestimates of the quadratic variation of the finite volume approximationswe prove the compactness of the sequence of approximations and deducethe strong convergence of the numerical method.We finally discuss the applicability of this approach to nonlinear hyper-bolic systems.

### Dates and versions

cea-02400170 , version 1 (09-12-2019)

### Identifiers

• HAL Id : cea-02400170 , version 1

### Cite

S. Ngwamou, M. Ndjinga. Strong convergence of nonlinear finite volumemethods for linear hyperbolic systems. XVII International Conference on Hyperbolic ProblemsTheory, Numerics, Applications, Jun 2018, University Park, United States. ⟨cea-02400170⟩

### Export

BibTeX TEI Dublin Core DC Terms EndNote Datacite

19 View

format: plain


text:
2 views
There is a stream of neutrons with a kinetic energy of 0.0327 eV. If the half life of neutrons is 700 seconds, what fraction of neutrons will decay before they travel a distance of 10 m ?
in Physics | 2 views

The kinetic energy of neutron is $$\displaystyle \frac{1}{2}mu^2=0.0327\times 1.6\times 10^{-19}J$$        --{the unit eV is converted to J by multiplying with 1.6×10−19

The mass of neutron is $$1.675 \times 10^{-27 }$$

Therefore $$\displaystyle u^2=\frac{2 \times0.0327 \times 1.6 \times 10^{-19}}{1.675 \times 10^{-27} }$$    =625×10

∴, the speed of neutrons is u=2500m/sec

Time taken to travel 10 m is $$\displaystyle \frac {\text {Distance}}{\text {speed}}= \frac{10}{2500}=0.004 \: sec$$

$$\displaystyle \frac{dN}{N}=\lambda .dt$$

The fraction of neutron will decay before they travel a distance of 10 meters is  $$\displaystyle \frac{dN}{N}=\frac{0.693}{700}\times 0.004=3.96\times 10^{-6}$$

by (5.4k points)


text:
# Algebra 1 Help

1. Jan 22, 2007

### kai89

Algebra 1 Help!!

This is really easy but I just can't seem to get it.

Two men were talking about their ages. One said he was 94 years old. "Then," said the younger, "the sum of your age and mine multiplied by the difference will be 8512." How old was the young man.

I thought all i had to do was solve for x
(94-x)(94+x)=8512 but i get a larger number I kept doing it over and over thinking it was a foil mistake but its still wrong. I'm thinking I am gettin tripped up at "multiplied by the difference" the difference of what? If any one can help me it is greatly appreciated. Thanks

2. Jan 22, 2007

### cristo

Staff Emeritus
Your equation is correct. When you multiply out the brackets, you should arrive at an equation for x2. Perhaps you forgot to take the square root, that may be why you have got a large number. If this doesn't help, post your work and we may be able to spot a mistake, if there is one!

3. Jan 23, 2007

### disregardthat

Sorry, wrong place...

Last edited: Jan 23, 2007
4. Jan 23, 2007

### arildno

You might also fiddle about with the prime factorization 8512=2*2*2*2*2*2*7*19

5. Jan 24, 2007

### complexPHILOSOPHY

This is my first attempt with LaTeX.

As the others have said, your equation is correct.
$$(94-x)(94+x)=8512$$

After performing FOIL operation:

$$-x^2+94x-94x+8836=8512$$

After combining like-terms:

$$-x^2+8836=8512$$

To isolate the $$-x^2$$ term:

$$-x^2=-324$$

Now, in order to simplify the $$-x^2$$ term, you must take the square root. I am not sure if you have come across radicals or not yet, but if the index (the root, $$n$$) is even, then the radicand cannot be negative. You will end up with an irrational number.

This is in the form:
$$(\sqrt[n]{a})^m$$

In order to get rid of the negative sign:

$$+(-x^2=-324)$$

Then:

$$\sqrt{x^2}=\sqrt{324}$$

From here, see if you can complete the problem.

Last edited: Jan 24, 2007
6. Jan 24, 2007

### chuckd1356

And, BTW, you would do this to get rid of the negative sign:

$$-(-x^2=-324)$$

not this:

$$+(-x^2=-324)$$

7. Jan 24, 2007

I appreciate you've probably solved this problem by now, but there's an interesting thing with expressions like the one you're dealing with, which is one of the first things they teach us here in the UK when it comes to algebra:
An expression of the format (y+x)(y-x) expands to become y^2-x^2. So straight away, taking y as 94, you can get:

94^2-x^2=8512
>> x^2 = 94^2 - 8512
>> x^2 = 324

With simple problems it's often easy to expand the brackets manually, then re-factor once you have a quadratic in x. However, it can be useful and time - saving to learn to spot these little tricks.

8. Jan 24, 2007

### complexPHILOSOPHY

Sorry, I hit the wrong symbo on the keyboard.

9. Jan 24, 2007

### chuckd1356

No problem, just making sure the kid didn't get confused.

10. Jan 24, 2007

### complexPHILOSOPHY

I definitely appreciate it, as well my friend.


text:
# Impedance

Impedance is the complex-valued generalization of resistance. It may refer to:

• Acoustic impedance: a constant related to the propagation of sound waves in an acoustic medium.
• Electrical impedance: the ratio of the voltage phasor to the electric current phasor, a measure of the opposition to time-varying electric current in an electric circuit.
• High impedance, when only a small amount of current is allowed through.
• The characteristic impedance of a transmission line.
• Impedance (accelerator physics), a characterization of the self-interaction of a charged particle beam.
• Nominal impedance, approximately designed impedance.
• Impedance matching, the adjustment of input impedance, and output impedance.
• Mechanical impedance: a measure of opposition to the motion of a structure subjected to a force.
• Wave impedance: a constant related to electromagnetic wave propagation in a medium.

## Acoustic impedance

Acoustic impedance and specific acoustic impedance are measures of the opposition that a system presents to the acoustic flow resulting from an acoustic pressure applied to the system.

The SI unit of acoustic impedance is the pascal second per cubic metre (Pa·s/m3). There is a close analogy with electrical impedance, which measures the opposition that a system presents to the electrical flow resulting from an electrical voltage applied to the system.

## Electrical impedance

Electrical impedance is a physical quantity that represents the opposition force of a circuit to the passage of alternating electric current, or, more generally, of a variable current. In other words, is the amount of opposition that an electrical element offers to current flow in a circuit when a voltage is applied at a specific frequency. It can be expressed as a complex number and is given by the relationship between voltage and current.

Commonly the impedance is indicated by $$Z$$, and its unit of measurement is the ohm $$(\Omega)$$.

The concept of impedance generalizes Ohm’s law extending it to circuits operating in a sinusoidal regime (commonly called alternating current): in fact, in a continuous current regime, it represents the electrical resistance. It takes into account the phenomena of electric current consumption and the phenomena of electromagnetic energy accumulation.

The electrical impedance is described mathematically by a complex number, whose real part in the schematization with elements in series represents the dissipative phenomenon and corresponds to the electrical resistance, $$R$$. While the imaginary part, called reactance, $$X$$, is associated with the energy phenomena of accumulation.

$\dfrac{V}{I}=Z=R+jX$

The reciprocal of impedance is called admittance $$Y$$.

### How to calculate electrical impedance

To calculate the impedance of a capacitor, the formula to do so is:

$Z_C=\dfrac{1}{2\pi fC}$

where $$Z_C$$ is the impedance in unit ohms, $$f$$ is the frequency of the signal passing through the capacitor, and $$C$$ is the capacitance of the capacitor. To calculate the impedance of an inductor, the formula to do so is:

$Z_L=2\pi fL$

where $$Z_L$$ is the impedance in unit ohms, $$f$$ is the frequency of the signal passing through the inductor, and $$L$$ is the inductance of the inductor. If there are both capacitors and inductors present in a circuit, the total amount of impedance can be calculated by adding all of the individual impedances:

$Z_{tot}=Z_C+Z_L$

## Mechanical impedance

Mechanical impedance is a measure of how much a structure resists motion when subjected to a harmonic force. It relates forces with velocities acting on a mechanical system. The mechanical impedance of a point on a structure is the ratio of the force applied at a point to the resulting velocity at that point.

## Wave impedance

The wave impedance of an electromagnetic wave is the ratio of the transverse components of the electric and magnetic fields (the transverse components being those at right angles to the direction of propagation). If the electric field strength is expressed in volts per meter and the magnetic field strength is expressed in ampere-turns per meter, the wave impedance will have the units of ohms. The wave impedance, $$Z$$, of an electromagnetic wave is given by:

$Z=\sqrt{\dfrac{\mu}{\varepsilon}}$

where $$\mu$$ is the magnetic permeability and $$\varepsilon$$ is the electric permittivity. For a transverse-electric-magnetic (TEM) plane wave traveling through a homogeneous medium, the wave impedance is everywhere equal to the intrinsic impedance of the medium. In particular, for a plane wave traveling through empty space, the wave impedance is equal to the impedance of free space. The symbol Z is used to represent it and it is expressed in units of ohms. The symbol η (eta) may be used instead of Z for wave impedance to avoid confusion with electrical impedance.

Scroll to Top


text:
Also, Read Circle theorems and Properties

Circle:

At this stage, we study plane figures which are in 2 dimensions. Circle is one of them. Circle is said to be an important part of geometry because it has a wide range of applications. When we see around many objects have circular portion. Take an example of a water bottle, from its cover to bottom it is circular. To make it, there must be requirement of knowledge of circle and circle formulas.

Definition of circle:

We can define circle as closed figure round in shape. Or,

Circle is a collection of points which is equidistant from a given fixed point. Or,

Circle is a curve which follows a path which is all round equidistant from a fixed point.

Terms used in circle:

Radius: The line segment joining the centre to any point on the circle.

Diameter: The line segment joining two points on the circle and passes through centre is called diameter. Or, say the longest chord of circle.

Chord: The line segment joining any two point on the circle is called chord.

Arc: A part of circumference of circle whose end points joined by chord. Smaller part is minor arc and larger part is major arc.

Sector: The space covered by arc and two radius in a circle is Sector.

Tangent: A straight line which only touches the circle and is in the plane of circle.

Circumference: The length of curved path of circle is called circumference.

Circle Formulas:

r is symbol for radius of circle.

d is symbol for diameter of circle.

c is symbol for circumference of circle.

Circle formulas are:

1. Diameter of circle = 2r
2. Circumference of circle = 2πr (where π = $$\frac{22}{7}$$)
3. Area of circle = πr2

Extended circle formulas:

1. Length of arc = $$\frac{ϴ}{360⁰}$$ x 2πr (where ϴ = angle subtended by arc at centre)
2. Area of sector = $$\frac{ϴ}{360⁰}$$ x πr2 (where ϴ = angle subtended by sector at centre)

Examples of circles:

1. If the diameter of a circle is 14 cm, Find the area of circle.

Solution:

D = 2r
r = D/2
r = 7 cm
Area = πr2
Area= $$\frac{22}{7}$$x 72
=
154 cm2

1. If circumference of circle is 308cm. Find the area of circle.

Solution:

Circumference = 2πr = 308 cm
r = $$\frac{308}{2π}$$ = 49
Area = πr2
=
$$\frac{22}{7}$$ x (49)2 = 7546 cm2

 More Formulas Triangle Formulas Trigonometric Formulas Lines and Angles Formula Algebraic Formula Number system Calculus formulas


text:
# Graphs

## Introduction

Graphs are a fundamental object within all of mathematics and computer science. A graph consists of two sets of data:

• a finite set $V := \{1,\ldots,n\}$ of vertices; and
• a finite set $E \subseteq V\times V$ of edges.

There are two types of graphs, directed and undirected. For a directed graph the elements of $E$ are considered to be ordered pairs, for an undirected graph the elements of $E$ are unordered pairs or rather sets with two elements.

The interface is modeled alongside the Graphs.jl interface to allow for easier integration elsewhere.

Warning

The mechanism for removing a vertex is slightly different in out implementation to the Graphs.jl implementation: In Graphs.jl first the vertex to be removed is swapped with the last vertex, then the last vertex is removed. In our implementation, the vertex is removed and all subsequent vertices have their labels changed. Hence edges can be different in the two implementations after removing a vertex.

## Construction

GraphMethod
Graph{T}(nverts::Int64) where {T <: Union{Directed, Undirected}}

Construct a graph on nverts vertices and no edges. T indicates whether the graph should be Directed or Undirected.

Examples

Make a directed graph with 5 vertices and print the number of nodes and edges.

julia> g = Graph{Directed}(5);

julia> nv(g)
5

julia> ne(g)
0
source
dualgraphMethod
dualgraph(p::Polyhedron)

Return the dual graph of a Polyhedron, vertices of the graph correspond to facets of the polyhedron and there is an edge between two vertices if the corresponding facets are neighboring, meaning their intersection is a codimension 2 face of the polyhedron.

For bounded polyhedra containing 0 in the interior this is the same as the edge graph the polar dual polyhedron.

Examples

Construct the dual graph of the cube. This is the same as the edge graph of the octahedron, so it has 6 vertices and 12 edges.

julia> c = cube(3);

julia> g = dualgraph(c);

julia> nv(g)
6

julia> ne(g)
12
source
edgegraphMethod
edgegraph(p::Polyhedron)

Return the edge graph of a Polyhedron, vertices of the graph correspond to vertices of the polyhedron, there is an edge between two vertices if the polyhedron has an edge between the corresponding vertices. The resulting graph is Undirected.

Examples

Construct the edge graph of the cube. Like the cube it has 8 vertices and 12 edges.

julia> c = cube(3);

julia> g = edgegraph(c);

julia> nv(g)
8

julia> ne(g)
12
source

### Modifying graphs

add_edge!Method
add_edge!(g::Graph{T}, s::Int64, t::Int64) where {T <: Union{Directed, Undirected}}

Add edge (s,t) to the graph g.

Examples

julia> g = Graph{Directed}(2);

julia> ne(g)
1
source
add_vertices!Method
add_vertices!(g::Graph{T}, n::Int64) where {T <: Union{Directed, Undirected}}

Add a n new vertices to the graph g.

Examples

julia> g = Graph{Directed}(2);

julia> nv(g)
2

julia> nv(g)
7
source
add_vertex!Method
add_vertex!(g::Graph{T}) where {T <: Union{Directed, Undirected}}

Add a vertex to the graph g. The return value is the new vertex.

Examples

julia> g = Graph{Directed}(2);

julia> nv(g)
2

3

julia> nv(g)
3
source
rem_edge!Method
rem_edge!(g::Graph{T}, s::Int64, t::Int64) where {T <: Union{Directed, Undirected}}

Remove edge (s,t) from the graph g.

Examples

julia> g = Graph{Directed}(2);

julia> ne(g)
1

julia> rem_edge!(g, 1, 2);

julia> ne(g)
0
source
rem_vertex!Method
rem_vertex!(g::Graph{T}, v::Int64) where {T <: Union{Directed, Undirected}}

Remove the vertex v from the graph g.

Examples

julia> g = Graph{Directed}(2);

julia> nv(g)
2

julia> rem_vertex!(g, 1)

julia> nv(g)
1
source

## Auxiliary functions

all_neighborsMethod
all_neighbors(g::Graph{T}, v::Int64) where {T <: Union{Directed, Undirected}}

Return all vertices of a graph g that are connected to the vertex v via an edge, independent of the edge direction.

Examples

julia> g = Graph{Directed}(5);

julia> all_neighbors(g, 3)
2-element Vector{Int64}:
1
4

julia> all_neighbors(g, 4)
1-element Vector{Int64}:
3
source
automorphism_group_generatorsMethod
automorphism_group_generators(g::Graph{T}) where {T <: Union{Directed, Undirected}}

Return generators of the automorphism group of the graph g.

Examples

julia> g = complete_graph(4);

julia> automorphism_group_generators(g)
3-element Vector{PermGroupElem}:
(3,4)
(2,3)
(1,2)
source
complete_graphMethod
complete_graph(n::Int64)

Assemble the undirected complete graph on n nodes.

Examples

julia> g = complete_graph(3);

julia> collect(edges(g))
3-element Vector{Edge}:
Edge(2, 1)
Edge(3, 1)
Edge(3, 2)
source
complete_bipartite_graphMethod
complete_bipartite_graph(n::Int64, m::Int64)

Assemble the undirected complete bipartite graph between n and m nodes.

Examples

julia> g = complete_bipartite_graph(2,2);

julia> collect(edges(g))
4-element Vector{Edge}:
Edge(3, 1)
Edge(3, 2)
Edge(4, 1)
Edge(4, 2)
source
edgesMethod
edges(g::Graph{T}) where {T <: Union{Directed, Undirected}}

Return an iterator over the edges of the graph g.

Examples

A triangle has three edges.

julia> triangle = simplex(2);

julia> g = edgegraph(triangle);

julia> collect(edges(g))
3-element Vector{Edge}:
Edge(2, 1)
Edge(3, 1)
Edge(3, 2)
source
has_edgeMethod
has_edge(g::Graph{T}, source::Int64, target::Int64) where {T <: Union{Directed, Undirected}}

Check for an edge in a graph.

Examples

Check for the edge $1\to 2$ in the edge graph of a triangle.

julia> triangle = simplex(2);

julia> g = edgegraph(triangle);

julia> has_edge(g, 1, 2)
true
source
has_vertexMethod
has_vertex(g::Graph{T}, v::Int64) where {T <: Union{Directed, Undirected}}

Check for a vertex in a graph.

Examples

The edge graph of a triangle only has 3 vertices.

julia> triangle = simplex(2);

julia> g = edgegraph(triangle);

julia> has_vertex(g, 1)
true

julia> has_vertex(g, 4)
false
source
inneighborsMethod
inneighbors(g::Graph{T}, v::Int64) where {T <: Union{Directed, Undirected}}

Return the vertices of a graph g that have an edge going towards v. For an undirected graph, all neighboring vertices are returned.

Examples

julia> g = Graph{Directed}(5);

julia> inneighbors(g, 3)
1-element Vector{Int64}:
1

julia> inneighbors(g, 1)
Int64[]
source
neMethod
ne(g::Graph{T}) where {T <: Union{Directed, Undirected}}

Return the number of edges of a graph.

Examples

The edge graph of the cube has 12 edges just like the cube itself.

julia> c = cube(3);

julia> g = edgegraph(c);

julia> ne(g)
12
source
neighborsMethod
neighbors(g::Graph{T}, v::Int64) where {T <: Union{Directed, Undirected}}

Return the neighboring vertices of a vertex v in a graph g. If the graph is directed, the neighbors reachable via outgoing edges are returned.

Examples

julia> g = Graph{Directed}(5);

julia> neighbors(g, 3)
1-element Vector{Int64}:
4
source
nvMethod
nv(g::Graph{T}) where {T <: Union{Directed, Undirected}}

Return the number of vertices of a graph.

Examples

The edge graph of the cube has eight vertices, just like the cube itself.

julia> c = cube(3);

julia> g = edgegraph(c);

julia> nv(g)
8
source
outneighborsMethod
outneighbors(g::Graph{T}, v::Int64) where {T <: Union{Directed, Undirected}}

Return the vertices of a graph g that are target of an edge coming from v. For an undirected graph, all neighboring vertices are returned.

Examples

julia> g = Graph{Directed}(5);

julia> outneighbors(g, 3)
1-element Vector{Int64}:
4

julia> outneighbors(g, 4)
Int64[]
source
shortest_path_dijkstraFunction
shortest_path_dijkstra(g::Graph{T}, s::Int64, t::Int64; reverse::Bool=false) where {T <: Union{Directed, Undirected}}

Compute the shortest path between two vertices in a graph using Dijkstra's algorithm. All edges are set to have a length of 1. The optional parameter indicates whether the edges should be considered reversed.

Examples

julia> g = Graph{Directed}(3);

julia> shortest_path_dijkstra(g, 3, 1)
2-element Vector{Int64}:
3
1

julia> shortest_path_dijkstra(g, 1, 3)
3-element Vector{Int64}:
1
2
3

julia> shortest_path_dijkstra(g, 3, 1; reverse=true)
3-element Vector{Int64}:
3
2
1
source

### Edges

dstMethod
dst(e::Edge)

Return the destination of an edge.

Examples

julia> g = complete_graph(2);

julia> E = collect(edges(g));

julia> e = E[1]
Edge(2, 1)

julia> dst(e)
1
source
reverseMethod
reverse(e::Edge)

Return the edge in the opposite direction of the edge e.

Examples

julia> g = complete_graph(2);

julia> E = collect(edges(g));

julia> e = E[1]
Edge(2, 1)

julia> reverse(e)
Edge(1, 2)
source
srcMethod
src(e::Edge)

Return the source of an edge.

Examples

julia> g = complete_graph(2);

julia> E = collect(edges(g));

julia> e = E[1]
Edge(2, 1)

julia> src(e)
2
source

Objects of type Graph can be saved to a file and loaded with the methods load and save. The file is in JSON format and contains the underlying polymake object. In particular, this file can now be read by both polymake and OSCAR.


text:
# ImageGPT (small-sized model)

ImageGPT (iGPT) model pre-trained on ImageNet ILSVRC 2012 (14 million images, 21,843 classes) at resolution 32x32. It was introduced in the paper Generative Pretraining from Pixels by Chen et al. and first released in this repository. See also the official blog post.

Disclaimer: The team releasing ImageGPT did not write a model card for this model so this model card has been written by the Hugging Face team.

## Model description

The ImageGPT (iGPT) is a transformer decoder model (GPT-like) pretrained on a large collection of images in a self-supervised fashion, namely ImageNet-21k, at a resolution of 32x32 pixels.

The goal for the model is simply to predict the next pixel value, given the previous ones.

By pre-training the model, it learns an inner representation of images that can then be used to:

• extract features useful for downstream tasks: one can either use ImageGPT to produce fixed image features, in order to train a linear model (like a sklearn logistic regression model or SVM). This is also referred to as "linear probing".
• perform (un)conditional image generation.

## Intended uses & limitations

You can use the raw model for either feature extractor or (un) conditional image generation. See the model hub to all ImageGPT variants.

### How to use

Here is how to use this model in PyTorch to perform unconditional image generation:

from transformers import ImageGPTFeatureExtractor, ImageGPTForCausalImageModeling
import torch
import matplotlib.pyplot as plt
import numpy as np

feature_extractor = ImageGPTFeatureExtractor.from_pretrained('openai/imagegpt-small')
model = ImageGPTForCausalImageModeling.from_pretrained('openai/imagegpt-small')

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)

# unconditional generation of 8 images
batch_size = 8
context = torch.full((batch_size, 1), model.config.vocab_size - 1) #initialize with SOS token
context = torch.tensor(context).to(device)
output = model.generate(pixel_values=context, max_length=model.config.n_positions + 1, temperature=1.0, do_sample=True, top_k=40)

clusters = feature_extractor.clusters
n_px = feature_extractor.size

samples = output[:,1:].cpu().detach().numpy()
samples_img = [np.reshape(np.rint(127.5 * (clusters[s] + 1.0)), [n_px, n_px, 3]).astype(np.uint8) for s in samples] # convert color cluster tokens back to pixels

f, axes = plt.subplots(1, batch_size, dpi=300)
for img, ax in zip(samples_img, axes):
ax.axis('off')
ax.imshow(img)

## Training data

The ImageGPT model was pretrained on ImageNet-21k, a dataset consisting of 14 million images and 21k classes.

## Training procedure

### Preprocessing

Images are first resized/rescaled to the same resolution (32x32) and normalized across the RGB channels. Next, color-clustering is performed. This means that every pixel is turned into one of 512 possible cluster values. This way, one ends up with a sequence of 32x32 = 1024 pixel values, rather than 32x32x3 = 3072, which is prohibitively large for Transformer-based models.

### Pretraining

Training details can be found in section 3.4 of v2 of the paper.

## Evaluation results

For evaluation results on several image classification benchmarks, we refer to the original paper.

### BibTeX entry and citation info

@InProceedings{pmlr-v119-chen20s,
title =      {Generative Pretraining From Pixels},
author =       {Chen, Mark and Radford, Alec and Child, Rewon and Wu, Jeffrey and Jun, Heewoo and Luan, David and Sutskever, Ilya},
booktitle =      {Proceedings of the 37th International Conference on Machine Learning},
pages =      {1691--1703},
year =      {2020},
editor =      {III, Hal DaumÃ© and Singh, Aarti},
volume =      {119},
series =      {Proceedings of Machine Learning Research},
month =      {13--18 Jul},
publisher =    {PMLR},
pdf =      {http://proceedings.mlr.press/v119/chen20s/chen20s.pdf},
url =      {https://proceedings.mlr.press/v119/chen20s.html
}

@inproceedings{deng2009imagenet,
title={Imagenet: A large-scale hierarchical image database},
author={Deng, Jia and Dong, Wei and Socher, Richard and Li, Li-Jia and Li, Kai and Fei-Fei, Li},
booktitle={2009 IEEE conference on computer vision and pattern recognition},
pages={248--255},
year={2009},
organization={Ieee}
}


text:
3,431 questions with no upvoted or accepted answers
310 views

### When does the laugh track kick in?

One of my weekend projects has brought me into the deep waters of signal processing. As with all my code projects that require some heavy-duty math, I'm more than happy to tinker my way to a solution ...
583 views

### Will an Unscented Kalman Filter Be “As Good” as Other Optimization Algorithms for This Problem?

I want to calibrate a tri-axis magnetometer when a tri-axis gyroscope is also available. I am fairly certain I can solve this problem using various optimisation algorithms, but I would prefer to use ...
1k views

### Ensemble learning, multiple classifier system

I am trying to use a MCS (Multi classifier system) to do some better work on limited data i.e become more accurate. I am using K-means clustering at the moment but may choose to go with FCM (Fuzzy c-...
1k views

### Help in Retraining a HOG Descriptor using SVMLight

I am currently trying to count cars using OpenCV 2.4.4 with a HOG descriptor. Because a model for car detection is not available in OpenCV, I am creating my own model using SVMLight and a dataset of ...
227 views

### What is the normalization factor for the quincunx lattice wavelet transform, and how do you find it?

On pages 57-60 (preview was available last I checked, images here in case), there is a quincunx lattice transform described. Lattice: ...
265 views

### Reducing noise from the same frequency band as signal

Sorry for the vague question (as I'm not even quite sure what I want to do is possible), just asking for some general direction to take my research. For a brief description, my signal resembles ...


text:
# Sequential minimal optimization

(Redirected from Sequential Minimal Optimization)
Class Optimization algorithm for training support vector machines O(n³)

Sequential minimal optimization (SMO) is an algorithm for solving the quadratic programming (QP) problem that arises during the training of support vector machines. It was invented by John Platt in 1998 at Microsoft Research.[1] SMO is widely used for training support vector machines and is implemented by the popular LIBSVM tool.[2][3] The publication of the SMO algorithm in 1998 has generated a lot of excitement in the SVM community, as previously available methods for SVM training were much more complex and required expensive third-party QP solvers.[4]

## Optimization problem

Consider a binary classification problem with a dataset (x1, y1), ..., (xn, yn), where xi is an input vector and yi ∈ {-1, +1} is a binary label corresponding to it. A soft-margin support vector machine is trained by solving a quadratic programming problem, which is expressed in the dual form as follows:

$\max_{\alpha} \sum_{i=1}^n \alpha_i - \frac12 \sum_{i=1}^n \sum_{j=1}^n y_i y_j K(x_i, x_j) \alpha_i \alpha_j,$
subject to:
$0 \leq \alpha_i \leq C, \quad \mbox{ for } i=1, 2, \ldots, n,$
$\sum_{i=1}^n y_i \alpha_i = 0$

where C is an SVM hyperparameter and K(xi, xj) is the kernel function, both supplied by the user; and the variables $\alpha_i$ are Lagrange multipliers.

## Algorithm

SMO is an iterative algorithm for solving the optimization problem described above. SMO breaks this problem into a series of smallest possible sub-problems, which are then solved analytically. Because of the linear equality constraint involving the Lagrange multipliers $\alpha_i$, the smallest possible problem involves two such multipliers. Then, for any two multipliers $\alpha_1$ and $\alpha_2$, the constraints are reduced to:

$0 \leq \alpha_1, \alpha_2 \leq C,$
$y_1 \alpha_1 + y_2 \alpha_2 = k,$

and this reduced problem can be solved analytically: one needs to find a minimum of a one-dimensional quadratic function. $k$ is the negative of the sum over the rest of terms in the equality constraint, which is fixed in each iteration.

The algorithm proceeds as follows:

1. Find a Lagrange multiplier $\alpha_1$ that violates the Karush–Kuhn–Tucker (KKT) conditions for the optimization problem.
2. Pick a second multiplier $\alpha_2$ and optimize the pair $(\alpha_1,\alpha_2)$.
3. Repeat steps 1 and 2 until convergence.

When all the Lagrange multipliers satisfy the KKT conditions (within a user-defined tolerance), the problem has been solved. Although this algorithm is guaranteed to converge, heuristics are used to choose the pair of multipliers so as to accelerate the rate of convergence.


text:
# Phelps Signature Cow Elk Diaphragm

\$9.00

Single Reed. This call was specifically designed to easily produce great cow sounds. Turns out it also has just enough backbone to bugle with if needed.

Out of stock

SKU: PHE-DIAPHRAGM-SIGNATURECOW Categories: , , , ,

## Description

Single Reed. This call was specifically designed to easily produce great cow sounds. Turns out it also has just enough backbone to bugle with if needed.