# An open textbook — chapters drafted in the open and released under a Creative Commons licence

Recipe No. 17, Teaching and courses. From The know.sh Cookbook: https://know.sh/cookbook/open-textbook

- For: a community-college instructor writing an open textbook for introductory statistics
- You bring: your lecture notes, the public datasets you teach with, R scripts that run, and the openly licensed books you plan to adapt
- You get: eight chapters of an open statistics textbook, each on its own public link with its licence statement and every section sourced, ready for layout in Pressbooks
- Time: a term to draft, about a chapter a fortnight
- Keep it: private while you work; share one document by a read-only link

Students in an introductory statistics course often pay more for the textbook than they can easily afford, and many never buy it. Open textbooks answer that, and they are written the way courses are taught: a chapter at a time, tried on a class, rewritten the next term. The hard part is keeping the draft, the sources and the permissions straight while all three are still changing.

This recipe drafts *Counting on It: Introductory Statistics* in know.sh. Your assistant, whether Claude, ChatGPT or a local model, turns your lecture notes into a chapter: a research document whose overview carries the chapter's aims and its licence statement, with a finding per section. You write the explanations into shape in the editor, with sources on every section, tables, and R code in code blocks. A chapter goes out on its own public link as soon as it is good enough for students, and those links are the draft edition your class reads while you write the next one.

Two things stay outside. know.sh has no maths typesetting, so formulas are written in plain text or as code until layout. And the finished book is laid out in Pressbooks or a similar platform, which makes the editions students download and print.

## What you will use

- **Shelf**: One shelf for the book, *Counting on It*, whose notes record the licence decision and the house style.
- **Research document**: One document per chapter; the overview holds the chapter’s aims and its licence statement.
- **Finding**: One finding per section, with its source links, tables and R code blocks; exercises filed as a *Question*.
- **Your AI assistant**: Lays out each chapter from your notes, checks sources and attributions, finds openly licensed datasets on the web, and reads chapters back as Markdown for layout.
- **The editor**: Where the explanations become yours: tables, code blocks, formulas in plain text, attribution lines and the order of sections.
- **The A–Z index**: The book’s index of names, datasets and acronyms (*Gosset*, *ANOVA*), grown from section titles and their opening lines as you write.
- **Public link**: A public link per chapter that never expires, so students read the draft while you write on.

## Method

### 1. Choose the licence before the first chapter

Decide the book's licence before you adapt a word, because the licence of anything you adapt limits what yours can be. CC BY lets anyone reuse the book with credit and is the usual choice for open textbooks. Adapting material licensed CC BY-SA means the adapted work must be released under CC BY-SA too. Write the decision into the shelf's notes, with the date and your reasons.

Then write the licence statement that ends every chapter's overview: "*Counting on It: Introductory Statistics* by R. Delgado, Alder Valley Community College, is licensed under CC BY 4.0, except where otherwise noted." Each chapter has its own link, and a reader may arrive at any one of them without seeing the others.

### 2. Have your assistant lay out a chapter from your notes

Give your assistant your lecture notes and R scripts for one chapter, attached in Claude or ChatGPT or as files a local client can read. Ask it to create *Chapter 5 — Confidence intervals* on the *Counting on It* shelf: the chapter's aims and your licence statement in the overview, then one finding per section, with your worked examples, tables and code carried across as they are.

It arranges your material; it does not write the book. The explanations are yours to write and rewrite, and the assistant's draft is scaffolding. know.sh numbers findings by their order, so section 5.3 is simply the third finding of chapter 5; keep numbers out of section titles and they cannot fall out of step when you reorder.

### 3. Write it into shape in the editor

Press **Edit** and work through the chapter. Rewrite each explanation in your voice, drag sections into teaching order, and split any section too long to read on a phone. File each kind of section the same way throughout: explanations as *Observation*, worked examples as *Evidence*, common mistakes as *Problem*, exercises as *Question*, and say in the overview what each means.

Tables arrive as tables and code sits in fenced blocks, highlighted while you edit. Run every block in R yourself before it goes on a link; an assistant reading code is not a test of it. There is no maths typesetting, so write formulas in plain text or as code — `mean ± t* × s / sqrt(n)` — and define every symbol in the sentence that follows.

### 4. Give every section its sources

Every finding has a list of source links. Use it every time: the dataset's home page, the study a worked example came from, the open textbook a passage was adapted from. When a passage is adapted, also end the section with an attribution line naming the title, author, source and licence, and saying what you changed: "Adapted from *Statistics for Everyone*, chapter 6, by J. Ferris, CC BY 4.0; example data replaced."

Then ask your assistant to read the chapter and list every section without a source link, every passage that looks adapted but has no attribution line, and every symbol used before it is defined, as a finding called *Checks before release* rather than changes to the text.

