bugtex4ht - Bugs: bug #208, lit/Makefile has extra space in...

 
 
Show feedback again

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

bug #208: lit/Makefile has extra space in latex argument confusing MikTeX latex

Submitted by:  Vincent Belaïche <vincentb1>
Submitted on:  Sun Mar 2 22:11:12 2014  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Tue Jun 17 23:01:34 2014, comment #4:

Hi Vincent - mkht-scripts.4ht is generated from tex4ht-mkht.tex, I am 99% sure.

And unfortunately, no, I don't have any ingrained knowledge of how to get the necessary quoting for the .bat files (or the Unix scripts for that matter, which suffer from similar problems) through the tex4ht "literate" processing.

I have to research pretty much everything in tex4ht from first principles, and that's not going to happen today.

Best,
Karl

Karl Berry <karl>
Project Administrator
Tue Jun 17 06:55:46 2014, comment #3:

It seems that the source code is mkht-scripts.4ht, and not tex4ht-mkht.tex.

Is there any documentation about the syntax of this file, notably how to escape any character in the MSDOS batch file that would be interpreted as special.

Is there any documentation how one generate the MSDOS batch files from mkht-scripts.4ht, do I need to do only something like

make ../bin/ht/win32/ht.bat

Then I can provide the suitable patch (don't expect anything quick however...).

Vincent

Vincent Belaïche <vincentb1>
Project Member
Thu Mar 6 19:14:54 2014, comment #2:

Hi Vincent - well, thanks for the report and patch, but not dequoting is a fundamental discrepancy between shells. I have no intention of trying to support DOS, Windows, or anything else Microsoft. If you want to, ok, but otherwise, consider it unsupported.

I wrote lit/Makefile to be a convenience on Unix (and it is far from complete); Eitan never had a Makefile at all. (Sigh.)

As far as the patch goes, htlatex is just one of many scripts. And patching it directly isn't possible, since those scripts are all generated from tex4ht-mkht.tex (and other things?) in some process I haven't internalized. So I'm afraid I can't even tell you for sure the actual source files that need to be changed.

All the Unix scripts have quoting problems too. It's all a gigantic mess and is one of the lowest-priority things to even look at :(.

sorry,
karl

Karl Berry <karl>
Project Administrator
Sun Mar 2 22:27:12 2014, comment #1:

Ok, I attached htlatex.bat.diff which is certainly a better patch to correct this issue than my previous patch in Makefile.diff

(file #167)

Vincent Belaïche <vincentb1>
Project Member
Sun Mar 2 22:11:12 2014, original submission:

In lit/Makefile we have these lines:

tex_opts = --interaction=nonstopmode #--file-line-error
tex_1opt = "$(tex_opts)"

This means that the argument passed e.g. to htlatex.bat is (with added delimitting by `and ') the following

`--interaction=nonstopmode '

i.e. there is one tailing space just after the nonstopmode.

This confuses latex (as called by htlatex.bat) which outputs the following error message

latex: Invalid option argument.
latex: Data: nonstopmode
latex: Invalid option argument.
latex: Data: nonstopmode
latex: Invalid option argument.
latex: Data: nonstopmode

I.e. latex does not know `nonstopmode ', but only `nonstopmode'.

The root cause for the problem is that when passing argument to a MSDOS batch, the argument is not de-quoted. That is to say, assume that I have some batch toto.bat as follows

some_exe.exe %1

and I call

toto.bat "a b c"

Then %1 will expand to "a b c", and therefore the command some_exe.exe will be passed only one argument that is `a b c', instead of 3 arguments a, b and c, which is the intention.

This means that the patch which I propose as attached is not really a definitive solution --- if ever there would be more than one option, that would not work any longer. Instead, to follow the intention of tex_1opt Makefile variable double-quoting in order to pass several options just as one argument, one needs in htlatex.bat some explicit code in order to do the de-quoting --- that would by the same way solve the tailing space issue, so the same lit/Makefile as currently could be reverted.

I will try to propose this in another post, I need some more thinking how to do that in MSDOS --- if ever feasible, DOS is no longer maintained, and quite unpractical a language.

Vincent Belaïche <vincentb1>
Project Member

 

Attached Files
file #167:  htlatex.bat.diff added by vincentb1 (3kB - application/octet-stream)
file #166:  Makefile.diff added by vincentb1 (399B - 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):

     

     

    2 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Mar 2 22:27:12 2014vincentb1Attached File-=>Added htlatex.bat.diff, #167
    Sun Mar 2 22:11:12 2014vincentb1Attached File-=>Added Makefile.diff, #166
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray