+1
213 次浏览

(See also Inserting Pages from a PDF which is more focussed on inserting a particular page or two, with the option of the added pages being scaled, rotated, etc and appearing with a running header.)

Let us assume that you want to PTXprint to insert every page of a PDF before the start of a particular book or at the end of a particular book.

What to do:

  • On the advanced tab, tick “Apply Customised Settings” and then edit it.
    image

  • On an otherwise empty line in that file, type something like the following:

\setbookhook{start}{MAT}{\includepdf{../../../figures/FileName.pdf}}

Or, for the file to be after the end of the book of Revelation, this:

\setbookhook{end}{REV}{\pb \includepdf{../../../figures/FileName.pdf}}
  • Click on Print to make sure that it is correct!

Now for some explanation.

At various points in processing the USFM, PTXprint checks to see if the user has asked for anything unusual to happen. You might like to think of those checks as a big grid of hooks on a wall, where almost all of them are empty. But, someone might put a list of instructions on a given one. If there is a list of instructions on the hook, then those instructions are added to the list of things that TeX should do before it does anything else.

The start and end of books is one place where the grid of hooks is checked, and the command \setbookhook puts its list of instructions on the specified hook (throwing away anything else that might already be there). Another place that hooks are checked for is the start of a verse (\setcvhook).

\setbookhook{start}{MAT}{\includepdf{filename.pdf}} tells the code that at the start of the book with \id MAT, it should process the instruction \includepdf{filename.pdf}.

In the example above, the instruction is including ../../../figures/FileName.pdf.
I’m using the unix-style forward slash between directories because (a) I’m typiing this on linux, (b) Windows programs can, I believe, normally cope with unix-style paths, and (c) I’d need to use \\ so that the backslash got through, and it then wouldn’t work on linux or Apple computers.
../../.. means three directories above ‘where we are now’, with ‘now’ being where TeX gets run from - for Default configuration, that’s .../PROJECT/local/ptxprint/Default and so the above is looking for the PDF in .../PROJECT/figures and by using a relative path rather than an absolute one, it ought to work on everyone’s computer.

Other things to note

  • The \pb used with the {end} version above forces a page break before the pages are added. Without it, then the PDF might be added before the last page of the book.
  • While this does not add page numbers to pages, it does count pages.
  • If you get the file path and name correct then you will get a message in the log file saying
includepdf ../../../figures/test.pdf pages=2

If you make a mistake, and there’s no file there, it will say pages=0 That is your only warning!

  • There is also a special book final (e.g. \setbookhook{end}{final}{...}) which is the last book of the job.
  • While there is only one ‘hook’ at a particular point, multiple hooks can be used. e.g.:
  • There are several differences between how input in .tex files and .sfm (or USFM) files are handled. \includepdf is a TeX instruction, not USFM, and so cannot easily be used in USFM files, such as peripheries or front matter.
  • \includepdf is an immediate command which jumps over any queues. While most input adds material to TeX’s lists of text and paragraphs to get arranged on a page some time, \includepdf outputs the PDF’s pages as soon as it is encountered. - hence the need for the page-break command in the end-of-Revelation example. On the positive side, as it ignores the queue, it should not alter the arrangement of any paragraphs that it is met in.
PTXprint (1.1k 分) 发布 | 213 次浏览

登录注册以回答此问题。

相关问题

0
3 个回答 308 次浏览
Mark 要求在这里添加一些关于如何从 PDF 添加页面的内容 (另请参阅 插入整个 PDF) 所以,嗯,这是第一次尝试 假设我们有一个 2 页的 PDF 我刚做了一个 这是它的 2 页视图: image1078 802 9 ... 得挑剔,没有写入文件 镜像和旋转有效(尽管镜像可能不是对文本最友好的操作!) image885 696 54.4 KB
DG 1.1k 发布 提问于 十月 2, 2023
PTXprint
0
1 个回答 98 次浏览
我早就听说 PTXprint 不需要安装 Paratext 也能使用 但是不使用 Paratext 而使用 PTXprint 的过程并不直观 当我询问 PTXprint AI 支持代理时,它幻想了各种不存在的功能,例如:当提示选择 ... 包含一些图像),除了创建一个虚拟的 Paratext 项目外,有没有办法用 PTXprint 打印它? 谢谢,Jeff
jeffh 1.4k 发布 提问于 一月 6
0
1 个回答 54 次浏览
Mailto: <*Emails are not allowed*> PTXprint [2.7.17] - Error! Failed to create: MSB_BookofMark_XXC_ptxp.pdf ! File ... various settings on the Advanced tab. PTXprint Version 2.7.17
MnKN 134 发布 提问于 九月 13, 2025
PTXprint
0
3 个回答 262 次浏览
在我的 ptxprint-mods.tex 文件中,我想对标点符号进行一些特定的调整 以下是关于冒号的调整: \catcode`\:=\active \def:{\unskip\kern0.25em\char`\:{}} % colon 不幸的是,这弄乱了 ... 版权页的 PDF 我在输出的顶部看到了这个: 有人能帮我弄清楚如何同时实现这两者吗?谢谢
jeffh 1.4k 发布 提问于 二月 22, 2021
PTXprint
0
3 个回答 375 次浏览
Now and then I've encountered an issue where I can't use Export to PDF for a particular project, where the ... not installed for all users will also effect users of PTXPrint.
[Expert]
sewhite
3.3k 发布
提问于 二月 27, 2020
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Make every effort to keep the unity of the Spirit through the bond of peace.
Ephesians 4:3
3,048 个问题
6,007 个回答
5,672 条评论
2,028 位用户