/* * Academic Marp (acarp) Theme * Version: 1.0.0 * License: MIT * Repository: https://git.samsci.com/cgit.cgi/acarp-marp-theme/ * * A minimal, grid-based theme for Marp presentations designed for academic content. * Grid-only layouts - no flexbox, no utility classes, explicit contracts. * * ============================================================================ * CUSTOMIZATION GUIDE * ============================================================================ * * Most common customizations are in the :root section below. Edit these * CSS variables to change the theme's appearance: * * Dimensions: * --slide-width: 1280px # Slide width (16:9 aspect ratio) * --slide-height: 720px # Slide height (16:9 aspect ratio) * --padding: 70px # Main content padding (left/right) * --pad-top: 30px # Top padding * --pad-bottom: 30px # Bottom padding (also pagination position) * * Colors: * --color-background: #fdfcff # Slide background * --color-foreground: #202228 # Text color * --color-highlight: #009dd5 # Accent color (links, highlights) * --color-highlight-heading: #33b1dd # Heading accent color * --color-background-code: #f2f1f4 # Code block background * * Typography: * Font family: 'Atkinson Hyperlegible' (sans, projection-optimized) * Base font size: 28px * Line height: 1.4 * * Logo (optional): * --logo-image: url('path/to/logo.png') * --logo-width: 100px * --logo-height: 40px * --logo-opacity: 0.7 * --logo-top: 20px * --logo-right: 20px * * For 4:3 aspect ratio (Beamer style), see acarp-beamer.css * * ============================================================================ */ /* @theme acarp */ @import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap'); /* Import syntax highlighting theme */ @import url('https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css'); /* Academic Marp (acarp) Theme Base Grid-only layout system. No flexbox. No utility classes. Explicit grid contracts for all layouts. */ :root { --slide-width: 1280px; --slide-height: 720px; --padding: 70px; --pad-top: 30px; --pad-bottom: 30px; --page-right: var(--padding); --page-bottom: var(--pad-bottom); --color-background: #fdfcff; --color-background-code: #f2f1f4; --color-foreground: #202228; --color-highlight: #009dd5; --color-highlight-hover: #087eaa; --color-highlight-heading: #33b1dd; } /* ============================================================================ BASE SECTION STYLING All slides inherit from this base. Defines the slide container, typography, and positioning context for pagination. ============================================================================ */ section { /* Visual appearance */ background: var(--color-background); color: var(--color-foreground); /* Layout and positioning */ display: block; position: relative; width: var(--slide-width); height: var(--slide-height); padding: var(--pad-top) var(--padding) var(--pad-bottom); z-index: 0; /* Typography */ font-family: 'Atkinson Hyperlegible', 'Helvetica Neue', Arial, sans-serif; font-size: 28px; letter-spacing: 0.2px; line-height: 1.4; /* Text behavior */ text-align: left; word-wrap: break-word; } /* ============================================================================ PAGINATION Marp renders slide numbers as section::after pseudo-elements. Positioned absolutely in the bottom-right corner using CSS variables to ensure consistency across all layout types. ============================================================================ */ section::after { position: absolute; bottom: var(--page-bottom); right: var(--page-right); color: #888888 !important; font-size: 18px !important; font-family: 'Atkinson Hyperlegible', 'Helvetica Neue', Arial, sans-serif !important; } /* Hide pagination on title slides */ section.title::after { display: none !important; } /* ============================================================================ LOGO SUPPORT Optional logo in top-right corner. Configure via CSS variables in your markdown frontmatter or override in :root above. ============================================================================ */ section:not(.title)::before { content: ''; position: absolute; top: var(--logo-top, 20px); right: var(--logo-right, 20px); width: var(--logo-width, 100px); height: var(--logo-height, 40px); background-image: var(--logo-image, none); background-repeat: no-repeat; background-position: right center; background-size: contain; opacity: var(--logo-opacity, 0.7); z-index: 1; } section:not([data-marpit-pagination])::after { display: none; } /* ============================================================================ TYPOGRAPHY: MARGINS AND SPACING Remove default margins from first and last elements to maintain clean spacing. Paragraphs and blockquotes use consistent 15px bottom margin. ============================================================================ */ section > *:first-child, section[data-header] > :nth-child(2) { margin-top: 0; } section > *:last-child, section[data-footer] > :nth-last-child(2) { margin-bottom: 0; } section p, section blockquote { margin: 0 0 15px; } /* ============================================================================ TYPOGRAPHY: LISTS Use right-pointing angle bracket (›) as list marker for a more academic, minimal appearance. ============================================================================ */ section ul { list-style-type: '› '; } /* ============================================================================ TYPOGRAPHY: HEADINGS Headings use consistent spacing and sizing. Bold text in headings is highlighted with the accent color for emphasis. ============================================================================ */ section :is(h1, h2, h3, h4, h5, h6) { margin: 15px 0 30px; } section :is(h1, h2, h3, h4, h5, h6) strong { color: var(--color-highlight-heading); font-weight: inherit; } section :is(h1, h2, h3, h4, h5, h6)::part(auto-scaling) { max-height: 660px; } section h1 { font-size: 2em; } section h2 { font-size: 1.6em; } section h3 { font-size: 1.3em; } section h4 { font-size: 1.1em; } section h5 { font-size: 1.05em; letter-spacing: 0.2px; } section h6 { font-size: 0.9em; letter-spacing: 0.2px; } /* ============================================================================ CODE: INLINE CODE Inline code (backticks) gets a subtle background and border. Font size is reduced to 85% to maintain visual balance. ============================================================================ */ code { font-family: Monaco, monospace; letter-spacing: 0; } section > code, section *:not(pre) > code { background: var(--color-background-code); color: var(--color-foreground); margin: -0.2em 0.2em 0.2em; padding: 0.15em 0.3em; border-radius: 2px; font-size: 0.85em; border: 1px solid rgba(0, 0, 0, 0.08); font-family: Monaco, monospace; letter-spacing: -0.02em; } /* ============================================================================ CODE: CODE BLOCKS Code blocks (pre/code) use a subtle drop shadow and top accent bar. Font size is reduced to 70% to fit more content. Overflow is handled with horizontal scrolling. ============================================================================ */ pre { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2)); font-size: 70%; line-height: 1.15; margin: 15px 0 30px; text-align: left; padding: 0; overflow-x: auto; border-radius: 6px; position: relative; } /* Hide scrollbar when pre is inside a width-constrained container */ div[style*="max-width"] pre { overflow-x: hidden; } /* Add subtle accent bar at top of code blocks */ pre::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--color-highlight), var(--color-highlight-hover)); border-radius: 6px 6px 0 0; } /* Code block content styling */ pre > code { background: var(--color-background-code); box-sizing: content-box; color: var(--color-foreground); display: block; margin: 0 auto; min-width: 456px; padding: 0.8em 1em; font-size: 0.9em; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.1); } /* ============================================================================ MATH FORMULAS Math expressions (LaTeX) are displayed as block elements with left indentation for visual hierarchy. ============================================================================ */ math, section span[data-math], section .math { font-size: 1.1em; display: block !important; margin: 0.8em 0 0.8em 1.5em !important; text-align: left !important; padding-left: 1.5em; } /* ============================================================================ UTILITY CLASSES Spacing utilities for fine-grained control over vertical spacing. Use these classes to add consistent spacing between content blocks. ============================================================================ */ /* Vertical spacing utilities - add top margin. For custom spacings, use an inline-height spacer div instead:
Note: consecutive vspace divs do NOT stack - adjacent margins collapse to the larger value, so two .vspace-10 give 10em, not 20em. */ .vspace-tiny { margin-top: 0.5em !important; } .vspace-small { margin-top: 1em !important; } .vspace-medium { margin-top: 2em !important; } .vspace-large { margin-top: 3em !important; } .vspace-xlarge { margin-top: 4em !important; } .vspace-xxlarge { margin-top: 5em !important; } .vspace-6 { margin-top: 6em !important; } .vspace-7 { margin-top: 7em !important; } .vspace-8 { margin-top: 8em !important; } .vspace-9 { margin-top: 9em !important; } .vspace-10 { margin-top: 10em !important; } /* General spacing utilities */ .push-down { margin-bottom: 1.5em !important; } .push-up { margin-top: 1.5em !important; } /* Center figures and their content */ .centered-figure { text-align: center; } /* Auto-center images that are alone in a paragraph */ section p > img:only-child { display: block; margin: 0 auto; } /* ============================================================================ CITATION HELPER Position citations in the bottom-left corner. Use the .cite class on a div or span to add a citation to your slide. ============================================================================ */ section .cite, div.cite { position: absolute !important; bottom: var(--page-bottom) !important; left: var(--padding) !important; font-size: 18px !important; color: #888888 !important; opacity: 0.9 !important; white-space: normal !important; margin-bottom: 0 !important; width: calc(100% - var(--padding) - var(--page-right) - 150px) !important; max-width: calc(100% - var(--padding) - var(--page-right) - 150px) !important; box-sizing: border-box !important; overflow-wrap: break-word !important; word-break: break-word !important; display: block !important; } /* ============================================================================ LAYOUT: title Title slide layout - centered content with flexbox. Usage: # Main Title ## Subtitle Features: - Centered vertically and horizontally - Hides pagination - Supports multiple heading levels - Images scale to 80% width ============================================================================ */ section.title { text-align: center; padding: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; width: 100%; box-sizing: border-box; position: relative; } section.title > * { flex: 0 0 auto; } section.title > h1 { font-size: 2em !important; margin: 0; padding: 0; } section.title > h2 { font-size: 1.3em !important; color: #666; margin: 0.5em 0 0 0; padding: 0; font-weight: normal; letter-spacing: 0.2px; } section.title > h3 { font-size: 0.9em !important; font-weight: normal !important; color: #888; margin: 0.5em 0 0 0; padding: 0; } section.title > h4 { font-size: 0.8em !important; font-weight: normal !important; color: #888; margin: 0.3em 0 0 0; padding: 0; letter-spacing: 0.2px; } section.title > img { margin: 2em 0; max-width: 80%; height: auto; } :is(div.marpit, svg.marpit, .marpit svg) > foreignObject > section.title { width: 100%; height: 100%; display: grid; place-items: center; } /* ============================================================================ LAYOUT: layout-2col Two-column layout with title at top. Grid structure: ┌─────────────────────────────┐ │ title │ ├──────────────┬──────────────┤ │ │ │ │ left-col │ right-col │ │ │ │ └──────────────┴──────────────┘ Usage: # Title