I haven’t really worked with the natbib package but I’d like to point you to the great biblatex package which offers a wide range of styles and it is — relatively — easy to configure your own style rules.
Well, the biblatex package seems also to have a natbib compatibility option, that defines some more natbib-like commands. Maybe you should start with
\usepackage[natbib=true, bibstyle=authoryear, citestyle=authoryear-comp]{biblatex}
and change the bibstyle and citestyle according to the documentation. Good luck with it.
Note: LaTeXTools for Sublime Text now supports automatic engine detection if your file starts with %!TEX program = <program>
, where <program>
is any of pdflatex
, xelatex
or lualatex
. The below instructions are only necessary if you need to manually switch engines for whatever reasons.
Take the LaTeX.sublime-build
file in the LaTeXTools
folder under ~/Library/Application Support/Sublime Text 2/Packages
and copy it to ~/Library/Application Support/Sublime Text 2/Packages/User/
, but do it twice and give those files the following name:
LaTeX.sublime-build.latex
LaTeX.sublime-build.xetex
Change the files to use the pdflatex
for LaTeX and xelatex
engines for XeTeX, respectively (as seen in the question).
Then, create a new plugin through Tools » New Plugin… (saving it as switch.py
to the location above):
import sublime, sublime_plugin, os, shutil, filecmp
class SwitchCommand(sublime_plugin.ApplicationCommand):
def run(self):
folder = os.path.expanduser( \
'~/Library/Application Support/Sublime Text 2/Packages/User/')
latex_src = folder + 'LaTeX.sublime-build.latex'
xetex_src = folder + 'LaTeX.sublime-build.xetex'
dest = folder + 'LaTeX.sublime-build'
if filecmp.cmp(dest, latex_src):
sublime.status_message("Switching to XeTeX")
shutil.copy(xetex_src, dest)
else:
sublime.status_message("Switching to LaTeX")
shutil.copy(latex_src, dest)
And create a keyboard shortcut for it in Preferences » Key Bindings – User:
[ {
"keys": ["super+shift+x"], "command": "switch"
} ]
You can also add this to your menu by adding the Main.sublime-menu
file to your User
package:
[ {
"id":"tools", "children":
[ {
"command": "switch",
"caption": "Switch between LaTeX/XeTeX"
}
]
} ]
This will now compare the currently active build file with the build settings needed for XeTeX and LaTeX and switch them if necessary.
This could sure use some improvement, but it works for the moment.
Best Answer
You can write
This only (of course?) works for delimiters that actually scale.
\middle
is defined as part of eTeX, which is standard in all distributions for years now.