[l2h] What is a good way to introduce five or six consecutive, blank spaces within text in a .html file produced using LaTeX2HTML?

Pat Somerville l_pat_s at hotmail.com
Thu Oct 13 05:39:12 CEST 2011


Hello. This year of 2011 I wanted to include Fortran computer program code (footnote below) and output listings in .tex files and then run latex and latex2html commands on those files to produce .html output files. But I have yet to produce all of the blank columns or spaces and in the proper locations that I would like to see them in the output, .html files at or near the beginnings of all of the desired Fortran statements. I have been using HTML (HyperText Markup Language) version 3.2 in a latex2html command; LaTeX2HTML 2008, version 1.71; and the two Web browsers Konqueror 4.6.00 (4.6.0) "release 6" and Mozilla Firefox 6.0.2 during these trials. Fortran programmers may know that commonly a commented (C) line begins with a character, such as "C", in column one; executable statements begin in column seven; I think characters beyond column 72 are ignored in an executable Fortran statement; and a continuation character, for example "+" or I use "H", for a long Fortran statement which continues on a second or succeeding line often appears in column six on each line continuing the long Fortran statement. Similarly input data for Fortran computer codes often are in fixed columns, at least usually in the Fortran codes I wrote. I would like such "rigid"-column formatting to appear in my Fortran code, as well as in input and output file listings in the .html files I produce using LaTeX2HTML. I think writing things like "\noindent \ \ \ \ \ \ DO 1 I=1,100" and maybe also of the form "\noindent C\ \ \ \ \ THIS IS A COMMENT LINE." in the .tex file may be at least approximately correct for this sort of formatting in the .dvi output file produced by a command of the form "latex myfile.tex." But in the .html file produced by executing a latex2html command on such a .tex file the spaces I wanted near the beginnings of the Fortran code lines were mostly lost. For example, I may have seen something like "C THIS IS A COMMENT LINE." instead of "C THIS IS A COMMENT LINE." in the .html file. I also tried using something like \hspace{0.5in} in an attempt to add horizontal spacing. But that attempt failed. I also tried some things of the following general forms, but not necessarily character-by-character the same as the lines below:

$\mbox{C\ \ \ \ \ THIS IS A COMMENT LINE.}$

$\mbox{\ \ \ \ \ \ DO 1 I=1,100}$

.

But those attempts failed for the total blank spacing I wanted in the .html file. And the use of \indent or I think starting a new line in column one after skipping a line in the .tex file unfortunately did not result in indenting the text in the output, .html file produced by LaTeX2HTML.

The use of something at least generally equivalent in structure to

\begin{quotation}

Text here

\end{quotation}

resulted in the partial success of indenting the lines between the \begin{quotation} and \end{quotation} by five characters. 

Eventually I learned from the Internet that HTML (HyperText Markup Language) code is set to ignore any blank spaces in an HTML, I suppose tag beyond I think the first blank space. And sure enough when I viewed the document source code for a .html file produced by a latex2html command invoking HTML version 3.2, there were multiple consecutive spaces in the same HTML tag. Then again from the Internet I learned that a blank space can be commanded with a command of the form " " with the letters standing for Non-Breaking SPace within an HTML tag. So next I tried things something like this in the document source code of the .html file:

<P>

&nbsp:&nbsp:&nbsp:&nbsp:&nbsp:&nbsp:RETURN

</P>

Simlarly to save five blank spaces between the "C" in column one and other text beginning in column seven of a comment line I tried something of this form:

<P>

C&nbsp:&nbsp:&nbsp:&nbsp:&nbsp:A COMMENT WOULD BE HERE.

</P>

The purpose was to have to six or five blank spaces hopefully by using six or five consecutive " "s in the HTML source code. The HTML source code of an open, .html file in a Web browser was reached by right-touch-pad-button-clicking on that .html page and then selecting something like View Document Source or View Document Source Code. But after saving that document source code and viewing the corresponding .html file in the two browsers Konqueror 4.6.00 (4.6.0) "release 6" and Mozilla Firefox 6.0.2, about only two blank spaces appeared in each case instead of the six or five blank spaces I wanted to see. 

I admit I am not very experienced in HTML coding. But it appears to me that some of the " "s in a succession of five or six of them may have been "disregarded" by the browsers, which among other things are HTML interpreters.

A multistep way to solve this problem could be to get ink flowing through my printer's ink cartridge again, then to print out the Fortran code and input and output file listings onto paper, to scan those sheets of papers using a optical scanner into Multi-Tagged Image File Format (.tif) image files, and finally to use the Gnu Not Unix (GNU) Image Manipulation Program (GIMP) in a Linux operating system to convert those .tif files into Encapsulated PostScript (.eps) files for use in a .tex file. After that, executing first latex and secondly latex2html.... commands on that .tex file should produce the desired blank spacings in the Fortran code in a figure with the help of LaTeX2HTML. But I don't promise to go through all of what I just described.

Questions:

1) Why did the use of six consecutive " "s in the HTML code not produce six blank spaces in the corresponding, output, .html file?

2 What better ways are there to obtain the blank spacing I desire in a .html file at or near the beginnings of lines of a Fortran computer code listing?

Pat

Footnote: Fortran I think at least used to stand for FORmula TRANSlation. In spite of the new computer languages which have appeared in the last few decades, I think Fortran is still a good language for handling formulas and mathematics. Fortunately free Fortran compilers, such as gfortran, can still be obtained as part of the Gnu Not Unix (GNU) Compiler Collection (gcc), available for at least the openSUSE-11.4 distribution of the Linux operating system; and I would not be surprised if the gcc can be obtained as a part of other distributions of a Linux operating system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/latex2html/attachments/20111012/c336a94b/attachment.html>


More information about the latex2html mailing list