User:Rkundalini

Wikisophia chemistry rendering

Regarding the discussion on Wikipedia_talk:WikiProject_Drugs, here are some examples. As you can see PPCHTeX is fine when rendered well by WikiTeX.

Here is a structure rendered using the notes below, with ugly aliasing:

Image:Ergopeptides.png

Here it is using WikiTex:

Missing image
Ergopeptides2.gif
Image:ergopeptides2.gif

Here it is without forcing sans serif, in WikiTeX

Missing image
Ergopeptides3.gif
Image:ergopeptides3.gif


Old PPCHTex Notes

The following notes were here for use while wikisophia was down; it is now back! I'll keep this for a while anyways

While http://wikisophia.org is down, the following might be useful for people who want to continue using PPCHTeX to make pngs for wikipedia. Here is what I did, quick and very dirty:

  • Download PPCHTeX from http://www.pragma-ade.com/ppchtex.htm
  • Scratch my head at the very confusing documentation, give up on a proper installation and just try to run latex on a file containing the chemical. Here is an example (LaTeX2e) with the extra guff required:
\documentclass[a4paper]{article}
\usepackage{m-pictex}
\usepackage{m-ch-en}
\usepackage{graphics}
\pagestyle{empty}
\begin{document}
\resizebox{0.5\hsize}{!}{
\startchemical[size=big]
\chemical[SIX,B,EB135] 
\chemical[SIX,MOV1,S6,B1,EB1,+SB2,-SB3,Z3,SR3,RZ3][\sf N,\sf H] 
\chemical[SIX,MOV1,B56] 
\chemical[SIX,MOV1,+SB5,Z6][\SL{\sf NH_2}] 
\stopchemical 
}
\end{document}
  • Try to run latex on the file, and each time you get an error that a file can't be found, copy the required file into the current directory. You will either find it in some strange subdirectory in the strucure that expands from the zip file you downloaded, or not. If not, find it with a google search instead.
  • Once that works, you will have a dvi file. Using ImageMagick, convert it to png format, including antialiasing, automatic cropping, and transparent background:
convert +antialias $1.dvi -crop 0x0 -transparent "#FFFFFF" $1.png

(where $1.dvi denotes your dvi file)

The result for the above input should look like this:

Missing image
Tryptamine.png
Image:tryptamine.png

There you have it. The 0.5 argument to resizebox is a kludge to get approximately the right size of image. Possibly an argument could be given to convert instead to get a consistent image size. One day web browsers will properly support SVG format and we could avoid silly raster formats like png altogether.

Here is a handy script to convert it, print the full path of the file to upload, and text to paste into the image description, and display the image:


#!/bin/csh
 
latex $1.tex
convert +antialias $1.dvi -crop 0x0 -transparent "#FFFFFF" $1.png
echo `pwd`/$1.png
echo "[[PPCHTeX]]" source:
awk 'BEGIN{i=0;}{if (match($0,"startchemical")!=0) i=1; if (i) printf " %s\n", $0; if (match($0,"stopchemical")!=0) i=0;}' < $1.tex 
echo "{{msg:PD}}"
display $1.png

Images

All images I have uploaded, for maintenance purposes live here.

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools