[tex-k] HyperTeX tags
Heiko Oberdiek
oberdiek at uni-freiburg.de
Tue Feb 28 14:57:02 CET 2006
On Tue, Feb 28, 2006 at 09:51:22PM +0900, Akira Kakuto wrote:
> > Next problem is dvips itself:
> >
> > \special{html:<a name="abc)def">}%
> >
> > The PS file is then invalid:
> >
> > (abc)def) [2 [72 719 183 721] 841] def
> >
> > The name should be quoted to get a valid PostScript string:
> >
> > (abc\)def) ...
>
> Very crude patch:
> Best,
> Akira
>
> --- hps.c.orig Sun Jan 16 14:54:10 2005
> +++ hps.c Tue Feb 28 21:36:12 2006
> @@ -123,7 +123,14 @@
> void do_html P1C(char *, s)
> {
> Hps_link *nl ;
> - url_name = (char *)malloc(strlen(s)+1) ;
> + int ki = 0 ;
> + char *kp ;
> +
> + for (kp = s; *kp; kp++) {
> + if (*kp == '(' || *kp == ')')
and at least: || *kp == '\\'
> + ki++ ;
> + }
> + url_name = (char *)malloc(strlen(s)+ki+1) ;
> hs = s ;
> HREF_COUNT = 0 ;
> skip_space(hs) ; /* skip spaces */
> @@ -227,7 +234,10 @@
> skip_space(hs) ;
> /* hash_name() ; */
> if (*hs == '"') {
> - for(hs++ ; *hs != '"' && *hs != '\0' ; *v++ = *hs++) ; /* need to esc " */
> + for(hs++ ; *hs != '"' && *hs != '\0' ; hs++) {
> + if (*hs == '(' || *hs == ')') *v++ = '\\' ;
and at least: || *kp = '\\'
> + *v++ = *hs ;
> + }
> if(*hs == '"') {
> hs++ ;
> *v++ = '\0' ;
Yours sincerely
Heiko <oberdiek at uni-freiburg.de>
More information about the tex-k
mailing list