Open turner-eng opened 3 years ago
You could add it directly in this convert_symbol function ?
elif m == "prime":
m = r"\prime"
A cleaner implementation would be to generalize this with a dictionary of Latex commands and the equivalent Python name they would replace, similar to unicode_tbl
Cool instruction, let me do it.
Best is if you add a small test to :
Test syntax is quite obvious : https://github.com/erwanp/pytexit/blob/master/pytexit/test/test_functions.py#L21
I am planning to add some basic operation into the variable_name so that it is better suited for civil engineering calculation, any suggestion to do this?
for the example below, I will have R_designMINUSaction as python name, "MINUS" is the key for "-" in the convert_symbols function.
I think putting new symbols conversion option in convert_symbols function is better, since convert_symbols seems to be component (individual superscript/subscript) based while replace_unicode is whole expression based. Mending the latter will disable us to do the following action carelessly unless we define the subsuming variable in correct order
for example in: Rˆprime=Tˆdprime+1, dprime subsumes prime.
This feature is interesting, I want to extend this to allow for even more scenarios (such as simple operations) in the variable name such as the second figure
RoutputDIVIDEinput to R{output/input}
I want to get N_{Rd}^{\prime} shown below, from variable name N_Rdˆprime, this is a feature similar to auto-recognition of greek letters, can we have this?