### ptx2pdf Setup File Configuration (GLW-setup.txt) Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/quick-start/README.md This .txt file contains user-defined configurations for a ptx2pdf project. It allows customization of page dimensions, margins, fonts, header/footer content, column layout, and stylesheet selection. Changes here directly affect the final PDF output. ```plaintext % GLW-setup % % Paratext-to-PDF converter setup for GLW example % % This file defines some basic parameters that control the format of the output % Dimensions of A5 paper \PaperWidth=148.5mm \PaperHeight=210mm \CropMarkstrue % Basic unit for margins; changing this will alter them all \MarginUnit=.75in % Relative sizes of margins, based on the unit above \def\TopMarginFactor{1.0} \def\BottomMarginFactor{1.0} \def\SideMarginFactor{0.75} % Fonts to use for "plain", "bold", "italic", and "bold italic" from the Paratext stylesheet % (they need not really be italic, etc, of course) \def\regular{"Charis SIL"} \def\bold{"Charis SIL/B"} \def\italic{"Charis SIL/I"} \def\bolditalic{"Charis SIL/BI"} % Use right-to-left layout mode %\RTLtrue % Unit for font sizes in the stylesheet; changing this will scale all text proportionately \FontSizeUnit=0.8pt % Scaling factor used to adjust line spacing, relative to font size \def\LineSpacingFactor{1.05} \def\VerticalSpaceFactor{1.0} % Information to include in the running header (at top of pages, except first) % We set the items to print at left/center/right of odd and even pages separately % Possible contents: % \rangeref = Scripture reference of the range of text on the page; % \firstref = reference of the first verse on the page) % \lastref = reference of the last verse on the page) % \pagenumber = the page number % \empty = print nothing in this position \def\RHoddleft{\empty} \def\RHoddcenter{\empty} \def\RHoddright{\rangeref} \def\RHevenleft{\rangeref} \def\RHevencenter{\empty} \def\RHevenright{\empty} \def\RHtitleleft{\empty} \def\RHtitlecenter{\empty} \def\RHtitleright{\empty} \def\RFoddcenter{\pagenumber} \def\RFevencenter{\pagenumber} \def\RFtitlecenter{\pagenumber} \VerseRefstrue % whether to include verse number in running head, or only chapter \OmitVerseNumberOnetrue % whether to skip printing verse number 1 at start of chapter %\IndentAtChaptertrue % whether to use paragraph indent at drop-cap chapter numbers \AutoCallers{f}{*,?,?,¶,§} \PageResetCallers{f} %\NumericCallers{f} %\OmitCallerInNote{f} \ParagraphedNotes{x} % reformat \x notes as a single paragraph \TitleColumns=1 \IntroColumns=1 \BodyColumns=2 \def\ColumnGutterFactor{15} % gutter between double cols, relative to font size %\BindingGuttertrue % add extra margin of \BindingGutter on binding side %\BindingGutter=10pt %\DoubleSidedfalse % Define the Paratext stylesheet to be used as a basis for formatting \stylesheet{usfm.sty} \stylesheet{GLW-custom.sty} % here we load a custom style sheet overriding some of the defaults ``` -------------------------------- ### ptx2pdf Project File Example (GLW.tex) Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/quick-start/README.md This TeX file serves as the main project file for ptx2pdf. It includes the necessary ptx2pdf macro package and the setup file, then inputs the scripture files (.sfm) that will be processed. It's essential for linking all project components. ```tex % sample ptx2pdf-project file \input paratext2.tex % first we \input the ptx2pdf macro package \input GLW-setup.txt % then we \input the setup file \ptxfile{Intro-GLW.sfm} % we use \ptxfile to input the sfm files \ptxfile{43-JHN-GLW.sfm} \ptxfile{62-1JN-GLW.sfm} \ptxfile{63-2JN-GLW.sfm} \ptxfile{64-3JN-GLW.sfm} \end % and this is how we end this file ``` -------------------------------- ### Install PTXprint Dependencies Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/WinDevEnvSetupGuide.md This command installs a comprehensive list of necessary packages for PTXprint development within the MSYS2 MinGW 64-bit environment. These include Python, pip, setuptools, GTK+ libraries, font tools, and other essential components. Execute this within the MSYS2 MinGW x64 console. ```bash pacman -S mingw-w64-x86_64-python mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-setuptools mingw-w64-x86_64-gtksourceview3 mingw-w64-x86_64-python-pillow mingw-w64-x86_64-python-fonttools mingw-w64-x86_64-python-regex mingw-w64-x86_64-python-cairo mingw-w64-x86_64-python-gobject mingw-w64-x86_64-gtk3 mingw-w64-x86_64-glib2 mingw-w64-x86_64-libffi mingw-w64-x86_64-gcc mingw-w64-x86_64-glade mingw-w64-x86_64-python-pyopenssl mingw-w64-x86_64-poppler mingw-w64-x86_64-python-numpy mingw-w64-x86_64-adwaita-icon-theme mingw-w64-x86_64-python-lxml ``` -------------------------------- ### One-Time Setup for USFM Processing Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/ptx2pdf/setup.md This code performs one-time setup operations before processing any USFM files. It captures baseline skip settings, calls various setup macros and hook routines, and sets a flag indicating that the process is inside a USFM file. It then triggers job initialization hooks. ```tex [=csty_onetime]:: ``` -------------------------------- ### Install PTXprint via pip Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/WinDevEnvSetupGuide.md This command installs the PTXprint package and its dependencies using pip. It assumes you have already navigated to the PTXprint repository directory. The '-e' flag installs the package in editable mode, which is useful for development. ```bash cd to/where/you/have/the/ptxprint/repository pip3 install -e . ``` -------------------------------- ### Example .delayed File Format for Slop Calculations Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/documentation/figures.md This example demonstrates the format of a .delayed file, which lists items subject to slop calculations for cutout positioning. The first item after \DelayedItem or \RaiseItem is the name to be supplied to \setCutoutSlop. ```tex \DelayedItem{dropsidebarBox1}{GEN1.5}{2}{(95.354ptx12@2)R} \DelayedItem{dropgraphicInSidebar2}{GEN2.12}{1}{(53.677ptx3@1)R} \RaiseItem{droppic6}{TST1.7-preverse}{2} \DelayedItem{droppic6}{TST1.7-preverse}{11}{(58.91803ptx8@-4)R} ``` -------------------------------- ### Build PTXprint Executable Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/WinDevEnvSetupGuide.md This command initiates the build process for creating the PTXprint executable on Windows. It relies on the Build4Windows.bat script, which should be present in the repository. Ensure all previous setup steps are completed before running this. ```bash ./Build4Windows.bat ``` -------------------------------- ### Run PTXprint for Testing Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/WinDevEnvSetupGuide.md This command executes the PTXprint script to process project files and apply specified fonts. It's used for testing the installation and functionality after setting up the development environment. Replace 'test/projects' and 'test/fonts' with the actual paths to your project files and font directories. ```bash python python/scripts/ptxprint -p test/projects -f test/fonts ``` -------------------------------- ### Example with Enhanced Milestone and Stack Complexity Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/documentation/styling.md Presents an example of an enhanced milestone with an additional attribute ('zwho') and demonstrates how style stack complexity affects the search list. It details the fully specified style stack and the reduced lists generated when \StackComplexity is set. ```tex \ts-s|zwho="Alice"\ ... \p Jesus said, <<\qt-s|Jesus\* It is written, \+bd /ptx2pdf python setup.py develop ``` -------------------------------- ### Multi-Attribute Milestone Styling Examples Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/Milestones.md Illustrates various methods for styling milestones that explicitly have multiple attributes. These examples explore different syntaxes for defining and mapping named attributes to marker styles, including ordered and unordered attribute lists. ```plaintext 1. \Marker qt-Jesus-story 2. \Marker qt-s-Jesus-story 3. \Marker ms:who=Jesus;style=story|qt 4. \Marker ms:Jesus;style=story|qt 5. \Marker Jesus;style=story|qt ``` -------------------------------- ### Styling Based on Book and Periph Division - USFM Example Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/documentation/styling.md Demonstrates styling that is conditional on the book identifier (\id) and a peripheral division (\periph). This example targets the 'Holy Bible' book name within a 'promo' peripheral division and 'Main' category. ```tex \id FRT \periph Promotional Page|promo \ip \cat Main\cat* The \bk Holy Bible\bk* is the Word of God, a valuable part of the life of any Christian's life... ``` ```tex \Marker id:FRT|periph:promo|cat:Main|bk+ip ``` -------------------------------- ### TeX: Paragraphed Notes Setup Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/ptx2pdf/styles.md Sets up the text width and line breaking parameters for paragraphed notes. It configures the `linepenalty` and `floatingpenalty` to control how notes are displayed and prevent page breaks within notes. ```TeX [=c_paragraphedNotes]:: ``` -------------------------------- ### SidebarGridding Configuration Example Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/documentation/SideBars.md This snippet demonstrates the configuration settings for a 'headingsbox' sidebar, including the SidebarGridding option and other related parameters like BorderWidth, BorderPadding, and BackgroundColor. These settings collectively define the appearance and layout of the sidebar. ```tex \Marker cat:headingsbox|esb \TextProperties publishable \SidebarGridding normal \BorderWidth 4 \BorderPadding 1 \BoxPadding 0 \BorderStyle ornaments \BorderRef Han4 \BorderFillColour .5 .5 .5 \BgColor 0.50 0.50 0 ``` -------------------------------- ### ztruetext Example with Conditional Audio Recording Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/help/ztruetext.md This example demonstrates how to use ztruetext in conjunction with zifvarset to conditionally display text related to audio recordings. The content inside \ztruetext and \ztruetext* will only be visible if the 'recording' variable is set. This is useful for generating documents with optional content sections. ```tex \zifvarset|var="recording"\ \ztruetext \is2 Audio recordings available! \ip Audio recordings are available at \zvar|recording S* \ztruetext* ``` -------------------------------- ### Default Parameterized Milestone Styling Examples Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/Milestones.md Presents multiple approaches to styling default parameterized milestones, which accept a default attribute. Examples show different syntaxes for associating attributes with milestone markers, including direct association and category-based markup. ```plaintext 1. \Marker qt-Jesus 2. \Marker qt-s-Jesus 3. \Marker ms:Jesus|qt-s 4. \Marker ms:who=Jesus|qt-s 5. \Marker Jesus|qt-s ``` -------------------------------- ### Polyglot USFM File Structure Example Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/documentation/diglot.md Illustrates the structure of a polyglot-friendly USFM file, utilizing \polyglotcolumn and \polyglotendcols to manage multiple text columns for parallel typesetting. ```usfm \polyglotcolumn L \s The birth of diglot \p \polyglotendcols \polyglotcolumn L \p \v 4 David took ptxplus and tweaked it in various places and so diglot came into being, and it lived in dark obscurity for many years, sometimes crafting text, sometimes creating strange things. \p \polyglotcolumn R \p \v 4 And David took ptxplus and did bend it in diverse places to make diglot. Diglot dwelt in darkness and created beauty or disaster depending upon many factors. \polyglotendcols ``` -------------------------------- ### Update MSYS2 Packages Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/WinDevEnvSetupGuide.md This command updates the package database and installs the latest versions of base packages within the MSYS2 environment. It's a crucial first step to ensure all package information is current before proceeding with further installations. Ensure you are in the MSYS2 MinGW x64 console. ```bash pacman -Syu ``` -------------------------------- ### USFM Markup for Actor Script Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/Milestones.md This USFM markup example illustrates how to distinguish dialogue attributed to different characters using \qt-s\* (quote start) and \qt-e\* (quote end) tags. It handles inline quotes where the speaker is identified. ```usfm \v 15 He sad to them, \qt-s |Jesus\* "But who do you say that I am?"\qt-e \v 16 Simon Peter replied, \qt-s |Peter\* "You are the Christ, the Son of the living God."\qt-e* ``` -------------------------------- ### Diglot USFM Example with Control Words Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/quick-start/diglot-quick.md This USFM snippet demonstrates the use of diglot-specific control words like \lefttext, \righttext, \nolefttext, and \norighttext to structure two-column text. It shows how these commands influence text alignment and spacing for parallel translations. ```usfm \lefttext \s The birth of diglot \p \norighttext \p \v 4 David took ptxplus and tweaked it in various places and so diglot came into being, and it lived in dark obscurity for many years, sometimes crafting text, sometimes creating strange things. \p \righttext \p \v 4 And David took ptxplus and did bend it in diverse places to make diglot. Diglot dwelt in darkness and created beauty or disaster depending upon many factors. ``` -------------------------------- ### Clone PTXprint Repository Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/WinDevEnvSetupGuide.md This command uses Git to clone the PTXprint repository from GitHub to your local machine. It's the first step in setting up the development environment for working on the PTXprint codebase. After cloning, use 'pwd' to determine the repository's path for subsequent steps. ```bash git clone https://github.com/sillsdev/ptx2pdf.git pwd ``` -------------------------------- ### Milestone-Based Paragraph Styling Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/documentation/advanced.md Allows ranged milestones to influence paragraph styles, such as applying specific colors or indentations. The example defines a style for words of Jesus, making them red and indenting paragraphs starting with that milestone. The behavior of \DefineParBeforeMilestone controls whether paragraphs are indented when they begin with a milestone. ```tex \Marker Jesus|qt-s \LeftMargin 0.25 \RightMargin 0.25 \Color 7f0000 ``` ```tex \DefineParBeforeMilestonefalse ``` -------------------------------- ### Implement zmakeinsert and multidepth periphs (ptx2pdf) Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/inno-docs/ReleaseNotes.txt Continues the implementation of `zmakeinsert` and multidepth peripheries. This is likely related to managing complex document structures and inserting content at various levels. ```latex Finish(?) implementing zmakeinsert and multidepth periphs ``` -------------------------------- ### Simple Milestone Styling Examples Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/Milestones.md Demonstrates various methods for styling simple, unparameterised milestones. These methods range from basic marker additions to more complex category-style markups, illustrating different approaches to user-defined styling. ```plaintext 1. \Marker wj-s 2. \Marker ms:wj 3. \Marker ms:|wj 4. \Marker ms:wj|* ``` -------------------------------- ### Update TeX Live Installation (Windows) Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/cookbook/updating-xetex-in-texlive.md Command to update a standard TeX Live installation on Windows to the latest versions of all packages, including XeTeX. ```bash tlmgr update --self --all ``` -------------------------------- ### USFM Category Style Prefix Example Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/ptx2pdf/styles.md Demonstrates how a category prefix is used to define stylesheet entries for markers within a specific category. This example shows the structure for a 'people' category and an 'fq' marker. ```USFM \Marker cat:people|fq ``` -------------------------------- ### Example SmallCaps Character Style with \FontScale Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/documentation/ptx2pdf-faq.md Provides an example of a smallcaps character style definition using \FontScale in a custom PTX2PDF stylesheet. This demonstrates setting a multiplier for the font size. ```tex \Marker nd \EndMarker nd* \StyleType character \FontScale 1 \SmallCaps ``` -------------------------------- ### zcolsync Usage Examples Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/help/zcolsync.md Demonstrates various ways to use the \zcolsync milestone for synchronizing diglot/polyglot positions. These examples show how to sync with a specific ID, a verse number, or a paragraph number. ```text \zcolsync|id\* % This position shuold be synchronised with id on the other column(s) \zcolsync|v23a\* % This position should be synchronised as if it were verse 23a. \zcolsync|p3\* % This position should syncronised as if it were paragraph 3. ``` -------------------------------- ### Directly Create PDF with Configuration (Windows) Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/inno-docs/AboutPTXprint.txt This command bypasses the GUI and directly generates a PDF from a specified project using a saved configuration. ```batch "C:\Program Files\PTXprint\PTXprint.exe" -c NTandPsalms -P XYZ ``` -------------------------------- ### Directly Create PDF for Specific Book(s) (Windows) Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/inno-docs/AboutPTXprint.txt This command directly creates a PDF for one or more specified books within a project, using a given configuration. The GUI is not displayed. ```batch "C:\Program Files\PTXprint\PTXprint.exe" -b ROM -c SideXrefs -P XYZ ``` ```batch "C:\Program Files\PTXprint\PTXprint.exe" -b "MAT MRK LUK JHN ACT GLO" -P XYZ ``` -------------------------------- ### Basic Style Stack Precedence Example Source: https://github.com/sillsdev/ptx2pdf/blob/master/docs/documentation/styling.md Demonstrates a simple style stack for a TeX snippet and explains the order of precedence for style elements. It shows how the innermost style is prioritized and how style definitions are applied based on their specificity. ```tex \p Jesus said, <<\wj It is written,