37

Any one know of a good script to turn a bibtex file into a nice academic portfolio that:

  • links to electronic versions where known (from url or doi)
  • works with local files (e.g. with bibdesk's format or otherwise)
  • automatically creates a thumbnail of the first page

and generally produces a polished web page suitable for showing off your work?

3
  • The first two point might be possible with \nocite{*} and latex2html but the third point might be trickier. I wonder if you can \includegraphics just the first page of a pdf...
    – Seamus
    Commented Jun 29, 2011 at 18:29
  • To include just the first page of a pdf, you can use \usepackage{pdfpages} and then \includepdf[pages=1]{file.pdf}. But how would you get access to the filename of the pdf on your hard disk? Commented Jun 30, 2011 at 8:27
  • Comment on the previous comments (@Sebastian and @Seamus). It might be possible to "prepare" the latex document by inserting carefully tailored tags in the text of the bibliography, that a second process would use to generate the final document. Which process I have no idea.
    – Martigan
    Commented Jun 30, 2011 at 13:30

5 Answers 5

36

Here's a possible solution using biblatex and tex4ht (steps shown after the image). The publication lists can be split according to their types. The result looks like this:

enter image description here

While this webpage is not exactly aesthetically "impressive", I suppose there's nothing some really good CSS-fu can't do! ;-)


The Bibliography File

I used a custom biblatex field, usera, to hold the local PDF filename. Following is the content of my publications.bib:

@INPROCEEDINGS{Lim:2009,
  author = {Lim, Lian Tze},
  title = {Multilingual Lexicons for Machine Translation},
  booktitle = {Proceedings of the 11th {I}nternational {C}onference on {I}nformation
    {I}ntegration and {W}eb-based {A}pplications \& {S}ervices ({iiWAS}2009)
    {M}aster and {D}octoral {C}olloquium ({MDC})},
  year = {2009},
  pages = {732--736},
  address = {Kuala Lumpur, Malaysia},
  doi = {10.1145/1806338.1806477},
  usera = {LLT-iiWAS09MDC.pdf}
}

@ARTICLE{Lim:Ranaivo:Tang:2011,
  author = {Lim, Lian Tze and Ranaivo-Malan\c{c}on, Bali and Tang, Enya Kong},
  title = {Low Cost Construction of a Multilingual Lexicon from Bilingual Lists},
  journal = {Polibits},
  year = {2011},
  volume = {43},
  pages = {45--51},
  url = {http://polibits.gelbukh.com/2011_43/43-06.htm},
  usera = {LLT-polibits.pdf}
}

The LaTeX Source File

Next is the portfolio.tex file, in which I set up a hook at every bibliography item to include the first page of the file pointed to by usera. I've also added a bibmacro called string+hyperlink, to make the publication title link to the url or doi field if these are available, as shown in this answer.

\documentclass{article}
\usepackage[backend=biber,bibstyle=authoryear,sorting=ydnt]{biblatex}
\usepackage{graphicx}
\bibliography{publications}
\usepackage{hyperref}

\ExecuteBibliographyOptions{doi=false,url=false}
\newbibmacro{string+hyperlink}[1]{%
  \iffieldundef{url}{%
    \iffieldundef{doi}{#1}{\href{http://dx.doi.org/\thefield{doi}}{#1}}}
    {\href{\thefield{url}}{#1}}}
\DeclareFieldFormat*{title}{\usebibmacro{string+hyperlink}{#1}}

\newbibmacro{usera}{%
\iffieldundef{usera}{}{%
\savefield*{usera}{\filename}%
\usebibmacro{string+hyperlink}{\includegraphics[width=100pt]{\filename}}\\}%
}
\AtEveryBibitem{\usebibmacro{usera}}

\begin{document}
\section{My Academic Portfolio}
\nocite{*}
\printbibliography[title={Articles},type={article}]
\printbibliography[title={Conference Proceedings},type={inproceedings}]

\end{document}

tex4ht Configuration File

I then set up a tex4ht personal configuration file, called portfolio.cfg. It contains some simple CSS, and tells tex4ht to convert the first page of the local PDFs into PNGs using ghostscript. (So you will need to have ghostscript installed for this to work.)

\Preamble{html}
\begin{document}
\Configure{TITLE+}{My Academic Portfolio}
 \Configure{section} 
    {}{} 
    {\HCode{<h2>}} 
    {\HCode{</h2>}} 

\Css{
    .likesectionHead {
        clear: both;
        padding-top: 2em; */
    }
    dd.thebibliography {
        clear: both;
        padding-bottom: 1em; 
    }
    dd.thebibliography img {
        position: relative;
        border: solid 1px \#666;
        display: block;
        float: left;
        margin-right: 1em;
        box-shadow: 5px 5px 5px \#ccc;
        -moz-box-shadow: 5px 5px 5px \#ccc;
        -webkit-box-shadow: 5px 5px 5px \#ccc;
    }
}

\makeatletter
\Configure{graphics*}  
         {pdf}
         {\Needs{"gs -o\csname Gin@base\endcsname-thumbnail.png -sDEVICE=pngalpha
                -dFirstPage=1 -dLastPage=1 -r10
                \csname Gin@base\endcsname.pdf"}%  
          \Picture[pict]{\csname Gin@base\endcsname-thumbnail.png}%  
         }  
\makeatother
\EndPreamble

Running tex4ht

Or rather, the command htlatex :

$  htlatex portfolio "portfolio"

Don't forget to run

$  biber portfolio

too, to actually get the .bib file processed.

5

bibtex2html and pybtex could be a base to start from... I've written down how I extract the entries where I'm involved from a bib file and make a html page with links (and a pdf) out of it on my webpage.

2

JabRef seems to have an export function and also supports HTML as export format. According to their homepage it is even possible to write those export filters yourself, or changing an existing one to your needs. But I have to admit that I've never used those functions of JabRef myself. I can imagine that your last point is nonetheless not a trival task.

2

I wrote some simple Python scripts that generate CSS-friendly HTML. The scripts use the Python module bibliograph to parse bibtex entries. I could instead use bibtex2html. I like my solution better because the customization is all done using CSS rather than Python, so I can change the look without re-generating the HTML. Of course, bibtex2html is a more polished and flexible tool than my 30-line script. Here's a CSS snippet that's used for this publication list:

#pub {padding: 5px; border-width: 2px; border-style: none; background-color: #eee4b5;  
font-size: 1.2em; margin-top: 20px; margin-bottom: 20px;}
#pub a{font-weight: bold; color: #09434e;}
#pub name{font-weight: bold; color: #09434e;}
#pub journal{font-style: italic;}

The workflow for adding a new paper to an html bibliography is:

  1. Add the paper in Mendeley. Export bibtex from Mendeley.
  2. Run Python scripts.
  3. Paste resulting HTML into the appropriate file.

This doesn't create the first-page thumbnails, but does the other parts and is nicely customizable with CSS.

0

If you're using WordPress papercite is a good plugin for setting up your academic portfolio. It's simple to use and provides functions for the first two of your requirements. No thumbnail, though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .