ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: jerome.laurens@u-bourgogne.fr
Subject: Re: Synchronization (.tex <-> .pdf)
Date: Mon, 22 Dec 2003 16:58:28 +0100	[thread overview]
Message-ID: <6.0.1.1.2.20031222165049.01e087a0@server-1> (raw)
In-Reply-To: <a06002000bc0cacc6322a@[217.184.13.25]>

At 15:38 22/12/2003, Steffen Wolfrum wrote:

>I don't now how many ConTeXt user are aware of the idea of 
>synchronization. In the LaTeX area of TeX it has a kind of tradition 
>(Textures, srcltx, ...) for dvi output.
>
>For PDF output Jérôme Laurens has now written a package (for use with 
>iTeXMac and TeXShop) that makes the advantages from source-output 
>synchronization also available for the todays standard PDF. But as so many 
>things in the TeX world it is written as a "plug-in" for LaTeX.
>
>Does anybody has an idea how to use this great achievement also with ConTeXt?
>For those who would like to have a look at Jérôme's great work, I insert 
>his code at the end of this email.

It's not that complicated to implement this kind of support in context, but 
i'd rather start from the editor's specs, so what is it that texshop wants 
as input (syntax and so)? Once that is known, i can have a look at it and 
see to what extend it can be supported in an non-interfering way. 
(furthermore i'd also support it in dvi mode)

(in one of old context manuals the typeset result is crosslinked to the 
input in a similar way; one reason for me to drop it is that in many cases 
my output is not in sync with the source, i.e. as soon as you move data 
around ...)

Hans


>%%%%  This is pdfsync.sty
>%%%%  2003-12-08:
>%%%%  There is a bug in using everyvbox... novbox is now the default
>%%%%  bug fixed: $0$ was no visible
>%%%%  2003-11-28:
>%%%%  comment characters added to fix an error. Don't know exactly the 
>cause...
>%%%%  Default option is all...
>%%%%  Could not use \everydisplay... (bug in eqnarray)
>%%%%  2003-11-19
>%%%%  first version
>%%%% usage: \usepackage[display,cr,vbox]{PDFSYNC}
>%%%% appends reference points before each \par and at each \hbox, inline math;
>%%%% optionally also at every displayed math, with the option [display]
>%%%% optionally also at every \cr, with the option [cr]
>%%%% optionally also at every \vbox, with the option [vbox]
>%%%%
>%%%% If you want additional files to be parsed, please use the command
>%%%% \include (which is redefined below)
>%%%% This file is due to Piero D'Ancona and jlaurens@users.sourceforge.net
>%%%% iTeXMac is supporting pdfsync
>%%%% Copy this file to ~/Library/texmf/tex/latex or 
>~/Library/TeX/texmf/tex/latex if available
>%%%% This file is distributed under the GPL and the "smart licence": 
>please make things better if you can
>%%%% © 2003, jlaurens@users.sourceforge.net
>%
>\NeedsTeXFormat{LaTeX2e}%
>\ProvidesPackage{pdfsync}[2003/12/08 v0.3]%
>\newif\ifPDFSYNCOK%
>\newif\ifPDFSYNCStar%
>\newif\ifPDFSYNCPar \PDFSYNCPartrue%
>\newif\ifPDFSYNCMath \PDFSYNCMathtrue%
>\newif\ifPDFSYNCCr \PDFSYNCCrtrue%
>\newif\ifPDFSYNCHBox \PDFSYNCHBoxtrue%
>\newif\ifPDFSYNCVBox \PDFSYNCVBoxfalse%
>\newif\ifPDFSYNCExtra \PDFSYNCExtratrue%
>\newwrite\PDFPOS%
>\newcount\PDFSYNC@folio\PDFSYNC@folio=0%
>\newcount\PDFSYNC@rder\PDFSYNC@rder=0%
>\DeclareOption{nopar}{\PDFSYNCParfalse}%
>\DeclareOption{nomath}{\PDFSYNCMathfalse}%
>\DeclareOption{nocr}{\PDFSYNCCrfalse}%
>\DeclareOption{nohbox}{\PDFSYNCHBoxfalse}%
>\DeclareOption{novbox}{\PDFSYNCVBoxfalse}%
>\DeclareOption{vbox}{\PDFSYNCVBoxtrue}%
>\DeclareOption{noextra}{\PDFSYNCExtrafalse}%
>\DeclareOption{nothing}{\let\pdfsyncstart\pdfsyncstop}%
>\ProcessOptions\relax%
>\RequirePackage{everyshi}%
>\ifx\pdfsavepos\undefined%
>   \wlog{Synchronization is only available with pdf. Use a dvi viewer 
> instead.}%
>   \let\pdfsyncstart\relax%
>   \let\pdfsyncstop\relax%
>   \let\pdfsync\relax%
>   \let\@PDFSYNC\relax%
>\else%
>   \def\pdfsyncstart{\global\PDFSYNCOKtrue}%
>   \def\pdfsyncstop{\global\PDFSYNCOKfalse}%
>   \EveryShipout{\@PDFSYNC\global\advance\PDFSYNC@folio by 
> 1\immediate\write\PDFPOS{s\space\the\PDFSYNC@folio}}%
>    \immediate\openout\PDFPOS\jobname.pdfsync%
>     \immediate\write\PDFPOS{\jobname}%            control info
>     \immediate\write\PDFPOS{version 0}%            control info
>     \let\PDFSYNC@include\include%
>     \def\PDFSYNC@@include#1{%
>             \immediate\write\PDFPOS{(#1}%
>             \PDFSYNC@include{#1}\immediate\write\PDFPOS{)}}%
>     \let\include\PDFSYNC@@include%
>     \def\@PDFSYNC{%
>     \ifPDFSYNCOK%
>         \pdfsavepos%
> 
>\immediate\write\PDFPOS{l\space\the\PDFSYNC@rder\space\the\inputlineno}%
>         \def\position{\the\pdflastxpos\space\the\pdflastypos}%
>         \ifPDFSYNCStar%
> 
>\edef\argument{{p*\space\the\PDFSYNC@rder\space\noexpand\position}}%
>         \else%
> 
>\edef\argument{{p\space\the\PDFSYNC@rder\space\noexpand\position}}%
>         \fi%
>         \expandafter\write\expandafter\PDFPOS\argument%
>         \global\advance\PDFSYNC@rder by 1%
>     \fi}%
>  \def\pdfsync{\global\PDFSYNCStartrue\@PDFSYNC\global\PDFSYNCStarfalse}%
>   \def\PDFSYNC@Extra{%
>% 
>\let\PDFSYNC@maketitle\maketitle\def\maketitle{\pdfsyncstop\PDFSYNC@maketitle\pdfsyncstart}
>   \let\PDFSYNC@newline\\\def\\{{\@PDFSYNC}\PDFSYNC@newline}%
>   \global\let\PDFSYNC@verse\verse
> 
>\global\def\verse{\PDFSYNC@verse\let\PDFSYNC@newline\\\def\\{{\@PDFSYNC}\PDFSYNC@newline}}%
>   }%
>\AtBeginDocument{%
>\pdfsyncstart%
>\ifPDFSYNCPar\global\let\p@@r\par\gdef\par{{\@PDFSYNC}\p@@r}\fi%
>\ifPDFSYNCMath\everymath{{\@PDFSYNC}}\fi%
>\ifPDFSYNCCr\everycr {{\@PDFSYNC}}\fi%
>\ifPDFSYNCHBox\everyhbox {{\@PDFSYNC}}\fi%
>\ifPDFSYNCVBox\everyvbox {{\@PDFSYNC}}\fi%there is a bug here
>\ifPDFSYNCExtra\PDFSYNC@Extra\fi%
>}%
>\fi%
>\endinput
>
>_______________________________________________
>ntg-context mailing list
>ntg-context@ntg.nl
>http://www.ntg.nl/mailman/listinfo/ntg-context
>
>================================================================
>Deze e-mail is door E-mail VirusScanner van Planet Internet gecontroleerd 
>op virussen.
>Op http://www.planet.nl/evs staat een verwijzing naar de actuele lijst 
>waar op wordt gecontroleerd.

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

  parent reply	other threads:[~2003-12-22 15:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-22 14:38 Steffen Wolfrum
2003-12-22 15:56 ` Nigel King
2003-12-22 16:32   ` Hans Hagen
2003-12-22 17:29     ` Nigel King
     [not found]     ` <9E1E738E-34AF-11D8-87D8-000A95B11F72@mac.com>
2003-12-23  9:07       ` Hans Hagen
2003-12-23 10:14         ` Adam Lindsay
2003-12-23 10:49           ` Hans Hagen
2003-12-22 15:58 ` Hans Hagen [this message]
2003-12-23  8:41 Steffen Wolfrum

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=6.0.1.1.2.20031222165049.01e087a0@server-1 \
    --to=pragma@wxs.nl \
    --cc=jerome.laurens@u-bourgogne.fr \
    --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).