Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Someone yell at me if I'm wrong, but isn't TeX designed for paged content?

That means while TeX might work amazingly for paginated content, single page apps, or really any non-paginated content, is very much a screwdriver where a hammer should be used scenario.



Overall it is, but when the above commenter mentions box-and-glue, they're talking about the building blocks of the line breaking algorithm TeX uses (you can read about it in this paper: http://onlinelibrary.wiley.com/doi/10.1002/spe.4380111102/ab... ). The box-and-glue system is a way of expressing a layout as an optimization problem (in the paper, they talk mostly about determining line breaks within a paragraph, but the idea of minimizing badness can be extended to determining page breaks as well). A bigger concern for me is the performance of laying out any reasonably complex page — the performance we get from rendering a reasonably complex webpage today is generally much better than rendering a reasonably complex LaTeX document.

I've come across a feature request for Firefox where someone proposed to use the Knuth Plass line breaking algorithm just for text layout, but they didn't get very much traction: https://bugzilla.mozilla.org/show_bug.cgi?id=630181


Are there any CSS replacement proposals that are based on linear programming [1]? There are a lot of things you cannot solve with just LP (e.g. rearranging floats on a page) but it's a pretty good -- and simple -- abstraction for laying out boxes relative to each other.

Solving LP is fast, especially when many of your constraints are equality constraints (as would be when specifying tables).

[1] http://en.wikipedia.org/wiki/Linear_programming


I think Cassowary [1] is what you're talking about (particularly section 1.2 where they talk about some modifications to make their system very fast for incremental updates). Apple has based their constraint-based layout system, Autolayout [2], on Cassowary. There's also a project that incorporates Cassowary constraints into a CSS-like declarative syntax called GSS [3].

[1] https://www.cs.washington.edu/research/constraints/cassowary...

[2] https://developer.apple.com/library/ios/documentation/userex...

[3] http://gridstylesheets.org/


Great links, thanks!


TeX is the opposite of a layout language. It's closer to HTML than CSS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: