[texshop] How get sections in separate html pages with TeX4ht?

Richard Koch koch at uoregon.edu
Fri Sep 2 19:38:57 CEST 2022


Murray,

You are making this too complicated. Calling the pages Page1, Page2, etc., is irrelevant. I used that in the first version of the document, but it was misleading.

Here's how to do it. if you want to create a new separate web page (for each section, or just arbitrarily),
choose New in TeXShop and get a blank page. Go to the Templates toolbar item and select the
TeX4ht-Interactive template.

Accept the boilerplate stuff at the top and write html code in the body where there is now a comment.

This page can be typeset by just pushing command-T because the appropriate typesetting engine has been selected at the top in a magic comment. But the first time you do this, you will be asked to save the file first. This is not a surprise; TeXShop always works like that.

Save the document in the Interactive subfolder of the source folder of your main TeX4ht document.
Give it any name you like (don't use spaces in the name). If your page is going to have support files, like images or movies, create a folder inside Interactive and put your source in that folder.

Before you push save, use the bottom pulldown menu to select html rather than tex as extension.

Examples: For a stand along page,

	Interactive/Section3.html

For a page with support files

	Interactive/Section3/FirstSample.html

>From now on, you can edit and typeset in the usual style with that page.

Note that ths page doesn't have to be tied to a special section, so the above "Section3" might be
"UTubeExample". 

-------------

Now you have a stand along page. To link it to the document, find the spot in the document where it is supposed to live, and type something like

	\ifx\HCode\undefined

	\else

	Please try the following demonstration: \url{/Interactive/Section3/FirstSample.html}
	
	\fi



Dick Koch


> On Sep 2, 2022, at 10:22 AM, Murray Eisenberg <murrayeisenberg at gmail.com> wrote:
> 
> The question is how to produce separate html pages, one for each document section (with the usual kind of next and previous page links) In TeXShop, 
> 
> Allegedly, the optional parameter “2” to the make4ht command does that.
> 
> I’m trying this with the source document Fourier.tex from ~/Library/TeXShop/New/Demo/Fourier-for-TeXShop.
> 
> First I tried modifying the new TeXr4ht.engoine by changing its line
> 
> 	make4ht "$1" "mathjax”
> 
> to:
> 
> 	make4ht "$1" "mathjax,2”.
> 
> But when I typeset, I get a single html file.
> 
> Next I tried doing the same thing from a Terminal command line:
> 
> 	make4ht Fourier "mathjax,2”
> 
> (followed by pdflatex Fourier). But still a single html page.
> 
> Any idea how to make it work?
> ---
> Murray Eisenberg		murrayeisenberg at gmail.com
> Mobile (413)-427-5334
> 503 King Farm Blvd #101		
> Rockville, MD 20850-6667	
> 
> 
> 
> 




More information about the texshop mailing list.