Changes

Jump to navigation Jump to search
1,116 bytes added ,  15:11, 8 July 2021
Add minimal example for syncing
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 that you are using the latest ConTeXt release, and add the following additional “magic line” at the start of your source document:
% !TEX useConTeXtSyncParser
\setupsynctex[state=start]
Then, typeset your document and try Cmd-clicking either in the source or in the preview.This is a minimal example that allows you to test syncing within TeXShop: <nowiki>% !TEX TS-program = ConTeXt2021% !TEX useAlternatePath% !TEX useConTeXtSyncParser
This \setupsynctex[state=start,method=min] \starttextSed ut perspiciatis unde omnis iste natus error sit voluptatemaccusantium doloremque laudantium, totam rem aperiam, eaqueipsa quae ab illo inventore veritatis et quasi architectobeatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatemquia voluptas sit aspernatur aut odit aut fugit, sed quiaconsequuntur magni dolores eos qui ratione voluptatem sequinesciunt. Neque porro quisquam est, qui dolorem ipsum quiadolor sit amet, consectetur, adipisci velit, sed quia nonnumquam eius modi tempora incidunt ut labore et dolore magnamaliquam quaerat voluptatem. Ut enim ad minima veniam, quisnostrum exercitationem ullam corporis suscipit laboriosam, nisiut aliquid ex ea commodi consequatur? Quis autem vel eum iurereprehenderit qui in ea voluptate velit esse quam nihilmolestiae consequatur, vel illum qui dolorem eum fugiat quovoluptas nulla pariatur?\stoptext</nowiki> Syncing 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 an 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.tex</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.
134

edits

Navigation menu