% !TeX program = xelatex
% ============================================================
% Hebrew-English Course Book Template
% Compile with XeLaTeX in Overleaf.
% ============================================================
\documentclass[11pt,twoside]{article}
% --------------------
% Edition switches
% --------------------
\newif\ifDigitalEdition
\DigitalEditionfalse
%\DigitalEditiontrue
% false = print layout; true = digital/PDF layout. The change is in the margins and odd-even page).
\newif\ifIncludeCovers
\IncludeCoverstrue
%\IncludeCoversfalse
% true = include assets/FrontC.pdf and assets/BackC.pdf;
% false = omit the front and back covers.
% If true and a cover file is missing, a placeholder page is shown.
\newif\ifIncludeRightsNotice
\IncludeRightsNoticefalse
%\IncludeRightsNoticetrue
% false = do not print copyright text at the bottom of the inner opening page; true = copyright text appears, using the name of the author under \BookAuthorEN as the name.
\newif\ifIncludeSideTabs
\IncludeSideTabstrue
%\IncludeSideTabsfalse
% true = show the numbered chapter tabs on the outer page edges;
% false = omit all chapter side tabs.
\newif\ifIncludeBlankSheetBeforeBackCover
\IncludeBlankSheetBeforeBackCovertrue
%\IncludeBlankSheetBeforeBackCoverfalse
% true = insert one completely blank physical sheet (two PDF pages)
% before the back cover.
% false = do not insert a deliberate blank physical sheet;
% When covers are enabled, a single parity page may still be added when
% required to place the back cover on an even-numbered PDF page.
\usepackage{coursebook-template}
% --------------------
% Book metadata -- edit these fields
% Leave an optional field empty to hide it from the internal title page.
% --------------------
\newcommand{\BookTitle}{שם הספר}
\newcommand{\BookSubtitle}{כותרת משנה או שם התוכנית}
\newcommand{\BookTitleShort}{שם הספר}
\newcommand{\BookTypeLine}{} % e.g., ספר הקורס
\newcommand{\CourseName}{שם הקורס}
\newcommand{\BookAuthorHE}{שם המחבר או המחברת}
\newcommand{\BookAuthorEN}{Author Name}
\newcommand{\BookVersion}{} % e.g., Version 1.0, 2026
\newcommand{\InstitutionName}{} % optional institutional line
\newcommand{\CopyrightYear}{2026}
\newcommand{\RightsNoticeEN}{%
\textcopyright\ \CopyrightYear\ \BookAuthorEN.\\
This book was prepared for educational use within the context of this course.\\
Use or distribution outside this framework requires the author’s permission.
}
\begin{document}
% --------------------
% Cover and front matter
% --------------------
\TemplateFrontCover
\TemplateInnerTitlePage
\pagenumbering{roman}
\setcounter{page}{1}
% --------------------
% Preface
% Keep document-specific front-matter pages in main.tex. The style package
% provides \TemplateMajorPageTitle only for their shared visual treatment.
% --------------------
\thispagestyle{plain}
\phantomsection
\addcontentsline{toc}{section}{הקדמה}
\markboth{הקדמה}{הקדמה}
\vspace*{0.09\textheight}
\TemplateMajorPageTitle{הקדמה}
\begin{hebrew}
\setlength{\emergencystretch}{1em}%
\noindent
ברוכים הבאים וברוכות הבאות ל־\BookTitle{}.
זהו טקסט פתיחה לדוגמה. החליפו אותו בכמה פסקאות קצרות שמסבירות למי נועד הספר, מהו ההיגיון שמאחורי מבנה הקורס ואיך מומלץ להשתמש בו. אפשר לשלב באופן טבעי מונחים באנגלית, למשל \EN{machine learning}, בלי לשנות את כיוון המסמך כולו.
התבנית בנויה לשימוש ב־\EN{Overleaf}, אך אפשר להשתמש גם בכל תוכנת {\LaTeX} אחרת. בקובצי התבנית קיימים הגדרות שמקלות מאוד את העבודה במוד של עברית + אנגלית, וגם שילוב של מתמטיקה ונוסחאות במידת הצורך.
כמו כן, הגדרות ברירת המחדל (חלוקה לפרקים, צבעי \EN{Accent} עם שם הפרק בראש העמודים, התחלה של פרק בעמוד אי־זוגי לשמירה על אחידות וכו׳) מוגדרות בספריית הפורמט, ואפשר לשנותן בהתאם לצורך.
לבסוף, אפשר לבחור האם לייצר גרסת \EN{PDF} עבור הדפסה (כאשר שול העמוד הקרוב לשדרה מתרחב, בהתאם למקומו הזוגי/אי־זוגי, לצורך כריכה אפשרית), או עבור גרסה דיגיטלית שבה השוליים משתנים לצורך התאמה למסכים בסגנון קוראים דיגיטליים (קינדל לדוגמה).
\par\vspace{0.8\baselineskip}
\noindent כתיבה מהנה! אני משוכנע שהתוצר יתרום באופן מהותי ללמידה של הסטודנטים/יות שלנו.
\end{hebrew}
\TemplateClearDoublePage
% --------------------
% Table of contents
% --------------------
\thispagestyle{plain}
\phantomsection
\markboth{תוכן העניינים}{תוכן העניינים}
\vspace*{0.09\textheight}
\TemplateMajorPageTitle{תוכן העניינים}
\begingroup
\begin{hebrew}
\makeatletter
\@starttoc{toc}
\makeatother
\end{hebrew}
\endgroup
% --------------------
% Main matter
% --------------------
% This command closes the front matter, starts Arabic page numbering,
% and prepares the first chapter to begin on page 1.
\TemplateStartMainMatter
\Chapter{פרק 1 - התחלה, מושגים ודוגמאות}{chapters/01-getting-started}
\Chapter{פרק 2 - יישומים, נתונים וסיכום}{chapters/02-applications}
% --------------------
% Closing summary page
% --------------------
% Finish the final chapter page while its side tab is still active.
% The closing page begins on the next valid odd page. No extra blank
% physical sheet is inserted here by default.
\TemplateClearDoublePage
\TemplateStopTabs
%\TemplateInsertBlankSheet
\thispagestyle{chapterfirst}
\phantomsection
\addcontentsline{toc}{section}{משפט סיכום} % optional
\markboth{}{}
\vspace*{\stretch{4}}
\begin{center}
{\Huge\bfseries מכאן - זה שלכם/ן\par}
\end{center}
\vspace*{\stretch{6}}
% This command closes the summary page, optionally inserts one blank
% physical sheet, aligns the back cover to an even PDF page, and includes it.
\TemplateBackCover
\end{document}