Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9224257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:16:28+00:00 2026-06-18T04:16:28+00:00

Perhaps im overlooking the obvious but how do you prevent sympy from rearranging equations?

  • 0

Perhaps im overlooking the obvious but how do you prevent sympy from rearranging equations?

Im using Sympy in the iPython notebook so i can easily copy-paste the Latex code to Lyx, but i want the equations in the same order as i defined them.

For example, the formula for grey-body radiation as a function of its temperature:

enter image description here

Sympy automatically places the Temperature component to the front, which gives a very unusual representation of the formula. Is there anyway to prevent this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:16:29+00:00Added an answer on June 18, 2026 at 4:16 am

    Currently, there is no way in SymPy to print things exactly as they are entered, because that information isn’t even saved anywhere.

    I believe in a multiplication, symbols are ordered alphabetically, with capital letters coming before lowercase letters (basically, the order from ord). The best trick I can come up with is to use the symbol_names option to latex, which lets you change the name used for a Symbol in its LaTeX representation. The ordering will still be based on the original symbol’s name, so you can trick it:

    >>> from sympy.abc import epsilon, omega, t
    >>> latex(epsilon*sigma*t**4, symbol_names={t:"T"})
    \epsilon \sigma T^{4}
    

    If you want this to pretty print nicely in the notebook, you’ll have to write a custom version of the printing extension that passes your symbol_names dict to latex. See https://github.com/sympy/sympy/blob/master/sympy/interactive/printing.py (ideally one could just pass the latex options to init_printing, I’ll open an issue in the SymPy bug tracker for that).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Perhaps I'm just overlooking something obvious but I can't figure out how to bind
Perhaps I'm overlooking something, but can client WCF not handle a server response that
Perhaps I'm overlooking something obvious but I was wondering what the fastest way to
I can't figure out what I'm overlooking, perhaps it's obvious or lack of understanding.
Perhaps you can help me find this in the docs. I'm using pound-quote to
Perhaps I'm not using the right terminology, but I'm struggling to try to find
I'm perhaps overlooking something, but I'm attempting to wrestle protocol buffers into an easy
Perhaps I am missing something obvious, but when I utilize the dojo date picker
Perhaps I'm overlooking something simple, but I would like to cast an instance of
Perhaps any of you can help me with this anoying problem. I have long

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.