# Tag Info

25

The basic problem you're running into is the immaturity of the epub format. It's very easy for a publisher to produce an epub 3 of a novel if they're already set up to produce epub 2, and the epub 3 version will typically work fine on readers designed for epub 2. However, there seems to have been very slow progress to date on getting publishers and device ...

18

Lot of the things that are on your list are already implemented: tex4ht can produce xhtml with mathml tex4ht can produce SVG figures from tikz/pgf figures METAPOST already outputs SVG out of the box Linking to parts of your documents is done by the hyperref package, for pdf and html/xhtml. Connecting to Wolfram|Alpha is surely not a "web standard", and ...

17

There is specialized output driver for use with tex4ht in Tikz. Using it, diagrams are saved in SVG. \documentclass{article} \def\pgfsysdriver{pgfsys-tex4ht.def} \usepackage{tikz} \begin{document} \begin{tikzpicture} \path (0,0) node[draw] (A) {A}; \path (2,0) node[draw] (B) {B}; \draw (A) -- (B) node[midway,above = 0 em] {via}; ...

17

14

The first thing to do is the convert the text to Braille. I am using LuaLaTeX (it should work with XeTeX as well). So I found Braille here and did a \setmainfont{Braille} after installing it as a system font. Leaves formulas and graphs. Then, I came up with the following idea. Physicists tend to read mathematical formulas as the TeX-commands without the ...

13

Good question—I’m really not sure why not. I really do not like MathJax at all: it interferes with page loading and is vastly inferior (at least on the screen) to a carefully-constructed and aligned PNG image that’s been rendered by TeX. I’ve had very positive experiences lately using the Latin Modern fonts via CSS’s @font-face for program listings. When ...

13

Sorry for being late. Following code is likely to help the Jukka: \makeatletter \@ifundefined{Configure} {\def\Includegraphics[#1]#2{\includegraphics[page={#1}]{#2}}} {\def\Includegraphics[#1]#2{\def\GPT@page{#1}\includegraphics{#2}} \Configure{graphics*} {pdf} {\Needs{" pdftops -eps -f \GPT@page\space -l \GPT@page\space \Gin@base.pdf ...

13

A conditional named \iftex4ht is impossible to define without side effects. However using directly \@ifpackageloaded{tex4ht} has a big limitation, because it's allowed only in the preamble. There are a few strategies to circumvent the problem: all use \@ifpackageloaded in the preamble to define something that one will be able to use also in the body of the ...

12

The credits should go to Martin Scharrer. It is possible with the listings package: \documentclass{article} \usepackage{listings,color} \definecolor{verbgray}{gray}{0.9} \lstnewenvironment{code}{% \lstset{backgroundcolor=\color{verbgray}, frame=single, framerule=0pt, basicstyle=\ttfamily, columns=fullflexible}}{} ...

12

htlatex loads package tex4ht at the end of the class. Therefore \@ifpackageloaded can be used to detect TeX4ht. Inside a class tex4ht is not yet loaded if htlatex is used. Then TeX4ht can be detected via \HCode that is defined by htlatex. \makeatletter \@ifpackageloaded{tex4ht}{% \def\pgfsysdriver{pgfsys-tex4ht.def}% }{% % only needed inside a class ...

12

You have to do two things: you can disable generation of css and ugly elements like <span class="cmti-10x-x-109">Emphasized text</span> with some command line options: htlatex filename "xhtml, NoFonts, -css" You will then have to provide configurations for em and textit, as they are by default dealed only by css. This should be done ...

12

(This is really a comment on Ben's answer but is a bit long.) Broadly I agree with what Ben has said about the current state of play. The outlook is a bit gloomy. However, I think that there are a couple of glimmers of light that give me a little hope for some progress to occur. As Ben says, ePub is quite like XHTML. So if you can produce a valid ...

12

You can use TeX4ht. It can output math as mathml which can be then displayed with mathjax. You can also configure html header to load mathjax script from mathjax's cdn: \Preamble{xhtml,mathml} \Configure{VERSION}{} \Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}} \Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}} ...

10

You might want to look at NIST's LaTeXML, That does a particularly nice job of getting mathml out of LaTeX http://dlmf.nist.gov/ is generated from (highly stylised) latex source.

10

The env file is stored in %texmf-home%/texmf-dist/tex4ht/base/unix or %texmf-home%/texmf-dist/tex4ht/base/win32, depending on your operating system. For testing purposes, it is best to make copy of that file in your working directory. The structure of this file is little bit strange: <tag> Gsome command and the parameters Ganother command ...

10

Try this configuration file: \Preamble{xhtml} \Configure{graphics*} {pdf} {\Needs{"convert \csname Gin@base\endcsname.pdf \csname Gin@base\endcsname.png"}% \Picture[pict]{\csname Gin@base\endcsname.png}% \special{t4ht+@File: \csname Gin@base\endcsname.png} } ...

9

It is a bug in nameref.4ht, the support file of tex4ht for package nameref: \def\no@sect#1#2#3#4#5#6[#7]#8{\gdef\NR:Title{\a:newlabel{#7}}% \gdef\NR:Type{#1}% \NR:no@sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{#8}} \def\:tempc#1#2#3#4#5#6[#7]#8{% \gdef\NR:Title{\a:newlabel{#7}}% \gdef\NR:Type{#1}% \o:NR@sect:{#1}{#2}{#3}{#4}{#5}{#6}[#7]{#8}} ...

9

Maybe the statement on the tex4ht page refers to this Eitan Gurrari's project. Maybe the prototype they used to have is somewhere available, I don't know. Edit: There is some discussion right now. But you can use plain tex4ht to produce xhtml with mathml, which some screen readers can read. There is some tutorial. Another option is to produce braille ...

8

As to the “why” question, what is happening here is that under some circumstances the letter pair “ff” is replaced by “ﬀ” LATIN SMALL LIGATURE FF U+FB00, which is understandable in a sense, but then things go wrong. In cases 3 and 4, the character is presumably written correctly in the HTML document, but the font being used does not contain it, so the ...

8

The problem is an assumption in the LaTeX core graphics package. Early on, it includes the lines \edef\Gin@codes{% \catcode\noexpand\^^A\the\catcode\^^A\relax \catcode\noexpand\"\the\catcode\"\relax \catcode\noexpand\*\the\catcode\*\relax \catcode\noexpand\!\the\catcode\!\relax \catcode\noexpand\:\the\catcode\:\relax} ...

8

LuaTeX may well offer some real potential here because you can access the deepest internal structures of TeX: node lists. I'm not 100% sure, but once a mathematical object has been turned into a set of hlists and vlists inside LuaTeX you may not have access to sufficient information to generate MathML, but you do have enough positional and font information ...

7

It is perhaps possible to hook somewhere in the listings commands so that they write sensible class instructions. But on the other side listings is very complicated and this could easily break. Imho a more simple approach is with fonts: if every style is connected to a different font then tex4ht surrounds the chars with classes which you can set throught ...

7

The syntax for mk4ht is as given below: mk4ht command file option1 option2 option3 command could be htlatex or mzlatex or oolatex of any one of the scripts provided by tex4ht. option1 is passed on to tex4ht.sty (like html, xhtml, mathml ...) option2 is passed on to tex4ht.env and tex4ht binary, the post-processor of *.dvi output. option3 is those ...

7

TeX4ht does not use pdfTeX in PDF mode, but dvips instead. However dvips can neither read PDF files nor multipage files. Page 10 can be extracted and converted to eps with epstopdf of xpdf: epstopdf -eps -f 10 -l 10 foo.pdf foo-10.eps Or ghostscript can be used, e.g.: gs -dFirstPage=10 -dLastPage=10 -sDEVICE=epswrite -dBATCH -dNOPAUSE ...

7

The biblatex adaption of tex4ht is not up-to-date. It relies on a command which no longer exists. Try \makeatletter \newcommand\blx@unitmark{23sp} \makeatother

7

Following code will help you to grab the width and height dimensions of the graphic provided with your \includegraphics command: \makeatletter \Configure{graphics} {\bgroup \Configure{IMG} {\HCode{<img src="}} {\HCode{" alt="}} {" } {\HCode{" }} {}% \Picture+[PIC]{}} ...

7

Thanks to CV Radhakrishnan from tex4ht, the bug has been fixed. There is an option now to handle the problem with images for math in the align environment. The option is pic-align htlatex foo.tex "html,pic-align" Here is the result now using this option \documentclass[12pt,titlepage]{article}% \usepackage{amsmath} \usepackage{amsfonts} ...

6

As Michal wrote in his comment, there's no option to create a flat ODT document directly with TeX4ht. However, you don't need additional OO wrapper scripts either but can directly use OpenOffice/LibreOffice as a command-line converter: oowriter --convert-to fodt myfile.odt You only have to ensure that the proper OO XSLT filters are installed, i.e. export ...

6

In order to use the tikz externalize library, you need to call latex with --shell-escape option, so it can run the external commands. in tex4ht running of the external commands is not allowed. My solution is to run first pdflatex file -shell-escape to get the pdf figures, then comvert pdf files to png using imagemagick and finally run htlatex to insert the ...

6

You might make use of the following code to suppress character level <span> node creation: \Configure{htf}{4}{+}{}{}{}{}{}{}{} so that you will get: <span class="cmcsc-10">sufficient</span> which is the default behavior when character level <span> node is suppressed.

Only top voted, non community-wiki answers of a minimum length are eligible