Subject: mailing-list for TeXmacs Users
List archive
[texmacs-users] Altering the TOC architecture to create a list of doubts
- From: Paul Jacob Koshy <address@concealed>
- To: address@concealed
- Subject: [texmacs-users] Altering the TOC architecture to create a list of doubts
- Date: Sat, 4 Apr 2026 14:48:45 +0200
TeXmacs coders,
I have been facing a rather serious custom TeXmacs problem, as outlined below.
Please do help me out. And if you can contact other TeXmacs devlopers on this,
it would be very helpful.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hardware and software specs: Windows 11 OS, TeXmacs version 2.1.4.
Goal: Replication of the Table of Contents architecture to create a similar
List of Doubts object.
Codes
File and Location: Physics.ts style package file, stored in AppData/Roaming/
TeXmacs/packages, generates these tags.
<TeXmacs|2.1.4>
<style|source>
<\body>
<src-title|MASTER PHYSICS PACKAGE>
<src-comment|Standard Dependencies>
<use-package|std-math-layout|amsmath|std-title|std-toc|std-index>
<src-comment|Doubt Database Core>
<assign|doubt-prefix|doubt>
<src-comment|Render Logic: Keep this purely visual for speed>
<assign|doubt-dots|<macro|<datoms|<macro|x|<repeat|<arg|x>|<with|font-
series|medium|font-size|1|<space|0.2fn>.<space|0.2fn>>>>|<htab|5mm>>>>
<assign|doubt-tag|<macro|name|page|<vspace*|1fn><with|font-series|bold|
font-size|1.19|<arg|name>><doubt-dots><no-break><arg|page><vspace|0.5fn>>>
<src-comment|Entry Logic: High-speed tree writing>
<assign|doubt|<macro|what|
<render-doubt|<arg|what>>
<auto-label>
<write|<value|doubt-prefix>|<compound|doubt-tag|<arg|what>|<the-auto>>>
>>
<assign|render-doubt|<macro|body|<with|color|dark green|font-shape|
italic|[Doubt: <arg|body>]>>>
<src-comment|List Generation: Efficient Hooking>
<assign|list-of-doubts-title|<macro|<localize|List of doubts>>>
<assign|insert-list-of-doubts-list|<macro|
<assign|doubt-next-prefix|doubt>
<assign|doubt-next-list-title|<value|list-of-doubts-title>>
<extern|insert-list-of-doubts>
>>
<src-comment|The "Structured List" Renderer>
<assign|render-list-of-doubts|<macro|body|
<section*|<value|list-of-doubts-title>>
<arg|body>
>>
<initial|<\collection>
<associate|preamble|true>
</collection>>
</body>
File and location: init-physics.scm file, AppData/Roaming/TeXmacs/progs, that
creates the list of the doubts.
`(texmacs-module (init-physics)
(:use (generic generic-menu)))
;; 1. Manually force-load the database primitives if they are missing
(if (not (defined? 'drd-ref))
(lazy-module-force (database drd-database)))
;; 2. Now register the collection safely
(if (not (drd-ref "doubt"))
(drd-add-collection "doubt"))
;; 3. Define the insertion function
(tm-define (insert-list-of-doubts)
(:secure #t)
(exec-delayed (insert-structured-list "List of doubts" "doubt")))`
And this is the **my-init-texmacs.scm** file, stored in the same AppData/
Roaming/TeXmacs/progs, that is supposed to activate when TeXMacs runs.
`(load-module (init-physics))`
The problem is that while the Physics.ts. file seems to be working well, the
reader part of this construct (the .scm files) don't. Whether I run tests in
Scheme->Sessions like (use-modules(....)), (primitive-load "...<path to> init-
physics.scm"), or every trick in the book, or whether I try use this package
directly on TeXmacs, it always fails, leaving me with undefined variables, or
wrongly formatted answers. I do not publish the results because I think they
are too long this forum.
Would you be able to run this code and tell me what's wrong, or suggest a new
code, or let me know if somebody has already solved a problem clearly
analogous to this, or if it can't be done.
I credit Google Gemini for helping me refine the code so far, as compared to
my initial follies, but in the end it confessed it had reached the end of its
knowledge on this niche matter.
Kindly do reply as soon as possible.
Thanks,
Paul
- [texmacs-users] Altering the TOC architecture to create a list of doubts, Paul Jacob Koshy, 04/04/2026
Archive powered by MHonArc 2.6.24.