Tag Info

Hot answers tagged

40

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


24

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


21

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


19

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

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


17

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


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


14

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


12

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


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


11

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


11

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

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

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

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

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

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

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

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.


7

I'm afraid there's no easy solution. As Marco stated, a CV requires attention and better control. I'll present a solution I use, though it's not totally LaTeX based. Here comes sphinx. According to the website, sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license. ...


6

In ConTeXt, the char-ent.lua file contains the list of all HTML entities. You can access them using the characters.entities table. For example, the following code prints all the entities and their values to screen. \starttext \startluacode local entities = characters.entities for name, value in next, entities do print(name,value) ...


6

I doubt that there is an official way to do this (i.e. one mentioned in either the PDF or (X)HTML specification), but I could of course be wrong. For Adobe Acrobat (in a web browser) it seems to work the following way as mentioned at http://kb2.adobe.com/cps/317/317300.html: <A HREF="http://www.example.com/myfile.pdf#page=4"> Simply attach #page=4 ...


6

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


6

If you specifically want the Computer Modern fonts on your webpage, your best bet is to use the Latin Modern CM clone, since it is available in OTF format. These could then be used e.g. with @font-face (Fontsquirrel has a good generator). If you're asking a more general question, e.g. "How do I use any T1 font on my webpage", the answer is a bit more ...


6

Biber aims eventually to deal with such cases. At the moment (as of version 0.9.8), you can use the --bltxml option to ouput a BibLaTeXML file instead of a .bbl. BibLaTeXML is experimental still but it's XML with a defined schema so converting this to HTML is likely to be much easier than from .bib format directly, using XSLT. This is generally a better ...



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