### Bible Generation Workflow with SWORD Modules Source: https://context7.com/olsak/opbible/llms.txt This end-to-end workflow demonstrates the process of generating a typeset Bible PDF. It covers installing SWORD modules, extracting text, generating .txs files, setting up the TeX environment, and compiling the final document. ```bash # Step 1: Install SWORD module cd txs-gen # Download a Bible module from https://crosswire.org/sword/modules/ # Unzip into working directory installmgr -l # List installed modules # Step 2: Extract Bible text from SWORD module make # Compile mod2tex if not already done ./mod2tex Webster > Webster.out # Step 3: Generate .txs files ./maketxs.py Webster.out # Creates: Webster-Gen.txs, Webster-Exod.txs, ..., Webster-Rev.txs # Creates: Webster-books.tex # Step 4: Set up TeX environment cd ../examples/english mkdir -p ~/texmf/tex/opbible cp ../../macros/* ~/texmf/tex/opbible/ # Step 5: Copy generated files to project cp ../../txs-gen/Webster-*.txs txs/ cp ../../txs-gen/Webster-books.tex books.tex # Step 6: Edit bible.tex configuration # Set: \def\tmark{Webster} # Set: \def\printedbooks{Dan} (or multiple books) # Step 7: Compile the Bible optex bible.tex # Output: bible.pdf with professionally typeset Bible text # Generate entire Bible (all 66 books) # Edit bible.tex: # \def\printedbooks{Gen Exod Lev Num Deut Josh Judg Ruth ``` -------------------------------- ### Generate TXS Bible Book Files with maketxs.py (Python) Source: https://context7.com/olsak/opbible/llms.txt The maketxs.py script processes the intermediate format generated by mod2tex to create individual .txs files for each Bible book and a master books.tex file containing book titles. It requires Python 3 and the intermediate text file as input. The output consists of numerous .txs files and a single books.tex file. ```python #!/usr/bin/python3 # Process the mod2tex output to create .txs files # In txs-gen directory: # Generate .txs files from the intermediate format ./maketxs.py KJV.out # This creates 66 files: # KJV-Gen.txs, KJV-Exod.txs, ..., KJV-Rev.txs # Plus KJV-books.tex with book title definitions # Example output file (KJV-Dan.txs): # % source: KJV.out, book: Daniel # #1:1 In the third year of the reign of Jehoiakim king of Judah... # #1:2 And the Lord gave Jehoiakim king of Judah into his hand... # #2:1 And in the second year of the reign of Nebuchadnezzar... # The books.tex file contains: # \BookTitle Gen Gen {Genesis} # \BookTitle Exod Exod {Exodus} # ... ``` -------------------------------- ### Typeset Bible Books with \processbooks (OpTeX) Source: https://context7.com/olsak/opbible/llms.txt The \processbooks macro is the core OpTeX typesetting function in OpBible. It loads specified Bible books from their .txs files, along with formatting, notes, and introductions, to generate the final typeset output. It requires loading OpBible macros, font support, defining the translation, file paths, and the books to be typeset. Input is a list of book identifiers. ```tex % Main Bible typesetting file (bible.tex) \load[opbible] % Load OpBible macros \input opbible-hebrew % Hebrew font support % Define which translation to use \def\tmark{BBE} % Bible in Basic English % Define file locations \def\txsfile{./txs/\tmark-\bmark.txs} \def\fmtfile{./fmt/fmt-\tmark-\amark.tex} \def\notesfile{./notes/notes-\amark.tex} \def\introfile{./intros/intro-\amark.tex} % Set Bible translation name \switch {BBE}{\def\bibname{Bible in Basic English}}% {Webster}{\def\bibname{Noah Webster's Bible}}% % Input book definitions \input{books.tex} % Define which books to typeset (can be single book or multiple) \def\printedbooks{Dan} % Only Daniel % \def\printedbooks{Gen Exod Lev} % Multiple books % Process and typeset the books \processbooks \bye ``` -------------------------------- ### \processbooks - Main Typesetting Macro Source: https://context7.com/olsak/opbible/llms.txt The core OpTeX macro within OpBible responsible for processing and typesetting Bible books. It loads individual book `.txs` files, along with formatting, notes, and introductions, to produce the final typeset document. ```APIDOC ## \processbooks - Main Typesetting Macro ### Description This is the primary OpTeX macro that orchestrates the typesetting of Bible books. It reads the list of books to be typeset from `\printedbooks`, loads the corresponding `.txs` files, and integrates formatting, notes, and introductions to generate the final output. ### Method OpTeX macro execution within a `.tex` file. ### Endpoint N/A (OpTeX macro) ### Parameters #### Configuration Variables - **`\load[opbible]`**: Loads the main OpBible macro package. - **`\input opbible-hebrew`**: (Optional) Loads Hebrew font support. - **`\def\tmark{TRANSLATION_CODE}`**: Specifies the Bible translation to use (e.g., `BBE`, `Webster`). - **`\def\txsfile{PATH}`**: Defines the path to the book's `.txs` file. - **`\def\fmtfile{PATH}`**: Defines the path to the formatting file. - **`\def\notesfile{PATH}`**: Defines the path to the notes file. - **`\def\introfile{PATH}`**: Defines the path to the introduction file. - **`\switch {CODE} {...} {CODE} {...}`**: Sets the Bible translation name (e.g., `\switch {BBE}{\def\bibname{Bible in Basic English}}`). - **`\input{books.tex}`**: Loads the book title definitions. - **`\def\printedbooks{BOOK_LIST}`**: Specifies the list of books to typeset (e.g., `Dan` or `Gen Exod Lev`). ### Request Example ```tex % Main Bible typesetting file (bible.tex) \load[opbible] % Load OpBible macros \input opbible-hebrew % Hebrew font support (optional) % Define which translation to use \def\tmark{BBE} % Bible in Basic English % Define file locations (relative paths shown) \def\txsfile{./txs/\tmark-\bmark.txs} \def\fmtfile{./fmt/fmt-\tmark-\amark.tex} \def\notesfile{./notes/notes-\amark.tex} \def\introfile{./intros/intro-\amark.tex} % Set Bible translation name \switch {BBE}{\def\bibname{Bible in Basic English}}% {Webster}{\def\bibname{Noah Webster's Bible}}% % Input book definitions \input{books.tex} % Define which books to typeset \def\printedbooks{Dan} % Only Daniel % \def\printedbooks{Gen Exod Lev} % Multiple books % Process and typeset the books \processbooks \bye ``` ### Response #### Success Response Generates a typeset PDF document containing the specified Bible books according to the defined formatting and content. ``` -------------------------------- ### \fmtpre, \fmtadd, \fmtins - Formatting Control Macros Source: https://context7.com/olsak/opbible/llms.txt A set of OpTeX macros used to control the visual formatting of specific verses. They allow for adding section titles, paragraph breaks, inserting content, and formatting verses as poetry. ```APIDOC ## \fmtpre, \fmtadd, \fmtins - Formatting Control Macros ### Description These OpTeX macros provide fine-grained control over the formatting of Bible text. `\fmtpre` allows adding content before a verse, `\fmtadd` adds content after a verse (like paragraph breaks), and `\fmtins` inserts content within a verse. `\fmtpoetry` is used to format verses as poetry. ### Method OpTeX macros used within formatting files. ### Endpoint N/A (OpTeX macros) ### Parameters #### `\fmtpre` - **VERSE_REF** (string) - Required - The verse reference (e.g., `1:1`). - **CONTENT** (TeX content) - Required - The content to insert before the verse (e.g., `\chaptit{...}`). #### `\fmtadd` - **VERSE_REF** (string) - Required - The verse reference (e.g., `1:2`). - **CONTENT** (TeX content) - Required - The content to append after the verse (e.g., `\endgraf`). #### `\fmtins` - **VERSE_REF** (string) - Required - The verse reference (e.g., `2:20`). - **SEPARATOR** (string) - Required - The character or string to replace/insert after (e.g., `: `). - **CONTENT** (TeX content) - Required - The content to insert (e.g., `\medskip`). #### `\fmtpoetry` - **VERSE_REF** (string) - Required - The verse reference (e.g., `2:20`). - **POETIC_LINES** (string) - Required - The text of the verse formatted with `//` for line breaks and `///` for stanza breaks. ### Request Example ```tex % Format file (fmt/fmt-BBE-Dan.tex) % Add section title before verse 1:1 \fmtpre{1:1}{\chaptit{IN ROYAL SERVICE}\subtit{Undefiled}} % Add paragraph break after specific verses \fmtadd{1:2}{\endgraf} \fmtadd{1:7}{\endgraf} \fmtadd{1:10}{\endgraf} % Insert content within a verse (add space after colon in 2:20) \fmtins{2:20}{ CML2: }{\medskip} % Format verses as poetry with line breaks \fmtpoetry{2:20}{Blessed// be the name// of God///} \fmtpoetry{2:21}{He changes// times and// seasons///} % Define subtitle formatting (example macro definition) \def\subtit#1{\par \ifnum\_opb_currversenum=1 \else \medskip\fi \line{\indent\Red\it#1\hss}\nobreak \smallskip } ``` ### Response #### Success Response These macros modify the typesetting output by applying specific formatting rules to verses as defined in the formatting files. ``` -------------------------------- ### Translation Configuration and Variant Management Source: https://context7.com/olsak/opbible/llms.txt This system configures multiple Bible translations, supporting variant-specific formatting, quotation marks, and naming conventions. It uses the \switch macro to set parameters and defines file paths based on translation markers. ```tex % Configure translation variant \ifx\tmark\undefined \def\tmark{BBE} % Default translation \fi % Set translation-specific parameters \switch {BBE}{\def\bibname{Bible in Basic English}} {Jubilee2000}{\def\bibname{Jubilee 2000 Bible}} {NETfree}{\def\bibname{New English Translation}} {Webster}{\def\bibname{Noah Webster's Bible}} % Set quotation mark styles per translation \switch {NETfree}{\quotationmarks{"}{"}} \quotationmarks{"}{"}" % Default English style % Czech translations \switch {BKR}{\def\bibname{Bible kralická}} {B21}{\def\bibname{Bible pro 21. století}} {CEP}{\def\bibname{Český ekumenický překlad}} \quotationmarks{„}{"}" % Czech quotation style % File paths use translation markers \def\txsfile{./txs/\tmark-\bmark.txs} % e.g., BBE-Dan.txs \def\fmtfile{./fmt/fmt-\tmark-\amark.tex} % e.g., fmt-BBE-Dan.tex ``` -------------------------------- ### maketxs.py - TXS File Generator Source: https://context7.com/olsak/opbible/llms.txt A Python script that processes the intermediate format generated by `mod2tex`. It creates individual `.txs` files for each Bible book and a master `books.tex` file containing book title definitions. ```APIDOC ## maketxs.py - TXS File Generator ### Description This Python script takes the intermediate output from `mod2tex` and transforms it into individual `.txs` files, one for each book of the Bible. It also generates a `books.tex` file that defines the titles for each book, essential for the main typesetting process. ### Method Command-line execution ### Endpoint N/A (Command-line tool) ### Parameters #### Command Line Arguments - **INTERMEDIATE_FILE** (string) - Required - The path to the intermediate format file generated by `mod2tex` (e.g., KJV.out). ### Request Example ```bash # Run the script in the txs-gen directory ./maketxs.py KJV.out ``` ### Response #### Success Response This script generates multiple files in the current directory: - `KJV-Gen.txs`, `KJV-Exod.txs`, ..., `KJV-Rev.txs` (one for each book). - `KJV-books.tex` (containing book title definitions). #### Example Output File (KJV-Dan.txs) ``` % source: KJV.out, book: Daniel #1:1 In the third year of the reign of Jehoiakim king of Judah... #1:2 And the Lord gave Jehoiakim king of Judah into his hand... #2:1 And in the second year of the reign of Nebuchadnezzar... ``` #### Example `books.tex` Content ```tex \BookTitle Gen Gen {Genesis} \BookTitle Exod Exod {Exodus} ... ``` ``` -------------------------------- ### Note Macro for Annotations and Study Notes Source: https://context7.com/olsak/opbible/llms.txt The \Note macro allows for adding footnotes, cross-references, and study notes to specific verses or ranges within a Bible text. It supports inline notes, chapter introductions, and translation-specific summaries. ```tex % Notes file (notes/notes-Dan.tex) % Add a chapter introduction note (verse 0) \Note 1:0 {} % Add translation-specific chapter summaries \switch {BKR}{Daniel taken to the royal court, maintained faithfulness to God} {BBE}{God protects faithful Judean youths at the court} % Add study notes for verse ranges \Note 1:1-6:28 {}={Narrative Section} The first part of the book highlights God's absolute sovereignty over the kingdoms of this world, and the sincere devoted faithfulness to God that Daniel and his friends displayed. % Add inline word notes with translation variants \ww {Joakima} % King James rendering {Jehójákíma} % Czech rendering {Jehoiakim} % Modern rendering % Add cross-reference note \Note 1:1 {2Ki 24:1-2} Daniel was taken to Babylon in the third year of Jehoiakim's reign, as recorded in 2 Kings. % Add verse-specific explanatory note \Note 1:7 {} The renaming of the Hebrew youths with Babylonian names was intended to assimilate them into Babylonian culture and religion. ``` -------------------------------- ### Extract SWORD Modules to TeX Format with mod2tex (C++) Source: https://context7.com/olsak/opbible/llms.txt The mod2tex utility, written in C++, extracts Bible text from SWORD library modules and converts it into a TeX-compatible intermediate format. It includes book markers and verse references. Compilation requires a 'make' command and SWORD library support. Input is a SWORD module name, and output is a text file. ```cpp // Compile the utility with SWORD library support // In txs-gen directory: make // Extract a Bible module to text format // First install a SWORD module (e.g., KJV, ESV) installmgr -l // Convert the module to intermediate format ./mod2tex KJV > KJV.out // The output format contains book markers and verse references: // \kniha{Daniel} // \zkratka{Dan} // <1:1 In the third year of the reign of Jehoiakim...> // <1:2 And the Lord gave Jehoiakim king of Judah into his hand...> ``` -------------------------------- ### Control Verse Formatting with \fmtpre, \fmtadd, \fmtins (OpTeX) Source: https://context7.com/olsak/opbible/llms.txt These OpTeX macros, \fmtpre, \fmtadd, and \fmtins, allow fine-grained control over the visual formatting of specific Bible verses. They enable adding section titles before a verse, inserting paragraph breaks after verses, and embedding content or formatting within a verse. They are used within formatting files (e.g., fmt/fmt-BBE-Dan.tex). ```tex % Format file (fmt/fmt-BBE-Dan.tex) % Add section title before verse 1:1 \fmtpre{1:1}{\chaptit{IN ROYAL SERVICE}\subtit{Undefiled}} % Add paragraph break after specific verses \fmtadd{1:2}{\endgraf} \fmtadd{1:7}{\endgraf} \fmtadd{1:10}{\endgraf} % Insert content within a verse \fmtins{2:20}{:}{\medskip} % Add space after colon in verse 2:20 % Format verses as poetry with line breaks \fmtpoetry{2:20}{Blessed// be the name// of God///} \fmtpoetry{2:21}{He changes// times and// seasons///} % Define subtitle formatting \def\subtit#1{\par \ifnum\_opb_currversenum=1 \else \medskip\fi \line{\indent\Red\it#1\hss}\nobreak \smallskip } ``` -------------------------------- ### Hebrew Macro for Hebrew Text Rendering Source: https://context7.com/olsak/opbible/llms.txt The \Hebrew macro handles the insertion and rendering of Hebrew text in Bible documents. It includes automatic font selection, right-to-left support, and character definition for proper display. ```tex % Hebrew support configuration (opbible-hebrew.tex) \initunifonts \font\HebrewFont=[Shlomo]\relax % Primary Hebrew font % Fallback to DavidCLM-Medium if Shlomo not available % Define Hebrew character codes \chardef\Aleph 1488 \chardef\Bet 1489 \chardef\Shin 1513 \chardef\Tav 1514 % Use Hebrew text in notes or main text \Hebrew{\Shin\Aleph\Lamed\Vav\Mem} % שלום (shalom) % Use in annotations \Note 1:1 {} The divine name \Hebrew{\Yod\He\Waw\He} (YHWH) appears throughout the Hebrew text. % Complex Hebrew with kerning control \Hebrew{\Bet\\-2\Resh\\1\Aleph\Shin\\-1\Yod\Tav} % The \\N syntax controls inter-character spacing ``` -------------------------------- ### mod2tex - SWORD Module to TeX Converter Source: https://context7.com/olsak/opbible/llms.txt A command-line utility to extract Bible text from SWORD library modules and convert it into a TeX-compatible intermediate format. It includes book markers and verse references for further processing. ```APIDOC ## mod2tex - SWORD Module to TeX Converter ### Description This C++ command-line utility extracts Bible text from SWORD library modules and converts it to a TeX-compatible intermediate format. The output includes markers for books and verse references. ### Method Command-line execution ### Endpoint N/A (Command-line tool) ### Parameters #### Command Line Arguments - **SWORD_MODULE** (string) - Required - The name of the SWORD module to convert (e.g., KJV, ESV). ### Request Example ```bash # Compile the utility make # Extract a Bible module to text format ./mod2tex KJV > KJV.out ``` ### Response #### Success Response The output is a text file (redirected via `>`) containing the intermediate TeX-compatible format. #### Output Format Example ``` \kniha{Daniel} \zkratka{Dan} <1:1 In the third year of the reign of Jehoiakim...> <1:2 And the Lord gave Jehoiakim king of Judah into his hand...> ``` ``` -------------------------------- ### BookTitle Macro for Defining Book Titles Source: https://context7.com/olsak/opbible/llms.txt The \BookTitle macro defines book titles and their abbreviations for use in cross-references and navigation. It supports multiple languages and translation variants for flexibility. ```tex % Books file (books.tex) % English book titles \BookTitle Gen Gen {Genesis} \BookTitle Exod Exod {Exodus} \BookTitle Lev Lev {Leviticus} \BookTitle Dan Dan {Daniel} \BookTitle Matt Matt {Matthew} \BookTitle Rev Rev {Revelation} % Czech book titles \BookTitle Gn Gn {Genesis} \BookTitle Ex Ex {Exodus} \BookTitle Da Da {Daniel} \BookTitle Mt Mt {Matouš} \BookTitle Zj Zj {Zjevení} % The macro signature is: % \BookTitle {Full Title} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.