Changes

Jump to navigation Jump to search
3,501 bytes added ,  14:50, 8 July 2021
Explain how to setup syncing with new versions of TeXShop.
TeXShop is a good Editor for all variants of TeX and ConTeXt. It offers:
* Syntax highlighting.
* A viewer for your typeset PDFs.
* has templates and you can create your own
* command completions
* multiple file encodings
If you install "ConTeXt Suite" or want to use "TeXLive" in parallel with "ConTeXt Suite"s you have to create new engines * syntax highlighting;* a viewer for "TeXShop", so that your typeset PDFs;* two-way synchronisation (SyncTeX) between source and PDF;* templates (and you can run create your versions of "ConTeXt" directly from within "TeXShop"own);* command completion;* multiple file encodings.
==== SettingIf you have installed MacTeX (the TeX Live distribution for macOS), you may start typesetting right away.If TeXShop was installed with MacTeX, you may find it in the ''/Applications/TeX'' folder; otherwise, it will likely be in your ''Applications'' folder. Open a ConTeXt document with TeXShop, choose the ''ConTeXt (LuaTeX)'' engine from the drop-Up TeXShop for down menu in the toolbar of the source window, and typeset! Most likely, though, you will want to use the most up to date ConTeXt Single User release (see [[Installation ====]]). For that, you need to perform the following one-time set up: * ''In the Finder'', Option-click on the ''Go'' menu and select ''Library'' (this menu entry may not be visible if you do not keep Option pressed while clicking). TeXShop installs support files for every user in the folder ''TeXShop'' in the users user's ''Library '' folder of the users HOME user's home folder. They are installed first when the user runs TexShop TeXShop for the first time. * Go into ''TeXShop > Engines > Inactive > ConTeXt-Sync''. Move or copy the file <code>ConTeXt2021.engine</code> into the ''Engines'' folder.* Close and reopen TeXShop. The new ''ConTeXt2021'' engine should now appear in the toolbar drop-down menu.* Open Terminal.app, then type the following and press Enter: chmod 755 ~/Library/TeXShop/Engines/ConTeXt2021.engine* Back in TeXShop, go to ''Preferences > Engine'' and adjust the ''Alternate Path'' text field to point to the full path of your local ConTeXt installation. Now, every time you edit a ConTeXt document and want to use your local installation instead of MacTeX's, add the following “magic lines” right at the beginning of your source document: % !TEX TS-program = ConTeXt2021 % !TEX useAlternatePathThen, typeset your document. Verify in the Console window that the correct ConTeXt distribution is used. ===== Syncing Between Source and PDF =====As of July 2021, ConTeXt provides support 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. Editors can exploit this feature to provide smooth syncing between source code and PDF. TeXShop v4.66 and later has adopted ConTeXt's syncing feature. When this feature is enabled, Cmd-clicking somewhere in the preview window jumps to the source window and highlight the corresponding line. Vice versa, Cmd-clicking somewhere in a source window jumps to and highlights the corresponding spot in the preview. To enable this feature, make sure you are using the latest ConTeXt release, and add the following additional “magic line” at the start of your source document: % !TEX useConTeXtSyncParser Also, make sure that your document enables the generation of the <code>.synctex</code> file. Your source should contain this line: \setupsynctex[state=start,method=min]or this: \setupsynctex[state=start] Then, typeset your document and try Cmd-clicking either in the source or in the preview. This works even with complex documents made of several source files. Backward syncing (from PDF to source) works without any additional settings. To make forward syncing work (i.e., jumping from and included source to the PDF), you need to tell TeXShop which is the “root” document of your project. That is done by adding yet another “magic line” to all included sources: % !TEX root = <MAIN>.tex where <code>MAIN</code> is the name of your root source. If your included files are in a different folder, you need to specify the correct (relative) path to the root document. 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.
===== Making UTF-8 Default File Encoding=====
ConTeXt uses UTF-8 as its default encoding, so it is best to make this the default encoding for your files. You can also choose which ever whichever encoding you wish. You can, also, set the file encoding when it a document is saved. TeXShop will automatically recognize the file encoding of existing files and use that when saving the file.
* Start TeXShop. If TeXShop was installed with MacTeX you can find it in the folder TeX in your Application folder.To make TeXshop use utf-8 as its standard encoding for files, proceed as follows:
* Make TeXshop use utf-8 as its standard encoding for filesStart TeXShop. Choose the TeXShop-* Go to ''Preferences >Preferences Menu In the dialog window that comes up look for Encodings Field Source'', and choose ''Unicode (UTF-8 Close )'' from the drop-down menu in the Dialog window''Encoding'' group.
===== Creating an ''Engine'' for TeXShop =====
134

edits

Navigation menu