ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* visualising evolution from one version to another
@ 2006-08-06  6:46 Peter Münster
  2006-08-06 10:00 ` Taco Hoekwater
  2006-08-06 13:41 ` Aditya Mahajan
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Münster @ 2006-08-06  6:46 UTC (permalink / raw)


Hello,
if you know a bit MS-Word, then you have seen perhaps the feature, that
permits visualising differences between 2 versions of a document: added
text in red, and deleted text stroke out.

I would like to make something similar with ConTeXt: making a pdf-file from
doc-versionX.tex and doc-versionY.tex with added text in some colour and
deleted text displayed with \overstrikes{}.

Do you have some ideas, how to do that?

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: visualising evolution from one version to another
  2006-08-06  6:46 visualising evolution from one version to another Peter Münster
@ 2006-08-06 10:00 ` Taco Hoekwater
  2006-08-06 14:34   ` Peter Münster
  2006-08-06 13:41 ` Aditya Mahajan
  1 sibling, 1 reply; 6+ messages in thread
From: Taco Hoekwater @ 2006-08-06 10:00 UTC (permalink / raw)


Peter Münster wrote:
> Hello,
> if you know a bit MS-Word, then you have seen perhaps the feature, that
> permits visualising differences between 2 versions of a document: added
> text in red, and deleted text stroke out.
> 
> I would like to make something similar with ConTeXt: making a pdf-file from
> doc-versionX.tex and doc-versionY.tex with added text in some colour and
> deleted text displayed with \overstrikes{}.
> 
> Do you have some ideas, how to do that?

You need a way to create a merged ConTeXt document from the two separate
files, perhaps using something like this:

   http://search.cpan.org/dist/Text-WordDiff/lib/Text/WordDiff.pm

Cheers, taco

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: visualising evolution from one version to another
  2006-08-06  6:46 visualising evolution from one version to another Peter Münster
  2006-08-06 10:00 ` Taco Hoekwater
@ 2006-08-06 13:41 ` Aditya Mahajan
  2006-08-07 12:37   ` Peter Münster
  1 sibling, 1 reply; 6+ messages in thread
From: Aditya Mahajan @ 2006-08-06 13:41 UTC (permalink / raw)


On Sun, 6 Aug 2006, Peter Münster wrote:

> Hello,
> if you know a bit MS-Word, then you have seen perhaps the feature, that
> permits visualising differences between 2 versions of a document: added
> text in red, and deleted text stroke out.
>
> I would like to make something similar with ConTeXt: making a pdf-file from
> doc-versionX.tex and doc-versionY.tex with added text in some colour and
> deleted text displayed with \overstrikes{}.
>
> Do you have some ideas, how to do that?

There was a latex package with a perl script that did something like 
that. But I found it to be too cumbersome to use. If you are just 
using plain text, then it is easy to identify and mark what has 
changed. But what should happen if you change markup? What if a \bf is 
changed to \it or a \framed is added around a bit of text?
Marking differences in math is altogether a different story. For small 
documents (~10 pages) I found it easier to copy version2 by another 
name, diff the two files in an editor, and add the markup by hand. (I 
actualy had a macro to mark the change, so it was just pressing one of 
three keystokes). With context, you can have \DIFFdeleted, 
\DIFFchanged{before}{after} \DIFFadded with these expanding to the 
default MS word look and feel for changed files.

There are various diff programs, but I feel that for something 
slightly complicated, it is very hard to do identify the changes in a 
sensible way automatically. YMMV.

Aditya

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: visualising evolution from one version to another
  2006-08-06 10:00 ` Taco Hoekwater
@ 2006-08-06 14:34   ` Peter Münster
  2006-08-06 15:01     ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Münster @ 2006-08-06 14:34 UTC (permalink / raw)


On Sun, 6 Aug 2006, Taco Hoekwater wrote:

> You need a way to create a merged ConTeXt document from the two separate
> files, perhaps using something like this:
> 
>    http://search.cpan.org/dist/Text-WordDiff/lib/Text/WordDiff.pm

Thank you for this hint! It's exactly what I need. I've also found a shell
version: "wdiff"
But I still have one problem: I can't have a paragraph in \overstrikes.
Is there perhaps something like \startoverstrikes ... \stopoverstrikes ?

Here is a little script, to show what I'm doing now:

#!/bin/bash
OLD="$1"
NEW="$2"
OUT="$3"
shift 3
echo '\setupcolors[state=start]' >"$OUT.tex"
echo '\long\def\startDeleted*#1\stopDeleted*{\overstrikes{#1}}' >>"$OUT.tex"
echo '\long\def\startAdded*#1\stopAdded*{\startcolor[blue]#1\stopcolor}' \
	>>"$OUT.tex"
wdiff -w '\startDeleted*' -x '\stopDeleted*' \
	-y '\startAdded*' -z '\stopAdded*' "$OLD" "$NEW" >>"$OUT.tex"
texexec "$@" "$OUT"

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: visualising evolution from one version to another
  2006-08-06 14:34   ` Peter Münster
@ 2006-08-06 15:01     ` Taco Hoekwater
  0 siblings, 0 replies; 6+ messages in thread
From: Taco Hoekwater @ 2006-08-06 15:01 UTC (permalink / raw)


Peter Münster wrote:
> On Sun, 6 Aug 2006, Taco Hoekwater wrote:
> 
> 
>>You need a way to create a merged ConTeXt document from the two separate
>>files, perhaps using something like this:
>>
>>   http://search.cpan.org/dist/Text-WordDiff/lib/Text/WordDiff.pm
> 
> 
> Thank you for this hint! It's exactly what I need. I've also found a shell
> version: "wdiff"
> But I still have one problem: I can't have a paragraph in \overstrikes.
> Is there perhaps something like \startoverstrikes ... \stopoverstrikes ?

Not that I know of. It should be possible to cook something up with
metafun and/or \starttextbackgrounds i guess, but I do not have a
ready-to-use solution for you.

Taco

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: visualising evolution from one version to another
  2006-08-06 13:41 ` Aditya Mahajan
@ 2006-08-07 12:37   ` Peter Münster
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Münster @ 2006-08-07 12:37 UTC (permalink / raw)


On Sun, 6 Aug 2006, Aditya Mahajan wrote:

> But what should happen if you change markup? What if a \bf is
> changed to \it or a \framed is added around a bit of text?
> Marking differences in math is altogether a different story.

Yes, of course, I'll need to adjust manually in such cases.
But I'm already quite lucky, because with word-diff, the task was much
easier than I've ever hoped.

My intention is, to be prepared, if one of my colleagues, who are all used
to MS-Office, would ask for such a diff-document one day.
Now I'm able to generate such a document.
(My problem at work is, that I'm the only one not using MS-Office.)

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-08-07 12:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-06  6:46 visualising evolution from one version to another Peter Münster
2006-08-06 10:00 ` Taco Hoekwater
2006-08-06 14:34   ` Peter Münster
2006-08-06 15:01     ` Taco Hoekwater
2006-08-06 13:41 ` Aditya Mahajan
2006-08-07 12:37   ` Peter Münster

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).