diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/tex4ht/jhsample.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/tex4ht/jhsample.tex | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/tex4ht/jhsample.tex b/Master/texmf-dist/doc/generic/tex4ht/jhsample.tex new file mode 100644 index 00000000000..1842c99a3e2 --- /dev/null +++ b/Master/texmf-dist/doc/generic/tex4ht/jhsample.tex @@ -0,0 +1,118 @@ +\documentclass{article} + + \usepackage{url} + \Configure{ProTex}{java,<<<>>>,title,`,list,[[]]} + + \usepackage{makeidx} + \makeindex + +\begin{document} + +\tableofcontents + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Compilation Instructions} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{itemize} +\item +Make a subdirectory {\tt jobname-doc}. +\item +Compile the \LaTeX{} file with a command similar to +\index{htlatex}% +`{\tt htlatex +jobname "html,3.2,javahelp,3" "" "-djobname-doc/"}'. +\item +\index{JavaHelp indexer}% + Invoke the JavaHelp indexer to produce the search +database at `jobname-doc/jobname-jhs' with a command + similar to `{\tt java -jar + \$\string{HOME\string}/jh1.1.3/javahelp/bin/jhindexer.jar -db + jobname-doc/jobname-jhs +jobname*.html}'. +\item +\index{JavaHelp URL}% +The URL into the javahelp file, as provided by tex4ht, is +`{\tt jobname-doc/jobname-jh.xml}'. +\item +The java programs should be compiled with commands similar to +\index{javac}% +`{\tt javac -classpath + \$\string{HOME\string}/jh1.1.3/javahelp/lib/jh.jar program.java}'. +\item +The programs should run with commands similar to +\index{java}% +`{\tt java -classpath + \$\string{HOME\string}/jh1.1.3/javahelp/lib/jh.jar;. program}'. +\end{itemize} + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Sample Program} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\<jhprog\><<< +import java.net.URL; +import javax.help.*; +import javax.swing.*; +public class jhprog { + public static void main(String args[]) { + JHelp helpViewer=null; + try { + ClassLoader cl = jhprog.class.getClassLoader(); + URL url = HelpSet.findHelpSet(cl, + "`jobname-doc/`jobname.hs"); + helpViewer = new JHelp(new HelpSet(cl, url)); + } catch (Exception e) { System.out.println("error"); + } + JFrame frame = new JFrame(); + frame.setSize(500,500); + frame.getContentPane().add(helpViewer); + frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + frame.setVisible(true); + } +} +>>> + +\OutputCode\<jhprog\> + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Sample Script} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The source file \edef\temp{\noexpand\url{\jobname.tex}}\temp{} of this +document got compiled with the command `{\tt jhlatex jhsample "html,3"}', with +{\tt jhlatex} being the following script.\index{htlatex} + +\begin{verbatim} +mkdir jh-$1.dir +mkdir jh-$1.dir/$1-doc +htlatex $1 "html,3.2,javahelp,$2" "" "-djh-$1.dir/$1-doc/ -cjavahelp" +tex '\def\filename{{$1}{idx}{4dx}{ind}} \input idxmake.4ht' +makeindex -o $1.ind $1.4dx +htlatex $1 "html,3.2,javahelp" "" "-djh-$1.dir/$1-doc/ -cjavahelp" +cd jh-$1.dir; zip -r $1 * ; cd .. +mv jh-$1.dir/$1.zip . +rm -r -f jh-$1.dir +\end{verbatim} + +The compilation produced the following files. + +\begin{verbatim} +jhprog.class +jhsample-doc/ +jhsample-doc/jhsample.html +jhsample-doc/jhsample.jhm +jhsample-doc/jhsample-jhi.xml +jhsample-doc/jhsample.hs +jhsample-doc/jhsample-jht.xml +jhsample-doc/jhprog.java +\end{verbatim} + +\printindex + +\end{document} + |