# Calorie Math Quick nutrition math inside Sublime Text, from the command palette. Useful if you write meal plans, recipes, food blogs or nutrition notes in Sublime and want numbers without leaving the editor. All commands work offline. Nothing is saved or sent anywhere. ## Commands Open the command palette (`Ctrl+Shift+P`, or `Cmd+Shift+P` on macOS) and type **Calorie Math**. ### Calorie Math: Daily Calories (TDEE) Estimates how many calories you burn per day. 1. Type your stats in the input panel at the bottom, separated by spaces: `weight_kg height_cm age sex`, for example `70 170 30 female`. 2. Pick an activity level from the list: | Level | Multiplier | |---|---| | sedentary | 1.2 | | light | 1.375 | | moderate | 1.55 | | very active | 1.725 | | extra active | 1.9 | 3. A dialog shows: ``` BMR 1452 kcal/day TDEE 2250 kcal/day (moderate) gentle loss 1750 kcal/day protein RDA 56 g/day ``` - **BMR**: Mifflin-St Jeor equation. - **TDEE**: BMR × activity multiplier. - **Gentle loss**: TDEE − 500, never below 1200 (female) or 1500 (male). - **Protein RDA**: 0.8 g per kg of body weight. ### Calorie Math: Calories From Macros Turns grams of protein, carbs and fat into calories and a percentage split. Type `protein_g carbs_g fat_g`, for example `30 50 15`. The status bar shows: `Calorie Math: 455 kcal (protein 26%, carbs 44%, fat 30%)`. Uses 4 kcal/g for protein and carbs, 9 kcal/g for fat. ### Calorie Math: Insert Nutrition Facts Table Inserts a blank Markdown Nutrition Facts table at each cursor, ready to fill in: ```markdown | Nutrition Facts | per serving | % DV | |---|---:|---:| | Calories | | | | Total Fat | g | | | Sodium | mg | | | Total Carbohydrate | g | | | Dietary Fiber | g | | | Total Sugars | g | | | Protein | g | | ``` ## Install Package Control: **Install Package** → **CalorieMath**. Requires Sublime Text 4. No settings and no default key bindings. To bind a key, add to your key bindings file, for example: ```json { "keys": ["ctrl+alt+m"], "command": "calorie_math_macros" } ``` Command names: `calorie_math_tdee`, `calorie_math_macros`, `calorie_math_insert_label`. ## Notes Estimates for general wellness, not medical advice. Same formulas as the web calculator, with sources: https://snowbelly.app/tools/calorie-calculator/ MIT License.