### Install the ROMANNUM package Source: https://github.com/latex-package-repositories/herries-press/blob/main/romannum/README.md Execute this command to generate the required .sty file from the installation file. ```bash latex romannum.ins ``` -------------------------------- ### Manage Page Navigation in Two-Sided Documents Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Use navigation commands to force content onto specific even or odd pages, useful for managing chapter starts and facing-page layouts. ```latex \documentclass[twoside]{book} \usepackage{nextpage} \begin{document} \chapter{Introduction} Content of the first chapter... % Clear to next even page (for facing-page content before chapter) \cleartoevenpage % Put content on the even page facing the next chapter \begin{center} \vspace*{\fill} \textit{Part II begins on the next page} \vspace*{\fill} \end{center} \chapter{Part II - Advanced Topics} This chapter starts on an odd page. % Clear to even page with custom content on skipped page \cleartoevenpage[\thispagestyle{empty}] % Above: if a page is skipped, it will have empty page style % Move to odd page without flushing floats \movetooddpage Important content that must start on odd page. % Move to even page without flushing floats \movetoevenpage[\vspace*{\fill}\centerline{This page intentionally left blank}\vspace*{\fill}] % Clear to odd page (same as \cleardoublepage) \cleartooddpage[\thispagestyle{plain}] \end{document} ``` -------------------------------- ### Regenerate the user manual Source: https://github.com/latex-package-repositories/herries-press/blob/main/romannum/README.md Commands to compile the documentation and generate an index. ```bash latex romannum.dtx ``` ```bash makeindex -s gind.ist romannum ``` -------------------------------- ### Typesetting Quotations with \texttt{epigraph} Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Shows how to typeset quotations and epigraphs using the \texttt{epigraph} package, including configuration options and different usage environments like \texttt{epigraphs} and \texttt{epigraphhead}. ```latex \documentclass{book} \usepackage{epigraph} % Configure epigraph appearance \setlength{\epigraphwidth}{0.6\textwidth} \setlength{\epigraphrule}{0.4pt} \renewcommand{\epigraphsize}{\small} \renewcommand{\epigraphflush}{flushright} \renewcommand{\sourceflush}{flushright} \begin{document} % Simple epigraph after section heading \chapter{On Knowledge} \epigraph{The only true wisdom is in knowing you know nothing.}% {\textit{Socrates}} % Multiple epigraphs using the environment \chapter{Philosophy} \begin{epigraphs} \qitem{I think, therefore I am.}{\textsc{Descartes}} \qitem{The unexamined life is not worth living.}{\textsc{Socrates}} \end{epigraphs} % Epigraph before chapter heading using epigraphhead \chapter*{Prologue} \epigraphhead[70]{\epigraph{In the beginning...}{\textit{Genesis}}} % Drop chapter title to make room for long epigraph \dropchapter{2in} \chapter{Extended Introduction} \epigraphhead[100]{\epigraph{A very long quotation that spans multiple lines and requires extra space above the chapter title to display properly without overlapping.}{\textit{Author Name}}} \undodrop \end{document} ``` -------------------------------- ### Enhanced Appendix Handling with \texttt{appendix} Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Demonstrates enhanced appendix handling using the \texttt{appendix} package, including standard appendices, the \texttt{appendices} environment, and \texttt{subappendices} for local sections. ```latex \documentclass{book} \usepackage[toc,page,title,titletoc,header]{appendix} \begin{document} \chapter{Main Content} This is the main body of the document. % Standard appendix usage with heading \appendix \appendixpage \addappheadtotoc \chapter{First Appendix} Content of the first appendix. % Using the appendices environment \begin{appendices} \chapter{Second Appendix} This appendix appears in the ToC with "Appendix" prefix. \end{appendices} % Subappendices within a chapter \chapter{A Chapter with Its Own Appendices} Main chapter content here. \begin{subappendices} \section{Local Appendix A} This section-level appendix belongs to this chapter only. \section{Local Appendix B} Another local appendix. \end{subappendices} \end{document} ``` -------------------------------- ### Table of Contents Customization with \texttt{tocloft} Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Illustrates comprehensive control over the Table of Contents, List of Figures, and List of Tables using the \texttt{tocloft} package, including creating custom lists like \texttt{listofprograms}. ```latex \documentclass{report} \usepackage{tocloft} % Customize ToC title \renewcommand{\cfttoctitlefont}{\hfill\Large\bfseries} \renewcommand{\cftaftertoctitle}{\hfill} % Customize chapter entries \renewcommand{\cftchapfont}{\bfseries} \renewcommand{\cftchappagefont}{\bfseries} \setlength{\cftbeforechapskip}{1em} \renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % Customize section entries \setlength{\cftsecindent}{2em} \setlength{\cftsecnumwidth}{3em} \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}} % Create a custom "List of Programs" \newcommand{\listprogramname}{List of Programs} \newlistof{program}{prg}{\listprogramname} \newcommand{\program}[1]{% \refstepcounter{program} \par\noindent\textbf{Program \theprogram: #1} \addcontentsline{prg}{program}{\protect\numberline{\theprogram}#1} } \begin{document} \tableofcontents \listoffigures \listofprograms \chapter{Introduction} \section{Background} Content here. \program{Hello World} A simple introductory program. \program{Data Processing} A more complex example. \end{document} ``` -------------------------------- ### Customize Title Pages with titling Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Control the appearance of the \maketitle command and retain title metadata for reuse. Supports custom hooks and multiple title pages. ```latex \documentclass{article} \usepackage{titling} % Customize title appearance \pretitle{\begin{center}\LARGE\bfseries\sffamily} \posttitle{\par\end{center}\vskip 0.5em} \preauthor{\begin{center}\large\lineskip 0.5em \begin{tabular}[t]{c}} \postauthor{\end{tabular}\par\end{center}} \predate{\begin{center}\large\itshape} \postdate{\par\end{center}} % Lower the title position \setlength{\droptitle}{-2cm} % Add custom elements via hooks \newcommand{\published}[1]{\gdef\puB{#1}} \newcommand{\puB}{} \renewcommand{\maketitlehooka}{\noindent\puB\par\vskip 1em} \title{Advanced Document Formatting} \author{John Smith \and Jane Doe} \date{January 2024} \published{Originally published in \textit{Journal of Typography}} \begin{document} % First title page \begin{titlingpage} \maketitle \begin{abstract} This paper discusses advanced formatting techniques. \end{abstract} \end{titlingpage} % Access retained values later The paper ``\thetitle'' was written by \theauthor{} on \thedate. % Can create another title page with different content \title{Appendix Materials} \maketitle \end{document} ``` -------------------------------- ### Typeset Poetry with verse Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Extend standard verse environments with line numbering, custom indentation patterns, and stanza labels. Use \! to end lines within the verse environment. ```latex \documentclass{article} \usepackage{verse} % Set up line numbering every 2 lines \poemlines{2} \setlength{\vrightskip}{-2em} % Set verse width for centering \settowidth{\versewidth}{This is the longest line in the poem,} \begin{document} % Poem with title \poemtitle{The Road Not Taken} \begin{verse}[\versewidth] Two roads diverged in a yellow wood, \\ And sorry I could not travel both \\ And be one traveler, long I stood \\ And looked down one as far as I could \\ To where it bent in the undergrowth; \! Then took the other, as just as fair, \\ And having perhaps the better claim, \\ Because it was grassy and wanted wear; \\ Though as for that the passing there \\ Had worn them really about the same, \! \end{verse} % Alternating line indentation \begin{verse} \begin{altverse} There was an old party of Lyme \\ Who married three wives at one time. \\ When asked: `Why the third?' \\ He replied: `One's absurd, \\ And bigamy, sir, is a crime.' \! \end{altverse} \end{verse} % Custom indentation pattern \indentpattern{00110} \begin{verse} \begin{patverse} First line not indented \\ Second line not indented \\ Third line indented once \\ Fourth line indented once \\ Fifth line not indented \! \end{patverse} \end{verse} % Stanza labels \begin{verse} \flagverse{1.} First stanza begins here \\ with continuation lines \! \flagverse{2.} Second stanza follows \\ the same pattern \! \end{verse} \end{document} ``` -------------------------------- ### Adjust page dimensions with changepage Source: https://context7.com/latex-package-repositories/herries-press/llms.txt The changepage package provides the adjustwidth environment for temporary margin modifications. Use \checkoddpage to detect page parity for conditional layout adjustments. ```latex \documentclass{article} \usepackage[strict]{changepage} \begin{document} Normal text with standard margins continues here... % Temporarily widen the text block \begin{adjustwidth}{-1cm}{-1cm} This paragraph extends 1cm into both margins, providing extra width for tables, figures, or content that needs more space. The adjustment is made symmetrically on both sides. \end{adjustwidth} % Asymmetric adjustment \begin{adjustwidth}{}{-2cm} This text extends 2cm into the right margin only, useful for margin notes or special layouts. \end{adjustwidth} % Starred version: adjust based on inner/outer margins (for twoside) \begin{adjustwidth*}{1cm}{-1cm} In two-sided documents, this adjusts the inner margin by 1cm and outer margin by -1cm, maintaining consistency across even and odd pages. \end{adjustwidth*} % Check if on odd or even page (requires two compilations) \checkoddpage \ifoddpage On an odd page \else On an even page \fi \end{document} ``` -------------------------------- ### Format abstracts with the abstract package Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Use the abstract package to customize the appearance of the abstract environment and include it in the Table of Contents. The onecolabstract environment is available for spanning full page width in two-column documents. ```latex \documentclass{article} \usepackage[runin,addtotoc]{abstract} % Options: original, addtotoc, runin, style % Customize abstract appearance \renewcommand{\abstractnamefont}{\normalfont\bfseries} \renewcommand{\abstracttextfont}{\normalfont\small\itshape} \setlength{\absleftindent}{1cm} \setlength{\absrightindent}{1cm} \begin{document} \title{Document Title} \author{Author Name} \maketitle \begin{abstract} This abstract demonstrates the enhanced formatting capabilities. The text appears in small italics with custom margins, and the abstract title uses bold formatting. With the 'addtotoc' option, this abstract appears in the Table of Contents. \end{abstract} % One-column abstract in two-column document \begin{onecolabstract} For two-column documents, this environment creates a single-column abstract spanning the full page width. \end{onecolabstract} \tableofcontents \section{Introduction} Main content follows... \end{document} ``` -------------------------------- ### Create Hanging Paragraphs and Punctuation Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Use \hangpara for individual paragraphs or the hangparas environment for blocks. The hangpunct environment allows punctuation to extend into the margins. ```latex \documentclass{article} \usepackage{hanging} \begin{document} % Single hanging paragraph \hangpara{2em}{1} This is a hanging paragraph where the first line is at the normal margin, but all subsequent lines are indented by 2em from the left. This style is commonly used for bibliographic entries and glossaries. % Negative hangafter: indent first N lines \hangpara{3em}{-2} In this paragraph, the first two lines are indented by 3em, while all remaining lines return to the normal margin position. This is the inverse of the typical hanging indent style. % Multiple hanging paragraphs \begin{hangparas}{1.5em}{1} First paragraph in the environment with hanging indent. All lines after the first are indented by 1.5em. Second paragraph automatically gets the same treatment. The environment applies the hanging style to all paragraphs within it. Third paragraph continues the pattern without needing individual commands for each paragraph. \end{hangparas} % Hanging punctuation (quotes, periods extend into margin) \begin{hangpunct} ``This text demonstrates hanging punctuation where opening and closing quotation marks, periods, and commas extend slightly into the margin for improved visual alignment.'' The effect is subtle but creates cleaner text blocks. \end{hangpunct} \end{document} ``` -------------------------------- ### Add Bibliography and Index to ToC with tocbibind Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Automatically include document elements like the bibliography and index in the Table of Contents. Use package options to exclude specific elements or customize heading names. ```latex \documentclass{book} \usepackage[nottoc,notlot,notlof]{tocbibind} % Options: notbib, notindex, nottoc, notlot, notlof, none % numbib (number bibliography), numindex (number index) % Customize heading names \settocbibname{References} \setindexname{Subject Index} \begin{document} \tableofcontents \listoffigures \listoftables \chapter{Content} Main text with citations \cite{knuth1984}. % Bibliography will automatically appear in ToC \begin{thebibliography}{9} \bibitem{knuth1984} Donald Knuth, \textit{The TeXbook}, 1984. \end{thebibliography} % Index will automatically appear in ToC \printindex \end{document} ``` -------------------------------- ### Reserve Vertical Space with needspace Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Force a page break if the specified amount of vertical space is not available. Useful for keeping blocks of text or lists together. ```latex \documentclass{article} \usepackage{needspace} \begin{document} Some text at the end of a page... % Reserve approximately 5 lines of space \needspace{5\baselineskip} The next five lines will appear together on the same page, preventing an awkward break in the middle of this paragraph that needs to stay together for readability. % More precise space reservation (use between paragraphs) \Needspace{4\baselineskip} \begin{itemize} \item First item \item Second item \item Third item \item Fourth item \end{itemize} % Starred version maintains flush bottom if \flushbottom is active \Needspace*{6\baselineskip} This content and everything below for 6 lines will be kept together, with proper bottom alignment. \end{document} ``` -------------------------------- ### Remove chapter prefixes with anonchap Source: https://context7.com/latex-package-repositories/herries-press/llms.txt The anonchap package suppresses the 'Chapter N' prefix in headings while maintaining internal numbering for references. Use \restorechapter to revert to standard formatting. ```latex \documentclass{book} \usepackage{anonchap} \begin{document} \tableofcontents % This chapter heading shows only "Introduction" % not "Chapter 1 Introduction" \chapter{Introduction} Content of introduction. % Still numbered as Chapter 2 internally \chapter{Background} Chapter numbering still works for cross-references. See Chapter~\ref{ch:methods}. \chapter{Methods} \label{ch:methods} Methods description. % Can restore normal chapter headings if needed \restorechapter \chapter{Results} This shows as "Chapter 4 Results" \end{document} ``` -------------------------------- ### Control Hyphenation and Monospaced Text Source: https://context7.com/latex-package-repositories/herries-press/llms.txt Manage hyphenation globally or locally, including support for special characters and protecting monospaced text from automatic hyphenation. ```latex \documentclass{article} % Options: none (disable all hyphenation), htt (allow TT font hyphenation) \usepackage[htt]{hyphenat} \begin{document} % Disable hyphenation for specific text \nohyphens{This specific phrase will never be hyphenated across lines.} % Allow hyphenation after underscores in identifiers The variable \texttt{user\_defined\_callback\_function} can now be hyphenated properly after the underscores using the \_\ command. % Special commands for hyphenation after various characters \begin{itemize} \item Backslash: \texttt{path\bshyp{}to\bshyp{}file} \item Forward slash: \texttt{http://example\fshyp{}com} \item Period: \texttt{www\dothyp{}example\dothyp{}com} \item Colon: \texttt{key\colonhyp{}value} \item Hyphen in compound: electromagnetic\hyp{}endoscopy \end{itemize} % Non-hyphenating typewriter text (even with htt option) \textnhtt{This monospaced text will not be hyphenated} % Or using the declaration form {\nhttfamily This block of monospaced text is protected from automatic hyphenation regardless of the package options.} \end{document} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.