Math Text Box
Do calculations in a text box: define values, use units, read your measurements by name, and have the results written into the box so any PDF reader shows them.
A math text box is a text box whose lines can be calculations. Type a line such as “M := w*L^2/8 =” and DraftPDF writes the answer after the equals sign. The results become part of the page, so anyone who opens the PDF in another reader sees them. Only math text boxes are calculated. Ordinary text boxes are never changed.
Create a math text box
- Choose Math text box (the box with a Σ) from the Annotate toolbar, next to Text box.
- Drag a box on the page and type your lines. Press Enter between lines.
- Click outside the box. Results appear in blue after the equals sign.
Turn an existing text box into a math text box
- Select the text box.
- In the properties panel, under Text format, click the Σ button.
- Click it again to turn calculation off. The text stays as it is.
Writing calculations
- Define a value with := (for example “L := 20 ft” or “w := 2.5 kip/ft”). A definition shows no result.
- Ask for a result by ending a line with = (for example “M := w*L^2/8 =” shows “125 kip ft”, or just “w*L =”).
- Write ^ for powers and _ for subscripts, such as “L^2” and “A_1”. After you click away they are shown raised and lowered. You can also type raised or lowered text with the x² and x₂ buttons; it is read the same way.
- Add “to” and a unit to choose how a result is shown (for example “M to kN*m =”).
- A line with no = or := is plain text and is never touched. Text after a plain = that starts with a letter is also left alone.
Units
Values can carry units: ft, in, m, mm, kip, lbf, psf, ksi, kN and many more. Area and volume shorthand works too: sf, cf, cy, ft2, in3, m2 and so on. Results are shown in your preferred units (File > Preferences > Math notes), for example kip and ft, kip and in, or SI. A “to” unit on the line always wins. Stresses and pressures use ksf in the kip and ft setting, so add “to ksi” when you want ksi.
Using your measurements
A math text box can read the distance, perimeter and area markups on the same page by name. Each new measurement is named for you: distances L1, L2 and so on, perimeters P1, P2, and areas A1, A2. Rename one by editing its Subject in the properties panel. A name that is a plain word, such as L1 or Roof, can be used directly: “L1 + L2 =” or “Roof - Hall =”.
Other ways to read a measurement
- “len("Beam 1") =”, “perimeter("Gutter") =” and “area("Room A") =” find a measurement by its name, which can have spaces.
- A * or ? in the name matches several: “sum(area("Room *")) =” adds every area whose name starts with Room. Also try mean, min, max and count.
- “lengths()”, “areas()” and “perimeters()” stand for every measurement of that kind on the page, so “sum(areas()) =” is the total area.
When calculations run
A page is calculated when you select or deselect a math text box, when you finish typing in one, and when a measurement on that page changes. It is never calculated just because a file was opened. Boxes are read from the top of the page to the bottom, and left to right, so define a value above or to the left of where you use it. Each page is separate: a value defined on one page is not available on another.
Errors
If a line cannot be calculated, the reason appears after the equals sign in orange, for example “Undefined symbol x” or “Units do not match”. Fix the line and click away to calculate again.