# Tag Info

30

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 ...

21

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>}} \...

20

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 ...

18

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}; \end{...

17

17

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 ...

16

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} } \begin{...

15

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}}{} \definecolor{shadecolor}{rgb}{....

15

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 ...

14

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 text....

14

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 ...

13

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 </tag&...

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 \Gin@...

13

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 \...

13

(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 XHTML+...

11

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

Paragraph handling is little bit tricky with tex4ht. Some information can be found in the article TeX4ht configure: Part 1. There are two issues, if command with configuration hooks is at the beginning of the paragraph. If some hook is inserted at the beginning of the paragraph, it must place the tag manually, with some of commands described in the ...

10

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 ...

10

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}} \HLet\NR@...

9

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 ...

8

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

8

This may help you. I made a batch script that I use when working with htlatex. You can copy and paste it into a file, and save it with .bat extension, e.g., html.bat. You need to open a command prompt, you can type in the search bar cmd, or press WndLogo + R and write cmd to execute the command prompt. The command prompt is an application in which you can ...

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} \catcode\^^A=\catcode\%...

8

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} \usepackage{...

8

You can use config file from the answer you linked to, \VerbMath command is defined here. This command defines environment to be verbatim, so LaTeX macros inside are not processed. Just add \VerbMath{align} before \EndPreamble: \usepackage{verbatim} \Preamble{xhtml} % Configure for mathjax \Configure{VERSION}{} \Configure{DOCTYPE}{\HCode{<!DOCTYPE html&...

7

The following can be used. An advantage to this is that it does not need to be defined before. Hence it can be used in the preamble and the body \ifdefined\HCode %htlatex code here \else %pdflatex code here \fi some examples Example 1 \documentclass[]{article} \begin{document} \ifdefined\HCode This show in tex4ht only \else This shows in PDF ...

7

plasTeX is a python-based framework for converting LaTeX to other markup languages (xhtml, epub, docbook xml). I use it daily. By default it uses dvipng to render math and picture environments. However, it is not very difficult to render to mathml using an external tool of your choice + plasTeX. Some items on your list such as tool-tips can be automated ...

7

Another solution is to use tex4ht hook system. Put the definition of the environment to the code.sty file: \ProvidesPackage{mycode.sty} \RequirePackage{framed,color,verbatim} \definecolor{shadecolor}{rgb}{.9, .9, .9} \newenvironment{code}% {\snugshade\verbatim}% {\endverbatim\endsnugshade} then create file code.4ht which is called only with tex4ht:...

7

A little investigation reveals that htlatex is indeed a sh script file, at least in my system: $which htlatex /usr/texbin/htlatex$ file /usr/texbin/htlatex /usr/texbin/htlatex: symbolic link to `../../texmf-dist/scripts/tex4ht/htlatex.sh' And the contents of that script are: $cat /usr/texbin/htlatex #!/bin/sh latex$5 '\makeatletter\def\HCode{\...

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