Someone with lua knowledge could probably write the script, but so far they haven't.
So basically, we need a scholar to bring some lua knowledge here, so that someone makes a breakthrough and writes a script, that will produce knowledge about dwarves writing books.
I'm not sure how difficult the programming would be, but the design seems like the bigger challenge. There are around 300 topics. Let's say that a big library has 100 scholars. That's 30,000 bits to represent somehow, plus the knowledge that's in the books.
The librarian script's science page is a good starting point. It shows a symbol for each topic that's green if you have a book for that topic in your library, and red if you don't. Then it has a detail screen for each topic showing which books cover that topic, divided into books in your library and books outside your library. Combined with Legends Viewer, it's a great place to start a campaign of wholesale book theft.
Here's an idea on how to improve the science page:
A green number would mean that there's at least one book in the library on that topic, and that's the number of scholars in your library who know about it. To keep the single-digit format, any value over nine would be shown as a nine.
A yellow number would indicate that there aren't any books in the library about the topic, but that's the number of scholars in your library who know about it.
A blue exclamation mark would mean that there's at least one book in your library on the topic, but none of your scholars have learned it yet.
A bright red @ symbol would indicate that you have no books on that topic and none of your scholars know about it, but books on the topic exist somewhere in the world.
A dark red question mark would indicate that your scholars know nothing about the topic and there are no books anywhere in the world about it.
That screen would also be simpler if the user could navigate a cursor around the topic grid directly, which would free up the lower left area for a list of creatures in the fort who know about that topic. (I say "creatures" rather than "scholars" because we will also want to see the knowledge of visitors and non-scholars.)
Selecting a creature's name would pull up that individual's topic detail screen. Similar to the fortress-wide topic screen, a green symbol would mean that the creature knows about the topic, and there's a local book on it. A yellow symbol would mean knowledge with no local book, so you hope that the creature starts writing. A blue symbol would mean that the creature doesn't know about the topic but some book or scholar in the fort does, so you hope that the creature learns the topic. And a red symbol would mean that no creatures or books in the fort know about the topic. The individual detail screen would also show which topic they're working on, if any, and where they stand on breakthrough credits. I still don't understand breakthrough credits.
The big dream for a scholar script would be tracking scholar-related events. Part of why libraries are currently so boring is that there's no access to the underlying story. It's clear that something interesting is happening. Fikod reads a book and gains knowledge. Dastot becomes an apprentice of Urist. Ablel writes a book. Mebzuth attempts a breakthrough and fails. Lolor gains skill experience during a discussion. So the ideal scholar script would run in the background and compile a list of these types of events. After I steal or buy a book on a new topic, I would love to read the log of my scholars reading the book and acquiring the knowledge.
Tracking events like that may be impossible right now. The events may not even exist yet, and Toady will need to create them. But I think that it would help Toady, when he gets around to it, to develop a clear concept of how a scholar-and-book system ought to work.