I'm using pdftex
, and I'm trying to center an image with the rest of my text.
I want to get a result like:
{\hfil \pdfximage{test.png} \pdfrefximage\pdflastximage \hfil}
\bye
gives, but instead I'm trying to use this format so that I don't have to use a bunch of clunky groups and hfils everywhere:
\everypar={\leftskip=0pt plus 1fil \rightskip=\leftskip \parindent=0pt \parfillskip=0pt}
\hbox{}
\par
Here's some of my text
and a second line, but images don't work:
\pdfximage height 3in {test.png}\relax\pdfrefximage\pdflastximage
\bye
How can I get the images to center? I've tried \immediate
and moving the declaration out of \everypar
, but neither have worked.
For reference, results of first and second code's results in order:
\everypar
stuff is causing that). Otherwise you can just define a new macro for centered images, such that you don't have to repeat the commands all the time.