mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Enable reLyX to recognise m column descriptors. Ensure that the LaTeX->LyX->LaTeX cycle is invariant but also provide WYSIWYG support
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6054 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
13293f93d5
commit
73b7c8e3b3
@ -5,6 +5,8 @@
|
|||||||
* reLyX/BasicLyX.pm, reLyX/CleanTeX.pm, reLyX/Verbatim.pm: pass
|
* reLyX/BasicLyX.pm, reLyX/CleanTeX.pm, reLyX/Verbatim.pm: pass
|
||||||
$...$ and $$...$$ through reLyX unchanged.
|
$...$ and $$...$$ through reLyX unchanged.
|
||||||
|
|
||||||
|
* reLyX/RelyxTable.pm: provide support for 'm' column descriptors.
|
||||||
|
|
||||||
2003-02-04 Joao Luis Meloni Assirati <assirati@fma.if.usp.br>
|
2003-02-04 Joao Luis Meloni Assirati <assirati@fma.if.usp.br>
|
||||||
|
|
||||||
* images/math/rbracket.xpm: new file.
|
* images/math/rbracket.xpm: new file.
|
||||||
|
@ -68,7 +68,7 @@ sub parse_cols {
|
|||||||
while (@group) {
|
while (@group) {
|
||||||
|
|
||||||
$tok = shift(@group);
|
$tok = shift(@group);
|
||||||
# Each $tok will consist of /^[clr|]*[p*@]?$/
|
# Each $tok will consist of /^[clr|]*[mp*@]?$/
|
||||||
# (Except first may have | and/or @ expressions before it)
|
# (Except first may have | and/or @ expressions before it)
|
||||||
# p*@ will end the $tok since after it comes a group in braces
|
# p*@ will end the $tok since after it comes a group in braces
|
||||||
# @ will be a TT::Token, everything else will be in TT::Text
|
# @ will be a TT::Token, everything else will be in TT::Text
|
||||||
@ -86,13 +86,14 @@ sub parse_cols {
|
|||||||
@new_cols = ($description =~ /[clr]\|*/g);
|
@new_cols = ($description =~ /[clr]\|*/g);
|
||||||
push @cols, @new_cols;
|
push @cols, @new_cols;
|
||||||
|
|
||||||
# parse a p or * or @ if necessary
|
# parse a 'p', an 'm', a '*' or a '@' as necessary
|
||||||
# use exact_print in case there's weird stuff in the @ descriptions
|
# use exact_print in case there's weird stuff in the @ descriptions
|
||||||
$description = substr($description,-1);
|
$description = substr($description,-1);
|
||||||
if ($description eq 'p') {
|
# The m and p descriptors have identical form.
|
||||||
|
if ($description eq 'p' || $description eq 'm') {
|
||||||
$tok = shift(@group);
|
$tok = shift(@group);
|
||||||
my $pdes = $description . $tok->exact_print; # "p{foo}"
|
my $des = $description . $tok->exact_print; # 'p{foo}' or 'm{foo}'
|
||||||
push @cols, $pdes;
|
push @cols, $des;
|
||||||
|
|
||||||
} elsif ($description eq '@') {
|
} elsif ($description eq '@') {
|
||||||
$tok = shift(@group);
|
$tok = shift(@group);
|
||||||
@ -376,25 +377,25 @@ package RelyxTable::Column;
|
|||||||
$col->{"pwidth"} = "";
|
$col->{"pwidth"} = "";
|
||||||
$col->{"special"} = "";
|
$col->{"special"} = "";
|
||||||
|
|
||||||
# Any special (@) column should be handled differently
|
# LyX does not know about '@' or 'm' column descriptors so, to
|
||||||
if ($description =~ /\@/) {
|
# ensure that the LaTeX -> LyX -> LaTeX cycle is invariant,
|
||||||
# Just put the whole description in "special" field --- this
|
# these descriptors are placed in the 'special' field.
|
||||||
# corresponds the the "extra" field in LyX table popup
|
if ($description =~ /\@/ || $description =~ /^m/ ) {
|
||||||
# Note that LyX ignores alignment, r/l lines for a special column
|
$col->{"special"} = $description;
|
||||||
$col->{"special"} = $description;
|
print "\n'$description' column won't display WYSIWYG in LyX\n"
|
||||||
print "\n'$description' column won't display WYSIWYG in LyX\n"
|
if $debug_on;
|
||||||
if $debug_on;
|
}
|
||||||
|
|
||||||
# It's not a special @ column
|
|
||||||
} else {
|
|
||||||
|
|
||||||
|
# '@' columns really can't be displayed WYSIWYG in LyX,
|
||||||
|
# but we can get visual feedback on 'm' columns.
|
||||||
|
if (!($description =~ /\@/)) {
|
||||||
# left line?
|
# left line?
|
||||||
$description =~ s/^\|*//;
|
$description =~ s/^\|*//;
|
||||||
$col->{"left_line"} = length($&);
|
$col->{"left_line"} = length($&);
|
||||||
|
|
||||||
# main column description
|
# main column description
|
||||||
$description =~ s/^[clrp]//;
|
$description =~ s/^[clrpm]//;
|
||||||
if ($& eq "p") {
|
if ($& eq 'p' || $& eq 'm') {
|
||||||
$description =~ s/^\{(.+)\}//; # eat the width
|
$description =~ s/^\{(.+)\}//; # eat the width
|
||||||
$col->{"pwidth"} = $1; # width without braces
|
$col->{"pwidth"} = $1; # width without braces
|
||||||
# note: alignment is not applicable for 'p' columns
|
# note: alignment is not applicable for 'p' columns
|
||||||
|
Loading…
Reference in New Issue
Block a user