View Single Post
Old 04-06-2018, 12:25 PM   #8
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
This works in a web browser so may work as a template for calibre.

You need to extend the ronu list as far as needed, and set romp to the number of roman numeral pages at the start of the book.

Code:
<p id="pagenum" style="text-align:center;"></p>
<script>
  var ronu = [ "-", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii" ]
  var valu = ""
  var romp = 6
  if (_PAGENUM_ > romp)
    valu = _PAGENUM_ - romp
  else
    valu = ronu[_PAGENUM_]
document.getElementById("pagenum").innerHTML = valu
</script>
If you make ronu as big as you think you'll ever need, (e.g. 20 roman numerals), then you just need to change romp for each book.

Last edited by Agama; 04-06-2018 at 12:36 PM.
Agama is offline   Reply With Quote