How do we modify themes (default light mode or no dark mode)?

26 views
Skip to first unread message

phario

unread,
Aug 19, 2025, 8:06:49 AMAug 19
to PreTeXt support
I am working with the most basic pretext document found via the quick start guide: https://pretextbook.org/doc/guide/html/tutorial-first-document.html

using a local installation and compiling via Visual Studio Code. 

I'm struggling to understand the documentation and how we're supposed to implement the options. In particular I want to turn off dark mode. There is documentation here: 


but I can't make heads or tails out of it. 

Where should I be setting "@provide-dark-mode = off"?

Thanks,
phario

Oscar Levin

unread,
Aug 19, 2025, 9:35:41 AMAug 19
to pretext...@googlegroups.com
Those publication options are implemented in the file "publication.ptx" inside the "publication" folder.  That file should have lots of commented lines with examples.

The guide uses the @ symbol to indicated attributes.  So if it says something like, set html/@example to "no", you would enter that as, <html example="no">.


--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/e2385585-63e9-4e46-a050-5f15ba591167n%40googlegroups.com.

phario

unread,
Aug 19, 2025, 11:01:39 AMAug 19
to PreTeXt support
Hello!

Thank you. I eventually understood. I hope this isn't taken as criticism, but I find the documentation extremely difficult to understand. Perhaps this is because it requires experience in XML? 

For people who want to know how I did it: 

The documentation section for dark mode is in section 

publication/html/css 

and references @theme

I had to do this: 

<html> 
...
 <css theme="denver" provide-dark-mode="no"/>
...
</html> 

Oscar Levin

unread,
Aug 22, 2025, 10:14:34 PM (14 days ago) Aug 22
to PreTeXt support
Glad you figured it out.  I agree that the documentation is tricky at first; I struggled with the @attribute thing for a bit.  But now it makes distinguishing attributes and elements of the xml much easier. 

By the way, just to clarify on thing, if you didn't set @provide-dark-mode="no", then there would be a toggle to switch between modes.  The toggle persists in local storage, and is initially set to match the user's browser preferences.  So if someone usually picks light mode and has that set up in their browser, it should default to light mode.

Reply all
Reply to author
Forward
0 new messages