Raphaël Pinson has kindly contributed the code that enables TeX4ht to support lettrine package. (lettrine.sty helps to typeset dropped capitals in a LaTeX document.) This probably will solve the long standing problem of drop capital support in TeX4ht, even if all the options of lettrine package are not supported at this time. Hope, Raphaël will continue support to enhance TeX4ht by adding all the missing options of lettrine.
Only ante option is supported now apart from basic command lettrine with two arguments, the first being the character for dropped capital and second, rest of characters in that string or chosen to form what is usually called lettrine line.
Seven TeX4ht hooks have been provided to configure lettrine as given hereunder:
- Before
lettrine - After
lettrine - Before lettrine initial character
- Between lettrine initial character and lettrine line
- After lettrine line
- Before lettrine ante
- After lettrine ante
Further hooks, namely, HlettrineChar and HlettrineString have been defined to access initial character and lettrine line respectively, in case, we want to further re-configure lettrine. The default configuration is provided below:
Configure{lettrine}
{\HCode{<span class="lettrine lettrine-HlettrineChar">}}
{\HCode{</span>}}
{\HCode{<span class="lettrine-letter">}}
{\HCode{</span><span class="lettrine-line">}}
{\HCode{</span>}}
{\HCode{<span class="lettrine-ante">}}
{\HCode{</span>}}
Users shall write their own custom \Css declarations to format the dropcapital and lettrine line to suit their taste. The default \Css declarations are:
\Css{.lettrine{float: left;
line-height: 0.7; margin-left: -0.1em;
margin-bottom: -.5em; margin-right: 0.2em;}}
\Css{.lettrine-ante{vertical-align: top;}}
\Css{.lettrine-letter{font-family: InitialsFont; font-style: normal;
font-size: 4em; color: gray;}}
\Css{.lettrine-A{margin-right: 0.3em;}}
\Css{.lettrine-A + .lettrine-line{margin-left: -0.4em;}}
\Css{.lettrine-{margin-right: 0.3em;}}
\Css{.lettrine- + .lettrine-line{margin-left: -0.4em;}}
\Css{.lettrine-J{line-height: 1; margin-right: 0;}}
\Css{.lettrine-H, .lettrine-I, .lettrine-N, .lettrine-U{margin-right: 0;}}
\Css{.lettrine-V{margin-right: -0.3em;}}
\Css{.lettrine-V + .lettrine-line{margin-left: 0.3em;}}
\Css{.lettrine-Q{padding-bottom: 1em;margin-top: -0.6em;}}
\Css{.lettrine-line{font-variant: small-caps;}}
A typical html page generated with the help of this newly created lettrine.4ht can be seen here.