+1
215 次瀏覽

(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 點) 提出 | 215 次瀏覽

登入註冊 以回答此問題。

相關問題

0
3 個回答 308 次瀏覽
Mark 要求這裡應該有一些關於如何從 PDF 添加頁面的說明 (另請參見 插入整個 PDF) 所以,嗯,這是第一次嘗試 假設我們有一個 2 頁的 PDF 我剛做了一個 這是它的 2 頁檢視: image1078 802 9 ... 有寫入檔案 鏡像和旋轉是有效的(儘管對文字進行鏡像處理可能不是最好的做法!) image885 696 54.4 KB
DG 1.1k 提出 已提問 10月 2, 2023
0
1 個回答 98 次瀏覽
我聽說了很久,PTXprint 不需要安裝 Paratext 也能運作 但使用 PTXprint 而不依賴 Paratext 的流程並不明顯 當我詢問 PTXprint AI 支援代理時,它幻覺出各種不存在的功能,例如:當提示選擇 ... 含一些圖片),除了建立一個虛構的 Paratext 專案外,有沒有辦法用 PTXprint 來列印它? 謝謝,Jeff
jeffh 1.4k 提出 已提問 1月 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 提出 已提問 9月 13, 2025
0
3 個回答 262 次瀏覽
在我的 ptxprint-mods.tex 檔案中,我想對標點符號進行一些特定的調整 以下是關於冒號的調整: \catcode`\:=\active \def:{\unskip\kern0.25em\char`\:{}} % colon 不幸的是,這會導致 ... PDF 我在輸出內容的頂部看到了這個錯誤: 有人能幫我弄清楚如何同時實現這兩點嗎?謝謝
jeffh 1.4k 提出 已提問 2月 22, 2021
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 提出
已提問 2月 27, 2020
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
For we were all baptized by one Spirit so as to form one body—whether Jews or Gentiles, slave or free—and we were all given the one Spirit to drink.
1 Corinthians 12:13
3,048 個問題
6,007 個回答
5,672 則評論
2,028 位使用者