* [NTG-context] Background colour in PDF with export activated
@ 2024-11-20 16:26 Florent Michel
2024-11-20 17:07 ` [NTG-context] " Henning Hraban Ramm
2024-11-20 17:15 ` Wolfgang Schuster
0 siblings, 2 replies; 4+ messages in thread
From: Florent Michel @ 2024-11-20 16:26 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1249 bytes --]
Hi,
I'm having issues generating PDF files with a coloured background when
export is set to ‘yes’.
Minimal example:
\setupbackend[export=yes]
\setupbackgrounds [page] [background=color,backgroundcolor=black]
\starttext
\startcolor[white]
test
\stoptext
This example seems to work as expected when I comment out the first line (a
black page with the word ‘test’ in white). However, with the first line the
pdf looks entirely white. Is this a known issue, or am I doing something
wrong here?
Use-case: I am trying to generate a pdf and an html files with equivalent
content, the latter being primarily used for accessibility purposes. One
workaround is to split the tex file in two, e;g;:
% main.tex
\setupbackgrounds [page] [background=color,backgroundcolor=black]
\starttext
\startcolor[white]
test
\stoptext
%main-exp.tex
\setupbackend[export=yes]
\input{main.tex}
This way, I can generate the correct pdf by compiling main.tex and the html
by compiling main-exp.tex (adding a custom .css file to get a black
background).
But I'm wondering if there is a way of generating the correct pdf without
moving the line ‘\setupbackend[export=yes]’ into a different file.
Best regards,
Florent
[-- Attachment #1.2: Type: text/html, Size: 1394 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* [NTG-context] Re: Background colour in PDF with export activated
2024-11-20 16:26 [NTG-context] Background colour in PDF with export activated Florent Michel
@ 2024-11-20 17:07 ` Henning Hraban Ramm
2024-11-20 17:43 ` Florent Michel
2024-11-20 17:15 ` Wolfgang Schuster
1 sibling, 1 reply; 4+ messages in thread
From: Henning Hraban Ramm @ 2024-11-20 17:07 UTC (permalink / raw)
To: ntg-context
Am 20.11.24 um 17:26 schrieb Florent Michel:
> But I'm wondering if there is a way of generating the correct pdf
> without moving the line ‘\setupbackend[export=yes]’ into a different file.
Why don’t use use a mode?
\startmode[export]
\setupbackend[export=yes]
\stopmode
Then you can call "context --mode=export" etc.
(It’s a workaround, I don’t think activating the export should have this
effect.)
Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* [NTG-context] Re: Background colour in PDF with export activated
2024-11-20 16:26 [NTG-context] Background colour in PDF with export activated Florent Michel
2024-11-20 17:07 ` [NTG-context] " Henning Hraban Ramm
@ 2024-11-20 17:15 ` Wolfgang Schuster
1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2024-11-20 17:15 UTC (permalink / raw)
To: mailing list for ConTeXt users, Florent Michel
Florent Michel schrieb am 20.11.2024 um 17:26:
> Hi,
>
> I'm having issues generating PDF files with a coloured background when
> export is set to ‘yes’.
>
> Minimal example:
>
> \setupbackend[export=yes]
> \setupbackgrounds [page] [background=color,backgroundcolor=black]
> \starttext
> \startcolor[white]
> test
> \stoptext
>
> This example seems to work as expected when I comment out the first
> line (a black page with the word ‘test’ in white). However, with the
> first line the pdf looks entirely white. Is this a known issue, or am
> I doing something wrong here?
When you use the export mode some features of Context are disabled and
in your case the page background is one of these disabled features.
It has always been recommended to make separate runs for the PDF output
and the document export.
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* [NTG-context] Re: Background colour in PDF with export activated
2024-11-20 17:07 ` [NTG-context] " Henning Hraban Ramm
@ 2024-11-20 17:43 ` Florent Michel
0 siblings, 0 replies; 4+ messages in thread
From: Florent Michel @ 2024-11-20 17:43 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 822 bytes --]
Le mer. 20 nov. 2024 à 17:09, Henning Hraban Ramm <texml@fiee.net> a écrit :
> Why don’t use use a mode?
> \startmode[export]
> \setupbackend[export=yes]
> \stopmode
>
> Then you can call "context --mode=export" etc.
>
Thanks a lot for that, Henning! It indeed works perfectly!
Le mer. 20 nov. 2024 à 17:15, Wolfgang Schuster <
wolfgang.schuster.lists@gmail.com> a écrit :
> When you use the export mode some features of Context are disabled and
> in your case the page background is one of these disabled features.
>
> It has always been recommended to make separate runs for the PDF output
> and the document export.
>
Thank you Wolfgang for the explanation! That makes sense - and with the
workaround suggested by Henning making separate runs is no problem.
Best regards,
Florent
[-- Attachment #1.2: Type: text/html, Size: 1432 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-20 17:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-20 16:26 [NTG-context] Background colour in PDF with export activated Florent Michel
2024-11-20 17:07 ` [NTG-context] " Henning Hraban Ramm
2024-11-20 17:43 ` Florent Michel
2024-11-20 17:15 ` Wolfgang Schuster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).