Build Log #3: How to Set Up Branded Business PDFs with AI and Markdown

By MCP Analytics Team | Published , updated

Write in markdown. Keep the brand in one template. Build every PDF with one command.

By MCP Analytics Team · Build Log

We needed business documents: a one-sheeter, a longer overview, a product write-up, a go-to-market plan. The kind of thing you hand someone who asks "so what does your company do?"

Instead of laying each one out by hand in a slide or design tool, we write them in plain markdown and keep the look in one LaTeX template. One command turns every file into a branded PDF with our colors, fonts, a header and footer, and a title page, and then joins them into one combined deck.

This post shows the full setup. Every file below was saved exactly as printed and built on November 2, 2026; the result is in What the build produced. In our own repo the same idea runs as a script called build-pdf.sh, first committed on April 6, 2026.

What You Need

Pandoc: a document converter. It turns markdown into PDF (through LaTeX), HTML, Word and many other formats (pandoc manual). Install it:

brew install pandoc        # Mac
sudo apt install pandoc    # Ubuntu/Debian
choco install pandoc       # Windows

A LaTeX engine: LaTeX is the typesetting system pandoc uses to lay out the PDF. The template below loads fontspec, a package that lets LaTeX use the fonts installed on your computer; it needs the XeLaTeX or LuaLaTeX engine (fontspec on CTAN). Two ways to get one:

A text editor: you are writing markdown, so any editor works.

Step 1: Write Your Content in Markdown

Write the words. Fonts and colors are the template's job. The first line, \doctitle{Pitch}, is a LaTeX command that pandoc passes straight through to the PDF; it calls the title page defined in Step 2.

\doctitle{Pitch}

# Your Company Name

**The one-line pitch.**

## The Problem

Describe the problem your company solves. Keep it to 2-3 sentences.
If you can't explain the problem in 3 sentences, you don't understand
it well enough yet.

## The Solution

What you do about it. Be specific. Not "we leverage AI to optimize
synergies": say what actually happens when someone uses your product.

## Why Now

What changed in the world that makes this the right time.

## Where We Are

- Users, revenue, traction: whatever you've got
- Be honest: people can tell when you're inflating

## What We Need

The ask. Introductions? Investment? Customers? Say it directly.

Save it as pitch.md. That file is your source of truth: when the business changes, you edit it and build again.

Step 2: Create Your Brand Template

You write this LaTeX template once, and every document you build uses it. Save it as template.tex in the same folder as your markdown files.

\documentclass[11pt]{article}

\usepackage[margin=0.75in, top=1in, bottom=0.8in]{geometry}
\usepackage{fancyhdr}
\usepackage{fontspec}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{array}
\usepackage{calc}
\usepackage{parskip}

% === YOUR BRAND COLORS ===
% Change these hex codes to match your brand
\definecolor{brandprimary}{HTML}{C65000}  % Your primary color
\definecolor{darktext}{HTML}{1a1a2e}      % Body text
\definecolor{graytext}{HTML}{6b7280}      % Secondary text
\definecolor{rulegray}{HTML}{d1d5db}      % Lines and rules

% === YOUR FONTS ===
% Use any fonts installed on your system
\setmainfont{Georgia}           % Body text (serif)
\setsansfont{Helvetica Neue}    % Headings (sans-serif)
\setmonofont{Courier}           % Code blocks

% Links in your brand color
\hypersetup{
  colorlinks=true,
  linkcolor=brandprimary,
  urlcolor=brandprimary
}

% Section headings in brand color
\makeatletter
\renewcommand{\section}{%
  \@startsection{section}{1}{0pt}%
  {16pt}{8pt}%
  {\sffamily\Large\bfseries\color{brandprimary}}}
\renewcommand{\subsection}{%
  \@startsection{subsection}{2}{0pt}%
  {12pt}{4pt}%
  {\sffamily\large\bfseries}}
\makeatother

% === HEADER AND FOOTER ===
% This is what makes it look official
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0.4pt}
\fancyhead[L]{%
  \sffamily\small%
  {\color{brandprimary}YOUR}  % First word in brand color
  {\color{graytext}Company}   % Rest in gray
}
\fancyhead[R]{\sffamily\small\color{graytext}\today}
\fancyfoot[L]{%
  \sffamily\scriptsize\color{rulegray}yourcompany.com}
\fancyfoot[C]{\sffamily\small\color{graytext}\thepage}
\fancyfoot[R]{%
  \sffamily\scriptsize\color{rulegray}Confidential}

