Title page elements

25 views
Skip to first unread message

phario

unread,
Sep 1, 2025, 4:18:39 AM (5 days ago) Sep 1
to PreTeXt support
Hi,

I am trying to do the following things on the title page: insert a <p> ... </p> environment and insert an image. I'm confused how this is done. 

In the documentation Sec 4.25, it says that it's possible to include <paragraph> and <image> but both of these in <bibinfo> don't do anything (code attached at end).

Thanks!
phario

<bibinfo>
<author> ...
</author>
<date>
<today />
</date>

<paragraphs>
<title>Boo hoo</title>
<p>
Moo
</p>
</paragraphs>

<image source="test.jpg">
<shortdescription>(for accessibility)</shortdescription>
</image>

</bibinfo>

Oscar Levin

unread,
Sep 1, 2025, 9:37:55 AM (4 days ago) Sep 1
to pretext...@googlegroups.com
Currently this is not possible on a titlepage, although those elements can go in a preface in the front matter.  I've been working on improving the title page a bit though, so perhaps this could be implemented.  Can you share what you are trying to get the title page to look like, perhaps with a screen shot?

There is a way to add a front cover to a book, which will use appear in the PDF, by including a full page image.  What exactly goes on the title page is still a work in progress.

--
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/53a0347a-9265-44c5-b944-87e6a5f05fc3n%40googlegroups.com.

Rob Beezer

unread,
Sep 1, 2025, 10:41:50 AM (4 days ago) Sep 1
to pretext...@googlegroups.com
> In the documentation Sec 4.25

The documentation is not correct on this point. The general instructions in the
introduction apply to all the 4.25.x subsections, *except* the one about the
#titlepage (and maybe the #dedication is a bit different).

A *single* image as part of a title page has been a frequent request, which I
think Oscar is likely already aware of.

Sorry for the confusion on this one.

Rob

On 9/1/25 01:18, phario wrote:
> Hi,
>
> I am trying to do the following things on the title page: insert a <p> ... </p>
> environment and insert an image. I'm confused how this is done.
>
> In the documentation <https://pretextbook.org/doc/guide/html/topic-front-
> matter.html#topic-front-matter-2-1> Sec 4.25, it says that it's possible to
> include <paragraph> and <image> but both of these in <bibinfo> don't do anything
> (code attached at end).
>
> Thanks!
> phario
>
> <bibinfo>
> <author> ...
> </author>
> <date>
> <today/>
> </date>
>
> <paragraphs>
> <title>Boo hoo</title>
> <p>
> Moo
> </p>
> </paragraphs>
>
> <imagesource="test.jpg">
> <shortdescription>(for accessibility)</shortdescription>
> </image>
>
> </bibinfo>
>
> --
> 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>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-
> support/53a0347a-9265-44c5-b944-87e6a5f05fc3n%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-support/53a0347a-9265-44c5-
> b944-87e6a5f05fc3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Rob Beezer

unread,
Sep 1, 2025, 12:21:17 PM (4 days ago) Sep 1
to pretext...@googlegroups.com
I have updated the documentation, to catch up with the current state of the
front matter:

Section 4.25: Front Matter
https://pretextbook.org/doc/guide/html/topic-front-matter.html

phario

unread,
Sep 3, 2025, 11:29:53 AM (2 days ago) Sep 3
to PreTeXt support
It would be useful to have more flexibility. For example, with LaTeX, you can include the same macros analogous to pretext to generate the \maketitle. But a title page is nothing more than a page. So one can simply do an empty \pagestyle and literally put text down. 

In my opinion, you need an override that allows greater flexibility. For example, 

> Can you share what you are trying to get the title page to look like, perhaps with a screen shot?

I think a basic format would be: 

TITLE
Subtitle

IMAGE

Footer

I am finding pretext really good for 90% of the things we need, but the other 10% is so closed off.

At the moment, one hack I'm considering is a makefile that would literally replace frontmatter.html after building with the necessary mods. I think all you would need to do is find the element with span class="title" and insert the necessary <p> and <img> commands after it. 

