Jason Grout wrote: > Golam Mortuza Hossain wrote: >> Hi Jason, >> >> On Wed, Mar 25, 2009 at 11:57 AM, Jason Grout <jason-s...@creativetrax.com> >>> Can you post your patch that makes the functions typeset as greek >>> letters? >> This is my first attempt to modify Sage. So please feel free >> to correct me. Let me mention the changes I have made >> to get the elementary support for typesetting functions >> as Greek letters. >> >> >> (1) In file: "sage/misc/latex.py", I have added a function after the list >> "common_varnames" as follows >> -------------------------------------- >> def is_common_varname(a): >> """ >> Checks whether it is a common variable name such as alpha, beta >> """ >> if a in common_varnames: >> return True >> else: >> return False > > > Why not just: > > return a in common_varnames > > which I think is equivalent. > > Also, I think naming the function is_latex_name or something like that > would be better. common_varnames says nothing to me about the variable > name actually being a latex command which produces a symbol (yes, I know > you're just inheriting the current behavior, so it's not your fault).
On second thought, the function just takes a string and returns whether that string is actually a latex command (i.e., can be prepended by "\"). I'd probably just call it is_latex_command or is_latex_symbol. Eventually, this function will need to have a doctest or two illustrating its use. Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---