ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Procházka Lukáš Ing." <LPr@pontex.cz>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: future versions - synctex
Date: Tue, 21 Aug 2018 10:00:53 +0200	[thread overview]
Message-ID: <op.zn267rwj3h68c7@lpr> (raw)
In-Reply-To: <1f292b41-ba4b-b3ac-fae9-b12c92a18e9c@xs4all.nl>

Hello,

a bit later - I was thinking if to react here, after reading all about synctex and complicated support for complicatedly assembled source files - but my personal experience/wish...

> On 7/24/2018 11:02 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
>> Hi Hans, all,
>
>> One needed feature that would be of general use is better support for
>> synctex. Thinking especially of structural elements such as headings,
>> footnotes, etc. which mostly do not work with synctex - i.e., clicking
>> on these elements in the pdf do not take one back to the correct
>> location in the relevant TEX file.

When building a document (or more precisely: documentation which consists of many documents), I'm widely referring to other files via \input, \component etc., I'm widely using \defs, \defines and \buffers defined in separate files (as these defs are used at more places - so let them being defined in one source file) and I'm often generating texts by Lua (e.g. tables - being read and parsed from a text in a \start/\stopluacode block or e.g. Excel named range read via LuaXls or from a .xml - and typeset by a Lua function, which allows simply change all \NC into \VL in a particular place).

The lengthy process is to EDIT (almost) finished docs/documentation. And at this place, it would be very handy if synctex worked. So I vote for a better click-in-PDF-go-to-source support.

On Wed, 25 Jul 2018 01:21:48 +0200, Hans Hagen <j.hagen@xs4all.nl> wrote:

> Synctex is a beast. Basically it is not that useable for context which
> is why we have a different implementation with a rather clean, minimal,
> and predictable output. Unfortunately the usual approahc is to use a
> library for interoreting the synctex files which has too much heuristics
> built in. More flexible would be to let the viewer cann an external
> program which then can interpret the synctex file based on a page and
> position. This also would make it possible to have more clever
> synchronization and/or adapt to a macro package. Anyway, were sort of
> stuck and can only try to make the best of it.
>
> That said, the context generated synctex file is nornally okay unless we
> render from lua, which happens for instance with titles. Just try
>
> \ctxlua{context("foo bar")}
>
> and you will also see that there is no line related positioning.
> Tweaking luatex for this is not really an options because whatever
> decision we make here will backfire at some point. (I can look into some
> option later but it needs bit of thinking)

I don't know anything deep about how sync is provided. But my layman point of view would be that whenever a character (or a "box") is to be placed on the page (or into output stream), ConTeXt should know which is the "deepest - currently read" source file, the line, moreover the column - and that position could result into "pick-and-go" position.

In this approach - "boxes" generated by Lua-in-ConTeXt should "jump" on \startluacode, \ctxlua, \cldcommand statement...

> Anyway, i can cheat at the tex/lua end if needed and support e.g. titles
> but i'm not going to pollute the code with every place where we come
> from lua (also because in most cases there is no relation with the
> source anyway then). Also, I will not add code that can have an impact
> on performance when synctex is turned off.

Synctex should be turned on/off before source files are compiled into PDF - via command line option "--synctex" or \enabledirectives[system.synctex] before \starttext (\enabledirectives[system.synctex] after \starttext (\startcomponent) should be ignored?) - that could cause hooking picked Lua functions (or taking their "synctex-on" alternatives) - so normally (with synctex off) there wouldn't be any performance impact; worse performance would come only with synctex on - but it's user's choice.

> But for a subset of
> constructs that are relatively short in usage it is doable (but doesn't
> really qualify as fun -- also, i don't use it myself).

Anyway, a better support for "pick-in-PDF-and-go-to-source" (synctex), namely when user "tunes" the docs to their final stage, would be great.

Best regards,

Lukas

> (One complication is that for instance fixing it for some constructs
> will break it for xml input which also supports synctex.)
>
> Hans


-- 
Ing. Lukáš Procházka | mailto:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2018-08-21  8:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 18:43 future versions Hans Hagen
2018-07-24 19:07 ` Hans van der Meer
2018-07-24 20:35   ` Pablo Rodriguez
2018-07-24 20:30 ` Pablo Rodriguez
2018-07-24 21:02 ` Idris Samawi Hamid ادريس سماوي حامد
2018-07-24 23:21   ` Hans Hagen
2018-08-21  8:00     ` Procházka Lukáš Ing. [this message]
2018-08-21  8:33       ` future versions - synctex Hans Hagen
2018-08-21 13:04         ` Aditya Mahajan
2018-08-21 13:19           ` Hans Hagen
2018-08-21 14:46             ` Aditya Mahajan
2018-08-21 15:17               ` Hans Hagen
2018-07-25  1:29 ` future versions Rik Kabel
2018-07-25  8:19   ` Henning Hraban Ramm
2018-07-25 13:50     ` Rik Kabel
2018-07-25 16:06       ` Hans Hagen
2018-07-25 16:18       ` Alan Braslau
2018-07-25 17:01         ` Hans Hagen
2018-07-25 11:36   ` Hans Hagen
2018-07-25  7:45 ` Robert Zydenbos
2018-07-25 10:03   ` Richard Mahoney | Indica et Buddhica
2018-07-25 12:50     ` Hans Hagen
2018-07-25 13:12       ` Weber, Matthias
2018-07-25 17:50         ` Hans Hagen
2018-07-25 20:22           ` Henning Hraban Ramm
2018-07-25 11:38   ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.zn267rwj3h68c7@lpr \
    --to=lpr@pontex.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).