User:MRFS
Notes on creating diagrams for Wiki and Google
[edit]The aim of this page is to indicate how best to create geometric diagrams that can be used on Wikipedia and Google and also by LaTeX. There are many pitfalls along the way and many roads lead nowhere.
To begin with here are notes regarding the Eukleides package that I have copied verbatim from my PC ......
This is a repository of geometric diagrams. Euclid is merely the anglicised form of the Greek Eukleides which is the package that I thought would be able to minimise the effort required. Previous attempts with Powerpoint have produced eps files that have been extremely difficult to use because of numerous bounding box problems and incompatibilities between Microsoft and the rest of the world. So here, I thought, was a better way of drawing sketches.
The basic idea is simple. Write your source in Eukleides and run euktoeps to generate an eps file which can then be turned into pdf (via epstopdf in the MikTeX bin folder) or used directly in LaTeX. There is a program Scribus which can convert the eps into svg for Web use. Naturally there were a few initial problems :-
- 1. Pathetic documentation.
- 2. No decent feedback from euktoeps.
- 3. Unable to produce Greek letters.
- 4. Unable to change font sizes.
- 5. Unable to subscript.
In fact (3) was quite easy but because of (1) it took a long time to sort out. The trick is to use draw instead of label. The str to output a is simply "$\alpha$" etc, etc. Note that the $ signs switch into math mode which is somewhat italicised so "A" is normal whereas "$A$" is not.
Much worse was (4) and it took many hours to sort it out. In a nutshell euktoeps cannot cope with different fontsizes even though it uses the eukleides engine which can. The construct "$\textrm{\Huge Problem 1}$" can be sent to draw just as above and eukleides will produce Problem 1 in very large letters. With euktoeps this doesn't happen. Also if there is something wrong then eukleides will produce an error message of sorts. So the message is clear. euktoeps is suitable for most diagrams but if big letters are required you have to use eukleides instead to compile the euk file. You have to pipe the output to a small tex document that loads it through an \input command and then produces dvi and ps. Note that you possibly need something like \setlength{\hoffset}{-72pt} in the preamble to ensure that the whole diagram is visible. Other parameters that may need adjusted are \voffset and \textheight. You can then run the ps file through GhostView in order to generate eps. A tedious process.
It's tempting to paste the contents of the pstricks file produced by eukleides straight into a TeX file, and to fine tune the picture by editing in TeXmaker. Unfortunately if you do it that way then the euk file no longer represents the source, which rather inhibits any further editing of the source. The pstricks file really isn't suitable for this purpose. So you're faced with having to reverse engineer the final pstricks version in order to obtain a usable euk source.
One other (minor) problem that I came across on the diagrams was subscripting. A construct such as P_{0} for P0 makes eukleides produce nonsense. On the other hand P_0 works, so at least single subscripts can be easily worked round.
Also note that the wretched LaTeX documentation suggests you have to use mathrm and not textrm to produce Roman letters in math mode. As far as I can see this is completely untrue. The tragedy of TeX/LaTeX and their friends is that the whole area is hopelessly confused and very badly documented. They'll never beat Microsoft until they get their act together.
I've had a quick look at xeukleides in the hope of streamlining the process. Unfortunately it is pretty crap. Once you get it loaded (it pules about a missing library file) it simply allows you to load, save and edit sources and view the results. That might be useful but sadly it is even worse than euktoeps at interpreting euk files. Not only did it fail on the large text in z003.euk but it also messed up the angles quite horribly. So I'm afraid it gets a big thumbs down and must be deleted.