How would one open TeXShop, say, via command line using ssh
and X-forwarding?
[Tex/LaTex] How to open TeXShop remotely the command line
mactexshop
Related Solutions
TeXShop does not accept command line options.
The open
command allows a few (run open --help
), but they only allow you to do generic things like open the file without bringing TeXShop to the foreground.
Edit: The open
command does accept the --args
option, which allows you to pass arguments directly to any application. These arguments are passed to the application's main
function. TeXShop's main
function does not do anything with its arguments.
By inspecting the output of which pdflatex
, it seems you are using a TeX distribution provided by MacPorts. Personally, I think the use of a TeX distro via MacPorts should be discouraged; MacTeX is IMHO the best way of getting an updated and stable TeX distro on a Mac, and not to mention the handy TeX manager in the System Settings.
If you remove the TeX distro from MacPorts, the path inspection will return only one ocurrence of the TeX tools you need, i.e, the one living inside /usr/texbin
, which is the one TeXShop is using. In any case, if you want to stick with those two distros, let's see how to handle them.
Setting MacPorts TeX distro in TeXShop
TeX tools from MacPorts live inside /opt/local/bin
. If we want to use them in TeXShop, we need to add the full path. In TeXShop, from the menu, go to TeXShop
, and Preferences
. Select the Engine
tab. The following screen will pop up:
Setting the TeX tools via command line
If you want to set up your terminal to use a certain TeX distro, we need to inspect the path first. Issue
echo $PATH
and see the output. If, say, /usr/texbin
comes first than /opt/local/bin
, because of path search priority, the TeX tools will be from MacTeX instead of MacPorts. If by any chance you want to reverse the order, we need to edit the path. I'd recommend setting either .bashrc
or .bash_profile
. I usually prefer the latter.
Go to the terminal and type:
touch ~/.bash_profile
open ~/.bash_profile
The first command will create the .bash_profile
if it doesn't exist, while the second will open it in your default editor. Now, add the following line to your file
export PATH=/opt/local/bin:${PATH}
if you want the TeX distro from MacPorts to appear first, or
export PATH=/usr/texbin:${PATH}
to have MacTeX inspected first. Then save the file. You can apply modifications to your current session by issuing
source ~/.bash_profile
Additional info
As egreg and Alan mentioned in the commands, it's way better to rely on the official MacTeX distribution instead of relying on the MacPorts one. Besides, relying on /opt/local/bin
as the first search path might interfere with other system tools because of path priority. MacTeX is always the best solution.
Hope it helps. :)
Best Answer
Short answer: you can't. Longer answer: TeXshop is not a X-11 application, it's a native Mac one. As such, it cannot be run remotely over a
ssh
session. It can be opened locally from the Terminal usingNote also that TeXshop does not read command line parameters: TeXShop command line arguments