6

I have seen questions and answers posting output from latex that appear to blend in well with the site. In looking at the html/css underlying these posts, it appears that all that is required is to block quote the image and supply an image with a transparent background. When I produce a pdf and clip a portion of the screen, the resulting image has a white background and looks like this:

romanurl

rather than, like this (using a transparent background image):

anotherromanurl

What is the best way to capture latex output for use in questions/answers and is it best practice to block quote it?

  • Many of them convert to png directly which supports alpha and transparency. For block quote a single > is enough per paragraph. – percusse Aug 31 '14 at 17:22
  • 1
    From a semantic point of view, you shouldn't do this, since you're not quoting anyone. – morbusg Sep 3 '14 at 8:25
4

There is no need to do this, since one can display transparency as an overlay against another background as well.

This is purely up to personal preference.

I peruse the StackExchange network through Google Chrome. This allows me to copy-and-paste images directly via the image insertion capability (Ctrl + G); no need for saving the image and uploading it - it's fast. However, this loses the capability to insert images that "blend in nicely".

1

It took a little digging, but this approach works...

First, there needs to be some latex (save as somefile.tex):

\documentclass[12pt, preview]{standalone}
\begin{document}

\Huge http://en.wikipedia.org/wiki/Function\_(mathematics)

\end{document}

Next, turn the latex into a pdf:

pdflatex somefile.tex

Then convert the pdf to png:

convert -density 300 somefile.pdf -quality 90 somefile.png

And finally, create a block quote with the resulting png:

nicelookinglatex

It sure looks better than the alternative:

notnicelookinglatex

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .