# Tag Info

41

Answering my own question after much research, experimentation, and testing. stevem's pointer to to the Mac OS X TeX Toolbox approach (store the TeX snippet in a box and write the height, width, and depth to a file) was the crucial key to the puzzle. I followed that approach, made some adjustments and additions, and came up with a solution that is not only ...

30

What your best option would be depends on a lot on what your needs are. Are you only trying to import the structure, or exact look, or what? How important is it that the resulting document really be done properly? Anyway, here are a number of things to try. AbiWord: an open source word processor that can import HTML or similar formats and export LaTeX. (Be ...

27

Using PDF as an intermediate format when converting from LaTeX to HTML is not very good idea. LaTeX and HTML are both mostly structural markup langauages, which means you use them to describe the document structure (sections, emphasize, formulas etc.), whereas PDF is mostly about representation of your document on the screen or paper. When converting LaTeX ...

25

This is really a great question, because it's exactly the kind of thing somebody starting out would need to know, but it's very hard to figure out how to ask about or google for. Unfortunately, to do what you're describing you're going to have to make some concessions somewhere to achieve what you're talking about. Double unfortunately, because I think ...

20

ConTeXt does not directly output XHTML, it outputs XML. However the current browsers (at least Opera, Firefox and Chromium) are able to display XML correctly. The XML can be styled using CSS. When you want real XHTML, you have to transform the XML to XHTML using external tools. ConTeXt standalone ships with an example file: ...

19

I think that, if you are able to import your html tables in Excel or OpenOffice Calc, these tools are what you need: Excel2LaTeX for MSExcel Calc2LaTeX for OO Calc (this one is my preferred, guess why ;) The first one is a macro you add to your Excel, and provides you with an extra button to create the LaTeX code for the table from a set of selected ...

19

DocBook is certainly the standard for XML documentation writing. I've heard of DITA, but couldn't tell you much about it. You can use ConTeXt to process XML. It works by defining a mapping between the XML tags and TeX markup instructions. This should give you the benefits of DocBook (universal, XML-based) and many of the benefits of ConTeXt in the document ...

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

15

I know that you finally have found a solution, but there is solution for tex4ht, if anybody is interested. There are three problems: You run htxelatex bala.tex # generate html - there should be not # generate html, this is just some comment. Correct command is htlatex bala.tex "xhtml, charset=utf-8" " -cunihtf -utf8" in the case of unicode input. It ...

15

Is there a converter that will convert LaTeX to HTML? Yes. There are lots. But you already knew this, as evidenced by your second "question": I have tried several services but the LaTeX diagrams and some of the maths came out weird. "turning out weird" could mean any number of things: The document fails to compile The document compiles, but is ...

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

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

13

Update: I am still improving the code style. You can find the latest version here: https://www.writelatex.com/74567mmxwkw - I appreciate anyone who is testing :) After much trial and error and the help of people here from the community I have come to a very attractive result. Screenshot: The code is pretty intense, but it works. It would be nice if ...

12

To display mathematics on the web, you have a number of options. There is the MathML standard which has the advantage of being endorsed by the same body that maintains the HTML and CSS standards. This isn't however, LaTeX based. There are tools to translate LaTeX code into MathML. texmath LaTeXMathML There is the "heavy duty" MathJax option. You can ...

11

You can use package ifpdf and enclose pdf-specific stuff in \ifpdf ... \fi \usepackage{ifpdf} \ifpdf %pdf specific stuff \fi Alternatively, you can make the pdf-file and convert to html using a tool like pdftohtml.

11

(for reference the Adobe Knowledge base entry about pdf from html linking) Checkout section 4.1 in Hypertext capabilities with pdfLaTeX (F. Garcia, TUGBoat, Vol. 28, No. 1, 2007), which describes the hyperdef and hyperref commands. Just a small example: src.tex: \documentclass{article} \usepackage{hyperref} \begin{document} \section{Source a} ...

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

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

10

For pdf output you can use the minted package. This produces a nicely formatted and coloured PDF file for you. As described in the minted package documentation, you have to install Pygments and run (pdf)latex with the -shell-escape option. To use this approach to produce html you also need to pass the -shell-scape option to htlatex. You can do this using ...

9

Have a look at the ideas at The baseline problem corrected. They have been incorporated into mathTeX vertical alignment if you want to use mathTeX to create the images.

9

ConTeXt can directly process XML. See Thomas's MyWay and the official documentation

8

If the document is XHTML (rather than HTML), then it can be processed directly in ConTeXt. See http://dl.contextgarden.net/myway/tas/xhtml.pdf for a tutorial and http://dl.contextgarden.net/myway/tas/ for the sample files.

8

Check out this page http://www.ctan.org/tex-archive/help/Catalogue/entries/datatool.html and tools it links ie csvtools and pgfplotstable. They allow you to keep the data in csv or tsv format and configure typesetting options in .tex source. I have used pgfplotstable and it is very handy.

8

I would think the source would be at http://www.ctan.org/tex-archive/support/latex2html The latex2html-2008.tar.gz there is dated Sept 2008.

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

8

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

8

You convert the em dash by using three dashes in a row in the LaTeX file: --- Actually, this depends on the font, but for all practical cases, this will work.

8

We (W3C Math WG) did look at the start of the MathML2 cycle at specifying a linear (latex like) syntax for mathml (it was an explicit proposed deliverable) but initial investigations were not promising. As you note there are several I can't remember exactly which ones we polled probably jsmath (at the time), asciimathml, Word's linear format, itex, and ...

7

\documentclass[a4paper]{article} \usepackage[T1]{fontenc} % enable this to make a WEB template compilable % he <TMPL_VAR ..>'s will be replaced by the template system \catcode<=\active \catcode_=12 \gdef<#1>{\texttt{\textless #1\textgreater}} \begin{document} <TMPL_VAR TEST> <TMPL_IF NAME=TEST> something </TMPL_IF> ...

7

\textemdash - or, if you have a recent UTF-8 capable TeX engine, you can insert the UTF-8 character. See Wikipedia. Note that the command will gobble a trailing space unless you add a {} to it.

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