Recipe Scaling & Cooking

Scale recipes with fractions, measurement conventions, and the scale directive.

New to CalcMark measurements? Start with Understanding Measurements for a progressive walkthrough of quantities, unit conversions, fractions, and napkin math.

A recipe is a CalcMark document waiting to happen — quantities with units, scaling by servings, cost per portion. CalcMark handles fractions (2/3 cup), measurement conventions (US vs Imperial), and document-wide scaling with a single frontmatter directive.

Try it now: Open the Recipe Scaling example in Lark or run cm remote recipe-scaling in the editor.


Key Features for This Domain #

FeatureWhat It DoesReference
Fractions (2/3 cup, 1/4 tsp)Exact rational numbers with unitsLanguage Reference
scale directiveMultiply all quantities by a factor: scale: 3 triples everythingFrontmatter
measurement: conventionsvolume: imperial makes 1 cup = 284 mL (UK) instead of 240 mL (US)Units
Inline qualifiers (imp pt, us cup)Override the document convention for a single lineUnits
convert_to: siConvert all quantities to metric in outputFrontmatter
@scale referenceUse the scale factor in expressions: per_loaf = total / @scaleFrontmatter

Walkthrough: Scaling a UK Scone Recipe #

Step 1: Base Recipe with Imperial Measurements #

Declare the document uses Imperial volume (UK cups, pints, fluid ounces):

---
measurement:
  volume: imperial
scale:
  factor: 2
  unit_categories: [Mass, Volume]
---

# Scones (makes 8)

flour = 8 oz
butter = 2 oz
sugar = 1 oz
milk = 5 fl oz
Results
flour = 8 oz1 lb
butter = 2 oz4 oz
sugar = 1 oz2 oz
milk = 5 fl oz10 imperial fluid ounce

With volume: imperial, the 5 fl oz of milk is 142 mL (Imperial fluid ounce), not 148 mL (US). The scale: 2 doubles all Mass and Volume quantities — flour displays as 16 oz, milk as 10 fl oz.

Step 2: Cost Per Batch #

Currency is not in unit_categories, so prices stay at single-batch values:

flour_cost = $2.50
butter_cost = $1.80
sugar_cost = $0.40
milk_cost = $0.60
total_cost = sum of flour_cost, butter_cost, sugar_cost, milk_cost
per_scone = total_cost / (8 * @scale)
Results
flour_cost = $2.50$2.50
butter_cost = $1.80$1.80
sugar_cost = $0.40$0.40
milk_cost = $0.60$0.60
total_cost = sum of flour_cost, butter_cost, sugar_cost, milk_cost$5.30
per_scone = total_cost / (8 * @scale)$0.33

per_scone divides by 8 * @scale (16 scones for a doubled batch). The @scale reference reads the factor from frontmatter.

Step 3: Metric Conversion #

Add convert_to: si to see everything in metric:

---
measurement:
  volume: imperial
scale:
  factor: 2
  unit_categories: [Mass, Volume]
convert_to: si
---

Now flour displays as 454 g (16 oz → SI), milk as 284 ml (10 imp fl oz → SI). The three directives compose: measurement resolves unit identity → scale multiplies → convert_to changes the output system.


US vs Imperial: What Changes? #

The measurement: directive affects how bare unit names are interpreted:

UnitUS (default)Imperial
1 cup240 mL284 mL
1 pint473 mL568 mL
1 fl oz29.6 mL28.4 mL
1 gallon3.785 L4.546 L

Use inline qualifiers when a recipe mixes conventions:

us_butter = 1 us cup       → always 240 mL
uk_cream = 1 imp pt        → always 568 mL