Search found 15 matches

by cypherpunks
Wed Jan 15, 2025 6:32 pm
Forum: General
Topic: (pdfpages) How to write code that only affects some select pages of a PDF document
Replies: 0
Views: 1541

(pdfpages) How to write code that only affects some select pages of a PDF document

Suppose you feed a multi-page PDF into `\includepdf`. If you only want `pagecommand` or `picturecommand` to take effect on *some* pages, you normally must split the construct up into multiple invocations. E.g.

\includepdf[pages=1], pagecommand={\doStuffOnPageOne}]{file.pdf}
\includepdf[pages=2 ...
by cypherpunks
Sat Jan 11, 2025 11:50 pm
Forum: General
Topic: Is it possible to read a boolean value from a parent pkg?
Replies: 7
Views: 2833

Re: Is it possible to read a boolean value from a parent pkg?

Indeed I tried nesting it inside the command to reduce the scope of it, and actually /that/ caused problems. So the \makeatletter must surround the command definition. Once I removed an \ifdraft statement I forgot about, it was all good.
by cypherpunks
Sat Jan 11, 2025 11:30 pm
Forum: General
Topic: Is it possible to read a boolean value from a parent pkg?
Replies: 7
Views: 2833

Re: Is it possible to read a boolean value from a parent pkg?

Ah, thanks! That fixed it in my MWE.

For some reason the same approach did not fix it in my large complex document. I’ll have to see if I can narrow that down. In the failing case, \safepdfcomment is used inside an \includepdf option, like this:

\includepdf[pages=1,unit=1mm,pagecommand ...
by cypherpunks
Sat Jan 11, 2025 11:14 pm
Forum: General
Topic: Is it possible to read a boolean value from a parent pkg?
Replies: 7
Views: 2833

Re: Is it possible to read a boolean value from a parent pkg?

Glad to hear you were able to use it. That gives me hope.

This code sample shows “\ifpc@gopt@final\else” causing an “undefined control sequence”:

\documentclass{article}

% Demonstrates populating a PDF annotation with text input from an external file.
%
% Bugs/Limitations/anti-features ...
by cypherpunks
Sat Jan 11, 2025 10:40 pm
Forum: General
Topic: Is it possible to read a boolean value from a parent pkg?
Replies: 7
Views: 2833

Is it possible to read a boolean value from a parent pkg?

It would sometimes be useful to write conditional code that depends on boolean values held by a parent package. E.g. the \pdfcomment package has the boolean “final”, which disables all PDF annotations in the document. There is some other logic in the document that should also be disabled when that ...
by cypherpunks
Thu Jan 09, 2025 4:41 pm
Forum: General
Topic: bizarre output by \StrSubstitute when replacing &, %, _, and \newline
Replies: 0
Views: 1547

bizarre output by \StrSubstitute when replacing &, %, _, and \newline

I am trying to do some simple character replacements on an input file and writing it to a file. The output produced by \StrSubstitute is quite bizarre. Here is a MWE:

\documentclass{article}

\usepackage{newfile} % furnishes \newoutputstream
\usepackage{catchfile} % furnishes \CatchFileDef ...
by cypherpunks
Tue Jan 07, 2025 10:00 pm
Forum: General
Topic: Need to replace newline with '\textLF' (on text imported with \input)
Replies: 0
Views: 1540

Need to replace newline with '\textLF' (on text imported with \input)

This thread describes how to input a text file and put the contents into a PDF annotation using the \pdfcomment command. Problems occur when the input text contains a blank line because \pdfcomment cannot handle it. According to the pdfcomment docs, linefeeds must be replaced with \textLF . I tried ...
by cypherpunks
Tue Jan 07, 2025 8:13 pm
Forum: General
Topic: [solved] unable to use \pdfcomment on text imported from an external file (\input)
Replies: 0
Views: 1666

[solved] unable to use \pdfcomment on text imported from an external file (\input)

Here is a minimal example:
\documentclass{article}

\usepackage{pdfcomment}

\begin{document}
yada yada

\pdfcomment{This is a PDF annotation -- works as expected.}

\pdfcomment{\input{some_text.txt}} % the PDF comment is literally the text “some_text.txt”

yada yada
\end{document}

It compiles ...
by cypherpunks
Mon May 23, 2022 6:54 pm
Forum: Text Formatting
Topic: using \pgfmathsetlength to calculate padding; width() function gets wrong answer
Replies: 0
Views: 1671

using \pgfmathsetlength to calculate padding; width() function gets wrong answer

I have a split 2 column page, one for each language. Using footnotes like normal is a problem because all the footnotes end up below the left column (the french column in this case). Every footnote has a french and english version, so I’ve created a split footnote. The problem is that the padding ...
by cypherpunks
Sun Oct 31, 2021 7:58 pm
Forum: Page Layout
Topic: Getting paragraph numbers in the margin when using the reledmac pkg (\linenummargin has no effect)
Replies: 0
Views: 3254

Getting paragraph numbers in the margin when using the reledmac pkg (\linenummargin has no effect)

I want numbered paragraphs and I want the numbers to be in the left margin. Example:


\documentclass{scrartcl}
\usepackage[noend]{reledmac} % needed for \pstart & \pend to number paragraphs
\renewcommand{\thepstart}{{\textsuperscript{\fbox{\arabic{pstart}}}}} % ← this puts a box around the ...