Use article, report or book as textclass. Use LyX-Code. Support chapt.

* No longer use linuxdoc as textclass, modern lyx does not support it.
  Use plain article, report or book instead. Since none of them
  support verbatim layout, use LyX-Code instead. Also add chapt to lyx
  mapping file.
* Move $lyxheader to $lyxout
* Better scoping for $OUTPUT
parent f7cd8be5
#
# fmt_lyx.pl
#
# $Id: fmt_lyx.pl,v 1.1.1.1 2001/05/24 15:57:40 sano Exp $
#
# Lyx-specific driver stuff
#
# Copyright 1996, Cees de Groot
......@@ -85,7 +83,6 @@ $lyx->{postASP} = sub {
# -----------------------------------------------------------------------
# Take the sgmlsasp output, and make something useful from it.
# -----------------------------------------------------------------------
my $OUTFILE;
my $INFILE = shift;
my $lyxfile = "$global->{filename}.lyx";
my $nbsp = chr(160);
......@@ -99,11 +96,10 @@ $lyx->{postASP} = sub {
my $intag;
my $intt;
my $tscreen;
my $lyxout = '';
my $lyxheader = "#This file was created by LinuxDoc-SGML
my $lyxout = "#This file was created by LinuxDoc-SGML
#(conversion : Frank Pavageau and Jose' Matos)
\\lyxformat 2.15
\\textclass linuxdoc
\\textclass \@textclass\@
\\language default
\\inputencoding default
\\fontscheme default
......@@ -129,7 +125,8 @@ $lyx->{postASP} = sub {
chomp;
if ( /^\@(article|book|report)\@/ ) {
$lyxout = $lyxheader;
my $class = $1;
$lyxout =~ s/\@textclass\@/$class/;
} # Itemize; Enumerate and Description. $indent_level counts the level
elsif( /^\@itemize\@/ ) { # --- Itemized list begins
$indent_level++;
......@@ -197,7 +194,7 @@ $lyx->{postASP} = sub {
if ( $intag ) {
s/\s+/\n\\protected_separator\n/g unless m/^\\(family|series|shape)/;
} elsif ( $verbatim ) {
$_ = "\\layout Verbatim\n$_";
$_ = "\\layout LyX-Code\n$_";
} elsif ( $inheading) {
s/\s+/ /g;
}
......@@ -225,7 +222,7 @@ $lyx->{postASP} = sub {
$lyxout =~ s/\\end_deeper/\\end_deeper\n/gms;
# Print result
open ($OUTFILE, "> $lyxfile")
open (my $OUTFILE, "> $lyxfile")
or die "fmt_lyx::postASP: Could not open \"$lyxfile\" for writing. Aborting ...";
print $OUTFILE $lyxout;
close $OUTFILE;
......
......@@ -57,6 +57,9 @@
"\\end_inset\n" +
</toc>
<chapt> + "\\layout Chapter" +
</chapt>
<sect> + "\\layout Section" +
</sect>
......
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