Hello Is there a good way of writing articles so that citations and the bibliography works in both latex and html? Currently I am using \cite{foobar} in the text and have: #+LATEX: \bibliographystyle{foo} #+LATEX: \bibliography{bar} In the end and a corresponding .bib file. This works nicely with latex, but I would like a solution that worked also with html. How have other people solved this? - Taru Karttunen
At the moment, rather than using BibTeX, I'm just doing citations
manually, using org's footnote mechanism and /italics/ markup. This
works, but I think I may have a few bugs to report with org's LaTeX
export. All those italics, punctuation, and parentheses in close
proximity seem like they may be causing problems. I haven't yet
sorted out where the problems are, but I'll report them as soon as I
do.
If you can imagine forgoing the luxury of BibTeX, this is probably the
way to go., alternately you could use BibTeX to assure the quailty of
your LaTeX output (print still rules in some quarters), but do manual
citations in using #+HTML markup.
If you want to use BibTeX for your citations, you'd have to have
either: (1) a bibtex engine for HTML (does it exist?) or (2) get org
to cleverly insert fragments of TeX output in HTML, both for each
citation and the bibliography. This would be ugly even if it were
easy, and I suspect it's not.
With regard to (1), I suppose you could hack together a very
rudimentary substitution engine to replace your \cites with
preformatted citations which were already set up in org markup, and
would therefore export into HTML. This could be promising if your
citation requirements are simple, and if you do enough work using a
single style guide to make the setup work worth it.
You may find a LaTeX to HTML exporter that can do the trick. And if
it did, this might be the best of all worlds.
The last option would be working up an org export to 'pandoc', an
extension of Markdown which has a very cool citation mechanism in
development (using Citation Style Language, the same as the Zotero
bibliographic manager, so there are already many citation styles).
It's working (and can use BibTeX databases), but I've not put it to
the test. If you could sucessfully get your work from org to pandoc,
you could then export to either LaTeX or HTML (as well as ODF and
OOXML). There are some people on this list working on (or musing
over) a generalized org2wiki exporter, and, it might someday be
possible to coax that to export to pandoc/Markdown. This is, only a
possibility, though, and not free of problems. I only put it down for
the record.
Scot
On Tue, Feb 10, 2009 at 1:49 PM, Taru Karttunen <taruti@taruti.net> wrote:
> Hello
>
> Is there a good way of writing articles so that citations and
> the bibliography works in both latex and html?
>
> Currently I am using \cite{foobar} in the text and
> have:
>
> #+LATEX: \bibliographystyle{foo}
> #+LATEX: \bibliography{bar}
>
> In the end and a corresponding .bib file. This works nicely with
> latex, but I would like a solution that worked also with html.
>
> How have other people solved this?
>
> - Taru Karttunen
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
Hi Taru, Taru Karttunen <taruti@taruti.net> writes: > Currently I am using \cite{foobar} in the text and > have: > > #+LATEX: \bibliographystyle{foo} > #+LATEX: \bibliography{bar} > > In the end and a corresponding .bib file. This works nicely with > latex, but I would like a solution that worked also with html. > > How have other people solved this? I think you'll have to export to TeX and then convert to html using something like TeX4ht: http://www.cse.ohio-state.edu/~gurari/TeX4ht/ Best, Matt
> If you want to use BibTeX for your citations, you'd have to have > either: (1) a bibtex engine for HTML (does it exist?) or (2) get org > to cleverly insert fragments of TeX output in HTML, both for each > citation and the bibliography. This would be ugly even if it were > easy, and I suspect it's not. Some time ago I had some success in a similar context (writing an autodocumenter for the Ciao programming language) where I needed to generate citations in a format different from latex. I managed to do this by writing a new .bst file (the "bibliography style" file that controls the format in which bibtex formats the references that it outputs). Hope it helps. --Manuel -- ------------------------------------------------------------------------------- Manuel Hermenegildo | Prof., C.S.Dept., T.U. Madrid (UPM) Director, IMDEA-Software and CLIP Group | +34-91-336-7435 (W) -352-4819 (Fax) -------------------------------------------------------------------------------
At Tue, 10 Feb 2009 18:33:31 +0100, Manuel Hermenegildo wrote: > > Some time ago I had some success in a similar context (writing an > autodocumenter for the Ciao programming language) where I needed to > generate citations in a format different from latex. I managed to do > this by writing a new .bst file (the "bibliography style" file that > controls the format in which bibtex formats the references that it > outputs). Hope it helps. --Manuel > Unless you like forth, bst programming is not much fun. There is also e.g. the Text::BibTeX perl module, python-bibtex and probably other options parsing for the bibtex format. There is also ebib [1], a bibtex editor for emacs, but I'm not sure if deals with formatting entries, which is the main issue here. [1] http://ebib.sourceforge.net/
On Feb 10, 2009, at 7:02 PM, David Bremner wrote:
> At Tue, 10 Feb 2009 18:33:31 +0100,
> Manuel Hermenegildo wrote:
>>
>> Some time ago I had some success in a similar context (writing an
>> autodocumenter for the Ciao programming language) where I needed to
>> generate citations in a format different from latex. I managed to do
>> this by writing a new .bst file (the "bibliography style" file that
>> controls the format in which bibtex formats the references that it
>> outputs). Hope it helps. --Manuel
>>
>
> Unless you like forth, bst programming is not much fun. There is also
> e.g. the Text::BibTeX perl module, python-bibtex and probably other
> options parsing for the bibtex format.
>
> There is also ebib [1], a bibtex editor for emacs, but I'm not sure if
> deals with formatting entries, which is the main issue here.
Both reftex-cite.el and bibtex.el have pretty sophisticated
ways to extract info from bibtex databases. So with a little
bit of lisp, I am sure it is possible to cook something that
would insert references well enough during HTML export.
- Carsten
P.S. No, I am no writing it :-)