bugtex4ht - Bugs: bug #366, tex4ht-sty.tex does not test the...

Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #366: tex4ht-sty.tex does not test the presence of the local ./tex4ht.sty, but any tex4ht.sty in the TEXMF

Submitted by:  Vincent Belaïche <vincentb1>
Submitted on:  Mon Aug 14 10:49:40 2017  
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue Aug 15 10:35:26 2017, comment #2:

Ooops... sorry for the problem in my patch.

I had overlooked it because when you do the 1st pass w/o local tex4ht.sty it works. The problem is caused by subsequent \def\next while \next has been \let to \iffalse.

Attached is another patch tex4ht-sty-1.diff achieving the early \closein where I fixed that by \def-ining \next instead of \let-ing it.

Well, this one is not really fixing anything, just beautifying the code IMHO. At least this patch has the merits of explaining why my 1st patch did not work.

(file #281)

Vincent Belaïche <vincentb1>
Project Member
Mon Aug 14 21:53:07 2017, comment #1:

sounds sensible, but when i apply the patch and then run make (ht "tex --interaction=nonstopmode -recorder " tex4ht-sty.tex ""), i get an immediate error:

! Undefined control sequence.
l.439 \SubSection
{End Preamble}
(followed by many more).

Something in the \expandafter stuff causes the problem; if I merely change tex4ht.sty to ./tex4ht.sty, it goes ok. So I only installed that part of the diff. --thanks, karl.

Karl Berry <karl>
Project Administrator
Mon Aug 14 10:49:40 2017, original submission:

When one compiles tex4ht-sty.tex, this file checks the presence of tex4ht.sty, and if present it uses it, otherwise it uses an inlined replacement of it.

The problem is that it does not test for the local tex4ht.sty, but for any tex4ht.sty in the TEXMF. This has two bad consequences :

1) If I have a tex4ht.sty installed in my LaTeX distribution, then this one will be used instead of the local replacement. So if the installed tex4ht.sty is not forward compatible with the current needs of tex4ht-sty.tex that won't work

2) Even if the installed tex4ht.sty works, this is problematic, because this means that the local inlined replacement is never used/tested.

I attached a fix that works for me. The fix is very simple, instead of:
I have now (with current dir):
On top of that I did some other change so that the \closein15 comes as soon as possible. I did this change because it is useless to keep this input file open all along, as the purpose of opening it was just to make some \IfFileExists test in plain TeX, so one can, and IMHO should, close it as soon as this objective is reached.

Vincent Belaïche <vincentb1>
Project Member


Attached Files
file #281:  tex4ht-sty-1.diff added by vincentb1 (1kB - application/octet-stream)
file #280:  tex4ht-sty.diff added by vincentb1 (965B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by karl (Posted a comment)
  • -unavailable- added by vincentb1 (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    3 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Aug 15 10:35:26 2017vincentb1Attached File-=>Added tex4ht-sty-1.diff, #281
    Mon Aug 14 21:53:07 2017karlOpen/ClosedOpen=>Closed
    Mon Aug 14 10:49:40 2017vincentb1Attached File-=>Added tex4ht-sty.diff, #280
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup+gray