You'll have a TeXShop Engines
directory containing the shell scripts that are invoked whenever you hit the Typeset button. The script that's called depends which engine you have selected. For XeLaTeX it's usually ~/Library/TeXShop/Engines/XeLaTeX.engine
by default.
It looks something like this:
#!/bin/tcsh
set path= ($path /Library/TeX/texbin /usr/texbin /usr/local/bin)
xelatex -file-line-error -synctex=1 "$1"
You can open it with a text editor and add the -shell-escape
flag directly, like so:
#!/bin/tcsh
set path= ($path /Library/TeX/texbin /usr/texbin /usr/local/bin)
xelatex -file-line-error -synctex=1 -shell-escape "$1"
TeXShop will always call this script when XeLaTeX is selected, but you can save the changes to a new file, such as XeLaTeX-shellescape.engine
. Both will appear in the menu and you'll be able to set the magic line to use this new script:
% !TEX TS-program = XeLaTeX-shellescape
It is generally better to install fonts in your system-wide texmf-local
folder rather than your personal texmf
folder. In fact, TeXLive now has a simple script installed for installing the non-free fonts such as classico.
The really simple way
Open a Terminal window and type the following: (you should be logged in to an account with administrator privileges.)
sudo getnonfreefonts-sys classico
And you are done!
To use the font, add
\renewcommand{\sfdefault}{uop}
to your document preamble to make Classico the sans serif default.
What the script is doing (the slightly more complicated way)
Effectively the script is simply downloading the font from CTAN and executing 3 commands. Here's a step by step version of what it does, which you can also do if you prefer. I also leave it in for fonts that are not installed by the script. I will begin from the assumption that you have downloaded the uop.zip
file and it is in ~/Downloads
.
Open a Terminal window and type the following:
sudo unzip ~/Downloads/uop.zip -d /usr/local/texlive/texmf-local
You will be asked for your password.
This should return the a whole bunch of lines reporting the unzipped files:
Archive: uop.zip
inflating: /usr/local/texlive/texmf-local/doc/fonts/urw/Public.htm
inflating: /usr/local/texlive/texmf-local/doc/fonts/urw/classico.txt
creating: /usr/local/texlive/texmf-local/fonts/type1/urw/optima/
inflating: /usr/local/texlive/texmf-local/fonts/type1/urw/optima/uopb8a.pfb
inflating: /usr/local/texlive/texmf-local/fonts/type1/urw/optima/uopbi8a.pfb
... (lines deleted)
creating: /usr/local/texlive/texmf-local/tex/latex/uop/
inflating: /usr/local/texlive/texmf-local/tex/latex/uop/8ruop.fd
inflating: /usr/local/texlive/texmf-local/tex/latex/uop/ot1uop.fd
inflating: /usr/local/texlive/texmf-local/tex/latex/uop/t1uop.fd
inflating: /usr/local/texlive/texmf-local/tex/latex/uop/ts1uop.fd
Next enter
sudo texhash
this will rebuild the file list database to reflect the added files. This command should return:
texhash: Updating /usr/local/texlive/2011/../texmf-local/ls-R...
texhash: Updating /usr/local/texlive/2011/texmf/ls-R...
texhash: Updating /usr/local/texlive/2011/texmf-config/ls-R...
texhash: Updating /usr/local/texlive/2011/texmf-dist/ls-R...
texhash: Updating /usr/local/texlive/2011/texmf-var/ls-R...
texhash: Done.
Next enter
sudo updmap-sys --enable Map=uop.map
This command will enable the font map files and produce a lot of output too:
Config file: "/usr/local/texlive/2011/texmf-config/web2c/updmap.cfg"
dvips output dir: "/usr/local/texlive/2011/texmf-var/fonts/map/dvips/updmap"
pdftex output dir: "/usr/local/texlive/2011/texmf-var/fonts/map/pdftex/updmap"
dvipdfm output dir: "/usr/local/texlive/2011/texmf-var/fonts/map/dvipdfm/updmap"
pxdvi output dir: "/usr/local/texlive/2011/texmf-var/fonts/map/pxdvi/updmap"
/usr/texbin/updmap is creating new map files
using the following configuration:
LW35 font names : URWkb
prefer outlines : true
texhash enabled : true
download standard fonts (dvips) : true
download standard fonts (pdftex) : true
kanjiEmbed/variant replacement : noEmbed/
create a mapfile for pxdvi : false
Scanning for LW35 support files [ 3 files]
Scanning for MixedMap entries [ 44 files]
Scanning for KanjiMap entries [ 5 files]
Scanning for Map entries [169 files]
Generating output for dvipdfm...
Generating output for ps2pk...
Generating output for dvips...
Generating output for pdftex...
Files generated:
/usr/local/texlive/2011/texmf-var/fonts/map/dvips/updmap:
11499 2012-03-27 23:01:54 builtin35.map
15962 2012-03-27 23:01:54 download35.map
586252 2012-03-27 23:01:55 psfonts_pk.map
847257 2012-03-27 23:01:55 psfonts_t1.map
842824 2012-03-27 23:01:54 ps2pk.map
14 2012-03-27 23:01:56 psfonts.map -> psfonts_t1.map
/usr/local/texlive/2011/texmf-var/fonts/map/pdftex/updmap:
842831 2012-03-27 23:01:56 pdftex_dl14.map
841257 2012-03-27 23:01:55 pdftex_ndl14.map
15 2012-03-27 23:01:56 pdftex.map -> pdftex_dl14.map
/usr/local/texlive/2011/texmf-var/fonts/map/dvipdfm/updmap:
5003 2012-03-27 23:01:54 kanjix.map
Transcript written on "/usr/local/texlive/2011/texmf-var/web2c/updmap.log".
/usr/texbin/updmap: Updating ls-R files.
Now you are done. Use as above.
Best Answer
From the Finder
The reason you didn't find the
~/Library
folder using the Go menu was that you left out the~
. This symbol denotes your "home" folder, whereas without it (what you typed/Library
is the system Library folder.) Here's what the Go menu input should look like:From inside TeXShop
But with recent versions of TeXShop there's a direct way to get to the
~/Library/TeXShop
folder in the TeXShop menu of the application:From the Terminal
From the command line you can type
This means "change directory to
~/Library/TeXShop
and open.
(the current directory)". This will open a Finder window with the directory in it.Adding a new template
A template file is simply a
.tex
file that is stored in the Templates folder. Once you have added a file there, it will be immediately available in any new source window you open.