This is a major new release for handcalcs and introduces the global configuration feature. This allows users to have control over several options of how handcalcs works. The configuration options, with their default values, are as follow:
* `decimal_separator = "."`
* `latex_block_start = "\\["`
* `latex_block_end = "\\]"`
* `math_environment_start = "aligned"`
* `math_environment_end = "aligned"`
* `line_break = "\\\\[10pt]"`
* `use_scientific_notation = False`
* `display_precision = 3`
* `underscore_subscripts = True`
* `greek_exclusions = []`
* `param_columns = 3`
* `preferred_string_formatter = "L"`
Config API
python
import handcalcs.render
handcalcs.set_option("display_precision", 4)
handcalcs.set_option("param_columns", 5)
handcalcs.set_option("line_break", "\\\\[20pt]")
handcalcs.set_option("greek_exclusions", ["psi"]) etc...
These changes now affect all cells rendered in the current session. If you want to permanently update the `config.json` file with these changes (so handcalcs will always load up with these options), you can then call `handcalcs.save_config()` and the changes will be saved.
The auto-complete in the `handcalcs.set_option()` function demonstrates which options are available and what values they take.
Scientific notation
Previously, handcalcs had a sketchy "guess" at determining if a value should be rendered in scientific notation to make it more readable. This behaviour has now been removed and requires the user to explicitly set whether scientific notation should be used. This can be set as a global option with `handcalcs.set_option('use_scientific_notation', True)` and it can also be toggled at the cell level with the new `sci_not` cell override command. If the global configuration is set to `True`, the toggle will turn scientific notation OFF in that cell. If the global configuration is set to `False`, the toggle will turn scientific notation ON in that cell.
python
%%render sci_not 5