# Is there any method to get a JuMP model in Latex format?

**URL:** <https://discourse.julialang.org/t/is-there-any-method-to-get-a-jump-model-in-latex-format/106728>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [November 26, 2023, 2:19am UTC](https://discourse.julialang.org/t/is-there-any-method-to-get-a-jump-model-in-latex-format/106728 "2023-11-26T02:19:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_ricci](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Alex\_ricci](https://discourse.julialang.org/u/Alex_ricci)\
**Post date:** [November 26, 2023, 2:19am UTC](https://discourse.julialang.org/t/is-there-any-method-to-get-a-jump-model-in-latex-format/106728/1 "2023-11-26T02:19:45Z")

</div>

I use JuMP package from julia programming language for modelling optimization problems. To investigate the performance of the model I need to print some of the model constraints. I want to know is there any automatic way of receiving the model constraints in Latex format (for readibility reasons)?

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [November 26, 2023, 3:11am UTC](https://discourse.julialang.org/t/is-there-any-method-to-get-a-jump-model-in-latex-format/106728/2 "2023-11-26T03:11:33Z")

</div>

Yes, this is already a feature of JuMP. The question is where and how do you want to read the output? Eg. as TeX-markup text, rendered in a notebook, etc.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [November 26, 2023, 7:11pm UTC](https://discourse.julialang.org/t/is-there-any-method-to-get-a-jump-model-in-latex-format/106728/3 "2023-11-26T19:11:37Z")

</div>

You can use `latex_formulation(model)`, but it prints the scalarized version, not a compat set representation. See [Models · JuMP](https://jump.dev/JuMP.jl/stable/manual/models/#Print-the-model)

---

<div class="post-metadata">

**Author:** ![Alex\_ricci](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Alex\_ricci](https://discourse.julialang.org/u/Alex_ricci)\
**Post date:** [November 28, 2023, 9:15am UTC](https://discourse.julialang.org/t/is-there-any-method-to-get-a-jump-model-in-latex-format/106728/4 "2023-11-28T09:15:30Z")

</div>

Is there any way of getting it in a pdf format?  
Is there any way of getting specific constraints by calling their names?

---

<div class="post-metadata">

**Author:** ![Alex\_ricci](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Alex\_ricci](https://discourse.julialang.org/u/Alex_ricci)\
**Post date:** [November 28, 2023, 9:21am UTC](https://discourse.julialang.org/t/is-there-any-method-to-get-a-jump-model-in-latex-format/106728/5 "2023-11-28T09:21:11Z")

</div>

Thank you for this response.

I use VS code and have to copy the output from VS code to overleaf then modify some stuff like changing the letter delta to \delta so overleaf can read it.  
Is there any way of dealing with this?

I have an additional (silly) question, and I’m not sure if it’s feasible, but I wanted to check just in case. When generating LaTeX code for the model, is there a way to specify whether certain variables should appear on the right or left-hand side of the equation?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [November 28, 2023, 5:29pm UTC](https://discourse.julialang.org/t/is-there-any-method-to-get-a-jump-model-in-latex-format/106728/6 "2023-11-28T17:29:25Z")

</div>

The answer to all is no. The LaTeX export is a very limited feature.
