# [texhax] best way to create a short html or plain text document with a few references

Sun Jan 23 08:41:28 CET 2011

On 23/01/11 11:01 AM, Chris Ryan wrote:

> For an onine class I am taking, I have to create a large number of
> short (~500 word) essays, with references, and post them to our
> Blackboard website. Blackboard offers a box into which to post the
> text. I believe html source can be posted. The essays can't be pdf
> attachments.
>
> It's simple enough to just compose in a text editor, typing the
> references at the end. And that's probably what I should do.  But
> I already have a .bib file full of references, so I would like to
> use them if possible, and not have to re-type them. Plus I thought
> maybe I could learn some new LaTeX tricks.

I think, TeX4ht can be of help to you. You might keep each essay as a
version of TeX4ht installed, please issue the following command from
the terminal:

htlatex <filename> "html,next,2"

You will get as many html files as your sections which is what you
wanted, I believe.

You can also make use of bibTeX database, run bibTeX in the usual way
to create the *.bbl file and run the above command. That should solve
the bibliography problem.

Given below is an example which you might test with the above command
and see for yourself if it meets your requirements. The numeral '2' in
the above command is to cut your document at every section. If you
increase the number to '3' you can cut at every subsection onwards.
You can go upto '7'.

% <------------- begin test.tex --------------->

\documentclass[a4paper]{article}

\usepackage{lipsum}

\begin{document}

\title{Title}
\author{Author}

\maketitle

\section{Section One}
\lipsum[1]

\subsection{Subsection One.One}
\lipsum[3]

\section{Section Two}
\lipsum[2]

\section{Section Three}
\lipsum[3]

\section{Section Four}
\lipsum[4]

\end{document}

% <------------- End test.tex ----------------->

If you have any problems, please post your problems at the TeX4ht list:

text4ht at tug.org

Best regards
--