5.8.1. The properties
Title
Title - Optional
Date
rnotes/Date is a property.
Body
Body - Ordered list of elements (structs/objs)
Counters
Counters - Running counters per type
Labels
Labels - Map label
WorkDir
WorkDir - Temp working directory
figsDir
figsDir - Temp working directory for figures
filesToDelete
filesToDelete - Temp assets to clean (e.g., exported figs)
5.8.2. The methods
addParameterTable
ADDPARAMETERTABLE Add a parameterization table from a RISE model.
obj.addParameterTable(m)
- Inputs:
obj : rnotes (report) object
m : rise_model instance
- Name-Value Options:
- Precision (1,1) double = 4
Number of decimal places for parameter values.
Caption (1,:) char = ‘Model Parameterization’
- Produces table:
| Symbol | Description | Regime 1 | Regime 2 | … |
chapter
CHAPTER Add a chapter (report/book only).
checkLatexLiteralSafety
- rnotes.checkLatexLiteralSafety is a function.
warnings = rise.engine.reporting.rnotes.checkLatexLiteralSafety(str)
cleardoublepage
CLEARDOUBLEPAGE End the current page and start the next one on an odd-numbered page.
- Usage:
obj.cleardoublepage()
- Notes:
Emits LaTeX cleardoublepage. Like clearpage but additionally inserts a blank verso page if necessary so the next content starts on a recto (odd-numbered) page.
Only visually distinct from clearpage when the documentclass uses two-sided printing (e.g. report, book).
clearpage
CLEARPAGE End the current page and flush pending floats before starting a new page.
- Usage:
obj.clearpage()
- Notes:
Emits LaTeX clearpage.
Stronger than newpage: floats (figures, tables) that are still pending are flushed out before the new page starts.
create_figure
CREATE_FIGURE Build a multi-panel figure from subplot specs and append it.
- Usage:
r.create_figure(subplots) r.create_figure(subplots, Caption=”My figure”, DateFormat=”yyyy”)
- Inputs:
subplots: cell array. Each cell is itself a cell of the form:
{data, 'caption', '...', 'legend', {...}, 'plotfunc', @fn, ... 'highlighted_dates', {[d1 d2]}, 'style', {'linewidth',2}, ... 'xline', vals, 'yline', vals}Only data is required.
- Name-value options that apply to the whole figure:
DateFormat (string) : datetick format, e.g. “yyyy”.
Range (1x2) : x-axis limits applied to every subplot.
Plus any name-value option that obj.figure(…) accepts (Caption, Label, Width, Height, Scale, Angle, Placement, Numbered).
- Notes:
Each subplot draws into a horizontal slice of one figure.
The resulting figure handle is enrolled via obj.figure(…).
The xlim trap from @rprt/create_figure.m:223 (passing rise_dates.dates straight to fill() on a datetime axis) is handled identically here.
description
DESCRIPTION Insert a LaTeX description list into the report.
- Usage:
obj.description(items)
- Inputs:
items : an N×2 cell array, one row per entry:
{ label , text }Both label and text may be char, string, or convertible.
- Rules:
items must be an N×2 cell: labels in the first column, texts in the second, not a column of nested 1x2 cells.
Each label/text is LaTeX-escaped.
This method behaves like:
\begin{description} \item[Label] explanation text \end{description}Example:
r.description({ 'Persistence','Determines propagation speed' 'Uncertainty','Amplifies responses' });
dsge
DSGE Adds a RISE/DSGE model file to the report with syntax highlighting.
- Usage:
obj.dsge(“model.rs”) obj.dsge(“model.rsa”, Lines=1:50, Footnote=”Core equations”)
- Description:
Reads a RISE model file and renders it in LaTeX with syntax highlighting consistent with RISE’s internal color scheme (keywords, directives, comments).
- Name-Value Options:
Syntax (logical) : Enable syntax highlighting (default = true)
LineNumbers (logical) : Show line numbers (default = true)
Lines : “all” | “none” | numeric vector (default = “all”)
Footnote (string) : Optional footnote appended after the block
LatexAlias (logical) : Reserved for compatibility (default=false)
- Example:
r.dsge(“model.rs”, Lines=1:50, Footnote=”Core equations”)
enumerate
ENUMERATE Add a numbered list (enumerated list) to the report.
- Usage:
obj.enumerate({“Apple”, “Banana”, “Orange”});
- Inputs:
items : Cell array of strings, each representing a list element.
- Notes:
Uses the LaTeX ‘enumerate’ environment.
Each item is escaped for LaTeX safety.
- Example:
r.enumerate({“Step 1: Prepare”, “Step 2: Execute”, “Step 3: Review”});
equation
EQUATION Add a displayed equation to the report.
Usage:
obj.equation(expression) obj.equation(expression, Numbered=false) obj.equation(expression, Label="eq:ar1")
- Inputs:
expression : the LaTeX of the equation (string or char)
- Name-Value Options:
Numbered (logical) : number the equation (default = true)
Label (string) : LaTeX label for cross-references (default = “”)
- Notes:
Math delimiters around a plain expression (
$...$,$$...$$,\(...\),\[...\]) are removed first.Numbered: a plain expression is written in an
equationenvironment, labeled with Label, oreq:N(N the running equation number) when Label is empty. An expression already in anequation,alignorgatherenvironment is written as given (a starred environment loses its star), followed by Label when one is given.Unnumbered: a plain expression is written between
\[and\]; an environment or a\[...\]block is written as given. The equation counter does not move.Example:
r.equation("y_t = \rho y_{t-1} + \varepsilon_t", Label="eq:ar1");
figure
FIGURE Add a figure to the report (PDF only).
Usage:
obj.figure(source) obj.figure(source, Caption="Impulse responses", Label="fig:irf") obj.figure(source, Width=0.6, Placement="htbp", Numbered=false)
- Inputs:
source : a figure handle, an axes handle (its figure is used) or the name of an image file
- Name-Value Options:
Caption (string) : caption, escaped for LaTeX (default = “”)
Label (string) : LaTeX label for cross-references (default = “”)
Width (double) : at most this fraction of the text width, in (0,1] (default = 0.85)
Height (double) : at most this fraction of the text height, >= 0 (default = 0.8)
Scale (double) : scale factor passed to the image inclusion, in (0,1] (default = 0.85)
Angle (double) : rotation in degrees, in [-360,360] (default = 0)
Placement (string) : LaTeX float placement (default = “H”)
Numbered (logical) : number the figure (default = true)
- Notes:
A handle is saved as a PNG file in the report’s temporary folder; a file name is passed to
\includegraphicsas given.Width and Height are passed together with
keepaspectratio: they bound a box and the image keeps its proportions inside it.The label is written only when Label is given.
Example:
fig=figure; plot(1:10); r.figure(fig,Caption="A line",Label="fig:line");
footnote
FOOTNOTE Add a footnote to the report.
input
INPUT Insert a raw LaTeX input{…} directive into the report.
- Usage:
rpt.input(“chapter1.tex”);
- Notes:
*No escaping happens.* The file is given verbatim to LaTeX.
Useful for including custom LaTeX, tables, equations, or text.
Does NOT check syntax of the external file.
Optional: warn if file missing.
itemize
ITEMIZE Add a bullet list (itemized list) to the report.
- Usage:
obj.itemize({“Item 1”, “Item 2”, “Item 3”});
- Inputs:
items : Cell array of strings, each representing a bullet point.
- Notes:
Uses the LaTeX ‘itemize’ environment.
Each item is automatically escaped for LaTeX safety.
- Example:
r.itemize({“First point”, “Second point”, “Third point”});
latexSafe
- rnotes.latexSafe is a function.
out = rise.engine.reporting.rnotes.latexSafe(str, doEscapeLatex)
LATEXSAFE Make a LaTeX literal safe to pass as an fprintf/sprintf format.
out = rnotes.latexSafe(”\theta”) % “\\theta”, which sprintf prints as \theta out = rnotes.latexSafe(txt, true) % escape the plain text first
A backslash a format would read as an escape (\t, \n, \f, \a, \v, or one before a space) is doubled. With doEscapeLatex, the LaTeX specials of the plain text are escaped first (rnotes.escape_nonmath_latex).
maketitle
MAKETITLE Add a title block or title page to the report.
- Usage:
obj.maketitle() obj.maketitle(NewPage=false, Centered=false)
- Inputs (Name-Value arguments):
Title (optional) : Override report title (default = obj.Title)
Author (optional) : Override report authors (default = obj.Author)
Date (optional) : Override report date (default = current date)
Centered (logical) : Whether to center the title block (default=true)
NewPage (logical) : Whether to start the title on a new page (default=true)
TitleSize (string) : LaTeX font size command for the title (default=”\LARGE”)
AuthorSize (string): LaTeX font size command for authors (default=”\large”)
DateSize (string) : LaTeX font size command for date (default=”\normalsize”)
- Notes:
If Title or Author is empty, the corresponding field is omitted.
This method writes LaTeX commands directly and does not require the built-in maketitle, giving you full control over formatting.
- Example:
r = rise.engine.reporting.rnotes(title=”My Report”, author=”Junior Maih”); r.maketitle();
newpage
NEWPAGE Insert a page break into the report.
- Usage:
obj.newpage()
- Notes:
Inserts a LaTeX newpage command.
No options or arguments.
- Example:
r.newpage();
pagebreak
PAGEBREAK Insert a LaTeX pagebreak into the report.
- Usage:
obj.pagebreak() obj.pagebreak(Level=2)
- Inputs:
Level : optional integer in [0,4] controlling break strength (default 0)
- Notes:
Inserts pagebreak or pagebreak[Level] depending on input.
LaTeX-only (PDF export).
- Example:
r.pagebreak(Level=2);
paragraph
PARAGRAPH Add a paragraph of text to the report.
- Usage:
obj.paragraph(“This is a paragraph of text.”);
- Inputs:
text : Paragraph content (string or char)
- Notes:
Text is escaped for LaTeX safety.
Paragraphs are written as plain text with a blank line after.
No numbering or label.
- Example:
r.paragraph(“This paper studies the impact of fuel subsidy removal.”);
publish
PUBLISH Compile the report to a PDF file under the NEW ARCHITECTURE.
savefile: “report.pdf” (NO PATHS ALLOWED)
Formatting options are *all* passed inside args.
- Examples:
r.publish(“out.pdf”, DocumentClass=”report”, PointSize=”12pt”)
All figures are inside obj.WorkDir, under the temporary folder, and are reached through an absolute \graphicspath. TeX + PDF are written into pwd. When the report has figures and the working folder goes (KeepTempFiles=false, the default), they go to <name>_figures beside the TeX, which points there, so that the TeX still compiles. A kept working folder stays where the TeX points.
- Options of note:
- LatexEngine“pdflatex”, or the full path of an engine (spaces
allowed)
- MarginsTop, Bottom, Left, Right, numbers in centimeters or
text with a unit (“2cm”, “15mm”, “1in”)
- NumberingDepthdeepest numbered heading level (\setcounter
{secnumdepth}): 1 section, 2 subsection, 3 subsubsection (default)
quotation
QUOTATION Add a quotation block to the report.
- Usage:
obj.quotation(“Lorem ipsum dolor sit amet.”); obj.quotation(“Lorem ipsum dolor sit amet.”, Author=”John Doe”);
- Inputs:
text : Quotation text (string or char)
Author : Optional author of the quotation (string, default “”)
- Notes:
Uses the LaTeX ‘quotation’ environment (suitable for multi-paragraph quotes)
Automatically escapes LaTeX special characters
Author attribution is right-aligned and prefixed with an em-dash
- Example:
- r.quotation(“Courage is resistance to fear, mastery of fear—not absence of fear.”, …
Author=”Mark Twain”);
quote
QUOTE Add a block quotation to the report.
- Usage:
obj.quote(“Lorem ipsum dolor sit amet.”); obj.quote(“Lorem ipsum dolor sit amet.”, Author=”John Doe”);
- Inputs:
text : The quoted text (string or char)
Author : Optional author or attribution (string, default “”)
- Notes:
LaTeX-only (PDF export)
Text and author are automatically escaped for LaTeX
Formats as a centered quote with optional right-aligned author
- Example:
r.quote(“Wisdom begins in wonder.”, Author=”Socrates”);
rnotes
Lightweight constructor: content only.
- Usage:
r = rise.engine.reporting.rnotes(); r = rise.engine.reporting.rnotes(title=”My Report”); r = rise.engine.reporting.rnotes(title=”My Report”, author=”Junior Maih”);
section
SECTION Add a section to the report.
subparagraph
SUBPARAGRAPH Add a sub-paragraph heading to the report.
- Usage:
obj.subparagraph(“Title”) obj.subparagraph(“Title”, Numbered=false) obj.subparagraph(“Title”, Label=”sub:foo”)
- Notes:
Emits a LaTeX subparagraph{…} (numbered) or subparagraph*{…} (un-numbered, no entry in the TOC).
The numbering rule mirrors paragraph()/section(): subparagraphs don’t have their own counter, so Numbered=true just keeps the command form un-starred and lets LaTeX handle it; the report’s internal counters are untouched.
subsection
SUBSECTION Add a subsection to the report.
subsubsection
SUBSUBSECTION Add a subsubsection to the report.
table
TABLE Add a (LaTeX) table to the report.
- Usage:
obj.table(data) obj.table(data, Caption=”Sample Table”, Headers=headers, RowNames=rows)
- Inputs:
data : numeric, cell, or MATLAB table
Caption : string caption for the table (default “”)
- LabelLaTeX label for cross-referencing (default “”); needs
a numbered table with a caption
Headers : cellstr of column headers
RowNames : cellstr of row names
MaxRows : max number of rows before using longtable (default 10)
- Numberedlogical, whether to number table (default true). A
table is numbered through its caption; an unnumbered one keeps its caption, unnumbered
Precision : integer, number of decimal places (default 4)
- FormatFuncsstructure or array of structs with fields
.test (function handle) and .action (cellstr of actions)
- Notes:
Supports ‘bold’, ‘italics’, ‘underline’, and LaTeX colors (‘red’,’blue’,…).
Converts MATLAB tables automatically.
Escapes all text for LaTeX safety, except a cell or header that is one inline formula, $…$, which is written as mathematics.
Writes begin{table} or begin{longtable} depending on MaxRows.
- Example:
data = rand(3); hdrs = {‘A’,’B’,’C’}; rows = {‘Row1’,’Row2’,’Row3’}; f = struct(‘test’,@(x)x>0.5,’action’,{‘bold’,’red’}); r.table(data, Headers=hdrs, RowNames=rows, Caption=”Sample Table”, FormatFuncs=f);
text
TEXT Add a text of theText to the report.
- Usage:
obj.text(“This is a text of theText.”);
- Inputs:
theText : Paragraph content (string or char)
- Notes:
Text is escaped for LaTeX safety.
Paragraphs are written as plain text with a blank line after.
No numbering or label.
- Example:
r.text(“This paper studies the impact of fuel subsidy removal.”);
toc
TOC Add a table of contents to the report.
- Usage:
obj.toc() obj.toc(Depth=2)
- Inputs:
Depth (optional) : Number of section levels to include (1–3, default=2).
Title (optional) : Custom title for the TOC (default=”Contents”).
NewPage (optional) : Logical, whether to force a page break before TOC (default=true).
- Notes:
In LaTeX, this inserts tableofcontents and optionally limits the depth.
Automatically generates bookmarks when compiled to PDF (requires hyperref).
- Example:
r.toc(Depth=3, Title=”Table of Contents”, NewPage=false);
url
URL Add a hyperlink or URL to the report (LaTeX only).
- Usage:
obj.url(“Example”, “https://example.com”) obj.url(“Example”, “https://example.com”, MaskedText=”Visit site”)
- Inputs:
text : The visible label or fallback text.
link : The URL to link to.
MaskedText : Optional text to display instead of the raw URL (default: “”).
- Notes:
Uses the LaTeX href{}{} command (requires hyperref package).
Automatically escapes special LaTeX characters in both text and link.
- Example:
r.url(“GitHub”, “https://github.com/jmaih”, MaskedText=”RISE Toolbox”);
verbatim
VERBATIM Add verbatim (unformatted) text to the report.
- Usage:
obj.verbatim(“Some raw code or text”);
- Inputs:
text : string or char (printed exactly as given)
- Notes:
Text is written inside a LaTeX begin{verbatim}…end{verbatim} block.
No escaping or formatting is applied.
Intended for code listings, snippets, or raw text blocks.
- Example:
r.verbatim(“for i=1:10, disp(i), end”);
Write editable source without compiling
Set OutputFormat="tex" to emit TeX without invoking a compiler. PDF remains
the default. The output filename must use the selected extension, or omit it.
The same document writer is used; figure assets remain available beside the
emitted source when temporary files are removed. Existing PDFs are not used
as evidence for a source-only call. For example:
out=rise.publish('walkthrough.m','OutputFormat',"tex",'EvalCode',false);
report.publish("report.tex",'OutputFormat',"tex");
The first call returns the emitted .tex path. Execution and output format
are separate choices: EvalCode=false prevents script execution, while
OutputFormat="tex" prevents PDF compilation.