[texworks] Implementing word and / or character level synchronization in TeXworks using SyncTeX

Stefan Löffler st.loeffler at gmail.com
Sat Feb 5 09:38:42 CET 2011


Hi,

On 2011-02-04 14:58, amartyo banerjee wrote:
> At the place where I work, we are very interested in adding to the
> 'Jump to Source' feature in TeXworks such that one can jump to a
> particular character or word in the source file that has been
> highlighted in the output pdf file. It would make it much easier to
> work with the LaTeX files we use in production, which often contain
> very large paras.
>
> I understand that similar functionality is implemented in TeXShop and iTeXMac2.
>
> Is any work already being done to implement this feature? If so when
> might it be available, either in svn or a release version?
>
> If nobody else is already planning / working on it, I would appreciate
> any and all pointers on how to go about implementing this feature.
> Like I said, it really needs to implemented in my workplace. Also,
> what would be required to get this incorporated into TexWorks, once it
> is complete?

As is stated in the source code of SyncTeX [1] (which is used for
synchronization in Tw), "[Access to column numbers] is not yet fully
supported in TeX, the default implementation returns 0 which means the
whole line." Some short tests on TL'10 support that. So, at the moment
it would seem that the main problem is on the TeX side of things - I'm
not sure if any work is done to solve this right now. So it would
probably be best to ask for this feature on a TeX list. Once that is
implemented, it should be straight-forward to get it up and running in Tw.

Of course, in principle other approaches exist, such as using some
string search routines to find the word that was clicked. But that is
far from reliable. Just imagine a word occurring several times in a
line. Or think about the complexities TeX offers, with nested commands,
etc. So I think SyncTeX is the better alternative here.

HTH
Stefan

[1] http://itexmac.sourceforge.net/SyncTeX.html


More information about the texworks mailing list