separator-convert.sh

Lyx files converted from 2.1 to 2.2 contain parbeak and latexpar separators that
would not appear if the lyx file was written in 2.2 from scratch. The script
removes latexpar separators and transforms parbreak separators into plain
separators. Then it displays a diff of the resulting pdf files (requires
diffpdf) for manual control. All lyx files shipped with lyx should be updated in
this way. See #10068.

example usage:
cd lib/doc
../development/tools/separator-convert.sh Math.lyx
This commit is contained in:
Guillaume Munch 2016-04-12 19:57:37 +01:00
parent 10cbed2abe
commit 654f213a2f

View File

@ -0,0 +1,21 @@
#!/bin/bash
# Lyx files converted from 2.1 to 2.2 contain parbeak and latexpar separators
# that would not appear if the lyx file was written in 2.2 from scratch. The
# script removes latexpar separators and transforms parbreak separators into
# plain separators. Then it displays a diff of the resulting pdf files (requires
# diffpdf) for manual control. All lyx files shipped with lyx should be updated
# in this way. See #10068.
#
# example usage:
# cd lib/doc
# ../development/tools/separator-convert.sh Math.lyx
#
BUILD=../../build
LYX=$BUILD/src/lyx
cp $1 $1.old
$LYX -E pdf2 $1.old.pdf $1
sed -i "s/^\\\\begin_inset Separator parbreak$/\\\\begin_inset Separator plain/" $1
sed -i "/^\\\\begin_inset Separator latexpar$/ { N; d; }" $1
$LYX -e lyx $1
$LYX -E pdf2 $1.pdf $1
diffpdf $1.old.pdf $1.pdf