Re: [l2h] l2h new error

2018-07-17 Thread Ernesto Cuadros Vargas
Dear Shigeharu,

may you tell me if it is ready to update when I run something like
apt-get upgrade

I am running Ubuntu 18.04

Thanks
er

On Thu, Jul 12, 2018 at 10:59 PM, Shigeharu TAKENO 
wrote:

> shige 07/13 2018
> 
>
> I wrote:
> | I will consider the solution for problems 3) and 4).
>
> I think the following patch may workaround these problem 1-4)
> (this is for latex2html.pin in latex2html-2017.2).
>
> - From here -
> --- latex2html.pin.ORG  2018-07-13 12:46:13.674636000 +0900
> +++ latex2html.pin  2018-07-13 12:55:51.674987000 +0900
> @@ -11162,7 +11162,14 @@
>
> # Search for [aAiI1] which is not between a pair of { }
> # Other cases like "\theenumi" are not handled
> -   @label_fields = $standard_label =~ /$enum_label_rx/;
> +   # @label_fields = $standard_label =~ /$enum_label_rx/;
> +   # 07/13 2018 shige
> +   my $std_label = $standard_label;
> +   $std_label =~ s/$any_next_pair_rx/\{$2\}/g;
> +   @label_fields = $std_label =~ /$enum_label_rx/;
> +   $label_fields[0] =~ s/[\{\}]//g;
> +   $label_fields[$#label_fields] =~ s/[\{\}]//g;
> +   $std_label =~ s/[\{\}]//g;
> if (($standard_label =~ /^[aAiI1]$/)&&(not(/item\s*\[/))) {
> $enum_type = ' TYPE="'.$standard_label.'"';
> $standard_label = '';
> @@ -11173,9 +11180,12 @@
>  #  local($thislabel) = "\&$label_func";
>  #  do { local($_) = $thislabel; _unique($_);
>  #   $enum{'theenum' . $rlevel} = $_; };
> -   $standard_label =
> +   # $standard_label =
> +   # 07/13 2018 shige
> +   $standard_label = ($#label_fields > 0) ?
> "\"$label_fields[0]\" . eval(\$enum{\"theenum$rlevel\"})"
> -   . ".\"$label_fields[$#label_fields]\"";
> +   . ".\"$label_fields[$#label_fields]\"" :
> +   $std_label;
> $enum{'labelenum' . $rlevel} = $standard_label;
> }
>  }  elsif (s/^((.|\n)+?)\\item/$preitems=$1;"\\item"/es) {
> @@ -11193,9 +11203,16 @@
> $label_part = '"'.$label_part.'"';
> $enum{$cmd} = $label_part;
>  }
> -   $standard_label =
> -   "\"$label_fields[0]\" . eval(\$enum{\"theenum$rlevel\"})"
> -   . ".\"$label_fields[$#label_fields]\"" if ($cmd);
> +   # $standard_label =
> +   #"\"$label_fields[0]\" . eval(\$enum{\"theenum$rlevel\"})"
> +   #. ".\"$label_fields[$#label_fields]\"" if ($cmd);
> +   # 07/13 2018 shige
> +   if ($cmd) {
> +   $standard_label = ($#label_fields > 0) ?
> +   "\"$label_fields[0]\" . eval(\$enum{\"theenum$rlevel\"})"
> +   . ".\"$label_fields[$#label_fields]\"" :
> +   $std_label;
> +   }
> $_ = $pre_preitems . $preitems . $_ if ($pre_preitems||$preitems);
>  } else {
> @enum_default_type = ('A', '1', 'a', 'i', 'A') unless
> (@enum_default_type);
> @@ -11244,7 +11261,9 @@
> $item = "[$enum_label\]$item";
> $enum_label =~ s/\.$//;
> }
> -   if ($standard_label) {
> +   # if ($standard_label) {
> +   # 07/13 2018 shige
> +   if ($standard_label && $standard_label !~ /eval\(/) {
> $item =~ s/(\\labelitem$rlevel|$
> standard_label)/$enum_label/g
> } else {
> $item =~ s/(\\labelitem$rlevel)/$enum_label/g
> @@ -15928,7 +15947,9 @@
>  }
>  sub Alph{
>  local($num)=@_;
> -(eval($enum{$num}));
> +# (eval($enum{$num}));
> +# 07/13 2018 shige
> +(eval($enum{$num}));
>  }
>
>  sub Roman{
> @@ -16469,7 +16490,9 @@
>  # used for labels in {enumerate} environments
>  $standard_label_rx =
> "\\s*[[]\\s*((($any_next_pair_rx4)|([[][^]]*[]])|[^]])*)[]]";
> -$enum_label_rx = "^((({[^{}]*})|([^{}]))*)([aAiI1])(.*)";
> +# $enum_label_rx = "^((({[^{}]*})|([^{}]))*)([aAiI1])(.*)";
> +# 07/13 2018 shige
> +$enum_label_rx = "^(((\{[^\{\}]*\})|([^\{\}]))*)([aAiI1])(.*)";
>  $enum_level = 0;   # level for enumerate (1-4, i-iv)
>
>
> - To here -
>
> ++
>  Shigeharu TAKENO NIigata Institute of Technology
>kashiwazaki,Niigata 945-1195 JAPAN
>  sh...@iee.niit.ac.jp   TEL(): +81-257-22-8161
> ++
>



-- 
*Ernesto Cuadros-Vargas. PhD*
http://socios.spc.org.pe/ecuadros/
T:+(511) 2305000 <(01)%202305000> Ext 4281
Jr. Medrano Silva 165, Barranco
www.utec.edu.pe



-- 
La información contenida en este e-mail y sus anexos es confidencial, 
privilegiada y está dirigida exclusivamente a su destinatario, en 
consecuencia, solo puede ser utilizada por aquel. Si usted no es el 
destinatario original, no deberá examinar, usar, copiar o distribuir este 
mensaje o la información que contiene. Si lo recibe por error, por favor 

Re: [l2h] l2h new error

2018-07-12 Thread Shigeharu TAKENO
shige 07/13 2018


I wrote:
| I will consider the solution for problems 3) and 4).

I think the following patch may workaround these problem 1-4) 
(this is for latex2html.pin in latex2html-2017.2).

- From here -
--- latex2html.pin.ORG  2018-07-13 12:46:13.674636000 +0900
+++ latex2html.pin  2018-07-13 12:55:51.674987000 +0900
@@ -11162,7 +11162,14 @@
 
# Search for [aAiI1] which is not between a pair of { }
# Other cases like "\theenumi" are not handled
-   @label_fields = $standard_label =~ /$enum_label_rx/;
+   # @label_fields = $standard_label =~ /$enum_label_rx/;
+   # 07/13 2018 shige
+   my $std_label = $standard_label;
+   $std_label =~ s/$any_next_pair_rx/\{$2\}/g;
+   @label_fields = $std_label =~ /$enum_label_rx/;
+   $label_fields[0] =~ s/[\{\}]//g;
+   $label_fields[$#label_fields] =~ s/[\{\}]//g;
+   $std_label =~ s/[\{\}]//g;
if (($standard_label =~ /^[aAiI1]$/)&&(not(/item\s*\[/))) {
$enum_type = ' TYPE="'.$standard_label.'"';
$standard_label = '';
@@ -11173,9 +11180,12 @@
 #  local($thislabel) = "\&$label_func";
 #  do { local($_) = $thislabel; _unique($_);
 #   $enum{'theenum' . $rlevel} = $_; };
-   $standard_label = 
+   # $standard_label = 
+   # 07/13 2018 shige
+   $standard_label = ($#label_fields > 0) ?
"\"$label_fields[0]\" . eval(\$enum{\"theenum$rlevel\"})"
-   . ".\"$label_fields[$#label_fields]\"";
+   . ".\"$label_fields[$#label_fields]\"" :
+   $std_label;
$enum{'labelenum' . $rlevel} = $standard_label;
}
 }  elsif (s/^((.|\n)+?)\\item/$preitems=$1;"\\item"/es) {
@@ -11193,9 +11203,16 @@
$label_part = '"'.$label_part.'"';
$enum{$cmd} = $label_part;
 }
-   $standard_label = 
-   "\"$label_fields[0]\" . eval(\$enum{\"theenum$rlevel\"})"
-   . ".\"$label_fields[$#label_fields]\"" if ($cmd);
+   # $standard_label = 
+   #"\"$label_fields[0]\" . eval(\$enum{\"theenum$rlevel\"})"
+   #. ".\"$label_fields[$#label_fields]\"" if ($cmd);
+   # 07/13 2018 shige
+   if ($cmd) {
+   $standard_label = ($#label_fields > 0) ? 
+   "\"$label_fields[0]\" . eval(\$enum{\"theenum$rlevel\"})"
+   . ".\"$label_fields[$#label_fields]\"" :
+   $std_label;
+   }
$_ = $pre_preitems . $preitems . $_ if ($pre_preitems||$preitems);
 } else {
@enum_default_type = ('A', '1', 'a', 'i', 'A') unless 
(@enum_default_type);
@@ -11244,7 +11261,9 @@
$item = "[$enum_label\]$item";
$enum_label =~ s/\.$//;
}
-   if ($standard_label) {
+   # if ($standard_label) {
+   # 07/13 2018 shige
+   if ($standard_label && $standard_label !~ /eval\(/) {
$item =~ s/(\\labelitem$rlevel|$standard_label)/$enum_label/g
} else {
$item =~ s/(\\labelitem$rlevel)/$enum_label/g
@@ -15928,7 +15947,9 @@
 }
 sub Alph{
 local($num)=@_;
-(eval($enum{$num}));
+# (eval($enum{$num}));
+# 07/13 2018 shige
+(eval($enum{$num}));
 }
 
 sub Roman{
@@ -16469,7 +16490,9 @@
 # used for labels in {enumerate} environments
 $standard_label_rx = 
"\\s*[[]\\s*((($any_next_pair_rx4)|([[][^]]*[]])|[^]])*)[]]";
-$enum_label_rx = "^((({[^{}]*})|([^{}]))*)([aAiI1])(.*)";
+# $enum_label_rx = "^((({[^{}]*})|([^{}]))*)([aAiI1])(.*)";
+# 07/13 2018 shige
+$enum_label_rx = "^(((\{[^\{\}]*\})|([^\{\}]))*)([aAiI1])(.*)";
 $enum_level = 0;   # level for enumerate (1-4, i-iv)
 
 
- To here -

++
 Shigeharu TAKENO NIigata Institute of Technology
   kashiwazaki,Niigata 945-1195 JAPAN
 sh...@iee.niit.ac.jp   TEL(): +81-257-22-8161
++
___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] l2h new error

2018-07-12 Thread Shigeharu TAKENO
shige 07/13 2018


Ernesto Cuadros Vargas wrote:
| I just have a new error trying to run latex2html:
| 
| ;..,.Unescaped left brace in regex is illegal here in regex; marked by <--
| HERE in m/(\\labelitemi|"" . eval($enum{ <-- HERE "theenumi"})."\)")/ at
| /usr/bin/latex2html line 11325.
| 
| it is inside function sub do_env_enumerate
| 
| I am using Ubuntu 18.04.

This is because of the change of handling of recent perl for 
braces in regular expression.

Well, I think you are using enumerate package. Current l2h may 
have several problem for the handling of enumerate package.

1) Option 'A' of enumerate environment uses "alph", not "Alph"
  (it is a bug of sub Alph():  ->   )

2) "eval($enum{..." string is included in regular expressions
 (we can avoid it to modify
  if ($standard_label) {
  $item =~ s/(\\labelitem$rlevel|$standard_label)/$enum_label/g
  to
  if ($standard_label && $standard_label !~ /eval\(/) {
  $item =~ s/(\\labelitem$rlevel|$standard_label)/$enum_label/g
 )

3) The option are analyzed by the regex "$enum_label_rx", which 
  includes braces { and }. But the braces in options string are 
  modified to <<[n]>> before using "$enum_label_rx". Then, the 
  escape by {, } are not recognized correctly.

4) The regex "$enum_label_rx" supposes that the option must have
  a character [AaIi1].


I will consider the solution for problems 3) and 4).

++
 Shigeharu TAKENO NIigata Institute of Technology
   kashiwazaki,Niigata 945-1195 JAPAN
 sh...@iee.niit.ac.jp   TEL(): +81-257-22-8161
++
___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] l2h new error

2018-07-06 Thread Ernesto Cuadros Vargas
Hi,

I tried to fix this bug.
It seems that eval is the problem inside the regex
Instead of doing that I am evaluating that expresion vefore just to reduce
the complexity of it.

my $std_label = "\"$label_fields[0]\"" .
eval($enum{"theenum$rlevel"}). ".\"$label_fields[$#label_fields]\"";
# print "$std_label\n";
if ($standard_label) {
$item =~ s/(\\labelitem$rlevel|$std_label)/$enum_label/g;
} else {
$item =~ s/(\\labelitem$rlevel)/$enum_label/g;
}

Saludos
er

On Fri, Jul 6, 2018 at 4:20 PM, Ernesto Cuadros Vargas  wrote:

> Dear all,
>
> I just have a new error trying to run latex2html:
>
> ;..,.Unescaped left brace in regex is illegal here in regex; marked by <--
> HERE in m/(\\labelitemi|"" . eval($enum{ <-- HERE "theenumi"})."\)")/ at
> /usr/bin/latex2html line 11325.
>
> it is inside function sub do_env_enumerate
>
> I am using Ubuntu 18.04.
>
> My latex is compiling ok so I am sure it is not a problem in my side.
>
> Regards
> Er
>
>


-- 
*Ernesto Cuadros-Vargas. PhD*
http://socios.spc.org.pe/ecuadros/
T:+(511) 2305000 <(01)%202305000> Ext 4281
Jr. Medrano Silva 165, Barranco
www.utec.edu.pe



-- 
La información contenida en este e-mail y sus anexos es confidencial, 
privilegiada y está dirigida exclusivamente a su destinatario, en 
consecuencia, solo puede ser utilizada por aquel. Si usted no es el 
destinatario original, no deberá examinar, usar, copiar o distribuir este 
mensaje o la información que contiene. Si lo recibe por error, por favor 
reenvíelo a la persona que se lo envió y elimínelo. Cualquier retención o 
uso total o parcial no autorizada de este mensaje está estrictamente 
prohibida y sancionada por ley.
___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html