Department of Physics and Astronomy

The Forbes Group

Creating a Post

$\newcommand{\vect}[1]{\mathbf{#1}} \newcommand{\uvect}[1]{\hat{#1}} \newcommand{\abs}[1]{\lvert#1\rvert} \newcommand{\norm}[1]{\lVert#1\rVert} \newcommand{\I}{\mathrm{i}} \newcommand{\ket}[1]{\left|#1\right\rangle} \newcommand{\bra}[1]{\left\langle#1\right|} \newcommand{\braket}[1]{\langle#1\rangle} \newcommand{\op}[1]{\mathbf{#1}} \newcommand{\mat}[1]{\mathbf{#1}} \newcommand{\d}{\mathrm{d}} \newcommand{\pdiff}[3][]{\frac{\partial^{#1} #2}{\partial {#3}^{#1}}} \newcommand{\diff}[3][]{\frac{\d^{#1} #2}{\d {#3}^{#1}}} \newcommand{\ddiff}[3][]{\frac{\delta^{#1} #2}{\delta {#3}^{#1}}} \DeclareMathOperator{\erf}{erf} \DeclareMathOperator{\Tr}{Tr} \DeclareMathOperator{\order}{O} \DeclareMathOperator{\diag}{diag} \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\sech}{sech} $

Creating a Post

Initial Image

The first part of a post should be an image which will appear on cover pages etc. It should be included using one of the following sets of code:

  • The first part of a post should be an image which will appear on cover pages etc. It should be included using one of the following sets of code:

    ![Text](<URL or /images/filename.png>)
    Optional text.
    
In [2]:
print("This is a really long line of actual code.  Is it formatted differently and with wrapping?")
This is a really long line of actual code.  Is it formatted differently and with wrapping?
  • Pure markdown:

    ![Textual description (alt text) of the image](<URL or /images/filename.png>)
    Optional text such as image credit (which could be in the alt text).
    
    • Another list:

      ![Textual description (alt text) of the image](<URL or /images/filename.png>)
      Optional text such as image credit (which could be in the alt text).
      

    This is the simplest option, but has very little flexibility. For example, markdown images cannot be resized, or embeded as links. In principle, this could be nested in HTML with `...` but presently the conversion to HTML passes through [reStructureText](http://docutils.sourceforge.net/rst.html) which does not permit nested markup.

  • Pure HTML.

    <a href="http://dx.doi.org/10.1103/PhysRevLett.118.155301"
        class="image">
       <img alt="Textual description (alt text) of the image."
       src="<URL or /images/filename.png>">
     </a>
    

    This allows you to add links, or any other formatting.

Image Files

Images can either be referenced by URL, or locally. The advantage of local images is that they will be available even when off-line, or if the link breaks, but they require storing the image locally and distributing it.

To manage images, we have a top level folder /images in our website folder (the top level Nikola project) in which we store all of the images. This folder will be copied by Nikola to the site. We refer to these locally using an absolute filename /images/filename.png. In order to make this work in the Jupyter notebooks while editing, we symlink the /images to the directory where the notebook server is running. Thus, if you always start the server from the top level of the Nikola site, no symlinks are required.

A good source of images is:

These are free for use without any restrictions (although attribution is appreciated).

Examples

Images

  • Simple Markdown inclusion of photo with credit in Alt text:

![Photo of Stars by Teddy Kelley on Unsplash](https://unsplash.com/photos/uCzBVrIbdvQ/download)

  • Simple Markdown inclusion of photo with credit as following badge. (The Unsplash image page provides a link on each images page with the badge code which you can just copy and paste.):

Photo of Stars Teddy Kelley

Schematic of an expanding BEC entering the regime of negative mass.

In [ ]: