Coder Social home page Coder Social logo

bibtex2html's People

Contributors

backtracking avatar bisaloo avatar claudemarche avatar darvasd avatar dgomes avatar khatchad avatar morxa avatar signoles avatar treinen avatar yxoc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bibtex2html's Issues

tmpdir issues on Mac yosemite

I am editing this 1-day old issue. It turns out that bibtex2html works fine on smaller .bib files, which makes me believe that there must be some corruption (or just a bad entry) in my bigger .bib file. I will continue testing.

Thanks, Larrabee

Compiled 1.98 on Mac yosemite (via brew).

It produces .aux, .bb. and .blg files, but no html. Maybe this is fine, but the .aux, .bbl, etc. files have what appear to be temporary file names, maybe OK. I tried the export TMPDIR=. but didn't help.

Here is an example output

-rw------- 1 strow staff 0 Dec 29 16:13 bib2html5168c5
-rw-r--r-- 1 strow staff 51 Dec 29 16:13 bib2html5168c5.aux
-rw-r--r-- 1 strow staff 398284 Dec 29 16:13 bib2html5168c5.bbl
-rw-r--r-- 1 strow staff 59722 Dec 29 16:13 bib2html5168c5.blg

The .blg and .bbl look as they should. Just no .html files.

utf8?

Hello,

Is it possible to generate html from utf8 input? I'm using chinese characters (not fitting into 8-bit encodings)...

Thank you,

unknown macro \rq (apostrophe)

I have trouble processing a BibTex file which contains {\rq} macro instead of plain text apostrophes. I believe those macros are inserted automatically by kbibtex, because when I look at the "source view" of kbibtex, these \rq are not visible but replaced by the actual character ’ ("right single quotation mark", which is the same as apostrophe).

bibtex2html outputs the warning message Unknown macro: \rq and this macro is erased in output html file.

