2

I am new to LaTeX, using MacTeX 2014, biblatex 2.9/Biber 0.9. In need to create a custom build that includes xelatex-biber-xelatex in Sublime Text 3.

Comments below from @cfr and @egreg helped me to compile in terminal

Also @AndrewCashner helped me use Preview via terminal. No sync-jump between apps.

  • 3
    Try /usr/texbin/biber instead of /usr/texbin/biber.exe. You are not using Windows. It is very unlikely that MacTeX provides a .exe binary or that OS X could use it if it did. The error you get on the command line probably has a different cause but we need a minimal (non-)working example (MWE) for that. – cfr Sep 9 '14 at 23:01
  • 1
    Yes. Terminal is the built-in way to access the command line. Not all editors have access to the command line. I don't know TexMate or Sublime Text. Kile has it. TeXShop does not (or did not). cd is the command to change directory. Normally, when you open a new session, you are in your home directory, /Users/<your username>. If your .tex file is in <your home directory> > Documents > MyProject, say, cd Documents/MyProject would change into the appropriate directory. Or cd /Users/<your username>/Documents/MyProject or cd ~/Documents/MyProject. (~ is an abbreviation for your home. – cfr Sep 10 '14 at 14:47
  • 2
    @Nhaps You shouldn't get the error if you call Biber from the terminal by biber filename or biber filename.bcf – egreg Sep 10 '14 at 16:01
  • 1
    If you keep the PDF open in Preview, when you recompile in the Terminal, Preview will update the PDF to the new file. – musarithmia Sep 12 '14 at 15:12
  • 1
    @Nhaps, you might know this, but typing the up arrow in the terminal will give you access to previously entered commands. So this makes repeated compilation cycles very easy. – musarithmia Sep 12 '14 at 17:26
2
  1. To compile xelatex, biber, xelatex in Sublime Text 3 on a per document basis: Select Tools, Build System, LaTeX (I am using LaTeXing for ST). Now add this to the top of your main tex file.

    %-*- program: xelatex -*-        
    %-*- program: biber -*-`        
    %-*- program: xelatex -*-
    

    Use Cmd+B to invoke compiling.

  2. To see the results in Skim, go to Preferences, Sync, choose Preset: Custom. Under Command paste this:

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

    You may have to edit app name, as for most cases it's just Sublime Text.app

    And also for the Argument: "%file":%line

That's it. Now to jump from Skim to ST3: cmd-shif-click on any part of the PDF. From ST3 to Skim: Command+l, j.

0

I'd rather post this is a comment than an answer since it doesn't reference Sublime Text 3, but I don't have the reputation for commenting. Anyway, at least in Texpad on Mac creating a custom build script is very easy. You only need to make a .tpbuild script (which is just a BASH script);

#!/bin/bash

# run a .Rnw file through knitr first
# R -e 'library(knitr); knit("'$TEXPAD_ROOTFILE_NO_EXT'.Rnw")'

# build a .tex file
xelatex -synctex=1 "$TEXPAD_ROOTFILE_NO_EXT.tex"
biber "$TEXPAD_ROOTFILE_NO_EXT"
xelatex -synctex=1 "$TEXPAD_ROOTFILE_NO_EXT.tex"
xelatex -synctex=1 "$TEXPAD_ROOTFILE_NO_EXT.tex"

Or whatever you like.

  • You have more reputation than I do, and I comment freely without any problem. I will keep note of this, but I don't think it will work for ST3. – Nhaps Sep 21 '14 at 6:10
  • No, this is a Texpad specific solution unfortunately (e.g. that variable $TEXPAD_ROOTFILE_NO_EXT if defined by Texpad). It's an alternative if Sublime Text won't play nicely though. – drgibbon Sep 21 '14 at 16:10
  • I can comment on my own answers, but not on others "You must have 50 reputation or more to comment". – drgibbon Sep 21 '14 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.