[l2h] In my LaTeX2HTML-produced, .html file the references don't look good. What am I missing?

Pat Somerville l_pat_s at hotmail.com
Tue Feb 12 07:48:02 CET 2013


Sorry, but concerning the first part of my electronic-mail letter there was 
one very important thing in which my procedure failed.---The numbering of 
the references was not sequentially in the order in which I cited the 
references using a command of the form \cite{....} in my text!  But 
gratefully I found a way that worked to solve that problem.

I switched from \usepackage[sort&compress]{natbib} to \usepackage{natbib}.
And I switched from \bibliographystyle{plainnat} to 
\bibliographystyle{unsrt}.

I kept some other important commands the same, namely commands of the form
..
\usepackage{...............,hyperref,hypernat}
..
\bibpunct{}{,}{n}{}{}
\begin{document}
..
\bibliography{MyDotBibFileNameWithoutAPeriodOrExtension}
\end{document}
.
Then afterwards in a test gratefully it appeared that the order of my citing 
references in text matched the order in which those references were 
numbered.

I wanted a way to have the reference numbers in citations in text not have 
parentheses around them, the format I think the journal Physical Review C 
used or accepted in 1985.  The method I discuss here gratefully accomplished 
that goal as far as the looks of reference citations within text were 
concerned.
--------------------------------------------------
From: "Pat Somerville" <l_pat_s at hotmail.com>
Sent: Wednesday, November 02, 2011 1:40 AM
To: <latex2html at tug.org>
Subject: Re: [l2h] In my LaTeX2HTML-produced,.html file the references don't 
look good.  What am I missing?

