MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / repl

Function repl

demo/posterbuilder/convert.py:406–414  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

404
405def bump_beamerposter_scale(tex: str, target: float) -> str:
406 def repl(m):
407 opts = m.group(1)
408 if re.search(r"scale\s*=\s*[\d.]+", opts):
409 opts2 = re.sub(r"scale\s*=\s*[\d.]+", f"scale={target}", opts)
410 else:
411 if opts.strip().endswith(","): opts2 = opts + f"scale={target}"
412 elif opts.strip()=="": opts2 = f"scale={target}"
413 else: opts2 = opts + f",scale={target}"
414 return f"\\usepackage[{opts2}]{{beamerposter}}"
415 return re.sub(r"\\usepackage\[(.*?)\]\{beamerposter\}", repl, tex, flags=re.S)
416
417def inject_font_tweaks(tex: str, title_size_cmd: str) -> str:

Callers

nothing calls this directly

Calls 1

subMethod · 0.45

Tested by

no test coverage detected