Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Inserting PNG files

  1. Mar 26, 2015 #1
    I frequently want to discuss in a Physics Forum an equation in a Wikipedia article. I can acquire an equation there as a PNG file. Is there a way I can insert a PNG file into a forum message?
  2. jcsd
  3. Mar 26, 2015 #2
    Either use the image bbcode (there is a button in the editor) using the image URL or download the image and upload it as an attachment and then you can insert it into the message.
  4. Mar 26, 2015 #3


    User Avatar
    Science Advisor
    Gold Member

    As Wikipedia uses LaTeX like our website does, there's a better way.
    1. Start to edit the Wikipedia page, look for the equation which will be coded in between "math" tags, e.g.
      Code (Text):
      <math>E = \frac{mc^2}{\sqrt{1 - v^2/c^2}}</math>
    2. Copy the code between the tags (excluding the tags) and paste it into your message on this website.
    3. Add "tex" tags e.g.
      Code (Text):
      [ tex ]E = \frac{mc^2}{\sqrt{1 - v^2/c^2}}[ /tex ]
      but without the spaces in the square brackets
    4. Use the "Preview..." button to check that it works: [tex]E = \frac{mc^2}{\sqrt{1 - v^2/c^2}}[/tex]
    5. Don't forget to close the Wikipedia page without saving.
    Last edited: Mar 26, 2015
  5. Mar 26, 2015 #4
    Many thanks to both Greg Bernhardt and DrGreg.
  6. Mar 28, 2015 #5


    Staff: Mentor

    Instead of using [ tex ] or [ itex ] tags (without the extra spaces) as DrGreg mentioned, I prefer to use $ or # tags, as there is less typing to do.

    So instead of this example of DrGreg's:
    Code (Text):
    [ tex ]E = \frac{mc^2}{\sqrt{1 - v^2/c^2}}[ /tex ]
    I would do this:
    Code (Text):
    $ $ E = \frac{mc^2}{\sqrt{1 - v^2/c^2}} $ $
    Again, without the extra spaces between each pair of $ characters.

    To render inline, as opposed to standalone expressions or equations, a pair of # characters at front an back is equivalent to the [ itex ] and [ /itex ] tags.
    Code (Text):
    # # E = \frac{mc^2}{\sqrt{1 - v^2/c^2}} # #
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook