Tag Info

Hot answers tagged

44

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


40

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


34

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


29

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


23

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


21

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


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


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

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


17

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 :) If you want to get a copy of the source code, you can get it here: https://dl.dropboxusercontent.com/u/74217418/stackexchange/tex/html5_listings_sample.tex After much trial and error and the help ...


16

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


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

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


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


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


12

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


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.


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

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

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


10

My very first attempt is something like morekeywords={>, etc}. But every > at the end of comments is colored pink. I cannot override its color by, say, moewkeywords=[9]{-->}. Then I found that it is probably because < and > are special in this case. More precisely, Listings actually takes care of tags by the following: when you say ...


9

Some comments : xcolor is loaded by tikz, so don't reload it again, use capitals in color numbers, your last rectangle overlap the previous ones, you can make it shorter using foreach. Here is the code : \documentclass[tikz]{standalone} \definecolor{rot}{HTML}{E40303} \definecolor{xorange}{HTML}{FF8C00} \definecolor{gelb}{HTML}{FFED00} ...


9

pandoc cannot convert a .bib file into another file format1. However, it can convert a .tex file which contains references (called from a .bib file) into a pdf, odt, html, ... If your .tex file just contains the \nocite{*} command, the result is similar (you will have all your references printed). Here is the magick command: pandoc test.tex -o output.odt ...


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


9

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


9

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.


9

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


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.


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

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.



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