Best,
phario

Oscar Levin

unread,
Sep 3, 2025, 12:02:19 PM (2 days ago) Sep 3
to pretext...@googlegroups.com
I agree that the titlepage element needs more attention, both from the standpoint of how it is presented in the HTML version and what can be included in it.  The reason I asked about what purpose those serve is not to suggest that they are not needed, but rather to start thinking about how to implement them.

A core and absolutely fundamental principle of PreTeXt is that you describe the semantic structure of your document.  This is crucial to be able to convert to multiple output formats and for accessibility (which intersect in things like the braille output format).  Is the image on a titlepage decorative?  That will change how it gets marked up in the HTML for accessibility.  Is it a publisher's logo?  Is the additional text below the image publisher/printer information?  An abstract?  We do have support for keywords and support statements already, for example.

Perhaps a good place to start would be to look at what the Chicago Manual of Style says about title pages (this is more a note for myself as I think about implementing this).  Also, this discussion is quickly getting into development, so it might be better to continue the discussion on the pretext-dev group.

David W. Farmer

unread,
Sep 3, 2025, 12:50:52 PM (2 days ago) Sep 3
to pretext...@googlegroups.com

Oscar explained how the PreTeXt Principles have to be followed as we
discuss options for the title page.

But let make the same point by directly pushing back against
one particular comment:

"need an override that allows greater flexibility"

That is not the PreTeXt way of thinking. Avoiding such
flexibility is why PreTeXt has been able to keep its promise
to output a variety of formats, all from the same source.
That is also why PreTeXt does so much better than everything else
on accessibility.

Those features are not subject to compromise, which is why we are
so particular about following the Principles.

As often happens, and I believe the Title page discussion is an
example, a use case arises which has not been adequately addressed
by the developers. The solution is not to implement what that one
particular author or publishers thinks they want, but rather the
solution will present itself in a natural way, once enough people
start examining this and other related situations, and understand
the more general context in which this issue occurs.

This is much slower than the LaTeX way of figuring out how to hack
what you want, but this way pays dividends in the long run.

Regards,

David
> https://groups.google.com/d/msgid/pretext-support/CAOU9BaVu_EV-3zBVnJZgpOQAbef%2BHXkdea5NgaBvL%2BbjEx%3DNOA%40mail.gmail.com.
>
>

phario

unread,
Sep 3, 2025, 2:31:14 PM (2 days ago) Sep 3
to PreTeXt support
Hi,

Ah, many thanks. I'm starting to understand. Thanks for explaining the situation.

I did try and go into the source xsl files to see how things are generated. The backend is very rigid. Although there are template functionalities stated in the documentation, I'm not sure how many people have tried to roll their own templates. I think that others have asked about this two years ago: https://groups.google.com/g/pretext-support/c/0QdBhe-idJA but it was agreed that there would never be such functionality. 

At this stage, I would probably agree that the easiest way to deal with this is to write your own makefile that performs the necessary changes to the HTML, LaTeX, or other files as a post-processing step. In this case, it is a trivial change: 

#!/bin/bash
# Usage: ./insert_html.sh input.html output.html
INPUT_FILE="$1"
OUTPUT_FILE="$2"
# Custom HTML to insert
CUSTOM_HTML='<p>Hello world.</p>'
# Use sed to insert after matching <div class="date">...</div>
sed "/<div class=\"date\">.*<\/div>/a $CUSTOM_HTML" "$INPUT_FILE" > "$OUTPUT_FILE"

I'll try and revisit Quarto or other Pandoc-like systems to compare. For Quarto for example, the titlepage is a simple Markdown file. You can insert an image, a header, text, etc. There is no problem with accessibility, and it is converted just fine into many other formats. The challenge with Quarto is the speed of compilation, which is why I was investigating pretext.

Thanks again for the careful consideration. 
Reply all
Reply to author
Forward
0 new messages