5.8.1. The properties

Title

Title - Optional

Author

Author normalized to cell rows: {Name, Email, Institution}

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 = 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 : a cell array of 1x2 entries, where each element is:

    { label , text }
    

    Both label and text may be char, string, or convertible.

Rules:
  • items must be an N×2 cell.

  • 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:

rnotes.dsge(“model.rise”, 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

=== 1. Update counter only if numbered ===

figure

FIGURE Add a figure to the report (PDF only).

footnote

FOOTNOTE Add a footnote to the report.

getfieldWithDefault

rnotes.getfieldWithDefault is a function.

v = rnotes.getfieldWithDefault(s, f, def)

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 = rnotes.latexSafe(str, doEscapeLatex)

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 = 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. TeX + PDF are written into pwd.

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 = rnotes(); r = rnotes(title=”My Report”); r = 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 “”)

  • Label : LaTeX label for cross-referencing (default “”)

  • Headers : cellstr of column headers

  • RowNames : cellstr of row names

  • MaxRows : max number of rows before using longtable (default 10)

  • Numbered : logical, whether to number table (default true)

  • 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.

  • 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(“OpenAI”, “https://openai.com”) obj.url(“OpenAI”, “https://openai.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”);