Add LaTeX compile support with templates (memoir, academic)

This commit is contained in:
Solaria
2026-03-14 13:16:09 +00:00
parent c42556d147
commit 8693d2ffa9
5 changed files with 748 additions and 0 deletions
@@ -0,0 +1,152 @@
% Opus Orchestrator - Academic/Textbook Template
% Technical, educational, academic works
\documentclass[12pt,oneside]{book}
% Packages
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{geometry}
\usepackage{makeidx}
\usepackage{natbib}
\usepackage{titlesec}
\usepackage{booktabs}
\usepackage{listings}
\usepackage{fancyvrb}
\usepackage{multicol}
% Geometry
\geometry{
paperwidth=8.5in,
paperheight=11in,
textwidth=6in,
textheight=9in,
left=1in,
right=1in,
top=1in,
bottom=1in,
}
% Hyperref
\hypersetup{
colorlinks=true,
linkcolor=blue,
citecolor=blue,
urlcolor=blue,
}
% Chapter formatting
\titleformat{\chapter}[display]
{\normalfont\LARGE\bfseries}
{\chaptertitlename\ \thechapter}{20pt}{\LARGE\bfseries}
\titleformat{\section}
{\normalfont\Large\bfseries}
{\thesection}{12pt}{\Large\bfseries}
\titleformat{\subsection}
{\normalfont\large\bfseries}
{\thesubsection}{12pt}{\large\bfseries}
% Headers
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE]{\thepage}
\fancyhead[RO]{\thepage}
\fancyhead[RE]{\leftmark}
\fancyhead[LO]{\rightmark}
% Code listings
\lstset{
basicstyle=\ttfamily\small,
frame=single,
backgroundcolor=\color{lightgray},
}
% Index
\makeindex
% Book metadata
\def\booktitle{$book_title$}
\def\bookauthor{$author$}
\def\bookdate{$date$}
\def\bookpublisher{$publisher$}
\def\bookedition{$edition$}
\begin{document}
% Front matter
\frontmatter
% Title page
\begin{titlepage}
\begin{center}
\vspace*{1in}
{\Huge\bfseries\booktitle\par}
\vspace{0.5in}
{\Large\bookauthor\par}
\vfill
{\large\bookedition}\\
\bigskip
{\large\bookpublisher}\\
{\large\bookdate}
\end{titlepage}
% Copyright
\thispagestyle{empty}
\vspace*{\fill}
Copyright \textcopyright\ \bookdate\ \bookauthor\\
All rights reserved.
\vfill
% Dedication
$if(dedication)$
\clearpage
\begin{center}
\textit{$dedication$}
\end{center}
$endif$
% Acknowledgments
$if(acknowledgments)$
\chapter{Acknowledgments}
$acknowledgments$
$endif$
% Abstract
$if(abstract)$
\chapter{Abstract}
$abstract$
$endif$
% Table of contents
\tableofcontents
% List of figures
\listoffigures
% List of tables
\listoftables
% Main matter
\mainmatter
$body$
% Back matter
\backmatter
% Bibliography
$if(bibliography)$
\bibliographystyle{plainnat}
\bibliography{$bibliography$}
$endif$
% Index
\printindex
\end{document}
+123
View File
@@ -0,0 +1,123 @@
% Opus Orchestrator - Base LaTeX Template
% Auto-generated book template
\documentclass[12pt,openany]{book}
% Packages
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{indentfirst}
\usepackage{epigraph}
\usepackage{changepage}
% Geometry
\geometry{
paperwidth=6in,
paperheight=9in,
textwidth=4.5in,
textheight=7in,
headheight=12pt,
headsep=12pt,
footskip=24pt,
marginparwidth=0pt,
}
% Hyperref
\hypersetup{
colorlinks=true,
linkcolor=black,
citecolor=black,
urlcolor=black,
}
% Title formatting
\titleformat{\chapter}[display]
{\normalfont\LARGE\bfseries}
{\chaptertitlefont\thechapter}{1em}{\chaptertitlefont\titlefont}
\titleformat{\section}
{\normalfont\Large\bfseries}
{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\large\bfseries}
{\thesubsection}{1em}{}
% Headers
\fancyhf{}
\fancyhead[LE]{\nouppercase{\thechapter}}
\fancyhead[RO]{\nouppercase{\rightmark}}
\fancyfoot[C]{\thepage}
\pagestyle{fancy}
% Commands
\newcommand{\chaptertitlefont}{\scshape}
\newcommand{\titlefont}{\scshape}
% Book metadata (filled by Opus)
\def\booktitle{$book_title$}
\def\bookauthor{$author$}
\def\bookdate{$date$}
\def\bookpublisher{$publisher$}
\def\bookisbn{$isbn$}
\begin{document}
% Frontmatter
\frontmatter
% Title page
\begin{titlepage}
\begin{center}
\vspace*{1in}
{\Huge\scshape\booktitle\par}
\vspace{2in}
{\Large\scshape\bookauthor\par}
\vspace{1in}
{\large\scshape\bookdate\par}
\vfill
\end{titlepage}
% Copyright page
\thispagestyle{empty}
\vspace*{\fill}
\begin{center}
Copyright \textcopyright\ \bookdate\ \bookauthor\\
All rights reserved.\\
\bookisbn
\end{center}
\vspace*{\fill}
% Dedication (if any)
$if(dedication)$
\cleardoublepage
\thispagestyle{empty}
\vspace*{3in}
\begin{center}
\textit{$dedication$}
\end{center}
$endif$
% Table of contents
\tableofcontents
% Main body
\mainmatter
$body$
% Backmatter
\backmatter
% Bibliography (if any)
$if(bibliography)$
\printbibliography
$endif$
\end{document}
@@ -0,0 +1,135 @@
% Opus Orchestrator - Memoir Template
% Novel, memoir, personal narrative
\documentclass[12pt,openany]{memoir}
% Packages
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{lettrine}
% Geometry - trade book format
\geometry{
paperwidth=5.5in,
paperheight=8.5in,
textwidth=4in,
textheight=7in,
inner=0.75in,
outer=0.5in,
top=0.75in,
bottom=0.75in,
}
% Hyperref
\hypersetup{
colorlinks=false,
}
% Memoir settings
\chapterstyle{levado}
\sectionstyle{hang}
\subsectionstyle{runin}
% Drop caps
\def\rubricum#1{{\let\A\firstchar #1}}
\let\firstchar=
% Custom chapter style
\makechapterstyle{levado}{
\def\chapterheadstart{}
\def\beforechaptitle{\centering\spacedallcaps}
\def\chapternumber{\chapnumfont\thechapter}
\def\afterchaptitle{\par\nobreak\vskip 1.5em}
}
% Epigraphs
\epigraphwidth=3in
\epigraphsize\small
% Headers
\nouppercaseheads
\headsep=12pt
\makepagestyle{opus}
\makepsmarks{opus}{
\createmark{chapter}{left}{shownumber}{\chaptertitleformat}{\ }
\createmark{section}{right}{shownumber}{\sectiontitleformat}{\ }
\nobreak\Cfoot{\thepage}\or
\nobreak\cefoot{\thepage}\or
\nobreak\cofoot{\thepage}
}
\pagestyle{opus}
% Book metadata
\def\booktitle{$book_title$}
\def\bookauthor{$author$}
\def\bookdate{$date$}
\def\bookpublisher{$publisher$}
\def\bookseries{$series$}
\begin{document}
% Half title
\thispagestyle{empty}
\begin{center}
\vspace*{2in}
{\Huge\scshape\booktitle\par}
\end{center}
% Title page
\clearpage
\thispagestyle{empty}
\begin{center}
\vspace*{1in}
{\Huge\scshape\booktitle\par}
\vspace{2in}
{\Large\scshape\bookauthor\par}
\vfill
{\large\scshape\bookpublisher\par}
{\large\scshape\bookdate\par}
\end{center}
% Copyright
\clearpage
\thispagestyle{empty}
\vspace*{\fill}
\begin{center}
Copyright \textcopyright\ \bookdate\ \bookauthor\\
All rights reserved.\\
ISBN: $isbn$
\end{center}
\vspace*{\fill}
% Dedication
$if(dedication)$
\clearpage
\thispagestyle{empty}
\vspace*{3in}
\begin{center}
\textit{$dedication$}
\end{center}
$endif$
% Epigraph
$if(epigraph)$
\clearpage
\begin{center}
\textit{$epigraph$}
\end{center}
$endif$
% Contents
\clearpage
\tableofcontents*
\clearpage
\mainmatter
$body$
\end{document}