1

In TeXShop, is it possible to use the ctrl/cmd+T hotkey to compile a different file than the one that's open?

When distributing the project into multiple files, it would be nice to have a hotkey which always compiles the associated main.tex file. Normally, I have main.tex open in the first tab of the window, and a hotkey for compiling the first tab would be nice.

3

I made two files

File estenmain.tex

\documentclass{article}

\begin{document}

\input{estensecondary}

\end{document}

File estensecondary.tex

% !TEX root = estenmain.tex

Hello world.

Then clicking “Typeset” in the window of the second file, the root file is compiled.

The “magic line” can be added with a choice from the menu “Macros > Root”. A box for choosing a file will appear and you'll be given the choice between a relative path or an absolute path. The former is best.

| improve this answer | |
  • Please also read Help->TeXShop Tips and Tricks. – Herb Schulz Sep 27 '19 at 0:42
  • Amazing, thank you! – esten Sep 27 '19 at 7:29

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.