Working with sheets

A calculation sheet collects the formulas, values, and explanations for a complete task in one document. Unlike the quick calculator, a sheet is not limited to one current formula or the ten predefined variables. You create descriptive variables as you work, and every line is calculated in order from the top of the sheet to the bottom.

Choose Window → Calculation Sheet… to open a sheet.

Calculation Sheet editor

The two panes

The Equations pane on the left is the editable source. Write assignments, expressions, and comments here. It behaves like a text editor: long lines wrap without creating additional calculations, while pressing Return creates a new calculation line or paragraph.

The Calculated pane on the right shows the same sheet as typeset mathematics with the result of each calculation. This pane is generated from the source; edit the equations in the left pane rather than the rendered result.

Drag the divider between the panes when one side needs more room. Use the control at the bottom to zoom the calculated display.

Writing a sheet

Assign a value or expression to a variable with =. A variable defined on one line can be used by every later line:

distanceKm ⁣:travelled distance in kilometrestimeHours ⁣:elapsed time in hoursspeed ⁣:calculated speeddistanceKm=3.5timeHours=0.75speed=distanceKmtimeHours \begin{aligned} \mathrm{distanceKm} &\colon\quad \text{travelled distance in kilometres} \\ \mathrm{timeHours} &\colon\quad \text{elapsed time in hours} \\ \mathrm{speed} &\colon\quad \text{calculated speed} \\[0.6em] \mathrm{distanceKm} &= 3.5 \\ \mathrm{timeHours} &= 0.75 \\ \mathrm{speed} &= \frac{\mathrm{distanceKm}}{\mathrm{timeHours}} \end{aligned}

The result is approximately 4.667 kilometres per hour.

Use a descriptive lower camelCase name for a multi-word variable, such as effectiveTreadDepth or tipToTipDistance. Underscores and trailing digits are LaTeX subscript notation, so camelCase keeps ordinary names from being typeset as subscripts.

Use explicit multiplication with *:

x ⁣:a variabley ⁣:the calculated valuex=4y=2x3 \begin{aligned} x &\colon\quad \text{a variable} \\ y &\colon\quad \text{the calculated value} \\[0.6em] x &= 4 \\ y &= \frac{2\cdot x}{3} \end{aligned}

Writing 2*x is unambiguous even when variable names contain several characters.

Function parameters in documentation formulas are separated with commas. Calculation sheets also accept semicolons when entering a library function interactively:

sideA ⁣:first side of a trianglesideB ⁣:second side of a trianglesideC ⁣:third side of a triangleheight ⁣:triangle height relative to sideAsideA=20sideB=30sideC=40height=TriangleHeight(sideA,sideB,sideC) \begin{aligned} \mathrm{sideA} &\colon\quad \text{first side of a triangle} \\ \mathrm{sideB} &\colon\quad \text{second side of a triangle} \\ \mathrm{sideC} &\colon\quad \text{third side of a triangle} \\ \mathrm{height} &\colon\quad \text{triangle height relative to sideA} \\[0.6em] \mathrm{sideA} &= 20 \\ \mathrm{sideB} &= 30 \\ \mathrm{sideC} &= 40 \\ \mathrm{height} &= \operatorname{TriangleHeight}\left(\mathrm{sideA}, \mathrm{sideB}, \mathrm{sideC}\right) \end{aligned}

Comments and explanations

Begin a line with # to make it a comment:

# All dimensions are in centimetres.

Comments are not calculated. They appear as readable explanatory text in the calculated pane and in exported reports, without the leading #. Long comments wrap in both panes. Wrapped continuations are indented in the editor so they are not mistaken for new formula lines.

Blank lines can be used to separate logical sections of a larger project.

Calculation order

Press Run to calculate the complete sheet. Editing a line and pressing Return also recalculates it. FormulaCalculator starts at the first line and continues downward, so a variable must be defined before it is used.

If a variable is assigned again, later calculations use its new value while earlier results retain the value that was available at their position in the sheet.

Errors are shown beside the affected line in red. A failed line does not silently produce a valid-looking result. Correct the source and run the sheet again.

Built-in constants, such as e and pi, and user-defined constants from Preferences can be used in a sheet but cannot be reassigned.

Displaying results

The display controls change how results are shown without changing their stored numeric values:

For example, engineering notation displays 0.00001 as 10 E-6, while scientific notation displays it as 1 E-5.

Long formulas remain readable. FormulaCalculator wraps or splits the result onto a following line when the full equation and value cannot fit together. Wide mathematical content can also be scrolled horizontally.

Expanding a library function

Formula-backed functions from the built-in library can be replaced with their underlying calculations. Point at the function name in the Equations pane, open the context menu, and choose Expand from Library.

The function arguments are inserted directly into the expanded formulas. Temporary variables receive short unique names so they do not conflict with variables already used in the sheet. FormulaCalculator also inserts the original function call as a comment.

This is useful when documenting how a result was obtained or when adapting a library formula for a particular project. Native functions that do not have an expandable library formula continue to calculate normally.

Saving and loading sheets

Choose File → Save Calculation Sheet…. Enter a title and description, then select the destination for the JSON file. The document stores:

The calculated pane is not stored because it can be reproduced from the equations.

Choose File → Load Calculation Sheet… to open a saved JSON document. FormulaCalculator restores the title, description, and source, then recalculates the sheet.

PDF and Markdown reports

Choose PDF Report… to create a finished report. The report contains its title and description, comments as normal paragraphs, and formulas with their calculated results as typeset mathematics. The selected decimal and notation settings are used in the report.

The report aligns formulas around their equal signs where practical. Long formulas are split logically so neither the expression nor its result is clipped.

The File menu also provides two Markdown exports:

The title and description are shared by the saved calculation sheet and its reports.

Ask OpenAI

OpenAI assistance is optional. Configure an API key in Preferences, then choose Ask OpenAI in the Calculation Sheet window.

The dialog can:

For a follow-up question, FormulaCalculator sends the current editable sheet as context. This helps OpenAI reuse variables already defined in the project instead of inventing replacements with different names.

The image preview shows exactly which image will be sent. Review AI-produced formulas and assumptions before using their results, especially for construction, electrical, financial, or safety-related work.

Good working practices

RELATED TOPICS