Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

latex - exclude section for printing

172 views
Skip to first unread message

Robert Bernhardt

unread,
Jul 6, 2006, 4:17:05 PM7/6/06
to
Hi,

it is possible to exclude some sections for printing but not viewing?

thanx

Heiko Oberdiek

unread,
Jul 6, 2006, 4:25:25 PM7/6/06
to
Robert Bernhardt <bern...@newsarea.de> wrote:

> it is possible to exclude some sections for printing but not viewing?

No.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Maarten Bergvelt

unread,
Jul 6, 2006, 4:26:31 PM7/6/06
to
In article <4h59dmF...@uni-berlin.de>, Robert Bernhardt wrote:

> it is possible to exclude some sections for printing but not viewing?

If you use dvi as final format you can use dvips with the -pp option
to specify the page range, if you use .pdf use acroreader to specify
the page range for printing.

Don't know about sections, looks difficult to me.

--
Maarten Bergvelt


Jay Belanger

unread,
Jul 6, 2006, 4:34:11 PM7/6/06
to

Maarten Bergvelt <be...@math.uiuc.edu> writes:

Suppose he used different formats for printing and viewing?
Perhaps he could define an environment like "pdfsection" which will
be a section in pdf and ignored in dvi.

Maarten Bergvelt

unread,
Jul 6, 2006, 4:39:10 PM7/6/06
to

Right, that is what I would call difficult. Maybe the OP should tells
us what he really wants to do.

--
Maarten Bergvelt

David Kastrup

unread,
Jul 6, 2006, 4:42:56 PM7/6/06
to
Heiko Oberdiek <ober...@uni-freiburg.de> writes:

> Robert Bernhardt <bern...@newsarea.de> wrote:
>
>> it is possible to exclude some sections for printing but not viewing?
>
> No.

Untested:

\special{ps::/woozle{//showpage}def/showpage{//erasepage}def}

...

\special{ps::/showpage{//woozle}def}

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>

Robert Heller

unread,
Jul 6, 2006, 4:50:43 PM7/6/06
to
At Thu, 06 Jul 2006 22:17:05 +0200 Robert Bernhardt <bern...@newsarea.de> wrote:

>
> Hi,
>
> it is possible to exclude some sections for printing but not viewing?

This makes no sense. LaTeX is mainly intended for creating hard-copy
documents (printing). The fact that *some* people don't actually waste
actually trees is a relatively recent innovation. I *suppose* one could
test to see if tex4ht or pdflatex was used to process the document and
include (or not include) selected bits, but on some level this really
won't work. A PDF file (meant for printing) might never land on paper
and a .html version (meant for viewing), might get itself converted to
PDF later or just printed via the "Print" button on the viewer used to
view the HTML file.

OTOH, if by viewing you mean viewing the LaTeX source, that is easy, you
can include a block of text with '%'s and I believe there are some
macros / environments that will also do that as well. Of course, some
clever person can also send the LaTeX source to the printer without
actually processing it at all...

>
> thanx
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
hel...@deepsoft.com -- Contract Programming: C/C++, Tcl/Tk

Scott Pakin

unread,
Jul 6, 2006, 5:48:38 PM7/6/06
to
Robert Bernhardt wrote:
> it is possible to exclude some sections for printing but not viewing?

If the text fits on a page you can put it in a PDF annotation with the
Invisible flag (or whatever it's called) set.

I second Maarten's comment that if you tell us what you *really* want to
do someone might be able to offer a better suggestions.

-- Scott

Robert Bernhardt

unread,
Jul 6, 2006, 6:20:48 PM7/6/06
to
Scott Pakin schrieb:
Hi,

in acrobat it is possible to set an image property to "don't print".
I want to only show the image.

-- rob

Maarten Bergvelt

unread,
Jul 6, 2006, 10:23:05 PM7/6/06
to
In article <4h5gllF...@uni-berlin.de>, Robert Bernhardt wrote:
> Scott Pakin schrieb:
>> Robert Bernhardt wrote:
>>> it is possible to exclude some sections for printing but not viewing?
>>
>> If the text fits on a page you can put it in a PDF annotation with the
>> Invisible flag (or whatever it's called) set.
>>
>> I second Maarten's comment that if you tell us what you *really* want to
>> do someone might be able to offer a better suggestions.
>>
> Hi,
>
> in acrobat it is possible to set an image property to "don't print".
> I want to only show the image.

Okay, so just use pdflatex to produce a .pdf file and use acrobat to
suppress some pages.

Still puzzled, hope this answers your question.
--
Maarten Bergvelt

Scott Pakin

unread,
Jul 7, 2006, 2:13:59 AM7/7/06
to
Robert Bernhardt wrote:
> in acrobat it is possible to set an image property to "don't print".
> I want to only show the image.

I don't know a good way to suppress printing while preserving screen
display. You may find the following kludge (using a PDF Stamp
annotation) good enough for your needs. Note that not all PDF viewers
honor the "don't print" mechanism. (In fact, probably only Acrobat
does.)

-- Scott

============================== cut here =============================

\documentclass{minimal}

\newsavebox{\vnpbox}

\newcommand{\doviewnoprint}[1]{%
\savebox{\vnpbox}{#1}%
\setbox0=\copy\vnpbox
\immediate\pdfxform0
\edef\vnpxform{\the\pdflastxform}%
\pdfannot width \wd\vnpbox height \ht\vnpbox depth \dp\vnpbox {
/Subtype /Stamp
/Subj (Notice)
/Contents (This can only be viewed on screen, not printed.)
/F 192
/AP <<
/N \vnpxform\space 0 R
/D \vnpxform\space 0 R
/R \vnpxform\space 0 R
>>
}%
\phantom{\usebox{\vnpbox}}%
}

\newenvironment{viewnoprint}{%
\noindent
\xdef\prevparindent{\the\parindent}%
\xdef\prevparskip{\the\parskip}%
\begin{lrbox}{\vnpbox}%
\begin{minipage}[t]{\linewidth}%
\parindent=\prevparindent
\parskip=\prevparskip
}{%
\rule[-1ex]{0pt}{1ex}%
\end{minipage}%
\end{lrbox}%
\leavevmode
\doviewnoprint{\usebox{\vnpbox}}%
}

\begin{document}

This document contains \doviewnoprint{secret stuff}!

You can print this text.

\begin{viewnoprint}
This is a great, big empty space. Not much here. Move along now.
Cras rhoncus, velit sit amet posuere sollicitudin, sem elit ultricies
lacus, eu lacinia metus turpis non urna. Sed scelerisque aliquet
orci. Suspendisse quis sem. Morbi risus justo, aliquet vit\ae,
consequat sit amet, dictum sit amet, lorem. Sed fermentum mauris sit
amet augue. Ut ut mauris non ligula interdum condimentum. Sed ac risus
porta pede pretium malesuada. Quisque nec ipsum. Pellentesque
laoreet. Suspendisse ut metus.

Pellentesque faucibus risus eget risus. Pellentesque id diam nec mi
rhoncus euismod. Cras aliquam, odio aliquet imperdiet lobortis, nunc
quam porta mauris, non suscipit velit turpis eget sem. Aliquam
consequat nulla ut elit. Pr\ae{}sent aliquam sollicitudin sem.
\end{viewnoprint}

You can print this text, too.

\end{document}

0 new messages