Introduction
An .nb file is a notebook from Wolfram Research’s
Mathematica, which has
used notebooks since its first version in 1988. A notebook holds text, Wolfram Language input,
the output it produced, such as formulas and graphics, and interactive controls, all
as cells in one document. The same files are used by the other Wolfram desktop
products and the Wolfram Cloud.
Structure
A notebook is a plain text file, readable in any text editor, holding a single
Wolfram Language expression. It starts with comments giving the content type
application/vnd.wolfram.mathematica and the program that wrote it, and
cache information that lets Mathematica open large files quickly. Then comes
Notebook[{…}], a list of Cell expressions, each with its
content and a style such as "Title", "Text",
"Input" or "Output". Cells can be grouped into sections, and
graphics are stored as expressions too, or as compressed data.
Notebook[{
Cell["Squares", "Title"],
Cell[BoxData[RowBox[{"Table", "[", RowBox[{RowBox[{"n", "^", "2"}], ",", RowBox[{"{", RowBox[{"n", ",", "5"}], "}"}]}], "]"}]], "Input"],
Cell[BoxData[RowBox[{"{", RowBox[{"1", ",", "4", ",", "9", ",", "16", ",", "25"}], "}"}]], "Output"]
}]
Links
Software
- Mathematica (Windows, macOS, Linux)
- Wolfram Player, a free reader (Windows, macOS, Linux)
- Wolfram Cloud (web)
Reference
- Notebook, Wolfram Language documentation