> Hello again.  When using the software package natbib and its bibliographic 
> style file plainnat.bst in a .tex file gratefully I learned a way to 
> obtain reference numbers both on the base line of text and as superscripts 
> in both the .dvi file produced by the September 24, 2009 version of LaTeX 
> 2e and the .html file produced by LaTeX2HTML 1.71 (These are automatically 
> numbered reference numbers corresponding to reference keys, for example 
> "RAT92" for the reference M. Rath and L. Pauling, J. Orthomolecular 
> Medicine 7(1), 5 (1992), in a special format in a .bib file.).  In the 
> .tex file that uses natbib and its plainnat.bst for plain reference 
> numbers with no parentheses or brackets or pairs of something else 
> surrounding them and for commas to separate a series of reference numbers, 
> include the command
>
> \bibpunct{}{}{,}{n}{}
>
> in the .tex file.  (I think the "n" stands for numeric reference citations 
> on the base line of the text.  Instead of "n" an "s" there would stand for 
> superscripted numbers for the reference citations.  I think the references 
> are supposed to be numbered in the order in which they are cited in the 
> .tex document.)  This will replace the numerical reference equivalent of 
> \cite{RAT92} on the base line of text with the reference number 
> corresponding to the example reference key "RAT92" of a reference with 
> data for it listed in a .bib file.  The LaTeX command $^{\cite{RAT92}}$ in 
> the .tex file will corresponded to that reference number as well, but 
> superscripted.  A beautiful thing about this procedure is that gratefully 
> 1) it worked this way for reference numbers, both on the base line of text 
> and as superscripts, in both the .dvi file produced by using the September 
> 24, 2009 version of LaTeX 2e with BibTeX 0.99d and the .html file produced 
> by LaTeX2HTML 1.71. So using natbib and its plainnat.bst with the line 
> \bib{}{}{,}{n}{} in the .tex file it is as if \cite{...} becomes the 
> equivalent of REVTeX 4.1's \onlinecite{...}, where here I think online 
> refers to having the reference number appear on the base line of text, not 
> to being on the Internet.  Done in this way a new command does not have to 
> be made for a custom \onlinecite{...} built for use with natbib like the 
> \onlinecite{...} command that works with REVTeX 4.1.  So 2) this avoids 
> the problem of LaTeX2HTML 1.71 not "recognizing" the citenum variable or 
> command that was used in the custom-built \onlinecite{...} command! 
> Furthermore when using natbib and plainnat.bst it appeared that I obtained 
> similar-looking references in my bibliography without using the 
> revtex-custom.bib file discussed at 
> http://tex.stackexchange.com/questions/15677/revtex-4-1-bibliography-style-in-other-classes 
> on the Internet.
>
> Now I discuss a different problem of an internal hyperlink in my table of 
> contents, which is called "Contents," to "Bibliography" not working. That 
> is in a .tex file the statements \tableofcontents and 
> \bibliography{MyBib}, where MyBib.bib is a file with the fictitious name 
> MyBib.bib containing reference data, produced A) the hyperlinked entry 
> "Bibliography" in "Contents" and B) the heading "Bibliography" appearing 
> in the .dvi and .html files corresponding to where the equivalent of 
> \bibliography{MyBib} was placed in the .tex file.  But in the .html file 
> produced by LaTeX2HTML 1.71 clicking on that hyperlink did not "take" me 
> to the "Bibliography" heading above the list of references in my document.
>
> Here is a "workaround" solution for that problem.  With .html file open in 
> a Web browser one can right-button-click on its contents and select "View 
> Document Source" or something similar to that.  In my Konqueror Web 
> browser that opened a text editor, in my case the text editor called Kate. 
> Then I could see the HTML (HyperText Markup Language) code for that .html 
> file. For the fictitious file name MyFile.html it looked equivalent to 
> this at the "Bibliography" entry in the "Contents:"
>
> <LI><A NAME="tex2html139"
>    HREF="MyFile.html#SECTION00700000000000000000>Bibliography</A>
> </UL>
>
> .  Then at the section of my document headed by "Bibliography" the HTML 
> code looked equivalent to this:
>
> <P>
> <H2><A NAME="SECTIONREF">Bibliography</A>
> </H2>
> ......
>
> In this case replacing "SECTIONREF" with "SECTION00700000000000000000" and 
> then saving the file in the text editor Kate was probably enough to make 
> the "Bibliography" internal hyperlink in "Contents" work.  I wanted to 
> have Bibligraphy numbered in both locations, too, since it was not 
> numbered for me by using the -show_section_numbers option in my latex2html 
> command.  So in addition I changed "Bibliography" to "6 Bibliography" in 
> each of the two locations in the above document source code.  Is there a 
> LaTeX command one can use to make that "Bibliography" internal hyperlink 
> in "Contents" work without the need to edit the HTML document source code 
> in the .html file produced by LaTeX2HTML 1.71?  Adding something like
>
> \label{Refs}
> \section{Bibliography}
>
> ahead of \bibliography{MyBib} I think resulted in hyperlinked 
> "Bibliography" being listed twice in "Contents" and probably also with two 
> instances of "Bibliography" appearing further down in the document, in 
> each case doubling that I don't want.
>
> Pat
>
> --------------------------------------------------
> From: "Pat Somerville" <l_pat_s at hotmail.com>
> Sent: Tuesday, November 01, 2011 10:39 AM
> To: <latex2html at tug.org>
> Subject: Re: [l2h] In my LaTeX2HTML-produced,.html file the references 
> don't look good.  What am I missing?
>
>> Hello again.  I want to explain one thing. That is although I didn't use 
>> BibTeX during the ten years before this one, I am not sure if I ever used 
>> it myself; it is possible someone might have shown me something about it 
>> or that I might have used it in the early 1990s or 1980s; but it is also 
>> possible that I didn't ever use BibTeX myself before this year.---I'm not 
>> sure.
>>
>> Pat
>>
>> --------------------------------------------------
>> From: "Pat Somerville" <l_pat_s at hotmail.com>
>> Sent: Tuesday, November 01, 2011 12:41 AM
>> To: <latex2html at tug.org>
>> Subject: Re: In my LaTeX2HTML-produced, .html file the references don't 
>> look good.  What am I missing?
>>
>>> Hello again.  I found a good hint for what one of my troubles could have 
>>> been from Erwin at 
>>> http://groups.google.com/group/comp.text.tex/browse_thread/thread/d2a363b56272c543/4553d7b2e2ef9db9?show_docid=4553d7b2e2ef9db9. 
>>> He found that the bibliographic style file plainnat.bst of Natbib could 
>>> be used to avoid a problem between Natbib and apsrev4-1.bst.  I 
>>> substituted plainnat.bst for apsrev4-1.bst in my .tex file using the 
>>> package natbib and gratefully obtained a not perfect, but reasonably 
>>> good-looking set of references in the .html (HyperText Markup Language) 
>>> file produced by LaTeX2HTML.  The custom \onlinecite{..} command did not 
>>> work in the .html file, though, to put automatically numbered reference 
>>> numbers on the base line of text.  My "workaround" solution for that was 
>>> to change textual references like, as a not necessarily real example for 
>>> discussion purposes, "according to reference \onlinecite{RAT92}" to 
>>> "according to the superscripted reference$^{\cite{RAT92}}$".  That is in 
>>> my .tex document I changed all of the \onlinecite{...} commands, 
>>> intended for reference numbers to be on the base line of text, to 
>>> instead superscripted numerical citings of references.
>>>
>>> Not having written any of the codes for the software packages I have 
>>> been discussing here, I give my thinking, reasoning, and guessing to 
>>> attempt to explain the results I mentioned in the above, first 
>>> paragraph.  First compare the dates of the software I  used:
>>>
>>> LaTeX2HTML 1.71 (year 2008, I think)
>>> Within it the file /usr/share/latex2html/styles/natbib.perl is 
>>> internally dated with 2001/11/08 or 2001/11/8, which I guess might mean 
>>> November 8, 2001 (Here in the United States such a date could be 
>>> numerically written as, for example 11/8/01 or maybe 11/8/2001.).
>>>
>>> LaTeX 2e (September 24, 2009)
>>>
>>> The file natbib.sty of Natbib 8.31a (November 7, 2009)
>>>
>>> The bibliographic style file apsrev4-1.bst of REVTeX 4.1 (for February 
>>> 12, 2010 Physical Review).  In REVTeX 4.1 some changes were introduced 
>>> compared to I think an earlier version of REVTeX which I guess might 
>>> have been version 4 of it.
>>>
>>> Also I compared the appearance of one reference in .bbl files produced 
>>> with LaTeX and BibTeX using both plainnat.bst of Natbib 8.31a and 
>>> apsrev4-1.bst of REVTeX 4.1.  The .bbl file produced using apsrev4-1.bst 
>>> contained a number of the commands or variables which LaTeX2HTML 
>>> "referred to" as undefined commands, such as BibitemOpen, BibitemShut, 
>>> citenamefont, bibnamefont, bibfnamefont, bibfield, bibinfo, and 
>>> href at noop; for the same test reference the .bbl file produced using 
>>> plainnat.bst did not contain any of those commands or variables.  So my 
>>> guess is that those new commands or variables are associated with REVTeX 
>>> 4.1 in the year 2010 or perhaps slightly earlier, which is too new for 
>>> the year-2008 LaTeX2HTML or the year-2001 file natbib.perl it contained 
>>> to have accommodated them.
>>>
>>> Also following another hint from Satsuma at 
>>> http://texblog.wordpress.com/2008/03/17/natbib-multiple-reference-citation/ 
>>> for citenum being undefined, he or she mentioned that one should obtain 
>>> a year-2007 version of natbib.sty to replace a year-2003 version of it 
>>> (But in the year 2011 there is a year-2009 version of that file 
>>> available, as I listed its date above.).  So in the text editor Kate I 
>>> looked inside he file natbib.sty of Natbib 8.31a and found that citenum 
>>> is defined with a new command in that file.  Copying that file from in 
>>> my case the directory /usr/share/texmf/tex/latex/natbib to the directory 
>>> containing my .tex files, similar to what Satsuma did with a year-2007 
>>> version of nabib.sty, unfortunately did not result in LaTeX2HTML 
>>> "recognizing" citenum in a .tex file.  So I suppose that LaTeX2HTML 1.71 
>>> may not have been built to accommodate the variable or command citenum 
>>> in a .tex file.
>>>
>>> Professor Ross Moore or anyone else knowledgeable of the internal code 
>>> of LaTeX2HTML 1.71 and the software packages it can accommodate is 
>>> welcome to correct me here.  But if my reasoning, thinking, and some 
>>> guessing are correct here, I suggest that the next version of LaTeX2HTML 
>>> be built to accommodate citenum in a .tex file and the various variables 
>>> or commands BibitemOpen, BibitemShut, citenamefont, bibnamefont, 
>>> bibfnamefont, bibfield, bibinfo, and href at noop in a .bbl file, which I 
>>> supposed may have been produced in my .bbl file as a result of using the 
>>> bibliographic style file apsrev4-1.bst of REVTeX 4.1.
>>>
>>> But in the near future, if one is not too particular in trying to 
>>> exactly duplicate the referencing style of apsrev4-1.bst of REVTeX 4.1, 
>>> for use with LaTeX2HTML plainnat.bst can serve as a reasonable, but not 
>>> exact, functional substitute.  With the command \bibpunct{}{}{,}{s}{} 
>>> for use with natbib in a .tex file, the use of plainnat.bst can produce 
>>> automatically numbered numerical superscripts corresponding to, for 
>>> example,$^{\cite{RAT92}}$ in the text and numbers on the base line in 
>>> the bibliography of the .html file produced by LaTeX2HTML, similar, but 
>>> exactly like what the use of apsrev4-1.bst would produce.  With 
>>> LaTeX2HTML 1.71 I suggest using only superscripts for automatically 
>>> numbered referencing.  Allow me to oversimplfiy things somewhat here; 
>>> more details and Internet references are given in my previous letter in 
>>> this chain of e-mail letters; besides, it is possible I might miss some 
>>> of the details here myself.  For publication in Physical Review 
>>> journals, books, or other journals in which simple numerical 
>>> superscripts are used for reference citations, one might use 
>>> \documentclass[prb,longbibliography,12pt]{revtex4-1}, 
>>> \bibliographystyle{apsrev4-1}, and \bibliography{MyBib}, where MyBib.bib 
>>> is the file containing your reference data for your document's 
>>> bibliography; from a .dvi file produced by LaTeX it should be possible 
>>> to print those references along with the rest of the document onto 
>>> paper. And for online or computer versions of documents and publications 
>>> with internal and external hyperlinks one might use 
>>> \documentclass[a4paper,12pt]{article}, 
>>> \usepackage[sort&compress]{natbib}, 
>>> \usepackage{....,doi,hyperref,hypernat}, \bibpunct{]{]{,}{s}{}, 
>>> \bibliographystyle{plainnat}, \bibliography{MyBib,revtex-custom}, where 
>>> the contents of a file revtex-custom.bib, including REVTeX 4.1 controls, 
>>> are discussed at 
>>> http://tex.stackexchange.com/questions/15677/revtex-4-1-bibliography-style-in-other-classes. 
>>> It might be necessary to experiment with the order of the packages in a 
>>> \usepackage{........} statement to avoid errors.
>>>
>>> There are still a few things that I haven't gotten to work 
>>> satisfactorily yet.  One of them is with multiple reference numbers as 
>>> one superscript always being in numerical order.  And I haven't checked 
>>> to see whether the compression worked correctly or not, for example 
>>> references(superscript 1,2,3,4) becoming references(superscript 1-4). 
>>> But, when necessary, those cases can be manually edited in the .tex file 
>>> to produce what you desire, as mentioned at 
>>> http://www.latex-community.org/forum/viewtopic.php?f=44&t=8897. I have 
>>> some unwanted pairs of side-by-side parentheses in .my .dvi file or 
>>> unwanted letters like a, b, etc., in my .html file sometimes appearing 
>>> in some references in my bibliography corresponding to sometimes when I 
>>> have \htmladdnormallink{http://..../}{http://....../} in my .tex file. 
>>> My table of contents doesn't show all four levels of 
>>> chapter-and-sectioning in the .html file that are shown in the 
>>> corresponding .dvi file.  And my internal hyperlink in the table of 
>>> contents for "Bibliography" isn't working for me in the .html file.
>>>
>>> Pat
>>>
>>> --------------------------------------------------
>>> From: "Pat Somerville" <l_pat_s at hotmail.com>
>>> Sent: Sunday, October 30, 2011 1:32 AM
>>> To: <latex2html at tug.org>
>>> Subject: In my LaTeX2HTML-produced, .html file the references don't look 
>>> good.  What am I missing?
>>>
>>>> Hello. I have been using:
>>>>
>>>> the September 24, 2009 version of LaTeX 2e,
>>>> BibTeX 0.99b,
>>>> by the command \usepackage[sort&compress]{natbib} the natbib software 
>>>> package with the options sort&compress and with the additional command 
>>>> \bibpunct{}{}{,}{s}{} (similar to at 
>>>> http://www.andy-roberts.net/writing/latex/bibliographies on the 
>>>> Internet),
>>>> the apsrev4-1.bst bibliographic style file of REVTeX 4.1 called in a 
>>>> .tex-file command of the form \bibliographystyle{apsrev4-1}, and
>>>> LaTeX2HTML 1.71
>>>>
>>>> in an openSUSE-11.4, Linux operating system. This is my first attempt 
>>>> to try to produce a letter for distribution to some other people which 
>>>> uses automatically numbered references, figures, tables, and equations 
>>>> and which uses a .bib, bibliography file external to my .tex file; for 
>>>> that matter I may not have even used BibTeX before this attempt.
>>>>
>>>> My use of several commands with natbib followed the advice of I think 
>>>> Daniel Els at 
>>>> http://tex.stackexchange.com/questions/15677/revtex-4-1-bibliography-style-in-other-classes. 
>>>> Similar to the procedure mentioned at 
>>>> http://www.wujiewen.com/faq/content/2/33/en/how-to-use-latex2html-to-convert-my-paper-to-webpages.html, I 
>>>> performed program executions of the following forms, here using the 
>>>> fictitious name MyFile:
>>>>
>>>> latex MyFile.tex
>>>> bibtek MyFile
>>>> latex MyFile.tex
>>>> latex MyFile.tex
>>>> latex2html............MyFile.tex
>>>> latex2html............MyFile.tex
>>>> .
>>>> For my .bib-file entry
>>>>
>>>> @article{RAT92,
>>>>      author="M. Rath and L. Pauling",
>>>>      title="",
>>>>      journal={J. Orthomolecular Medicine},
>>>>      volume="{\bf 7}",
>>>>      number="1",
>>>>      pages="5",
>>>>      year="1992"}
>>>>
>>>> BibTeX and/or LaTeX produced in the .bbl, output file
>>>>
>>>> \bibitem [{\citenamefont {Rath}\ and\ \citenamefont 
>>>> {Pauling}(1992)}]{RAT92}%
>>>>      \BibitemOpen
>>>>      \bibfield {author} {\bibinfo {author} {\bibfnamefont 
>>>> {M.}~\bibnamefont
>>>>      {Rath}}\ and\ \bibinfo {author} {\bibfnamefont {L.}~\bibnamefont 
>>>> {Pauling}},\
>>>>      }\href at noop {} {\bibfield {journal} {\bibinfo {journal} {J. 
>>>> Orthomolecular
>>>>     Medicine},\ }\textbf {\bibinfo {volume} {{\bf 7}}},\ \bibinfo 
>>>> {pages} {5}
>>>>     (\bibinfo {year} {1992})}\BibitemShut {NoStop}%
>>>>
>>>> and in the .dvi (DeVice-Independent), output file
>>>>
>>>> [22] M. Rath and L. Pauling, J. Orthomolecular Medicine, 7, 5, (1992).
>>>>
>>>> with the volume number 7 in a bold typeface.
>>>>
>>>> But LaTeX2HTML, executed by a command of the form
>>>>
>>>> latex2html -nonavigation -no_math -html_version 3.2,math -split 0 
>>>> MyFile.tex
>>>>
>>>> , correspondingly produced in its output, .html (HyperText Markup 
>>>> Language) file
>>>>
>>>> 22 author author M. Rath -
>>>> bibinfo author L. Pauling,#18543#> journal journal J. Orthomolecular 
>>>> Medicine,#18056#>volume 7,
>>>> bibinfo pages 5 (year 1992)NoStop
>>>>
>>>> instead of something close to what appeared in the .dvi file, and in a 
>>>> terminal program from which LaTeX2HTML was executed the following 
>>>> messages:
>>>>
>>>> Unknown commands: citenamefont captionsetup bibfnamefont citenum 
>>>> enquote ed bibnamefont BibitemShut ( href_at_noon BibitemOpen
>>>> bibfield < natexlib bibinfo
>>>> .
>>>> Note that among the commands "reported" as unknown by LaTeX2HTML, 
>>>> citenamefont, bibfnamefont, bibnamefont, BibitemShut, as well as 
>>>> BibitemOpen, bibfield, and bibinfo all appear in the entry of the .bbl 
>>>> file which LaTeX2HTML is supposed to be using. And it appears from the 
>>>> .html output file that LaTeX2HTML did indeed "read" M. Rath, L. 
>>>> Pauling, J. Orthomolecular Medicine, 7, 5, and 1992 from the .bbl file. 
>>>> The command or software package citenum was used in my .tex file in the 
>>>> command \newcommand{\onlinecite}[1]{\hspace{-1 ex} 
>>>> \nocite{#1}\citenum{#1}}, following advice from 
>>>> http://www.latex-community.org/forum/viewtopic.php?f=44&t=8897. The 
>>>> purpose of that command was to allow the use of this custom 
>>>> \onlinecite{...} command in text so that reference numbers could appear 
>>>> on the base line of text, rather than as superscripts dictated by the 
>>>> "s" for superscript in the .tex-file command \bibpunct{}{}{,}{s}{}. As 
>>>> far as just the correct reference numbers appearing was concerned, that 
>>>> custom \onlinecite{..} command worked for me in the .dvi file produced 
>>>> by LaTeX, but not in the .html file produced by LaTeX2HTML, perhaps 
>>>> because LaTeX2HTML did not "recognize" citenum in the \newcommand.... 
>>>> in my .tex file to define the custom \onlinecite{..} command (Instead 
>>>> in the .html file the reference "KEY" for a reference appeared [RAT92 
>>>> is the reference key in the .bib-file entry I discussed earlier here.]; 
>>>> it was desired to have had an internally hyperlinked reference number 
>>>> there in the .html file corresponding to a .tex-file command of the 
>>>> form \onlinecite{KEY}.). I also used captionsetup in my .tex file in 
>>>> the command
>>>> \captionsetup[subfigure]{labelformat=empty,labelsep=none} along with 
>>>> \usepackage{.....,caption,....}.
>>>>
>>>> Following a suggestion posted by Professor Ross Moore for a different 
>>>> problem than mine in the Internet thread which includes 
>>>> http://www.mail-archive.com/latex2html@tug.og/msg02874.html, but might 
>>>> be in a later reply to that message posted on that Web page, I found 
>>>> the file /usr/share/doc/packages/latex2html/dot.latex2hmtl-init and in 
>>>> it after "###Other global variables" entered a comment line of my own 
>>>> with a # at its beginning and the pair of statements:
>>>>
>>>> if($DO_INCLUDE) {$DO_INCLUDE .= ':bbl'}
>>>> else{ $DO_INCLUDE = 'bbl'};
>>>>
>>>> . Did I enter those lines in the correct file and in an acceptable 
>>>> location in that file? But unfortunately the result of such entry was 
>>>> no noticeable improvement for me in the bibliographic entries in the 
>>>> .html file produced from the .bbl file by the program LaTeX2HTML. What 
>>>> did I miss in all of this that 1) prevented the references in the .html 
>>>> file from looking as good as they did in the .dvi file and 2) prevented 
>>>> the custom \onlinecite{..} command from working in the .html file?
>>>>
>>>> Pat
>>>
>> _______________________________________________
>> latex2html mailing list
>> latex2html at tug.org
>> http://tug.org/mailman/listinfo/latex2html
>>
> 


More information about the latex2html mailing list