mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
Fun with reLyX.
Add support for babel extra arguments. Add support for make index. Clean output. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2891 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c804ecd29a
commit
acbce8a8fc
@ -1,3 +1,9 @@
|
|||||||
|
2001-10-17 José Matos <jamatos@fep.up.pt>
|
||||||
|
|
||||||
|
* reLyX/MakePreamble.pm: add support for \makeindex, added support
|
||||||
|
for optional arguments to babel, remove fontenc package. Don't
|
||||||
|
print the latex preamble if there isn't none to print.
|
||||||
|
|
||||||
2001-10-15 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
2001-10-15 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
|
||||||
* scripts/TeXFiles.sh: rewrite to use kpsewhich --show-path.
|
* scripts/TeXFiles.sh: rewrite to use kpsewhich --show-path.
|
||||||
|
@ -243,6 +243,7 @@ sub translate_preamble {
|
|||||||
if($Latex_Preamble =~ s/\\usepackage\[(.*)\]\{inputenc\}\s*//) {
|
if($Latex_Preamble =~ s/\\usepackage\[(.*)\]\{inputenc\}\s*//) {
|
||||||
$LyX_Preamble .= "\\inputencoding $1\n";
|
$LyX_Preamble .= "\\inputencoding $1\n";
|
||||||
}
|
}
|
||||||
|
$Latex_Preamble =~ s/\\usepackage\[.*\]\{fontenc\}\s*//;
|
||||||
|
|
||||||
## Deal with several \usepackage{} cases
|
## Deal with several \usepackage{} cases
|
||||||
my %Usepackage_Table = (
|
my %Usepackage_Table = (
|
||||||
@ -267,9 +268,17 @@ sub translate_preamble {
|
|||||||
"a4" => "\\paperpackage a4wide",
|
"a4" => "\\paperpackage a4wide",
|
||||||
|
|
||||||
"graphics" => "\\graphics default",
|
"graphics" => "\\graphics default",
|
||||||
"rotating" => ""
|
"rotating" => "",
|
||||||
|
"makeidx" => "\\makeindex"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
## Babel with arguments specifing language
|
||||||
|
if($Latex_Preamble =~ s/\\usepackage\[(.*)\]\{babel\}\s*//) {
|
||||||
|
my @languages = split(',',$1);
|
||||||
|
my $lang = pop @languages;
|
||||||
|
$LyX_Preamble .= "\\language $lang\n";
|
||||||
|
}
|
||||||
|
|
||||||
my $up;
|
my $up;
|
||||||
foreach $up (keys %Usepackage_Table) {
|
foreach $up (keys %Usepackage_Table) {
|
||||||
$Latex_Preamble =~ s/\\usepackage\{$up\}\s*// && do {
|
$Latex_Preamble =~ s/\\usepackage\{$up\}\s*// && do {
|
||||||
@ -342,7 +351,9 @@ sub translate_preamble {
|
|||||||
if ($write_preamble) {
|
if ($write_preamble) {
|
||||||
$Latex_Preamble =~ s/^\s*//;
|
$Latex_Preamble =~ s/^\s*//;
|
||||||
print "LaTeX preamble, consists of:\n$Latex_Preamble" if $debug_on;
|
print "LaTeX preamble, consists of:\n$Latex_Preamble" if $debug_on;
|
||||||
|
if($Latex_Preamble) {
|
||||||
$Latex_Preamble = "\\begin_preamble\n$Latex_Preamble\\end_preamble\n";
|
$Latex_Preamble = "\\begin_preamble\n$Latex_Preamble\\end_preamble\n";
|
||||||
|
}
|
||||||
print "End of LaTeX preamble\n" if $debug_on;
|
print "End of LaTeX preamble\n" if $debug_on;
|
||||||
} else {
|
} else {
|
||||||
$Latex_Preamble = ""; #just comments, whitespace. Ignore them
|
$Latex_Preamble = ""; #just comments, whitespace. Ignore them
|
||||||
|
Loading…
Reference in New Issue
Block a user