Tag Info

Hot answers tagged

16

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


13

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


13

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


12

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


11

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


10

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


9

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


9

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}% } \begin{document} \EndPreamble save it as myxhtml.cfg. This ...


9

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


9

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


8

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


8

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


7

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


6

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


6

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]{}} ...


6

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


6

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


6

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


5

Based on Harald's answer you can define your \iftex4ht as follows. \documentclass{article} %\usepackage{tex4ht} \makeatletter \@ifpackageloaded{tex4ht}{\def\iftex4ht{\iftrue}} {\def\iftex4ht{\iffalse}} \makeatother \begin{document} \iftex4ht TeX4ht\else no!\fi \end{document} OK, this answer is kind of a joke, but I wanted to ...


5

htlatex provides support for jsMath out of the box: htlatex file "xhtml,jsmath" " -cmozhtf" If you need output for a different engine, htlatex offers fine control on how math is to be output. In the Q/A section of the manual an example is shown that can be adapted to any use case. To output the original LaTeX source surrounded by $ signs, create a file ...


5

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


5

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


5

You need to change to the folder containing filename.tex before executing htlatex filename.tex. Under Windows, this can be achieved using cd path\to\the\folder You can either use backslashes \ or forward slashes /. If your path contains spaces, you can either use TAB to let Windows auto-complete a partially completed folder name (that is, you type cd ...


5

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


5

According to Advanced Usage of TeX4ht: You can convert all inline math to picture format by putting the following commands in a configuration file: \Configure{$}{\PicMath}{\EndPicMath}{} \Configure{PicMath}{}{}{}{class=’’math’’; align=’’absmiddle’’} Note that, unless you want to make extensive use of TeX fields, there’s no way to do this ...


5

The reason is because tex4ht can't find the htf font files, i.e. unisong51.htf etc. However, tex4ht does come with utf8song*.htf files in %TEX4HT%/ht-fonts/unicode/cjk/utf8/, so you could just create copies of those. (%TEX4HT% is likely to be %TEXMF%/tex4ht on your system.) Here's what I did. Create a copy of each utf8song*.htf to unisong*.htf, and modify ...


5

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


5

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.


5

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


5

I think the problem is that both memoir and tex4ht redefines lot of standard macros. tex4ht tries hard to translate LaTeX tables to their html counterparts. In order to do that, it inserts some configurable hooks to standard macros. But it seems that memoir also changes standard table macros, in some way which is incompatible with tex4ht This problem can be ...



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