agentsclimarketplace

Modernize

Skill SeidSmatti/misc-CC-Plugins/plugins/academic-latex/skills/modernize

Personal multi usage Claude Code plugins/skills marketplace

Install
npx -y skills add SeidSmatti/misc-CC-Plugins --skill modernize

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Ports legacy LaTeX (LaTeX 2.09 / plain TeX patterns) to modern LaTeX2e — replaces \bf/\it/\sl/\sc/\rm/\sf/\tt with \textXX{} or \XXshape; eqnarray to align; $$ ... $$ to \[...\]; \centerline to \centering; \epsfig to \includegraphics; drops obsolete inputenc/fontenc lines on modern engines. Each rewrite is conservative — only applied when the modern equivalent is provably correct. Use when the user asks to modernize, port old LaTeX, or compile fails on deprecated commands. Delegates to /academic-latex:docs-lookup before claiming a non-trivial mapping.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

7.0 KB, as published. Nobody here has run it

modernize — port deprecated LaTeX to LaTeX2e

Most of these patterns still compile but produce subtle bugs (broken NFSS interactions, wrong math spacing, miscalibrated boxes). Replace conservatively.

The replacement table

DeprecatedModernWhy
{\bf foo}\textbf{foo}\bf is a switch that resets shape; \textbf is NFSS-aware
{\it foo}\textit{foo}same
{\sl foo}\textsl{foo}same
{\sc foo}\textsc{foo}same
{\rm foo}\textrm{foo}same
{\sf foo}\textsf{foo}same
{\tt foo}\texttt{foo}same
\bf (declaration form)\bfseriesNFSS declaration; stacks correctly
\it (declaration form)\itshapesame
\sl (declaration form)\slshapesame
\sc (declaration form)\scshapesame
\rm (declaration form)\rmfamilysame
\sf (declaration form)\sffamilysame
\tt (declaration form)\ttfamilysame
\bf\it foo (combined)\textbf{\textit{foo}}\bf resets shape; combining old commands silently fails
\centerline{X}\begin{center}X\end{center} (or {\centering X\par})\centerline is plain TeX, doesn't interact with \par
\begin{eqnarray}...\end{eqnarray}\begin{align}...\end{align} (from amsmath)eqnarray miscalibrates math-relation column spacing; flagged obsolete
\begin{eqnarray*}...\end{eqnarray*}\begin{align*}...\end{align*}same
$$...$$\[...\] (or equation/align)plain TeX $$ skips \everydisplay, breaks amsmath features
\over (math)\frac{a}{b}\over is plain TeX, no semantic info
{a \over b}\frac{a}{b}same
\usepackage{epsfig}\usepackage{graphicx}epsfig is a thin wrapper for the deprecated graphics package
\epsfig{file=X,...}\includegraphics[...]{X}same
\usepackage[latin1]{inputenc}drop (or switch source to UTF-8)LaTeX 2018+ defaults to UTF-8
\usepackage[utf8]{inputenc} (LuaLaTeX/XeLaTeX)drop entirelyboth engines are natively Unicode
\usepackage[T1]{fontenc} (LuaLaTeX/XeLaTeX)drop entirely; use fontspecT1 is for pdflatex's 8-bit font world
\rm inside math\mathrm{...} (text in math) or \operatorname{...} (operator name)\rm in math is undefined behavior in modern LaTeX
\fbox{\parbox{...}{...}} callouts\fbox{\parbox{...}{...}} works, but for tunable callouts use tcolorboxwider styling control

Sources: TeX FAQ (https://texfaq.org/FAQ-2letterfontcmd); LaTeX2e for class/package writers (https://www.latex-project.org/help/documentation/usrguide.pdf); latexref.xyz/eqnarray.html.

Procedure

  1. Read the document before any rewriting. Confirm engine target (pdflatex / xelatex / lualatex) — some replacements differ.
  2. Search for legacy patterns:
    grep -nE '\\(bf|it|sl|sc|rm|sf|tt)\b' main.tex
    grep -nE '\\begin\{eqnarray\*?\}' main.tex
    grep -nE '\\\$\\\$|\$\$.*\$\$' main.tex     # naive — false positives possible
    grep -nE '\\centerline\b' main.tex
    grep -nE '\\epsfig\b|\\usepackage\{epsfig\}' main.tex
    grep -nE '\\usepackage(\[[^\]]*\])?\{inputenc\}' main.tex
    grep -nE '\\over\b' main.tex
    
  3. Apply replacements one class at a time, not all at once. Compile after each class to verify nothing else broke.
  4. For each replacement, prefer \textXX{...} over \XXshape ... \normalfont because the former auto-restores font state on }.
  5. For eqnarray → align: also rewrite the &=& columns to &= (eqnarray has 3 columns, align has 2). Add \usepackage{amsmath} to preamble if absent. Preserve \nonumber and equation labels.
  6. For inputenc/fontenc on modern engines: drop both lines; recompile under xelatex/lualatex with fontspec.

eqnarray → align — concrete rewrite

Before:

\begin{eqnarray}
  a &=& b + c \\
  &=& d \nonumber
\end{eqnarray}

After:

\begin{align}
  a &= b + c \\
  &= d \nonumber
\end{align}

Source: amsldoc PDF (amsmath documentation), §3.

Brace-balanced {\bf ...} rewriting

A naive regex rewrite of {\\bf (.+?)} is incorrect — nested braces aren't matched. Algorithm:

  1. Locate {\bf (or other declaration). The { opened the group.
  2. Walk forward, tracking brace depth. The matching } closes the group.
  3. Replace {\bf X} with \textbf{X}.
  4. If the group contains multiple paragraphs (\par or blank line), use the declaration form {\bfseries X} instead — \textbf doesn't allow paragraphs.

If the document is large and a script is wanted, write a small Python preprocessor (call from scripts/):

# scripts/modernize_font_switches.py — illustrative
import re, sys
SHORT_TO_LONG = {'bf':'textbf','it':'textit','sl':'textsl','sc':'textsc',
                 'rm':'textrm','sf':'textsf','tt':'texttt'}
# Match {\bf ...} or {\it ...} balanced. Use the `regex` package (pip install regex)
# for recursive-pattern matching, or write a small stateful walker.

(Don't run such a script on a paper without diffing the output. False positives in math mode or comments are common.)

Verifying after modernization

  1. Recompile. Errors decrease, ideally to zero.
  2. Compare PDFs visually — /academic-latex:verify-visual with the original as reference. Spacing should be the same or slightly better; substantive layout shifts indicate an over-aggressive rewrite.
  3. Check math regions especially carefully. eqnarray has known wrong spacing, so a small spacing change in equations is expected and good.

When NOT to modernize

  • The document compiles cleanly and the user is just patching one bug. Don't expand scope.
  • A journal class explicitly uses a deprecated pattern internally — don't rewrite the class.
  • The deprecated commands are inside verbatim/listings environments (they're code samples).

When uncertain

For mappings not in the table above (e.g., obscure plain-TeX primitives, custom legacy macros, or deprecated package options), delegate to /academic-latex:docs-lookup. Cite the exact source for any non-trivial mapping you propose.

Last verified

2026-05-09 — TeX FAQ, LaTeX2e usrguide, latexref.xyz, amsldoc.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.