Skip to content

Instantly share code, notes, and snippets.

@dohyunkim
Created January 14, 2014 08:30
Show Gist options
  • Select an option

  • Save dohyunkim/8415061 to your computer and use it in GitHub Desktop.

Select an option

Save dohyunkim/8415061 to your computer and use it in GitHub Desktop.
mplib figure as a page background
%\pdfcompresslevel=0
%\pdfobjcompresslevel=0
\input luamplib.sty
\mplibsetformat{metafun}
\newbox\MpPageBg
\setbox\MpPageBg\hbox{%
\mplibcode
beginfig(0);
draw btex D R A F T etex scaled 14 rotated 60
withcolor transparent("normal", 0.2, black);
endfig;
\endmplibcode
}\wd\MpPageBg=0pt\ht\MpPageBg=0pt\dp\MpPageBg=0pt
\edef\pagebody{\unexpanded\expandafter{\pagebody\copy\MpPageBg}}
\count255=0 \loop
This is a test line. This is a test line.
This is a test line. This is a test line. \endgraf
\ifnum\count255<120 \advance\count255 by 1 \repeat
\bye
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment