By Alvin Alexander. Last updated: June 4, 2016
Here is some example LaTeX code where I'm experimenting with image inclusion, as well as tags like htmlonly, latexonly, and the alltt environment.
This LaTeX example/test file was created for tests with the pdflatex (LaTeX PDF) and latex2html (LaTeX HTML) utilities. This is definitely not for newbies.
\documentclass[11pt,a4paper]{report}
\usepackage{version}
\includeversion{PDF}
\excludeversion{HTML}
\usepackage[pdftex]{graphicx}
\usepackage{html}
\usepackage{alltt}
\begin{document}
\DeclareGraphicsExtensions{.eps,.jpg,.png,.pdf}
\begin{enumerate}
\item This is some text.
\begin{enumerate}
\item This is some text.
\begin{enumerate}
\item This is some text.
\begin{enumerate}
\item This is some text.
\item This is some text.
\item This is some text.
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{enumerate}
%% this works with pdflatex
\includegraphics[scale=3]{mdlogo.jpg}
%\includegraphics[scale=3]{bench2.gif}
%% this html stuff works with l2h
\begin{htmlonly}
\htmladdnormallink{DevDaily Home Page}{http://www.devdaily.com/}
\end{htmlonly}
%% try an html image inclusion here
\begin{htmlonly}
This text should only appear in the HTML doc.
\begin{figure}
\htmlimages{thumbnail=0.5}
\htmlborder{2}
\centering \includegraphics[scale=3]{bench2.gif}
\end{figure}
\end{htmlonly}
% force image inclusion by doing it with html
\begin{htmlonly}
If this is an HTML document, you should be seeing an image below.
\begin{rawhtml}
<img border="0" src="../bench2.gif">
\end{rawhtml}
\end{htmlonly}
Try some conditional text below here:
\begin{latexonly}
This is some latex-only text.\\
It should appear in a PDF but not in my html docs.\\
\end{latexonly}
% ------- alltt test -----------
% this worked with latex2html:
Try some "alltt" testing here.
\begin{alltt}
\input{HelloWorld2.java}
\end{alltt}
This is some more text.
\end{document}

