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.

1 Answer 1

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.

2
  • Please also read Help->TeXShop Tips and Tricks. Sep 27, 2019 at 0:42
  • Amazing, thank you!
    – esten
    Sep 27, 2019 at 7:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .