Can I use LaTeX to specify cascading style sheet? Can someone enlighten me something about using LaTeX with my website?
Basically to setup layout like how I do for documents, setting up fonts, spacing etc
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.Sign up to join this community
You could also look at Pandoc, which can be used as follows:
pandoc -r latex -w html -o outfile.html infile.tex
This will generate the HTML for you. You will have to specify your own stylesheets, however. Also, Pandoc only supports a subset of LaTeX.
LaTeX2HTML is a powerful TeX compiler to directly render a TeX document into HTML.
While installation of
LaTeX2HTML involves several intricate steps, it is not impossible. Upon compilation, all necessary pages with the corresponding CSS is also created. Note, that the look of your document on the browser is only as good as you have developed it on TeX.
LaTeX2HTML is by far the best way to put your heavily loaded scientific and mathematical content on the web.
I agree with what was already said: you won't get the flexibility of manually playing with css, jquery/ajax, etc. However, as far as structured/markup languages are concerned, you may find the following two projects interesting:
However, note that in general stylesheet as well as layout are specified outside of the core document.
This is probably not exactly what you need, but I think it might make an interesting addition to the thread nonetheless. A few weeks ago, I stumbled across pdf2htmlEX, which can convert, as the name implies, pdf files to HTML, while maintaining the typography and layout pretty much intact.
I've tried it with some non-trivial LaTeX-generated pdfs of mine, and the results are truly impressive (they have very nice demos in their project page, too). On the other hand, the HTML markup it produces is heavy and not very editing-friendly. The point is that if you have some part of a site that you'd like to layout/typset with TeX, it is now possible to do so.
This is not a particularly good idea. While there are tools to convert LaTeX into HTML/CSS, they give a result that is nowhere near as flexible as you could get with HTML directly or other meta-languages.
If you like to use LaTeX equations in your web, you can use MathJax which is commonly used in Wikipedia, arxiv etc. (http://www.mathjax.org/) You can also use Markdown to format your HTML files quickly if you'd like to create on-line documents. You can also find a collection of tools /web templates etc. for creating online articles here:(http://laplace.phas.ubc.ca/People/arman/sg/)
tex4ht file.texand you get your web page with links and all. Think how nice it is to have all your web pages compiled to one book if needed. You can do that with Latex+tex4ht, but not if you just start from HTML. Also the pdf generated will have links inside it.