maranget / hevea

Hevea is a fast latex to html translator
http://hevea.inria.fr
Other
97 stars 12 forks source link

remove line break after first <li> item #62

Closed sanette closed 2 years ago

sanette commented 3 years ago

Currently the first item of an itemize environment is not rendered exactly as the other ones: there is a line break after <li...>, as in the following example:

<ul class="itemize"><li class="li-itemize">
item1
</li><li class="li-itemize">item2
</li><li class="li-itemize">item3
</li></ul>

This turns out to be a problem for some CSS list styles, like the "inside" style, where the line break is converted into a space.

Would it be possible to simply remove this line break? so as to obtain:

<ul class="itemize"><li class="li-itemize">item1
</li><li class="li-itemize">item2
</li><li class="li-itemize">item3
</li></ul>
cspiel commented 3 years ago

I have a patch here that opens a paragraph for \item to avoid mixed content and to simplify styling lists with CSS. The HTML output looks like this (after wrapping and indenting with tidy):

  <ul class="itemize">
    <li class="li-itemize">
      <p><span class="monospace">\epsilon</span>: є; <span class=
      "monospace">\varepsilon</span>: ε;</p>
    </li>
    <li class="li-itemize">
      <p><span class="monospace">\kappa</span>: κ; <span class=
      "monospace">\varkappa</span>: ϰ (AMST<sub>E</sub>X);</p>
    </li>

I have run into style-ability problems, too before this patch.

maranget commented 3 years ago

You get intended output by writing \begin{itemize}\item..., i.e. no newline before first \item. This is more a workaround than a solution.

maranget commented 3 years ago

Should be ok by now, having merged PR #63. Would you please check that the new code fixes your issue?

sanette commented 3 years ago

aside question, is there an easy way to create a local opam package for the dev version of hevea?

maranget commented 3 years ago

aside question, is there an easy way to create a local opam package for the dev version of hevea?

I have nether thought about doing that, considering that compiling hevea from sources is relatively easy (no requirement other than ocamlbuild).

sanette commented 3 years ago

what I would like is to be able to switch between two versions easily. If there is a simple way to uninstall the dev version, that's maybe enough

maranget commented 3 years ago

what I would like is to be able to switch between two versions easily. If there is a simple way to uninstall the dev version, that's maybe enough

I can easily add some uninstall entry in Makefile and will do. Notice that you can use two version of hevea easily by using compete command names. Assuming you have standard hevea installed normally, whatever the method. You can for instance install the dev version of hevea in your home directory with make all install PREFIX=$HOME. Then, you access to the dev version as ~/bin/hevea.

maranget commented 3 years ago

Complement, for make all install PREFIX=$HOME to work properly you have to call make clean beforehand.

maranget commented 2 years ago

Hi @sanette, I am a bit lost does PR #63 address theissue?

sanette commented 2 years ago

according to https://github.com/ocaml/ocaml/pull/10672#issuecomment-932902340 yes it does solve it.

I will try asap myself

sanette commented 2 years ago

yes! solved, thanks. I'm closing this.