5

I've written my CV in moderncv template.

Now I'm looking for a fast way to create an HTML version of my CV in order to use it in my website.

Any idea?

4
  • 5
    Since a quick and dirty solution is not appropriate when it comes to a CV, I would rather code the HTML and CSS myself. The advantage is full control over the appearance, clean and correct code and proper markup. The HTML produced by various programs is often crappy and not valid. This doesn't make a good impression for a CV.
    – Marco
    Commented Nov 28, 2011 at 20:22
  • 3
    Have you tried htlatex myfile.tex?
    – cmhughes
    Commented Nov 28, 2011 at 22:51
  • @Marco, tnx but that way I need to update both my tex version and html version all the time. it would be more appropriate if i could keep only one version update and convert to other.
    – MBZ
    Commented Nov 29, 2011 at 10:39
  • @cmhuges I tried it and there are problems. Will try some more and then post here.
    – Unapiedra
    Commented Nov 30, 2011 at 12:00

5 Answers 5

8

I'm afraid there's no easy solution. As Marco stated, a CV requires attention and better control. I'll present a solution I use, though it's not totally LaTeX based. Here comes sphinx.

According to the website, sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license. It requires Python.

sphinx is mainly used for documentation, but it's generic enough to be used everywhere.

It's a very straighforward process. Let's say I want to create an online CV for John Doe. I simply run sphinx-quickstart and answer a few questions. After running it, you will have index.rst - we put the content here - and conf.py - the configuration file. sphinx also creates both Makefile and make.bat for generating the outputs we want.

The rst format stands for reStructuredText, plain text markup syntax, very similar to Markdown. You will see, there's no secret.

Now, I'll open my index.rst file and type the following content:

.. My Curriculum Vitae documentation master file, created by
   sphinx-quickstart on Wed Nov 30 11:04:16 2011.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

John Doe
========

:Currently: PhD in Cat Physics

Publications
------------

* John Doe. *How to make a cat levitate*. In *Cat Symposium 2011*,
  pages 110--125. CS, 2011.

* John Doe, Jin Doe. *Violence against lolcats*. In *Cat Symposium 2009*,
  pages 98--101. CS, 2009.

Reports
-------

* 2008-2009: Growth of cats around the world. *Tech. report*.

* 2006-2007: Cats are dangerous? *Tech. report*.

Contributions
-------------

* `GCat <http://www.google.com/>`_ : a Google-based browser for cats.

Contact
-------

| John Doe
| [email protected]

.. toctree::
   :hidden:

That's it, plain and simple. Now I just need to run make html. The output:

John Doe 1

If you want to change the theme, there are some predefined ones, say, nature. Open conf.py and find the following line:

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
html_theme = 'default'

Simply replace default by nature. The new output:

John Doe 2

Note: You can tweak all elements of the page, e.g. removing the search box, but I can't remember right now. :)

sphinx can also generate a tex file. Go with make latex and the .tex file (and other styles) will be generated:

John Doe 3

OK, LaTeX output doesn't look so great. :) As I said, the most common use of sphinx is to generate documentation, but we can easily tweak our tex file to look more pleasant to the eye.

I've seen entire sites written with sphinx. You can create great looking HTML pages with ease. Use one of the predefined themes or come up with our own. :)

2
  • 2
    Gotta love me some downvotes. :) Dear downvoter, could you please explain why I got the downvote and what I could do in order to improve the answer? Thanks. :) Commented Jul 14, 2015 at 10:20
  • Well, I was going to (downvote) until I see your comment. Because you don't answer the question. For example, I can answer : write json content and a perl script to fill placeholders in a html cv from other person`. But the question is about my_moderncv.tex -> my_moderncv.html.
    – Tinmarino
    Commented Nov 30, 2019 at 4:58
2

I used to use moderncv for my Cv. But then I realised that using a template like that for a CV is a recipe for disaster. If the point of a CV is to stand out, then you don't want it to look like someone else's. So you're better off making your own template, rather than relying on this one. (That doesn't mean you can't take inspiration from moderncv).

Joseph Wright has written a series of blog posts on CVs that is worth looking through.

Here is my current solution for CV writing. Warning, Overkill

I have some yaml files that contain the data for my CV. For example, a sample entry for a talk I gave might look like this:

- title: A sample talk
  date: 2010-09-09
  conference: The sample conference
  place: University of Foo

There is also an index.yaml that keeps track of all the parts and to keep track of what documents I want produced. And then I use yst to turn this into .tex and .html files. It is pretty complicated to set up, but once it's done, it's fairly easy to maintain. It has the advantage that once I've edited something, I run one command yst and it outputs all the versions I want. I could have a DocBook version of my CV, if I wanted…

This method gives you quite some control over how to format things, if you're sophisticated in how you set up your templates.

1

I've created a stylesheet (css) and perl file to export my CV from LaTeX moderncv to HTML. Everything is published on github: https://github.com/fredrike/moderncv2html

Here is a demo of the default template.tex: http://fredrike.github.com/moderncv2html/examples/template.html

This is just a quick mockup, we still have some issues like:

  • Only support the blue style
  • No support for "maketitle" (yet)
  • Some cv-items are still un-supported like: cvlistdoubleitem, cvdoubleitem

If you like my work so far please fork on github.

0

Probably you should search for pdf2html!

2
  • I tried the convertpdftohtml.net side with the template.pdf provided by the moderncv package. The result is a server error (in French). Tried with Chrome and Firefox.
    – Unapiedra
    Commented Nov 30, 2011 at 12:21
  • This works. However, if your CV is multiple pages, there's a navigational menu on the left for "page 1", "page 2" etc. Commented Apr 23, 2018 at 17:57
0

I just had a short look at it. I am using Moderncv as well. Converting the code to html using htlatex cv.tex leads to a html page with quite a bit of mess.

This doesn't seem worthwile trying to fix it. However, I think it should be possible parsing the CV by hand. I only use the \cventry and \cvline commands so in total there are less than 10 commands to parse.

If you do that, please post the conversion scripts. Sorry, that this isn't a complete answer.

You must log in to answer this question.

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