Open HVEC-lab opened 2 years ago
Thanks for the compliments. You are correct, things like DeltaH
are not recognized yet. I have been thinking about how it might be implemented. Currently, individual elements of an equation are broken up as individual strings. Any strings in the equation which match any item in the list of "greeks" are then replaced with the corresponding latex code.
To capture DeltaH
, perhaps an obvious step would be to instead check if there is a "greek" within the string. This would have the side effect of extracting and converting eta
and nu
and psi
in words or names like metal
, null
, and ellipsis
.
Do you have any thoughts on what the syntax might be? I am planning on sticking with the underscore == subscript syntax however I have had thoughts about making a double underscore equivalent to an actual space (`) in Latex. However, this would not solve this problem because it would just insert a space, like,
Δ H`, which is not quite right.
Am interested to hear your ideas on how this might be done!
Thanks for the reply. Sadly I have no experience in the programming features required for handcalcs. I am currently developing and publishing packages for hydraulic engineering, which is my field. Handcalcs is great for preparing test cases.
Sorry I am unable to help you here.
I'm in favor of using the double underscore __
for text on the same level. E.g.
Delta__H
( \Delta H) $$\Delta H$$Delta__E_car
(\Delta E{car}) $$\Delta E{car}$$Thanks! I am also thinking of the following:
Thoughts?
On Jun 8, 2022, at 03:11, B. Willems @.***> wrote:
I'm in favor of using the double underscore __ for text on the same level. E.g.
DeltaH ( \Delta H) $$\Delta H$$ DeltaEcar (\Delta E{car}) $$\Delta E_{car}$$ — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
I have implemented the global option of being able to toggle on/off whether underscores become subscripts or if they just become spaces/separators between symbols. This is in the global_config
branch, which will be released as the new version in the coming week or so.
Thanks! I am also thinking of the following:
- A global setting to switch single underscore behaviour from subscript to a separator to enable things like DeltaT
Looks good to me for people who don't use underscores often.
- A global setting to switch double underscore behaviour from a separator to a separator with a space to enable things like “Annual Rate of Return = …” Thoughts?
A double subscript does't exist as far as I know. Only one subscript is used at a time, not two levels at once. Because of that I think the default of __
(two underscores) should be a space.
Thank you for your work.
My workaround is:
from handcalcs import constants
greek = constants.GREEK_LOWER
greek['DeltaSigma'] = '\\Delta\\sigma'
greek['parallel'] = '\\parallel'
greek['normal'] = '\\perp'
For something like this:
@av1dm That's a brilliant idea!
@av1dm great idea!
Hi,
I am really impressed by handcalcs and forallpeople and. Currently learning to use it.
In my field it is sometimes customary to write variables as combinations of a greek and normal characters (such as DeltaH). Handcalcs appears not to understand this.
Help is appreciated.
Hessel Voortman