Better tscreen support using LyX-Code.

* Use Lyx-Code more extensively. Do not use begin/end_deeper
* Do not work if there are things like <tt/../ (which should not
  be there) in non-verbatim tscren sections. Have to think a
  bit more about this.
parent 2e9c8854
......@@ -172,11 +172,8 @@ $lyx->{postASP} = sub {
} # tscreen
elsif( /^\@tscreen\@/ ) {
$tscreen = 1;
$lyxout .= "\\begin_deeper\n";
$lyxout .= "\\layout Standard\n"
} elsif ( /^\@\/tscreen\@/ ) {
} elsif ( /^\@\/tscreen\@/ ) {
$tscreen = 0;
$lyxout .= "\\end_deeper\n";
$lyxout .= "\\layout Standard\n";
} # Verbatim
elsif( /^\@verb\@/ ) {
......@@ -186,6 +183,8 @@ $lyx->{postASP} = sub {
} else {
$inheading = 0 if ( /^\\layout Standard/ );
$intt = 0 if ( /^\\family default.*$/ );
$inheading = 1 if ( /^\\layout (Part|Chapter|.*section|.*paragraph)/ );
$intt = 1 if ( /^\\family typewriter.*$/ );
# For LyX file clarity
s/\\backslash/\n\\backslash\n/g unless ( $verbatim or $inheading or $intt);
......@@ -193,15 +192,15 @@ $lyx->{postASP} = sub {
if ( $intag ) {
s/\s+/\n\\protected_separator\n/g unless m/^\\(family|series|shape)/;
} elsif ( $verbatim ) {
$_ = "\\layout LyX-Code\n$_";
} elsif ( $tscreen ) {
# If verbatim, lines are not split when things like <tt/../ appears.
$_ = "\\layout LyX-Code\n$_" unless ( $intt
or m/^\\(family|layout|series|shape)/
or m/^[$nbsp\s]*$/ );
} elsif ( $inheading) {
s/\s+/ /g;
}
$inheading = 1 if ( /^\\layout (Part|Chapter|.*section|.*paragraph)/ );
$intt = 1 if ( /^\\family typewriter.*$/ );
$lyxout .= "$_\n";
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment