
SavvySense™ Language Syntax
SavvySense™ is a specialized markdown-based language designed for interactive engineering calculations and rich document generation. It combines standard Markdown with a powerful math evaluation engine (`mathjs`), native structural engineering units, and advanced page layout controls.
- Published
- Aug 20, 2026
- Read time
- 4 min
Table of Contents
- 1. Document Structure
- 2. Variables & Calculations
- 3. Units & Constants
- 4. Built-in Functions
- 5. Styling & Layout
1. Document Structure
Title Blocks
SavvySense™ documents can include metadata blocks (YAML frontmatter) that populate a formal engineering title block at the header of a page. The metadata block must be enclosed in --- lines.
Supported keys:
projectjob_refsectionsheetcalc_authorcalc_datecheck_authorcheck_date
Example:
1---
2project: Office Building
3job_ref: 123456
4section: Cable Tray Support Design
5sheet: 1
6calc_author: XYZ
7calc_date: 10/24/23
8---Page Breaks
To manually force a page break and begin a new sheet, use the [pagebreak] tag.
- Note: A new title block automatically acts as a page break.
1[pagebreak]2. Variables & Calculations
SavvySense™ evaluates math expressions continuously, storing variables in a document-wide state. Calculations seamlessly handle unit conversions.
Calc Line Syntax
A "Calc Line" is a specialized, interactive block that follows a specific structure:
[Description:] [Variable =] Expression [= Result] [(Note)]
- Description: Optional text ending with a colon (
:) or separated by multiple spaces. - Variable: The name of the variable to store in the document state.
- Expression: The mathematical operation (e.g.,
4 ft,w_tray * L). - Result (Placeholder): Use
{?}or{?:N}(whereNis the number of decimal places) to display the computed result. You can follow the placeholder with a target unit. - Note: Optional text wrapped in parentheses
()at the end of the line.
Examples:
1# 1. Simple Assignment
2Length: L = 4 ft (see elec. dwgs.)
3
4# 2. Evaluation with target units and 0 decimal places
5Total Load at Beam: P_tray = w_tray * s_supp = {?:0} lbs
6
7# 3. Utilization Check
8Demand / Capacity: DC = T_u / T_n = {?:2}Inline Math
For math evaluations inside standard paragraph text or tables, use braces { }.
Example:
1The applied tension is {T_u = ?} and the capacity is {T_n = ?}.
2Therefore, the ratio is {DC = ?}.3. Units & Constants
SavvySense™ extends the standard mathjs unit library with specialized imperial units used in structural engineering.
Supported Engineering Units
- Force:
kip(1000 lbf),lbs,lb(aliases for lbf). - Force per Length:
plf(lbf/ft),klf(kip/ft),pli(lbf/in),kli(kip/in). - Pressure/Stress:
psf(lbf/sqft),ksf(kip/sqft),psi(lbf/sqin),ksi(kip/sqin),pcf(lbf/cuft). - Torque/Moment:
kipFt,kipIn,lbFt,lbIn.
Greek Symbols
You can utilize Greek letters directly in variable names. SavvySense™ provides canonical token mapping to prevent Unicode lookalike errors.
Common symbols include: α (Alpha), β (Beta), Δ (Delta), φ or ϕ (Phi), π (Pi), σ (Sigma), and θ (Theta).
- Built-in constants include
pi(orπ),e, andInfinity.
4. Built-in Functions
SavvySense™ inherits mathematical, geometric, statistical, and trigonometric functions.
- Math:
abs,ceil,floor,pow,sqrt,round. - Geometry:
distance,intersect. - Stats:
max,min,mean,sum. - Trig:
sin,cos,tan,acos,asin.
Custom if Function
SavvySense™ provides a custom conditional function that is highly useful for engineering checks:
if(condition, trueVal, falseVal)
Example:
1<!-- check_1 = if(DC <= 1, 'OKAY', 'NO GOOD') -->
2Check: {check_1 = ?}5. Styling & Layout
Style Blocks
Wrap content in [style: classes] ... [endstyle] tags to apply specific layout rules and Native Word Tab Stops during DOCX export.
Common style classes:
input: Colors variable values (dark blue in DOCX).result: Bolds resulting values.tab-3: Initializes tab stops (e.g., Left at 3 inches, Right at 7.25 inches) for calc lines.
Example:
1[style: input tab-3]
2Rod Diameter: = 0.375 in
3Rod Yield Strength: Fy = 36 ksi
4[endstyle]Images and Diagrams
Images can be sized and floated using an extended markdown syntax.
Syntax: 
To float an image or adjust alignment, wrap it in a style block with specific anchor classes:
- Anchor Type:
anchor-inline,anchor-floating. - Layering:
layer-behind. - Wrapping:
wrap-square,wrap-tight,wrap-top-bottom,wrap-none. - Alignment:
align-left,align-center,align-right,align-top-right,align-bottom-left, etc. - Position:
pos-x-{number},pos-y-{number}(explicit pixel offsets).
Example:
1[style: anchor-floating align-right wrap-square]
2
3[endstyle]
