diff options
author | Norbert Preining <norbert@preining.info> | 2021-05-12 03:01:15 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-05-12 03:01:15 +0000 |
commit | bcdf6c829c6761de02484473ebe43fa3760adcaa (patch) | |
tree | de384ae80a1a9e34f900739a9478f92a0660a9ef /support/TeX4ht/doc/jhsample.tex | |
parent | 4a8a25f4c6acac624cf323115db94d934b19d6b1 (diff) |
CTAN sync 202105120301
Diffstat (limited to 'support/TeX4ht/doc/jhsample.tex')
-rw-r--r-- | support/TeX4ht/doc/jhsample.tex | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/support/TeX4ht/doc/jhsample.tex b/support/TeX4ht/doc/jhsample.tex new file mode 100644 index 0000000000..c17e002d6a --- /dev/null +++ b/support/TeX4ht/doc/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 +Compile this \LaTeX{} file with the +\index{jhlatex}% +`{\tt jhlatex +jobname "html,3"}' +command. +\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}/jh2.0/javahelp/lib/jh.jar program.java}'. +\item +The programs should run with commands similar to +\index{java}% +`{\tt java -classpath + \$\string{HOME\string}/jh2.0/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} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +A source file \edef\temp{\noexpand\url{jhsample.tex}}\temp{} of this +document may be compiled for JavHelp 2.0 with the following script. + +\Verbatim +jhlatex jhsample +tex "\def\filename{{$1}{idx}{4dx}{ind}} \input idxmake.4ht" +makeindex -o jhsample.ind jhsample.4dx +jhlatex jhsample +\EndVerbatim + +The compilation produces 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} + + +The following instruction can be used for compiling the program. + +\Verbatim +javac -classpath ${HOME}/jh2.0/javahelp/lib/jh.jar jhprog.java +\EndVerbatim + + +The outcome could be viewed through the following command. + +\Verbatim +java -cp ${\home}/jh2.0/javahelp/lib/jh.jar:. jhprog +\EndVerbatim + + +\printindex + +\end{document} + |