I come from a web development background and I am used to apply CSS styles to HTML tags in order to position and shape them. In LaTeX I constantly find myself trying to think in terms of CSS and of how things are 'supposed' to float, move, or expand as I play around with content and style. However, my preconceived notions that come from this CSS knowledge often give predict the outcome poorly. I find myself generating PDFs frequently in order to understand how new code impacts the result. Surely I am unable to let go of particular ideas, but I just find that LaTeX floats boxes very oddly, and thatit is very difficult to put things in my position of choice.

The question is: can someone who was also used to work with CSS explain common pitfalls and suggest ideas for thinking differently about LaTeX and making things make 'more sense'?

  • 3
    I think the most important "pitfall" is that TeX breaks things into "real" pages, while CSS/HTML doesn't. This means "floats" in each case are quite different. As your document is not described, it is hard to suggest anything concrete that will help. Perhaps, though: don't float things if you have very concrete ideas about where things go. (See, e.g., the package textpos; and the layout category on CTAN.)
    – jon
    Feb 3 '15 at 23:15
  • Related
    – Clément
    Feb 17 '15 at 10:56
  • A better analogy between TeX and HTML based techniques is the <tr> and <td> tags of an HTML table which, very roughly(!), correspond to the horizontal and vertical modes of TeX box stacking.
    – percusse
    Aug 19 '15 at 22:23

Hope it can help,

Mainly, we are talking about completely different things here, the main difference being pages.

When you talk about LaTeX, you are really thinking in printing your work in paper (or at least a PDF), but in CSS, it is a fluid bunch of objects floating in the web page

Please take a look at this article

  • 4
    This just looks like Jon's comment with the addition of a link.
    – cfr
    Aug 19 '15 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.