[texworks] Commenting pdfs?

Stefan Löffler st.loeffler at gmail.com
Wed Jan 20 13:59:34 CET 2010


Am 2010-01-15 23:53, schrieb Paul A Norman:
> If poppler could be got to recognise (if not create) such comments in
> a pdf  (made outside poppler by a 3rd party?) - could it be asked to
> pass such comments back to into TeXWorks (as %comments themselves) in
> much the same way as it can reposition us in the TeXWorks editor, or
> would having coments added outside itself ruin the validity of the
> reposition information stored in the file that is generated when
> TeXWorks calls for the pdf to be made?

This is an interesting idea. In fact, existing comments can be accessed
already through poppler (I believe they are also working on the ability
to add comments, it just doesn't work yet). So importing them into Tw
would generally be possible.

Unfortunately, there is one problem with this idea, though, and that is
that it's not very generally applicable. You would need to have an
external PDF for which synctex information is available. So this would
only work in the single case that you typeset your document (with
synctex), send the pdf to, e.g., a co-worker, and get it back with
comments. If you then replace your original PDF with the commented one
synchronisation should work. In this case, it should be possible to
import the comment texts into the tex document. Of course this does ruin
the synctex info, but if it's done in the right way (i.e., from back to
front) I don't think that this would cause problems. This would also
mean that you overwrite the commented PDF the next time you hit typeset,
which is usually something you'd like to avoid.

> If it was achievable for stored comments in a pdf to be passed back -
> would it also open the door to sending plain text from the poppler
> interface back into the source TeXWorks document in realtime?
> E.g. A popup box could be made to appear with an input control and a
> button to send text back to TexWorks editor from a given location in
> the poppler interface?

Passing text in general (i.e., the "normal" text that is written in the
PDF, not comments or other markup) is actually more difficult. LaTeX
makes text out of boxes, and in PDF they could even be split into
smaller objects. So what we end up with is an a priori orderless bunch
of arbitrary characters on the page (for normal text this is usually put
in lines, so there is some order; but if you consider math formulas with
all sorts of subscripts and superscripts, the situation is much more
difficult; and finally, it is even possible to move text around fairly
arbitrarily (like with \raisebox)). Bringing these arbitrary, unordered
characters into a form suitable for copying is the real challenge here
(and I'm not even beginning to dive into the issue of RTL characters
like arabic that are stored in LTR order in the file).

> You've certainly raised the issue sof how TeXWorks can be used for
> groups projects in a wider sense in  a more WYSIWYG fashion.

Yeah, this was my intention indeed. Let's face it: most people use LaTeX
for complex (e.g. books) and/or scientific purposes. In both cases,
usually several people are involved (e.g. co-authors, supervisors,
lectors, reviewers, etc.). So working in groups is an important factor
for LaTeX IMO. Unfortunately, there are not many tools that facilitate
this process, especially when it comes to sharing documents with people
who know little or nothing about LaTeX. I've even seen people printing
out the PDF, making comments by hand, scanning the result and sending it
back as image (this is not as rare as it should be). So I think it would
be great if we could improve on that situation. After all Tw endeavors
to lower the barrier to the TeX world ;).


More information about the texworks mailing list