Suppressing print preview in web

19 views
Skip to first unread message

Federico Galetto

unread,
Aug 17, 2026, 12:03:13 PM (2 days ago) Aug 17
to PreTeXt support
Hello!

I plan to distribute my notes as a web page and as a PDF, but I would like to retain some control on how the notes look in print. I am finding it hard to produce a PDF that looks good while simultaneously making the print previews look good. So:

Is there a way to remove the print preview icon from the web publication target?

Thanks,
Fred

Federico Galetto

unread,
Aug 17, 2026, 1:42:58 PM (2 days ago) Aug 17
to PreTeXt support
AI actually came through on this one!

In your project create a folder called 'xsl', then place the file attached to this message in it. This file takes the portion of the code from 'pretext-html.xsl' that displays worksheets, handouts, and other divisions (?), and removes the lines that create the print preview button with the printer icon in the header. Then, go to your 'project.ptx' file and modify your web target to load the extra style; if you have a standard book project like me, you would replace the line:

<target name="web" format="html" deploy-dir="web"/>

with

<target name="web" format="html" deploy-dir="web" xsl="no-html-print-preview.xsl"/>


Cheers!
no-html-print-preview.xsl

Rob Beezer

unread,
Aug 17, 2026, 3:01:23 PM (2 days ago) Aug 17
to pretext...@googlegroups.com
On 8/17/26 10:42, Federico Galetto wrote:
> AI actually came through on this one!

Sure. And when we change the "heading-content" template, do you think you will
notice? Will you get those changes? Will you file a bug report as a
consequence? ;-)

Rob

Federico Galetto

unread,
Aug 17, 2026, 3:51:44 PM (2 days ago) Aug 17
to PreTeXt support
Admittedly not ideal, but it will have to do for now.

A supported way to enable/disable the print preview icon would be great. How would I go about submitting a feature request?

Thanks,
Fred

Oscar Levin

unread,
Aug 17, 2026, 6:33:32 PM (2 days ago) Aug 17
to pretext...@googlegroups.com
It looks like you found a workable hack to get what you want.  But I'd love to hear about what issues you are having getting the html version of the printouts looking the way you want.  We have some way to go to get the PDF and html versions of these in line, but hearing what isn't working would be very helpful to get that ball rolling.

--
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/383d9dda-ad63-4c95-9475-7205f51ab98cn%40googlegroups.com.

Federico Galetto

unread,
Aug 18, 2026, 12:28:17 PM (22 hours ago) Aug 18
to PreTeXt support
Hi Oscar!

I will try to lay out where this is all coming from.
  • I am converting old LaTeX notes where I have examples / theorems followed by empty space so that I can work out solutions / proofs in class on my tablet (and students can take their own notes on paper).
  • After a few iterations, I settled on https://groups.google.com/g/pretext-support/c/ksnXZktLjBg/m/00QIrOl1AAAJ which is simple and allows me to treat the two cases uniformly.
  • I have a target that creates a PDF with empty space in place of solutions / proofs. Empty space is produced by the 'workspace' attribute, which only works with certain divisions (I chose handout for some reason) and causes the print preview icon to appear.
  • I fine tune the empty space so that it looks good in the PDF. However, it does not always look good when each handout is printed out via the preview. This is, of course, subjective; for example, I do not like when the text of a problem or the empty space designated for a problem breaks across pages. This is compounded by the fact that my web version includes solutions, so one can enable those and everything moves around in the preview.
I tried using the <page> tag, but again hiding / revealing solutions causes things to move around (often beyond the bottom of the page). I could try to write two drastically different versions (using the versions feature) but that feels like a lot of work since my whole set of notes is a collection of handouts and nothing else.

Ultimately, the problem I have with the print preview is that if I want thinks to look good (to me), I am forced to curate two targets into one (web + handouts), so I would like the ability to distribute web only. 

Let me end this by saying that I am new to PreTeXt. I started converting my notes in the Spring having attended one of your excellent workshops (and some office hours). This was prompted mainly by the desire (and need) to offer my notes in a more accessible format. I am learning as I go and certainly making some mistakes along the way. Perhaps if I was writing something from scratch instead of converting existing material that uses a different model, I could more easily align it with the PreTeXt defaults. This is worsened by the imminent start of the semester, hence my many posts aimed at trying to fix all remaining "issues" before I can share my notes in class; sorry about that!

Many thanks!
Fred

Reply all
Reply to author
Forward
0 new messages