[Tex/LaTex] SyncTeX functionality in TeXShop and TeXworks

forward-inverse-searchtexshoptexworks

I have a LaTeX source code compiled with synctex=1. If I open it in TeXShop
and I can click in the viewer on a certain word then I am navigated exactly on the word in the source code. By contrast, if I open it in TeXworks and click on the same word, the whole paragraph containing the word is highlighted, which is a bit confusing when the paragraphs are quite long.

Any ideas how to force TeXworks to highlight only the particular word and not the whole paragraph?

Best Answer

SyncTeX only includes stores information on a line-by-line basis in the source, not to the granulatiry of individual letters or words. It is possible for editors to set up a search-based approach to give better synchronisation, as for example discussed in Forward-inverse search using SyncTeX with the precison of a single word. However, that is not necessarily trivial!

For this reason (and others), many experiences TeX authors write their source with 'hard' line breaks, rather than using the word wrap feature of their editor. This means that synchronisation will match to a single line. With a typical line length of 70-80 characters, this is usually sufficiently accurate for real-world use.