I believe the expected behavior would be to replace{\rq} by the html entity ’ (cf. https://en.wikipedia.org/wiki/Apostrophe#Entering_apostrophes)

Example:

@inbook{Multon:2013:TIBE8100,
author = "Multon, Bernard and Aubry, Judica{\"e}l and Haessig, Pierre and {Ben Ahmed}, Hamid",
booktitle = "{Technique de l{\rq}Ing{\'e}nieur}",
month = apr,
pages = "BE8100",
title = "{Syst{\`e}mes de stockage d{\rq}{\'e}nergie {\'e}lectrique}",
year = "2013"

}

This yields a title in html "Systèmes de stockage dénergie électrique" (instead of "...d’énergie...")

versions: I'm using bibtex2html version 1.98, compiled on Thu Oct 27 07:47:01 UTC 2016 from Debian stretch, which is calling BibTeX, Version 0.99d (TeX Live 2016/Debian).

Set CSS class for bibtex fields

In the HTML output, every field should be enclosed in an appropriate CSS class. This would ease a lot defining a custom layout. For example, given the bibtex entry:

@Book{texbook,
    author = "Donald E. Knuth",
    title= "The {{\TeX}book}",
    publisher = "Addison-Wesley",
    year = 1984
}

The desired output HTML would be something like:

<dl>
<dt>
[<a name="texbook">1</a>]
</dt>
<dd class="Book">
<span class="author">Donald E. Knuth</span>.
<span class="title">The TeXbook.</span>
  <span class="publisher">Addison-Wesley</span>, <span 
class="year">2005</span>.<br>

<pre class="bibtex" id="texbook">
@BookK{texbook,
    author = "Donald E. Knuth",
    title= "The {{\TeX}book}",
    publisher = "Addison-Wesley",
    year = 1984
}
</pre>
</dd>
</dl>

The <span>, class and id tags don't do anything by themselves. However, they allow to modify the layout easily using CSS. For example, I would be able to use something like this:

.author {
	font-weight: bold;
}
.title {
	font-variant: italic;
}
pre.bibtex {
	overflow: auto; /* if larger than maximum width, will produce scrollbars */
}

Moreover, implementing layout properties of different bibliographic styles will be rather straightforward since the CSS can be embedded in the header of the html file.

Unknown macro: \big

This is defined by amssymb.sty to increase the size of the symbol following it (typically a parenthesis). It could be handled by replacing

\big(

with

<span style="font-size: larger;">(</span>

Sort by key

Is it possible to sort the entries by bibtex key? My keys are in the form "Smith1987a", -a help partially, as it groups entries by author, but I'd like them to be sorted by year (and letter) withing each author. If it's not currently possible, any chance it may be implemented?

\@ eats a space

I write journal abbreviations in the bib file as "Chem.\@ Phys.\@ Lett." to avoid extra stretching when processing with LaTeX. It seems bibtex2html eats the space after the \@ macro, since I get in the html: Chem.Phys.Lett.. A workaround is using \@\ (with space after the last slash).

Fails to install with opam2 (because of sandboxing?)

I'm trying to install bibtex2html using opam2, and it fails with the following error log:

ocamlc.opt -c   options.mli
ocamlopt.opt -c    options.ml
ocamlopt.opt -c    html.ml
ocamlc.opt -c   latexmacros.mli
ocamlopt.opt -c    latexmacros.ml
ocamllex.opt latexscan.mll
376 states, 6131 transitions, table size 26780 bytes
4414 additional bytes used for bindings
ocamlopt.opt -c    latexscan.ml
ocamllex.opt bbl_lexer.mll
92 states, 740 transitions, table size 3512 bytes
ocamlopt.opt -c    bbl_lexer.ml
ocamlc.opt -c   bibtex.mli
ocamlopt.opt -c    bibtex.ml
ocamlyacc bibtex_parser.mly
ocamlc.opt -c   bibtex_parser.mli
ocamlopt.opt -c    bibtex_parser.ml
ocamllex.opt bibtex_lexer.mll
36 states, 325 transitions, table size 1516 bytes
1304 additional bytes used for bindings
ocamlopt.opt -c    bibtex_lexer.ml
ocamlc.opt -c   readbib.mli
ocamlopt.opt -c    readbib.ml
ocamlc.opt -c   expand.mli
ocamlopt.opt -c    expand.ml
ocamlc.opt -c   bibfilter.mli
ocamlopt.opt -c    bibfilter.ml
ocamlc.opt -c   biboutput.mli
ocamlopt.opt -c    biboutput.ml
echo "let version = \""1.99"\"" > version.ml
echo 'let date = "'"mer. févr.  6 17:21:14 CET 2019"'"' >> version.ml
ocamlc.opt -c   version.mli
ocamlopt.opt -c    version.ml
ocamlc.opt -c   translate.mli
ocamlopt.opt -c    translate.ml
ocamlc.opt -c   copying.mli
ocamlopt.opt -c    copying.ml
ocamlopt.opt -c    main.ml
ocamlopt.opt    -o bibtex2html str.cmxa options.cmx html.cmx latexmacros.cmx latexscan.cmx bbl_lexer.cmx bibtex.cmx bibtex_parser.cmx bibtex_lexer.cmx readbib.cmx expand.cmx bibfilter.cmx biboutput.cmx version.cmx translate.cmx copying.cmx main.cmx 
strip bibtex2html
ocamllex.opt latex_accents.mll
261 states, 608 transitions, table size 3998 bytes
ocamlc.opt -c   latex_accents.mli
ocamlopt.opt -c    latex_accents.ml
ocamlc.opt -c   condition.mli
ocamlopt.opt -c    condition.ml
ocamlyacc condition_parser.mly
ocamlc.opt -c   condition_parser.mli
ocamlopt.opt -c    condition_parser.ml
ocamllex.opt condition_lexer.mll
69 states, 1647 transitions, table size 7002 bytes
ocamlc.opt -c   condition_lexer.mli
ocamlopt.opt -c    condition_lexer.ml
ocamlc.opt -c   parse_condition.mli
ocamlopt.opt -c    parse_condition.ml
ocamlopt.opt -c    bib2bib.ml
ocamlopt.opt    -o bib2bib str.cmxa options.cmx bibtex.cmx bibtex_lexer.cmx bibtex_parser.cmx readbib.cmx latex_accents.cmx condition.cmx condition_parser.cmx condition_lexer.cmx parse_condition.cmx bibfilter.cmx latexmacros.cmx latexscan.cmx expand.cmx html.cmx biboutput.cmx version.cmx copying.cmx bib2bib.cmx 
strip bib2bib
printf "\\\newcommand{\\\version}{1.99}" > version.tex
pdflatex manual.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018/Arch Linux) (preloaded format=pdflatex)
 restricted \write18 enabled.

kpathsea: Running mktexfmt pdflatex.fmt
mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order):
mktexfmt:   /etc/texmf/web2c/fmtutil.cnf
mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes:
mktexfmt:   /home/armael/.texlive/texmf-config/web2c/fmtutil.cnf
/usr/bin/mktexfmt: mkdir(/home/armael/.texlive/texmf-var/web2c/) failed: Read-only file system at /usr/share/tlpkg/TeXLive/TLUtils.pm line 913.
I can't find the format file `pdflatex.fmt'!
make: *** [Makefile:291: manual.pdf] Error 1

I suspect the "Read-only file system" errors are due to sandboxing, introduced with opam 2, which doesn't allow a package to write outside of its installation directory.

Unknown macro: \setminus

$A \setminus B$ is translated to <em>A</em> <em>B</em>. The workaround:

\newcommand{\setminus}{&setminus;}

doesn't work because it becomes <em>A</em> &<em>setminus</em>;<em>B</em>. But

\newcommand{\setminus}{ &#8726; }

does work.

rawhtml

Html tags inside rawhtml sections in *_bib.html files should be displayed in quoted form, or else the validator complains. E.g., change

  abstract = {
	      \begin{rawhtml}
	      <p>
		    In this paper we consider the class of l-bijective C-systems, i.e., C-systems for which the length function is a bijection. The main result of the paper is a construction of an isomorphism between two categories - the category of l-bijective C-systems and the category of Lawvere theories.
	      </p>
	      \end{rawhtml}

to

  abstract = {
	      \begin{rawhtml}
	      &lt;p>
		    In this paper we consider the class of l-bijective C-systems, i.e., C-systems for which the length function is a bijection. The main result of the paper is a construction of an isomorphism between two categories - the category of l-bijective C-systems and the category of Lawvere theories.
	      &lt;/p>
	      \end{rawhtml}

Parse error character 13

When I try to process the attached file (with .txt extension because GitHub doesn't allow .bib),

kanban-w-firmie-eto.txt

I get the following error message:

$ bibtex2html kanban-w-firmie-eto.bib
This is bibtex2html version 1.99, compiled on Mon Mar  9 01:39:35 GMT 2020
Copyright (c) 1997-2010 Jean-Christophe Filliâtre and Claude Marché
This is free software with ABSOLUTELY NO WARRANTY (use option --warranty)

Reading kanban-w-firmie-eto.bib...Parse error character 13, in or after entry 'Kanban'.

I tried deleting some characters but it doesn't help. The contents was generated by copy-paste from https://zbib.org/ on macOS 10.14.6.

El Capitan problem?

Hi, I used your pre-compiled mac64 binary.
internbibJan20.bib
➜ Desktop git:(master) ✗ /usr/local/bin/bibtex2html/bibtex2html internbibJan20.bib
This is bibtex2html version 1.96, compiled on Mon Nov 22 10:33:42 CET 2010
Copyright (c) 1997-2010 Jean-Christophe Filliâtre and Claude Marché
This is free software with ABSOLUTELY NO WARRANTY (use option --warranty)

Reading internbibJan20.bib...ok (10 entries).
calling BibTeX...
bibtex: Not writing to /var/folders/wb/cfz8yrnd3gs8570lx2l291sh0000gn/T/bib2htmlabc7db.blg (openout_any = p).
I couldn't open file name `/var/folders/wb/cfz8yrnd3gs8570lx2l291sh0000gn/T/bib2htmlabc7db.blg'
error 1 while running bibtex

Doesn't compile with OCaml 4.06?

Looks like maybe the makefile needs -unsafe-string now?

Warning 3: deprecated: String.create
# Use Bytes.create instead.
# File "biboutput.ml", line 170, characters 27-44:
# Warning 3: deprecated: String.unsafe_set
# File "biboutput.ml", line 173, characters 6-23:
# Warning 3: deprecated: String.unsafe_set
# File "biboutput.ml", line 175, characters 4-6:
# Error: This expression has type bytes but an expression was expected of type
#          string
# make: *** [biboutput.cmx] Error 2

Install bibtex on OS EI?

This is bibtex2html version 1.96, compiled on Mon Nov 22 10:33:42 CET 2010
Copyright (c) 1997-2010 Jean-Christophe Filliâtre and Claude Marché
This is free software with ABSOLUTELY NO WARRANTY (use option --warranty)

Reading test.bib...ok (5 entries).
calling BibTeX...sh: bibtex: command not found
error 127 while running bibtex

I don't know how to install, can you give some help?

Support for biber/biblatex?

Thank you for your excellent tool!

I wanted to ask whether support for biblatex files is planned? biblatex files are slightly different from bibtex, they allow braced expressions. In case of plainnat style, this results in mis-formatted citations. (They are "almost" correct, but not quite.)

Biblatex is slightly different from bibtex, there are no "aux" files, but it should be possible to create "empty" latex documents, with biblatex' preamble, run xelatex, and get the required bcf files, in order to run biber on them and get the bbl file. Afterwards, the process should be the same.

May this option be considered?

bibtex: Not writing to /tmp/bib2html*.blg (openout_any = p) on newer texlive installations

On my new Fedora 25 installation bibtex2html (v1.97) fails to execute with the following error (twice per invocation, actually):

calling BibTeX...
bibtex: Not writing to /tmp/bib2html3d1304.blg (openout_any = p).
I couldn't open file name `/tmp/bib2html3d1304.blg'
error 1 while running bibtex

In the /tmp directory one can see that only the respective .aux files were created, but newer default configurations of BibTeX appear to refuse writing to files outside the current working directory (it's not related to the version of BibTeX itself, my old installation which worked out of the box was a TeX Live 2013/Debian build of BibTeX 0.99d, the new one where I encountered the problem is a new 2016 build installation, also of 0.99d).

Workaround: one can change the write restriction (globally) by finding the local texmf.cnf file (mine was in /usr/share/texlive/texmf-dist/web2c/, elsewhere I read /usr/share/texlive/texmf/web2c/) and changing the openout_any setting to either r or a (just away from p). This works for now, but it would probably be preferrable to leave that setting as it is and simply have bib2html create the temp files in the directory where it is invoked (the temp file names already have random bits in them so that shouldn't be a problem?)

Thanks for bib2html! :)

Long title

It seems that too long titles (more than 64 characters, say) break accent translation.

For instance
title="Du Th{'e}or{`e}me de {R}amsey {`a} la Conjecture d'{E}rd{\H o}s--{H}ajnal"
-> Du théorème de Ramsey à la conjecture d'Erd
os–Hajnal

but title="Du Th{'e}or{`e}me de {R}amsey {`a} la d'{E}rd{\H o}s--{H}ajnal"
-> Du théorème de Ramsey à la d'Erdős–Hajnal

specify the character encoding

The validator complains if we don't specify a character encoding. A change like this might be good, for we can also tell emacs the character encoding to use:

diff --git a/html.ml b/html.ml
index 33b8cac..a12b5b5 100644
--- a/html.ml
+++ b/html.ml
@@ -23,7 +23,9 @@ let css = ref None
 
 let open_document ch ftitle =
   output_string ch
-    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n\n";
+    "<?xml version=\"1.0\" encoding=\"utf-8\"?> <!-- -*- coding: utf-8 -*- -->\n";
+  output_string ch
+    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\n";
   output_string ch "<html>\n\n<head>\n";
   output_string ch "<title>"; ftitle(); output_string ch "</title>\n";
   begin match !css with

no links generated in _bib.html for https URLs

If the url field of a BibTeX entry contains a URL that starts with https (instead of http) no link is generated in the _bib.html file. This seems to happen because the url_re regular expression in biboutput.ml line 30 does not match strings with https. Perhaps https could be added to url_re.

anchor in invalid position

In the *_bib.html file, the anchors should be inside the paragraphs, or else the html validator complains. E.g., change

<a name="1602.00352"></a><pre>
@article{<a href="voevodsky-publications.html#1602.00352">1602.00352</a>,

to

<pre><a name="1602.00352"></a>
@article{<a href="voevodsky-publications.html#1602.00352">1602.00352</a>,

Unknown macro: \rangle

For bibtex fields containing $\rangle$ such as

title         = {t$|$ket$\rangle$: a retargetable compiler for {NISQ} devices},
[...]
title         = {{{LIQ}}$Ui|\rangle$: {{A Software Design Architecture}} and {{Domain}}-{{Specific Language}} for {{Quantum Computing}}},

I am getting this error: Unknown macro: \rangle while this macro seems defined in two places in latexmacros.ml: https://github.com/backtracking/bibtex2html/search?q=rangle&type=code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.