### 5. Find data and material to adapt

For datasets or openly licensed chapters, ask your assistant to research the question on the web and file what it finds as a new document on the shelf, one finding per dataset, each with its source links. This needs an assistant that can search the web; Claude and ChatGPT can, and many local set-ups cannot.

Treat what comes back as leads. Open every source, read its licence on its own page, and check the data says what the summary claims before a student sees it.

### 6. Release each chapter on its own link

When a chapter is ready for students, press **Share**, leave it with no expiry (the default), and copy the link as soon as it appears; it is shown once. Leave out *Checks before release* from its own page. Set no password: an open textbook is meant to be open.

Ask your assistant for one more document, *Read me first*, with the book's description, the licence, a line saying the draft changes between terms, and room for the link to every released chapter, which you paste in. Share that one too and post it in your course shell. When you revise a chapter, its link shows the new version at once, and the chapter's revisions keep what last term's class read.

### 7. Move to Pressbooks for layout

When the draft settles, lay the book out in Pressbooks or a similar platform, which handles the web edition, the files students download and proper mathematical notation. Bring the text across a chapter at a time: ask your assistant to read the chapter back to you as Markdown in the chat, then paste it into the platform and check it against the original.

Keep know.sh as the working draft. Errata arrive by email from students and colleagues; file each in an *Errata* document, a *Bug* for a mistake and a *Suggestion* for an improvement, and fix the chapter and the layout together.

## Prompts to try

Your assistant, connected to know.sh (Claude, ChatGPT or a local model):

> Using know.sh, create a document called “Chapter 5 — Confidence intervals” on my Counting on It shelf from the lecture notes and R scripts I have attached. Put the chapter aims and this licence statement in the overview: [paste your statement]. Then add one finding per section in teaching order, keeping my worked examples, tables and code exactly as they are, with R code in fenced blocks. Do not write new explanations; mark any gap in my notes with “TO WRITE”.

Your assistant, connected to know.sh (Claude, ChatGPT or a local model):

> Using know.sh, read “Chapter 5 — Confidence intervals” on my Counting on It shelf. List every section with no source link, every passage that looks adapted but has no attribution line, and every symbol or term used before it is defined. File the list as a new finding in that document called “Checks before release” and change nothing else.

Your assistant, connected to know.sh (Claude, ChatGPT or a local model):

> Using know.sh, read “Chapter 5 — Confidence intervals” on my Counting on It shelf and give it back to me here as Markdown, section by section, keeping the tables, the R code blocks and the formulas exactly as written. Do not rewrite or summarise anything; I am pasting it into Pressbooks.

## Variations

- Adapting an existing open textbook rather than writing your own? Have your assistant make one document per adapted chapter, starting each section with what you changed; the attribution lines then write themselves.
- Keep a *Style sheet* document on the shelf — notation, rounding, how datasets are cited, whether "data" is plural — and ask your assistant to check each new chapter against it.
- Teach from the draft: the [syllabus and course book](/cookbook/syllabus) recipe can link each week to the chapter students read that week.
- Writing a book of worked R examples for a methods course? The [technical book](/cookbook/technical-book) recipe keeps code notes in step with the software.

## Where it falls short

- There is no maths typesetting, no LaTeX and no equation editor. Formulas stay in plain text or code until layout.
- There is no export. Layout happens in Pressbooks or a similar platform, and the text gets there by copying a chapter or asking your assistant to read it back as Markdown.
- Figures and charts cannot be added; there is no image upload. Keep the R code that draws each figure in its section and make the figures at layout.
- Readers cannot comment or suggest changes on a link, so errata reach you by email and you file them.
- Web research needs an assistant with web search. Smaller local models call tools less reliably, so check what they file; Revisions shows every change.

## A note on licences, adapted material and data

Creative Commons licences are not all compatible. Material under CC BY can go into a CC BY or a CC BY-SA book, with attribution. Material under CC BY-SA can be adapted only if the adaptation is released under CC BY-SA. Material marked NonCommercial (NC) cannot go into a CC BY book, and material marked NoDerivatives (ND) cannot be adapted at all. Read the licence on the source's own page, record it on the finding, and attribute every adaptation with its title, author, source and licence, and what you changed. Your college's OER librarian can help with the hard cases.

The book's explanations are your work; use the assistant to arrange, check and find, and follow your college's policy on AI in published teaching materials. Datasets carry licences and terms too: use public data you are allowed to redistribute, never data about your own students. Assistants make mistakes, so check every source, every number and every line of R code by running it.

Indexed under: Open textbooks, Creative Commons, Attribution, Licence compatibility, R code, Formulas, Pressbooks.
