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

Paul A Norman paul.a.norman at gmail.com
Thu Feb 10 05:46:50 CET 2011

Dear Amartyo,

Here is a Script that may help a little, change as needed.


Searching within Large Paragraph(s) located by syncTeX from Tw Previewer.

  Out of discussion: -

Standard Tw Find does not give multiple results for a Find performed
within in a Selected area.

  INSTALLATION: Unzip anywhere under your Scripts folder (new folder
or existing one or  none).

  USAGE:  Triple Click the target paragraph / select paragraph(s)
first, then run this script. Shortcut Alt+L & ALt+S

If multiple results are found, a drop down selection box is presented
to the User to choose from, otherwise if one result it found - the
chosen result is jumped to and highlighted.

Script has much room for improvement ...

And could be partially automated if we had access to a global varible
that could be updated at this point in PDFdocument.cpp Line 1464 (ver
0.3 rev 729)
filename).canonicalFilePath(), true, true, synctex_node_line(node));



On 5 February 2011 21:38, Stefan Löffler <st.loeffler at gmail.com> wrote:

> 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.
> Stefan
> [1] http://itexmac.sourceforge.net/SyncTeX.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texworks/attachments/20110210/e9d410d8/attachment.html>

More information about the texworks mailing list