# LaTeXDocument MediaWiki Skin

This is a small MediaWiki skin design for using
[LaTeX.css](https://github.com/vincentdoerig/latex-css) as the main document
style. It keeps the wiki chrome simple and lets the article body look like a
LaTeX document.

## What I Found

I did not find a public MediaWiki skin that already packages LaTeX.css.
The closest practical bases are:

- `Skin:Example`, because MediaWiki documents it as the bare-bones skin to fork.
- `Skin:Timeless`, if you want a CSS-only overlay on an existing bundled,
  responsive, content-focused skin.
- `Skin:Vector/2022`, if you want to keep the default Wikimedia UX and only
  make article pages LaTeX-like.
- `Skin:Chameleon`, if your wiki already uses Bootstrap layouts, though
  Bootstrap and LaTeX.css will fight more than a minimal skin does.

The recommended route is this scaffold: a tiny `SkinMustache` skin whose only
job is to place MediaWiki page content inside a document-like shell.

## Install

1. Clone or copy this directory to `skins/LaTeXDocument` in your MediaWiki checkout.
2. Vendor LaTeX.css locally if `resources/latex.css` is still the placeholder:

   ```sh
   curl -L https://latex.vercel.app/style.css -o skins/LaTeXDocument/resources/latex.css
   ```

3. Add this to `LocalSettings.php`:

   ```php
   wfLoadSkin( 'LaTeXDocument' );
   $wgDefaultSkin = 'latexdocument';
   ```

4. Visit a page with `?useskin=latexdocument`.

## Why Local CSS

LaTeX.css can be loaded with a normal HTML `<link>`, but MediaWiki skins should
load styles through ResourceLoader. Keeping `latex.css` as a local file avoids
Content Security Policy surprises and makes the wiki independent of an external
CDN.

## Design Notes

- `resources/latex.css` is the upstream stylesheet slot.
- `resources/latexdocument.css` only adapts MediaWiki-specific things: portlets,
  tabs, search, edit links, categories, thumbnails, tables, and print behavior.
- The default article measure is `100ch` and the default article font size is
  `1.0625rem`. Adjust `--latexdocument-measure` and
  `--latexdocument-content-size` in `resources/latexdocument.css` if the wiki
  should be tighter or roomier.
- The skin ignores math rendering, syntax highlighting, and LaTeX.css class
  helpers beyond whatever you already put in wiki content.
- Most wiki UI is deliberately sans-serif so the article reads like the
  document and the controls read like controls.

## CSS-Only Alternative

If you do not want a new skin, install `Timeless` and paste a smaller overlay
into `MediaWiki:Timeless.css`. Vendoring the upstream CSS in a real skin is
cleaner, but this is enough for a quick trial:

```css
@import url("https://latex.vercel.app/style.css");

body.skin-timeless #mw-content {
	max-width: 82ch;
	margin-inline: auto;
	background: #fff;
	color: #111;
}

body.skin-timeless #mw-header,
body.skin-timeless #mw-site-navigation,
body.skin-timeless #mw-related-navigation,
body.skin-timeless .mw-editsection,
body.skin-timeless .catlinks,
body.skin-timeless .toc {
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.skin-timeless .mw-parser-output {
	overflow-wrap: break-word;
}

body.skin-timeless .mw-parser-output img {
	max-width: 100%;
	height: auto;
}
```

Treat the `@import` as a prototype shortcut. For production, copy `style.css`
into a skin ResourceLoader module instead.
