[Po4a-commits] "po4a/lib/Locale/Po4a LaTeX.pm,1.12,1.13"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sat Sep 24 21:08:11 UTC 2005


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv24222/lib/Locale/Po4a

Modified Files:
	LaTeX.pm 
Log Message:
The documentclass command can have an optional argument.
Thanks to the testsuite.


Index: LaTeX.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/LaTeX.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- LaTeX.pm	21 Sep 2005 20:36:18 -0000	1.12
+++ LaTeX.pm	24 Sep 2005 21:08:08 -0000	1.13
@@ -101,7 +101,7 @@
 # Only read the documentclass in order to find some po4a directives.
 # FIXME: The documentclass could contain translatable strings.
 # Maybe it should be implemented as \include{}.
-register_generic_command("*documentclass,{}");
+register_generic_command("*documentclass,[]{}");
 # We use register_generic_command to define the number and types of
 # parameters. The function is then overwritten:
 $commands{'documentclass'} = sub {
@@ -110,7 +110,8 @@
 
     # Only try to parse the file.  We don't want to fail or parse this file
     # if it is a standard documentclass.
-    parse_definition_file($self, $args->[1].".cls", 1);
+    my $name = ($args->[0] eq '[')? $args->[3]: $args->[1];
+    parse_definition_file($self, $name.".cls", 1);
 
     my ($t, at e) = generic_command($self,$command,$variant,$args,$env);
 




More information about the Po4a-commits mailing list