Changes

Jump to navigation Jump to search
2,018 bytes added ,  15:37, 8 July 2021
Add a section about configuring syncing with an external editor.
% !TEX useAlternatePath
Then, typeset your document. You do not need to select the correct engine from the drop-down menu when <code>% !TEX TS-program</code> is used: TeXShop will pick up the engine specified in the source. Verify in the Console window that the correct ConTeXt distribution is used for typesetting.
 
===== Syncing Between Source and PDF =====
 
As of July 2021, ConTeXt provides support through its Swiss-knife <code>mtxrun</code> script for getting the filename and line corresponding to a certain spot in a PDF document, and for getting the PDF coordinates (page number + bounding box) corresponding to a given line in a source file. Type this in a terminal window to get some information about this nifty feature:
mtxrun --script synctex --help
TeXShop still supports an old syncing method, which is based on Jérôme Laurens's SyncTeX, but using that for ConTeXt is not recommended any longer, so how to use that will not be explained in this document. Just note that the ''Sync Method'' preference in ''Preferences > Typesetting'' is not relevant for the new syncing method described above; it is strongly recommended that it is set to ''SyncTeX (TeX ≥ 2010)'' anyway.
 
 
===== Syncing with an External Editor =====
 
TeXShop can be used as a previewer for an external editor. If you want to edit your source files in a different editor, go to ''TeXShop > Preferences > Source'', and check ''Configure for External Editor''. Then, close and reopen TeXShop.
 
Detailed instructions about configuring TeXShop to synchronise with an external editor are provided in ''TeXShop > Help > Changes'' and in the documents located in the ''~/Library/TeXShop/Engines/Inactive/ConTeXt-Sync'' and ''~/Library/TeXShop/ExternalEditorScripts' folders—so such instructions will not be repeated here, also because they depend on which editor you are using.
 
The following are a few things you may want to keep in mind if you use an external editor. They certainly apply to TeXShop v4.66; more recent releases may have rectified some of the issues or improved the user experience:
 
* TeXShop v4.66 does not (yet) support forward syncing from an included source. Forward syncing is supported for the root source document, though.
 
* For syncing to work with an external editor, make sure that '''only one preview window''' (the preview of the document you are currently editing) is opened in TeXShop; otherwise, syncing may not work.
 
* If syncing with an external editor still does not appear to work, and you are sure that you have followed the instructions and your configuration is correct, make sure that the relevant “magic lines” appear in your source document and try typesetting your document once '''from within TeXShop,''' by selecting the menu entry 'Typeset > Typeset' (the PDF of your document must be opened in TeXShop, of course).
 
* Even if ''Configure for External Editor'' is checked in you preferences, always open the <code>.tex</code> file in TeXShop, rather than the <code>.pdf</code> file. TeXShop will open the PDF anyway, but by choosing the <code>.tex</code> file, it may have an opportunity to parse the “magic lines” of the source code and configure itself correctly.
 
===== Making UTF-8 Default File Encoding=====
134

edits

Navigation menu