question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipe dreams for .latex()

See original GitHub issue

.latex() is great! … but the output still requires a fair amount of editing to be truly useful/for it to save time.

This ticket may, as the name suggests, be unrealistically hopeful, but there are a few things that prevent .latex() from being fully useful:

  • Fractions show up as decimals, which is kind of gross, and sometimes fails to capture the constraint in a recognizable form. Can we leverage the fractions library here to try to improve this?
  • To complicate things more, there are irrational numbers that screw everything up. pi turns up all the time - is there anything we can implement that would recognize that a number is a multiple of pi and print accordingly?
  • For obvious reasons, the exponents in a given constraint are applied to each variable separately. Again, this means that constraints may look weird. Can we group variables with the same exponent and wrap them in parentheses?
  • This last one is definitely a pipe dream. The variables in a constraint are often (always?) printed in an order that is different from the way the constraint is typed, and therefore different from its recognizable form. If .latex() gives me 0.5 S C_d \rho V^2, I have to rearrange it to \frac12 \rho V^2 S C_d and this takes time. If I have to do this for every equation, I can probably achieve the same result by throwing some vim at the python source. Can anything be done about this?

Obviously, it won’t be possible to fully automate this for every single constraint ever, but I think the changes above, if at all possible, would make for a huge improvement, and drastically improve the usefulness of what is already a great concept.


carry over from #780

  • Currently the latex environment chosen does not support multi-page models, which is a problem for larger models. This might be best resolved by using a different environment (e.g. align).
  • M. Drela suggests putting a small space between variables in monomials, if there is no exponent taking up space. This probably isn’t specific to the latex() method but that’s just where I noticed it.
  • latex for some unit strings underscores letters after underscores. ex: pound_force_per_square_inch
  • Create latex tables for models without needing to solve them (#1045)

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pgkirschcommented, Nov 25, 2016

Eww do you really want to see your sensitivity to pi?

0reactions
bqpdcommented, Jul 1, 2019

https://github.com/convexengineering/gpkit/pull/1408 encompasses the first four points in the first post

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipe dreams for Schubert polynomials of the classical groups
Haiman in 1995; they are polynomial representatives of Schubert classes in a full flag variety of a classical group. We provide a combinatorial ......
Read more >
tikz - gradient along a bendy path - TeX - LaTeX Stack Exchange
I'm drawing pipes (like the Pipeline game), and I want them to be shaded to give the effect that the ... My pipe...
Read more >
Pipe Dreams Pet Beds - PetEdge
The Pipe Dream Elevated Pet Bed uses PVC piping to keeps dogs above hard, cold or uncomfortable ground, providing support that's particularly beneficial...
Read more >
Pipe Dreams - Rotten Tomatoes
There are no critic reviews yet for Pipe Dreams. ... There are no featured reviews for Pipe Dreams because the movie has not...
Read more >
Gröbner geometry of Schubert polynomials
Nantel Bergeron kindly provided. LATEX macros for drawing pipe dreams. Part 1. The Gröbner geometry theorems. 1.1. Schubert and Grothendieck polynomials. We ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found