from keecas import symbols, generate_label
# String label
generate_label("my-label") # Returns: 'eq-my-label''eq-my-label'
Generate formatted label text for use with show_eqn.
This function processes label inputs and returns formatted label strings that include the configured prefix and suffix. It supports multiple input types through singledispatch.
| Name | Type | Description | Default |
|---|---|---|---|
| arg | Any |
Label input. Can be: - str: Single label string - dict: Dictionary mapping keys to label strings - list: Converted to string representation, then labeled | required |
| unique_id | bool |
If True, generate a unique hash-based ID instead of using the provided label text. Defaults to False. | False |
| Name | Type | Description |
|---|---|---|
Any |
Formatted label(s) with prefix and suffix applied: | |
Any |
- str input returns formatted str | |
Any |
- dict input returns dict with formatted values | |
Any |
- list input returns formatted str (converted via str()) |
'eq-my-label'
{F: 'eq-force', A_{load}: 'eq-area'}
"eq-['item1', 'item2']"
generate_unique_label: Convenience function for unique ID generationshow_eqn: Main display function that uses labels