Skip to main content
change code to a macro with an argument
Source Link
corvus_192
  • 5.7k
  • 15
  • 24

LaTeX, 9766 bytes

\documentclass[tikz,border=9]{standalone}\begin{document}\tikz\draw circle[radius=1];\enddocument
\input tikz\def\f#1{~\vfill\centering\tikz\draw circle(#1);\vfill}

I consider the "canvas" required by this challenge to be the default text area of a latex page. The code defines a macro \f that takes the radius in cm as an argument.

Example Code

\documentclass{article}

\input tikz\def\f#1{~\vfill\centering\tikz\draw circle(#1);\vfill}

\begin{document}
\f{3}
\enddocument

Outputs a PDF:

enter image description hereenter image description here

LaTeX, 97 bytes

\documentclass[tikz,border=9]{standalone}\begin{document}\tikz\draw circle[radius=1];\enddocument

Outputs a PDF:

enter image description here

LaTeX, 66 bytes

\input tikz\def\f#1{~\vfill\centering\tikz\draw circle(#1);\vfill}

I consider the "canvas" required by this challenge to be the default text area of a latex page. The code defines a macro \f that takes the radius in cm as an argument.

Example Code

\documentclass{article}

\input tikz\def\f#1{~\vfill\centering\tikz\draw circle(#1);\vfill}

\begin{document}
\f{3}
\enddocument

Outputs a PDF:

enter image description here

Source Link
corvus_192
  • 5.7k
  • 15
  • 24

LaTeX, 97 bytes

\documentclass[tikz,border=9]{standalone}\begin{document}\tikz\draw circle[radius=1];\enddocument

Outputs a PDF:

enter image description here