% === TITLE PAGE ===
\newcommand{\doctitle}[1]{%
  \clearpage
  \thispagestyle{empty}
  \begin{center}
  \vspace*{80pt}
  {\sffamily\fontsize{36}{42}\selectfont%
    \color{brandprimary}\textbf{Your Company}}\\[16pt]
  {\sffamily\fontsize{16}{20}\selectfont%
    \color{graytext}#1}\\[50pt]
  {\color{rulegray}\rule{0.3\textwidth}{1pt}}\\[40pt]
  {\sffamily\color{graytext}\today}\\[6pt]
  {\sffamily\small\color{graytext}Confidential}
  \end{center}
  \newpage
}

% Pandoc compatibility
\providecommand{\tightlist}{%
  \setlength{\itemsep}{2pt}%
  \setlength{\parskip}{2pt}}
\newcounter{none}

\begin{document}
$body$
\end{document}

To make it yours, edit three blocks: the hex codes under YOUR BRAND COLORS, the font names under YOUR FONTS (use fonts installed on your computer; Georgia, Helvetica Neue and Courier ship with macOS), and the company name in the header and the TITLE PAGE block. The $body$ line is where pandoc inserts your converted markdown. The \clearpage at the top of \doctitle makes each title start on a fresh page, which matters once several documents are joined into one deck.

Step 3: Build One PDF

pandoc -f markdown --pdf-engine=xelatex \
  --template=template.tex \
  pitch.md -o pitch.pdf

If you installed Tectonic instead of a TeX distribution, use --pdf-engine=tectonic. Both are listed as valid engines in the pandoc manual. Add --toc for a table of contents.

Step 4: Build Every Document and a Combined Deck

Add a second file, one-sheet.md:

\doctitle{One-sheet}

# Your Company Name

**What we do, in one sentence.**

## Who It Is For

The customer, the job they need done, and what they use today.

## How It Works

Three steps, in the order a customer meets them.

Then save this script as build-pdf.sh and make it runnable with chmod +x build-pdf.sh. The loop builds one PDF per markdown file. The last pandoc call builds the combined deck: when pandoc is given several input files, it joins them (with blank lines between) before converting, so the deck is every document in order, each behind its own title page.

#!/bin/bash
# build-pdf.sh: build one PDF per markdown file, then one combined deck
set -e
cd "$(dirname "$0")"
mkdir -p pdf
ENGINE="${PDF_ENGINE:-xelatex}"

for f in *.md; do
  echo "Building $(basename "$f" .md).pdf..."
  pandoc -f markdown --pdf-engine="$ENGINE" \
    --template=template.tex \
    "$f" -o "pdf/$(basename "$f" .md).pdf"
done

# Combined deck: pandoc joins several input files into one document
echo "Building deck.pdf..."
pandoc -f markdown --pdf-engine="$ENGINE" \
  --template=template.tex \
  *.md -o pdf/deck.pdf

echo "Done."

What the Build Produced

We copied the files above exactly as printed and ran PDF_ENGINE=tectonic ./build-pdf.sh on November 2, 2026 (Apple M2 Pro, macOS 26.2, pandoc 3.9.0.2, Tectonic 0.16.9). The console output, with Tectonic's font-path warnings removed:

Building one-sheet.pdf... Building pitch.pdf... Building deck.pdf... Done.

Page counts from pdfinfo:

pdf/deck.pdf Pages: 4 pdf/one-sheet.pdf Pages: 2 pdf/pitch.pdf Pages: 2

Each single document is a title page plus one content page; the deck is both of them back to back. The content pages carry the orange section headings, the two-color company name and date in the header, and the site, page number and "Confidential" in the footer. pdffonts pdf/pitch.pdf lists Georgia, Georgia Bold, Helvetica Neue and Helvetica Neue Bold, all embedded, so the PDF looks the same on a computer without those fonts. One caution: in a few rebuilds on the same machine, Tectonic picked the bold italic face from the Helvetica Neue font file and the headings came out italic, so run pdffonts on your own build and look at the headings.

Timing: three full runs of the script took 11.2, 13.3 and 10.7 seconds of wall-clock time on that machine, for three PDFs. The very first Tectonic run took longer (about 73 seconds for a single PDF) because it downloaded its support files. Your times will differ with the machine, the engine and the length of the documents.

One thing the first test caught: without the \clearpage line in \doctitle, the second title page started on the same page as the end of the first document, and the deck came out at 3 pages instead of 4. The template above includes the fix.

How We Use It

Our business documents live as numbered markdown files in our repository. The script there does the same three things as the one above, plus a little more: it strips our internal note markers before building, adds a table of contents to the longer documents, leaves the one-sheeter out of the combined deck, and puts a title page at the front of the deck. When a section changes, we edit the markdown and rebuild.

Why markdown works well with AI writing tools. Chat assistants such as Claude and ChatGPT usually answer in markdown, and coding tools edit markdown files directly. When an assistant helps draft or revise a section, it only touches the words; the template decides how the page looks. That split is how we wrote our own business documents: a person sets the direction and decides what is true, the AI tool helps organize and phrase it, and the template handles the look.

Publishing the format may help AI agents reuse it. This is a possibility, not something we have measured. An AI agent asked to "make a business document" can only follow a format it can read. A template and build command written out in plain text on a public page, like this one, is something an agent can read and copy. We publish our documentation in that spirit.

Sources

The same idea, for data

With MCP Analytics you upload a CSV and tested statistical methods run on it. The report is repeatable: same data, same numbers.

See how it works

Your turn

Bring your own data and the question you actually need answered.

MCP AnalyticsData science by email Send us your data and your question, and we will reply. ds@mcpanalytics.ai