OASIS Virtual I/O Device (VIRTIO) TC

 View Only
  • 1.  [PATCH] makediffpdf.sh: tool to create marked-up diff

    Posted 06-22-2014 16:41
    make pdf diff using latexpand and latexdiff-fast styles are set in diffpreamble.tex: new text is blue, old text is red and is crossed-out. in diff, links are coloured green instead of blue Must be run within a git-svn clone of the spec repository. Note: latexdiff has --flatten option, this and options to select diff style don't seem to work well. So flatten by script myself, and add our own preamble. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- The following seems to work OK for me, though it probably can be made prettier. Anyone? Note: I'm using latexdiff-fast tool from cpan: default latexdiff on Fedora does not seem to work well. diffpreamble.tex 27 +++++++++++++++++++++++++++ makediffpdf.sh 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 diffpreamble.tex create mode 100755 makediffpdf.sh diff --git a/diffpreamble.tex b/diffpreamble.tex new file mode 100644 index 0000000..d34ced5 --- /dev/null +++ b/diffpreamble.tex @@ -0,0 +1,27 @@ +%DIF FONTSTRIKE PREAMBLE +RequirePackage[normalem]{ulem} +providecommand{DIFaddtex}[1]{{sf #1}} +providecommand{DIFdeltex}[1]{{footnotesize sout{#1}}} +%DIF END FONTSTRIKE PREAMBLE +%DIF COLOR PREAMBLE +RequirePackage{color} +providecommand{DIFaddbegin}{protectcolor{blue}} +providecommand{DIFaddend}{protectcolor{black}} +providecommand{DIFdelbegin}{protectcolor{red}} +providecommand{DIFdelend}{protectcolor{black}} +%DIF END COLOR PREAMBLE +% Standard DIFadd and DIFdel are redefined as DIFaddtex and DIFdeltex +% when hyperref package is included. +%DIF HYPERREF PREAMBLE +providecommand{DIFadd}[1]{ exorpdfstring{DIFaddtex{#1}}{#1}} +providecommand{DIFdel}[1]{ exorpdfstring{DIFdeltex{#1}}{}} +%DIF END HYPERREF PACKAGE + +%DIF FLOATSAFE PREAMBLE: SEEMS UNUSED BUT JUST IN CASE +providecommand{DIFaddFL}[1]{DIFadd{#1}} +providecommand{DIFdelFL}[1]{DIFdel{#1}} +providecommand{DIFaddbeginFL}{} +providecommand{DIFaddendFL}{} +providecommand{DIFdelbeginFL}{} +providecommand{DIFdelendFL}{} +%DIF END FLOATSAFE PREAMBLE diff --git a/makediffpdf.sh b/makediffpdf.sh new file mode 100755 index 0000000..a8176ad --- /dev/null +++ b/makediffpdf.sh @@ -0,0 +1,34 @@ +#make pdf diff using latexpand and latexdiff-fast +#preamble in diffpreamble.tex +#in diff, links are coloured green instead of blue +PATH=.:${PATH} +cur="$PWD" +rm -fr old new +git clone $PWD old +cd "${cur}/old" +git checkout ec1ffbf27a8f0a06ca65cd498a69c7f89bd97dc1 +mv specvars.tex specvars-orig.tex +#make links green to avoid confusion +sed s/blue/green/ specvars-orig.tex > specvars.tex +SPECDOC=${SPECDOC:-`cat REVISION`} +./make-setup-generated.sh "$SPECDOC" +#wget http://www.ctan.org/pkg/latexpand +#chmod +x latexpand +latexpand virtio.tex -o flat.tex +cd "${cur}" +git clone $PWD new +cd "${cur}/new" +mv specvars.tex specvars-orig.tex +#make links green to avoid confusion +sed s/blue/green/ specvars-orig.tex > specvars.tex +SPECDOC=${SPECDOC:-`cat REVISION`} +./make-setup-generated.sh "$SPECDOC" +latexpand virtio.tex -o flat.tex +cd "${cur}" +#wget http://mirror.math.ku.edu/tex-archive/support/latexdiff/latexdiff-fast +#chmod +x latexdiff-fast +latexdiff-fast -p diffpreamble.tex old/flat.tex new/flat.tex > virtio-diff.tex +rm $SPECDOC.aux $SPECDOC.pdf $SPECDOC.out +xelatex --jobname $SPECDOC virtio-diff.tex +xelatex --jobname $SPECDOC virtio-diff.tex +xelatex --jobname $SPECDOC virtio-diff.tex -- MST


  • 2.  [PATCH v2] makediffpdf.sh: tool to create marked-up diff

    Posted 06-23-2014 20:45
    make pdf diff using latexpand and latexdiff-fast styles are set in diffpreamble.tex: new text is blue, old text is red and is crossed-out. in diff, links are coloured green instead of blue Must be run within a git-svn clone of the spec repository. Note: latexdiff has --flatten option, this and options to select diff style don't seem to work well. So flatten by script myself, and add our own preamble. A script fixupdiff works around xetex bugs - color{ footnote{text} } does not work, replace with footnote{ extcolor{}} - too many color instructions produce "color stack overflow. Just ignore" error and xetex skips some color instructions. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- Changes from v1: work around xetex bugs Output looks ok to me now, plan to commit tomorrow. Comments? diff --git a/diffpreamble.tex b/diffpreamble.tex new file mode 100644 index 0000000..8abb737 --- /dev/null +++ b/diffpreamble.tex @@ -0,0 +1,28 @@ +%% diffpreable.tex start + +%DIF FONTSTRIKE PREAMBLE +RequirePackage[normalem]{ulem} +providecommand{DIFadd}[1]{{sf #1}} +providecommand{DIFdel}[1]{{footnotesize sout{#1}}} +%DIF END FONTSTRIKE PREAMBLE + +%DIF COLOR PREAMBLE +RequirePackage{color} +providecommand{DIFaddbegin}{protectcolor{blue}} +providecommand{DIFaddend}{protectcolor{black}} +providecommand{DIFdelbegin}{protectcolor{red}} +providecommand{DIFdelend}{protectcolor{black}} +%DIF END COLOR PREAMBLE +providecommand{DIFaddtext}[1]{ extcolor{blue}{sf #1}} +providecommand{DIFdeltext}[1]{ extcolor{red}{footnotesize sout{#1}}} + +%DIF FLOATSAFE PREAMBLE: SEEMS UNUSED BUT JUST IN CASE +providecommand{DIFaddFL}[1]{DIFadd{#1}} +providecommand{DIFdelFL}[1]{DIFdel{#1}} +providecommand{DIFaddbeginFL}{} +providecommand{DIFaddendFL}{} +providecommand{DIFdelbeginFL}{} +providecommand{DIFdelendFL}{} +%DIF END FLOATSAFE PREAMBLE + +%% diffpreable.tex end diff --git a/fixupdiff.pl b/fixupdiff.pl new file mode 100755 index 0000000..69d4e6e --- /dev/null +++ b/fixupdiff.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl -pi + +# Too many color directives (generated by DIFdel/addbegin/end) +# confuse xetex, producing errors: +# WARNING ** Color stack overflow. Just ignore. +# and resulting in corrupted color in output. +# As a work-around, detect cases where it's safe, and replace color with +# extcolor. +# As a result, number of color directives goes does sufficiently +# enough to avoid the overflow error. + +s/\DIFdelbegin \DIFdel{([^}]*)}\DIFdelend/\DIFdeltext{$1}/; +s/\DIFaddbegin \DIFadd{([^}]*)}\DIFaddend/\DIFaddtext{$1}/; + +# external color does not seem to apply to footnotes. +# detect and replace with extcolor within footnotes +s/(\footnotes*{[^}]*)\DIFadd{/$1\DIFaddtext{$2/; +s/(\footnotes*{[^}]*)\DIFdel{/$1\DIFdeltext{$2/; diff --git a/makediffpdf.sh b/makediffpdf.sh new file mode 100755 index 0000000..34904bf --- /dev/null +++ b/makediffpdf.sh @@ -0,0 +1,36 @@ +#make pdf diff using latexpand and latexdiff-fast +#preamble in diffpreamble.tex +#in diff, links are coloured green instead of blue +PATH=.:${PATH} +cur="$PWD" +rm -fr old new +git clone $PWD old +cd "${cur}/old" +git checkout ec1ffbf27a8f0a06ca65cd498a69c7f89bd97dc1 +mv specvars.tex specvars-orig.tex +#make links green to avoid confusion +sed s/blue/green/ specvars-orig.tex > specvars.tex +SPECDOC=${SPECDOC:-`cat REVISION`} +./make-setup-generated.sh "$SPECDOC" +#wget http://www.ctan.org/pkg/latexpand +#chmod +x latexpand +latexpand virtio.tex -o flat.tex +cd "${cur}" +git clone $PWD new +cd "${cur}/new" +mv specvars.tex specvars-orig.tex +#make links green to avoid confusion +sed s/blue/green/ specvars-orig.tex > specvars.tex +SPECDOC=${SPECDOC:-`cat REVISION`} +./make-setup-generated.sh "$SPECDOC" +latexpand virtio.tex -o flat.tex +cd "${cur}" +#wget http://mirror.math.ku.edu/tex-archive/support/latexdiff/latexdiff-fast +#chmod +x latexdiff-fast +latexdiff-fast -p diffpreamble.tex old/flat.tex new/flat.tex > virtio-diff.tex +perl -pi fixupdiff.pl virtio-diff.tex +SPECDOC="${SPECDOC}-diff" +rm $SPECDOC.aux $SPECDOC.pdf $SPECDOC.out +xelatex --jobname $SPECDOC virtio-diff.tex +xelatex --jobname $SPECDOC virtio-diff.tex +xelatex --jobname $SPECDOC virtio-diff.tex


  • 3.  [PATCH v2] makediffpdf.sh: tool to create marked-up diff

    Posted 06-23-2014 20:45
    make pdf diff using latexpand and latexdiff-fast

    styles are set in diffpreamble.tex:
    new text is blue, old text is red and is crossed-out.

    in diff, links are coloured green instead of blue

    Must be run within a git-svn clone of the spec repository.

    Note: latexdiff has --flatten option, this and options
    to select diff style don't seem to work well.
    So flatten by script myself, and add our own preamble.

    A script fixupdiff works around xetex bugs
    - \color{ \footnote{text} } does not work,
    replace with \footnote{\textcolor{}}
    - too many \color instructions produce
    "color stack overflow. Just ignore" error and
    xetex skips some \color instructions.

    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    ---

    Changes from v1:
    work around xetex bugs

    Output looks ok to me now, plan to commit tomorrow.
    Comments?


    diff --git a/diffpreamble.tex b/diffpreamble.tex
    new file mode 100644
    index 0000000..8abb737
    --- /dev/null
    +++ b/diffpreamble.tex
    @@ -0,0 +1,28 @@
    +%% diffpreable.tex start
    +
    +%DIF FONTSTRIKE PREAMBLE
    +\RequirePackage[normalem]{ulem}
    +\providecommand{\DIFadd}[1]{{\sf #1}}
    +\providecommand{\DIFdel}[1]{{\footnotesize \sout{#1}}}
    +%DIF END FONTSTRIKE PREAMBLE
    +
    +%DIF COLOR PREAMBLE
    +\RequirePackage{color}
    +\providecommand{\DIFaddbegin}{\protect\color{blue}}
    +\providecommand{\DIFaddend}{\protect\color{black}}
    +\providecommand{\DIFdelbegin}{\protect\color{red}}
    +\providecommand{\DIFdelend}{\protect\color{black}}
    +%DIF END COLOR PREAMBLE
    +\providecommand{\DIFaddtext}[1]{\textcolor{blue}{\sf #1}}
    +\providecommand{\DIFdeltext}[1]{\textcolor{red}{\footnotesize \sout{#1}}}
    +
    +%DIF FLOATSAFE PREAMBLE: SEEMS UNUSED BUT JUST IN CASE
    +\providecommand{\DIFaddFL}[1]{\DIFadd{#1}}
    +\providecommand{\DIFdelFL}[1]{\DIFdel{#1}}
    +\providecommand{\DIFaddbeginFL}{}
    +\providecommand{\DIFaddendFL}{}
    +\providecommand{\DIFdelbeginFL}{}
    +\providecommand{\DIFdelendFL}{}
    +%DIF END FLOATSAFE PREAMBLE
    +
    +%% diffpreable.tex end
    diff --git a/fixupdiff.pl b/fixupdiff.pl
    new file mode 100755
    index 0000000..69d4e6e
    --- /dev/null
    +++ b/fixupdiff.pl
    @@ -0,0 +1,18 @@
    +#!/usr/bin/perl -pi
    +
    +# Too many \color directives (generated by DIFdel/addbegin/end)
    +# confuse xetex, producing errors:
    +# WARNING ** Color stack overflow. Just ignore.
    +# and resulting in corrupted color in output.
    +# As a work-around, detect cases where it's safe, and replace \color with
    +# \textcolor.
    +# As a result, number of \color directives goes does sufficiently
    +# enough to avoid the overflow error.
    +
    +s/\\DIFdelbegin \\DIFdel{([^}]*)}\\DIFdelend/\\DIFdeltext{$1}/;
    +s/\\DIFaddbegin \\DIFadd{([^}]*)}\\DIFaddend/\\DIFaddtext{$1}/;
    +
    +# external \color does not seem to apply to footnotes.
    +# detect and replace with \textcolor within footnotes
    +s/(\\footnote\s*{[^}]*)\\DIFadd{/$1\\DIFaddtext{$2/;
    +s/(\\footnote\s*{[^}]*)\\DIFdel{/$1\\DIFdeltext{$2/;
    diff --git a/makediffpdf.sh b/makediffpdf.sh
    new file mode 100755
    index 0000000..34904bf
    --- /dev/null
    +++ b/makediffpdf.sh
    @@ -0,0 +1,36 @@
    +#make pdf diff using latexpand and latexdiff-fast
    +#preamble in diffpreamble.tex
    +#in diff, links are coloured green instead of blue
    +PATH=.:${PATH}
    +cur="$PWD"
    +rm -fr old new
    +git clone $PWD old
    +cd "${cur}/old"
    +git checkout ec1ffbf27a8f0a06ca65cd498a69c7f89bd97dc1
    +mv specvars.tex specvars-orig.tex
    +#make links green to avoid confusion
    +sed s/blue/green/ specvars-orig.tex > specvars.tex
    +SPECDOC=${SPECDOC:-`cat REVISION`}
    +./make-setup-generated.sh "$SPECDOC"
    +#wget http://www.ctan.org/pkg/latexpand
    +#chmod +x latexpand
    +latexpand virtio.tex -o flat.tex
    +cd "${cur}"
    +git clone $PWD new
    +cd "${cur}/new"
    +mv specvars.tex specvars-orig.tex
    +#make links green to avoid confusion
    +sed s/blue/green/ specvars-orig.tex > specvars.tex
    +SPECDOC=${SPECDOC:-`cat REVISION`}
    +./make-setup-generated.sh "$SPECDOC"
    +latexpand virtio.tex -o flat.tex
    +cd "${cur}"
    +#wget http://mirror.math.ku.edu/tex-archive/support/latexdiff/latexdiff-fast
    +#chmod +x latexdiff-fast
    +latexdiff-fast -p diffpreamble.tex old/flat.tex new/flat.tex > virtio-diff.tex
    +perl -pi fixupdiff.pl virtio-diff.tex
    +SPECDOC="${SPECDOC}-diff"
    +rm $SPECDOC.aux $SPECDOC.pdf $SPECDOC.out
    +xelatex --jobname $SPECDOC virtio-diff.tex
    +xelatex --jobname $SPECDOC virtio-diff.tex
    +xelatex --jobname $SPECDOC virtio-diff.tex



  • 4.  Re: [virtio] [PATCH v2] makediffpdf.sh: tool to create marked-up diff

    Posted 06-24-2014 07:49
    On Mon, 23 Jun 2014 23:45:14 +0300
    "Michael S. Tsirkin" <mst@redhat.com> wrote:

    > make pdf diff using latexpand and latexdiff-fast
    >
    > styles are set in diffpreamble.tex:
    > new text is blue, old text is red and is crossed-out.
    >
    > in diff, links are coloured green instead of blue

    One minor thing I noticed:

    If a link was changed (for example, in the conformance section), the old
    link is green and crossed out in red and the new one is green. It
    *should* be obvious what change was made, but it might be a bit
    confusing. I don't think it's worth further tampering around, though.

    >
    > Must be run within a git-svn clone of the spec repository.
    >
    > Note: latexdiff has --flatten option, this and options
    > to select diff style don't seem to work well.
    > So flatten by script myself, and add our own preamble.
    >
    > A script fixupdiff works around xetex bugs
    > - \color{ \footnote{text} } does not work,
    > replace with \footnote{\textcolor{}}
    > - too many \color instructions produce
    > "color stack overflow. Just ignore" error and
    > xetex skips some \color instructions.

    That's kind of sad, but probably the best way to get to a usable result
    for now.

    >
    > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    > ---
    >
    > Changes from v1:
    > work around xetex bugs
    >
    > Output looks ok to me now, plan to commit tomorrow.
    > Comments?

    I tried it and it seems to produce sensible output. I wonder whether
    the resulting pdf should lose the -diff suffix, though?




  • 5.  Re: [virtio] [PATCH v2] makediffpdf.sh: tool to create marked-up diff

    Posted 06-24-2014 07:49
    On Mon, 23 Jun 2014 23:45:14 +0300 "Michael S. Tsirkin" <mst@redhat.com> wrote: > make pdf diff using latexpand and latexdiff-fast > > styles are set in diffpreamble.tex: > new text is blue, old text is red and is crossed-out. > > in diff, links are coloured green instead of blue One minor thing I noticed: If a link was changed (for example, in the conformance section), the old link is green and crossed out in red and the new one is green. It *should* be obvious what change was made, but it might be a bit confusing. I don't think it's worth further tampering around, though. > > Must be run within a git-svn clone of the spec repository. > > Note: latexdiff has --flatten option, this and options > to select diff style don't seem to work well. > So flatten by script myself, and add our own preamble. > > A script fixupdiff works around xetex bugs > - color{ footnote{text} } does not work, > replace with footnote{ extcolor{}} > - too many color instructions produce > "color stack overflow. Just ignore" error and > xetex skips some color instructions. That's kind of sad, but probably the best way to get to a usable result for now. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > --- > > Changes from v1: > work around xetex bugs > > Output looks ok to me now, plan to commit tomorrow. > Comments? I tried it and it seems to produce sensible output. I wonder whether the resulting pdf should lose the -diff suffix, though?


  • 6.  Re: [virtio] [PATCH v2] makediffpdf.sh: tool to create marked-up diff

    Posted 06-24-2014 16:32
    On Tue, 2014-06-24 at 08:49 +0100, Cornelia Huck wrote:
    > If a link was changed (for example, in the conformance section), the old
    > link is green and crossed out in red and the new one is green. It
    > *should* be obvious what change was made, but it might be a bit
    > confusing. I don't think it's worth further tampering around, though.

    Turned out to be pretty simple (although hacky, as always with LaTeX ;-)

    Together with the previous change, the diffpreamble.tex could look like
    this:

    8<--------------------
    %DIF FONTSTRIKE PREAMBLE
    \RequirePackage[normalem]{ulem}
    \providecommand{\DIFaddtex}[1]{{\color{blue}\sf #1}}
    \providecommand{\DIFdeltex}[1]{{\color{red}\footnotesize \sout{#1}}}
    %DIF END FONTSTRIKE PREAMBLE
    %DIF COLOR PREAMBLE
    \RequirePackage{color}
    \providecommand{\DIFaddbegin}{}
    \providecommand{\DIFaddend}{}
    \providecommand{\DIFdelbegin}{\hypersetup{linkcolor=red,urlcolor=red}}
    \providecommand{\DIFdelend}{\hypersetup{linkcolor=green,urlcolor=green}}
    %DIF END COLOR PREAMBLE
    % Standard \DIFadd and \DIFdel are redefined as \DIFaddtex and \DIFdeltex
    % when hyperref package is included.
    %DIF HYPERREF PREAMBLE
    \providecommand{\DIFadd}[1]{\texorpdfstring{\DIFaddtex{#1}}{#1}}
    \providecommand{\DIFdel}[1]{\texorpdfstring{\DIFdeltex{#1}}{}}
    %DIF END HYPERREF PACKAGE

    %DIF FLOATSAFE PREAMBLE: SEEMS UNUSED BUT JUST IN CASE
    \providecommand{\DIFaddFL}[1]{\DIFadd{#1}}
    \providecommand{\DIFdelFL}[1]{\DIFdel{#1}}
    \providecommand{\DIFaddbeginFL}{}
    \providecommand{\DIFaddendFL}{}
    \providecommand{\DIFdelbeginFL}{}
    \providecommand{\DIFdelendFL}{}
    %DIF END FLOATSAFE PREAMBLE
    8<--------------------

    Pawel




  • 7.  Re: [virtio] [PATCH v2] makediffpdf.sh: tool to create marked-up diff

    Posted 06-24-2014 16:32
    On Tue, 2014-06-24 at 08:49 +0100, Cornelia Huck wrote: > If a link was changed (for example, in the conformance section), the old > link is green and crossed out in red and the new one is green. It > *should* be obvious what change was made, but it might be a bit > confusing. I don't think it's worth further tampering around, though. Turned out to be pretty simple (although hacky, as always with LaTeX ;-) Together with the previous change, the diffpreamble.tex could look like this: 8<-------------------- %DIF FONTSTRIKE PREAMBLE RequirePackage[normalem]{ulem} providecommand{DIFaddtex}[1]{{color{blue}sf #1}} providecommand{DIFdeltex}[1]{{color{red}footnotesize sout{#1}}} %DIF END FONTSTRIKE PREAMBLE %DIF COLOR PREAMBLE RequirePackage{color} providecommand{DIFaddbegin}{} providecommand{DIFaddend}{} providecommand{DIFdelbegin}{hypersetup{linkcolor=red,urlcolor=red}} providecommand{DIFdelend}{hypersetup{linkcolor=green,urlcolor=green}} %DIF END COLOR PREAMBLE % Standard DIFadd and DIFdel are redefined as DIFaddtex and DIFdeltex % when hyperref package is included. %DIF HYPERREF PREAMBLE providecommand{DIFadd}[1]{ exorpdfstring{DIFaddtex{#1}}{#1}} providecommand{DIFdel}[1]{ exorpdfstring{DIFdeltex{#1}}{}} %DIF END HYPERREF PACKAGE %DIF FLOATSAFE PREAMBLE: SEEMS UNUSED BUT JUST IN CASE providecommand{DIFaddFL}[1]{DIFadd{#1}} providecommand{DIFdelFL}[1]{DIFdel{#1}} providecommand{DIFaddbeginFL}{} providecommand{DIFaddendFL}{} providecommand{DIFdelbeginFL}{} providecommand{DIFdelendFL}{} %DIF END FLOATSAFE PREAMBLE 8<-------------------- Pawel


  • 8.  Re: [virtio] [PATCH v2] makediffpdf.sh: tool to create marked-up diff

    Posted 06-24-2014 17:23
    On Tue, Jun 24, 2014 at 05:32:13PM +0100, Pawel Moll wrote: > On Tue, 2014-06-24 at 08:49 +0100, Cornelia Huck wrote: > > If a link was changed (for example, in the conformance section), the old > > link is green and crossed out in red and the new one is green. It > > *should* be obvious what change was made, but it might be a bit > > confusing. I don't think it's worth further tampering around, though. > > Turned out to be pretty simple (although hacky, as always with LaTeX ;-) > > Together with the previous change, the diffpreamble.tex could look like > this: > > 8<-------------------- > %DIF FONTSTRIKE PREAMBLE > RequirePackage[normalem]{ulem} > providecommand{DIFaddtex}[1]{{color{blue}sf #1}} > providecommand{DIFdeltex}[1]{{color{red}footnotesize sout{#1}}} > %DIF END FONTSTRIKE PREAMBLE > %DIF COLOR PREAMBLE > RequirePackage{color} > providecommand{DIFaddbegin}{} > providecommand{DIFaddend}{} > providecommand{DIFdelbegin}{hypersetup{linkcolor=red,urlcolor=red}} > providecommand{DIFdelend}{hypersetup{linkcolor=green,urlcolor=green}} > %DIF END COLOR PREAMBLE > % Standard DIFadd and DIFdel are redefined as DIFaddtex and DIFdeltex > % when hyperref package is included. > %DIF HYPERREF PREAMBLE > providecommand{DIFadd}[1]{ exorpdfstring{DIFaddtex{#1}}{#1}} > providecommand{DIFdel}[1]{ exorpdfstring{DIFdeltex{#1}}{}} > %DIF END HYPERREF PACKAGE Thanks! This can be integrated with my hack as well, if we decide to keep using it. > %DIF FLOATSAFE PREAMBLE: SEEMS UNUSED BUT JUST IN CASE > providecommand{DIFaddFL}[1]{DIFadd{#1}} > providecommand{DIFdelFL}[1]{DIFdel{#1}} > providecommand{DIFaddbeginFL}{} > providecommand{DIFaddendFL}{} > providecommand{DIFdelbeginFL}{} > providecommand{DIFdelendFL}{} > %DIF END FLOATSAFE PREAMBLE > 8<-------------------- > > Pawel


  • 9.  Re: [virtio] [PATCH v2] makediffpdf.sh: tool to create marked-up diff

    Posted 06-24-2014 17:24
    On Tue, Jun 24, 2014 at 05:32:13PM +0100, Pawel Moll wrote:
    > On Tue, 2014-06-24 at 08:49 +0100, Cornelia Huck wrote:
    > > If a link was changed (for example, in the conformance section), the old
    > > link is green and crossed out in red and the new one is green. It
    > > *should* be obvious what change was made, but it might be a bit
    > > confusing. I don't think it's worth further tampering around, though.
    >
    > Turned out to be pretty simple (although hacky, as always with LaTeX ;-)
    >
    > Together with the previous change, the diffpreamble.tex could look like
    > this:
    >
    > 8<--------------------
    > %DIF FONTSTRIKE PREAMBLE
    > \RequirePackage[normalem]{ulem}
    > \providecommand{\DIFaddtex}[1]{{\color{blue}\sf #1}}
    > \providecommand{\DIFdeltex}[1]{{\color{red}\footnotesize \sout{#1}}}
    > %DIF END FONTSTRIKE PREAMBLE
    > %DIF COLOR PREAMBLE
    > \RequirePackage{color}
    > \providecommand{\DIFaddbegin}{}
    > \providecommand{\DIFaddend}{}
    > \providecommand{\DIFdelbegin}{\hypersetup{linkcolor=red,urlcolor=red}}
    > \providecommand{\DIFdelend}{\hypersetup{linkcolor=green,urlcolor=green}}
    > %DIF END COLOR PREAMBLE
    > % Standard \DIFadd and \DIFdel are redefined as \DIFaddtex and \DIFdeltex
    > % when hyperref package is included.
    > %DIF HYPERREF PREAMBLE
    > \providecommand{\DIFadd}[1]{\texorpdfstring{\DIFaddtex{#1}}{#1}}
    > \providecommand{\DIFdel}[1]{\texorpdfstring{\DIFdeltex{#1}}{}}
    > %DIF END HYPERREF PACKAGE


    Thanks!
    This can be integrated with my hack as well, if we
    decide to keep using it.

    > %DIF FLOATSAFE PREAMBLE: SEEMS UNUSED BUT JUST IN CASE
    > \providecommand{\DIFaddFL}[1]{\DIFadd{#1}}
    > \providecommand{\DIFdelFL}[1]{\DIFdel{#1}}
    > \providecommand{\DIFaddbeginFL}{}
    > \providecommand{\DIFaddendFL}{}
    > \providecommand{\DIFdelbeginFL}{}
    > \providecommand{\DIFdelendFL}{}
    > %DIF END FLOATSAFE PREAMBLE
    > 8<--------------------
    >
    > Pawel