Modifying the HTML header

23 views
Skip to first unread message

phario

unread,
Aug 27, 2025, 5:32:13 AM (10 days ago) Aug 27
to PreTeXt support
Hi, 

I am still coming to grips with pretext, but want to understand how modifications to the HTML output can be done. Currently, I am using the denver theme. So inside 

publication/publication.ptx 

I have the following line:

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

I want to basically remove the authors from the HTML header. So it is pulling the personname info from the frontmatter.ptx file (I think) and including it in the header.

Can you explain some easy ways how this can be done?

Thanks!


Oscar Levin

unread,
Aug 27, 2025, 12:02:59 PM (9 days ago) Aug 27
to pretext...@googlegroups.com
Can you say a little about why you want to do this?  The PreTeXt philosophy is to protect you from needing to make these nitty-gritty decisions as an author.  Deciding things about the details of page layout is really a decision for the "publisher" of your content (even if that is you, just wearing a different hat).  

That said, if you are looking to have something more like what you would get from a published paper, the "boulder" theme does not give a page header like the other themes do.  It is intended to be a single page with title and authors as the first thing at the top of the paper.  So you might try that (replace "denver" with "boulder" in the snippet you gave).

--
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/ba3562a2-9afe-4fa0-ab42-a0aaba64a059n%40googlegroups.com.

Andrew Scholer

unread,
Aug 27, 2025, 12:09:14 PM (9 days ago) Aug 27
to pretext...@googlegroups.com
Might this be a good publisher variable switch?

I can see a desire to disable the byline in the banner in a few cases:
  • There are a long list of authors/editors
  • Your book/article is more of a collection of content than a formal work
Similarly, I can see a desire to have a subtitle but not render it in the banner.

Both would of course still be visible in the "About this Book".

Andrew Scholer (he/him/his)
Computer Science Instructor
Chemeketa Community College


phario

unread,
Aug 27, 2025, 12:13:36 PM (9 days ago) Aug 27
to PreTeXt support
Can you say a little about why you want to do this?  The PreTeXt philosophy is to protect you from needing to make these nitty-gritty decisions as an author.  Deciding things about the details of page layout is really a decision for the "publisher" of your content (even if that is you, just wearing a different hat).  

Uh...I'd like to do it because I want it to look that way!

I remember first learning about LaTeX some 20 years back, and the standard response to any question might be "the point of latex is not to change defaults". Which is...silly. Everything in latex has been hacked, if not via a package (say for altering headers, page layouts, document layouts, fonts, etc.) or via hacks. 

I'm not fan of changing to a completely different theme to just change a few elements of a header. It would be better if I can learn a bit more about what's happening under the hood and how it can be modified.

WIth the above in mind, are there alternatives like: 
  • Duplicate the style layout and CSS, make my own theme, and then find the item that deals with the header?
  • Is there an alternative that involves injecting some hack into the webpage?  
Thanks!

Oscar Levin

unread,
Aug 27, 2025, 12:44:37 PM (9 days ago) Aug 27
to pretext...@googlegroups.com
It is possible to create a custom theme, although this is not encouraged for "authors" to do.  We really do think that LaTeX's ability to customize everything (despite their claims that you shouldn't mess with defaults) was a mistake.  Separating authoring from presentation really is an important feature and one about which PreTeXt is trying to avoid falling victim to the same mistakes made by LaTeX.

 The best way to get a custom theme started is to start here: Paragraph.  It is also possible to load an extra CSS file to override a few defaults.  I've done this for my book.  See https://github.com/oscarlevin/discrete-book/blob/7b77032ca2e48e0c110d0fe44c2269d9f61030e2/project.ptx#L12 and then https://github.com/oscarlevin/discrete-book/blob/main/assets/custom-styles.css.  Note that custom-styles is in my "assets" folder, but in the project.ptx, it looks for it in "external".

Rob Beezer

unread,
Aug 29, 2025, 11:16:30 AM (7 days ago) Aug 29
to pretext...@googlegroups.com
> Everything in latex has been hacked, if not via a package (say for altering
headers, page layouts, document layouts, fonts, etc.) or via hacks.

And many of those hacks are to correct deficiencies in LaTeX, or modernize the
output format, or do things that are contrary to accepted practices in
publishing or book design.

We want to make you modern output (good-looking and useful HTML), novel output
formats (braille), while avoiding all the mistakes of LaTeX, one of which is
unlimited extensibility. You do what you do best, write content about topics
for which you are knowledgeable, and you never have to wish you knew how to hack
the output. That's our audience and the people we are helping.

Rob

On 8/27/25 09:13, phario wrote:
> Can you say a little about why you want to do this?  The PreTeXt philosophy is
> to protect you from needing to make these nitty-gritty decisions as an author.
> Deciding things about the details of page layout is really a decision for the
> "publisher" of your content (even if that is you, just wearing a different hat).
>
> Uh...I'd like to do it because I want it to look that way!
>
> I remember first learning about LaTeX some 20 years back, and the standard
> response to any question might be "the point of latex is not to change
> defaults". Which is...silly. Everything in latex has been hacked, if not via a
> package (say for altering headers, page layouts, document layouts, fonts, etc.)
> or via hacks.
>
> I'm not fan of changing to a completely different theme to just change a few
> elements of a header. It would be better if I can learn a bit more about what's
> happening under the hood and how it can be modified.
>
> WIth the above in mind, are there alternatives like:
>
> * Duplicate the style layout and CSS, make my own theme, and then find the
> item that deals with the header?
> * Is there an alternative that involves injecting some hack into the webpage?
> <https://groups.google.com/d/msgid/pretext-support/ba3562a2-9afe-4fa0-
> ab42-a0aaba64a059n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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 <mailto:pretext-
> support+u...@googlegroups.com>.
> a04042c3-0776-494e-9df7-bebfae27976dn%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-support/a04042c3-0776-494e-9df7-
> bebfae27976dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages