Inserting Files and Pictures

From OpenOptogenetics.org

Jump to: navigation, search

Contents

Before inserting a file or picture, you have to upload it (see Uploading Files).

Rendering a single image

To insert pictures in an article, we recommend to use the following syntax:

[[File:picturename|right|200px|thumb|legend]]

Example: Here we are going to insert a picture (file: Laser.jpg) with a legend on the right of a text. The syntax is the following:

[[File:Laser.jpg|right|300px|thumb|The legend is here.]]
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium 
doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore 
veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim 
ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia 
consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque 
porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, 
adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et 
dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, 
quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut 
aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui
in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui 
dolorem eum fugiat quo voluptas nulla pariatur?

The above wiki code yields:

The legend is here.

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?

Rendering a gallery of images

Method 1

A gallery of thumbnails can be generated using the following syntax:

<gallery caption="Title of gallery" widths=200x heights=140px perrow=2>
File:Laser1.jpg|Legend 1
File:Laser2.jpg|Legend 2
File:Laser3.jpg|Legend 3
File:Laser4.jpg|Legend 4
</gallery>

Where:

  • caption={caption}: sets a caption on the gallery.
  • widths={width}px: sets the widths of the images, default 120px.
  • heights={heights}px: sets the (max) heights of the images.
  • perrow={integer}: sets the number of images per row.

The above code yields:

Method 2

The above method is simple to implement but does not allow centering the gallery easily. The second method consists in building a gallery using directly the table markups. It allows using alt text for the pictures and centering the gallery. Works like a charm. The code used in OpenOptogenetics is the following:

{|</noinclude> border="0" cellpadding="4" cellspacing="0" style="margin: 1em auto 1em auto; background: #f9f9f9;
border: 0; border-collapse: collapse; font-size: 95%; clear: center;"<noinclude>
| [[File:Laser1.jpg|thumb|200px|upright|alt=Laser pic #1.|Laser pic 1.]]
| [[File:Laser2.jpg|thumb|200px|upright|alt=Laser pic #2.|Laser pic 2.]]
| [[File:Laser3.jpg|thumb|200px|upright|alt=Laser pic #3.|Laser pic 3.]]
| [[File:Laser4.jpg|thumb|200px|upright|alt=Laser pic #4.|Laser pic 4.]]
|}

... and yields the following result:

Laser pic #1.
Laser pic 1.
Laser pic #2.
Laser pic 2.
Laser pic #3.
Laser pic 3.
Laser pic #4.
Laser pic 4.

Inserting a file

Example: inserting a pdf

  1. Upload the pdf (see Uploading Files). Example: we are uploading the file A_healthy_future_for_optogenetics.pdf.
  2. To create a link to this file inside an article, use the following code:
[[Media:A_healthy_future_for_optogenetics.pdf|A Healthy Future for Optogenetics]], by Jeff Bairstow.
''OptoIQ'', Aug 1 2009.

The above code yields:

A Healthy Future for Optogenetics, by Jeff Bairstow. OptoIQ, Aug 1 2009.