Summary: This report summarizes work done as part of Rice University's VIGRE program. VIGRE is a program of Vertically Integrated Grants for Research and Education in the Mathematical Sciences under the direction of the National Science Foundation. A PFUG is a group of Postdocs, Faculty, Undergraduates and Graduate students formed round the study of a common problem. This module describes a LaTeX template that PFUGs can use to draft research reports that can be readily imported into Connexions.
Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.
Connexions allows one to import content directly from LaTeX files. This document provides a template to help VIGRE research groups at Rice University draft documents that can be readily converted from LaTeX into Connexions.
The present template is designed to provide very rudimentary guidance on how to write LaTeX source that can easily be converted into Connexions. Here we use only one add-on packages, graphicx , which we use to include graphics. A number of additional packages are also supported; see http://www-sop.inria.fr/apics/tralics/packages.html . Given the importance of citing one's sources in research work, we also include bibliography references in this file.
This small document makes no effort to teach basic LaTeX skills. Many resources are available for this, such as the fundamental book by Lamport [3]. Donald Knuth, the author of the underlying TeX program, provides a treasure-trove of information not only about the technical aspects of TeX, but also about good mathematical typesetting style [2].
Connexions provides online instructions that guide you through the process of uploading your LaTeX source files. At present, you must use the Firefox or Internet Explorer browsers to properly view and edit Connexions content. To upload files, you will also need to create your own Connexions account; see http://cnx.org/join_form for details.
To convert your LaTeX document, you first need to create a .zip file that contains your .tex source files, your .bib file if you have a bibliography, and any image files you include in your document. Note: the names of your LaTeX source file and zip file must have the same stem. For example, foo.tex should be packaged into foo.zip . Now log-in to Connexions, go to your Workspace, create a new module with MathML support, and fill-in the basic “Metadata,” such as the title and summary. (The top of this LaTeX template contains some a basic text for the Summary: please copy, paste, and manually edit this text in the Summary box.) Finally, you arrive at the “Edit Text” window, with options to import from various file formats. Choose “LaTeX”, and then select the .zip file that contains your source files. Connexions commences with the conversion procedure, and in a few moments you should be presented with a translated version of your LaTeX document, in a format that allows for further edits directly in Connexions. You should proof-read the conversion to make sure all text and equations appear as you intended. When satisfied, you can preview and publish your document.
Connexions generally does a fine job translating LaTeX source code into the native Connexions mark-up language. However, one may need to adapt one's usual typesetting habits to work around a few idiosyncrasies. Firstly, one should not invest effort in adjusting page margins, line spacing, and fonts: the converter will strip away much of this veneer and replace it with the standard Connexions stylings. Equations will not be converted into graphics (as is common in LaTeX to HTML conversion), but will rather be translated into MathML fonts that can be subsequently edited in Connexions. Do not include a title or abstract in your LaTeX document: these must be entered into Connexions manually when you set up your module.
The Connexions converter will not properly handle several LaTeX commands, as noted in the online help (http://cnx.org/help/UsingLaTeX ).
You will likely want to make changes to your file at some point after you have uploaded the LaTeX document into Connexions. Should you edit the LaTeX document, then re-import, or should you alter the code directly in Connexions? If you have major mathematical edits, it may well be easiest to directly alter the LaTeX source. Beware that when you upload, any changes that you made to the previous version directly in Connexions will be overwritten. This is not such a concern if you can make all the edits you desire directly in LaTeX; however, this is not always the case: some things must be done in Connexions. (For example, see the comments about the verbatim environment in "Incorporating code" below.)
We list a few sample equations to test the ability of the converter.
For example, we have the Pythagorean Theorem,
To typeset a matrix, use the LaTeX array environment:
(Note that the TeX \matrix command does not properly translate.)
Figure 1 shows the gap between consecutive prime numbers; see [1]. Beware: though the original image was drawn in precise vector graphics, the converter has turned it into a bitmap of substantially diminished quality. Make sure you make your fonts large enough that they remain legible after the translation (unlike this figure). The translator also seems to place the figure directly after the reference, so the location of the figure in your Connexions document will generally differ from its placement in your LaTeX document (often for the better). Notice that if you choose the print the Connexions module as a .pdf file, the output will include the bitmapped image, rather than the sharp version in your original document.
|
Table 1 provides a list of the first seven Mersenne primes. (Beware: The Converter does not properly handle the caption command for tables. For example, if a caption precedes the table itself, as is the usual custom, the reference does not translate properly. Moreover, Connexions seems to draw boxes around all cells, regardless of the formatting in the LaTeX source.)
|
|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 3 | 7 | 31 | 127 | 8191 | 131071 | 524287 |
You might naturally want to include small snippets of code with your report, which you would incorporate in LaTeX using the verbatim environment. For example, the following MATLAB commands produce the Mersenne prime data given in Table 1.
p=[1:20]';
pmer = p(isprime(2.^p-1));
disp([[1:length(pmer)]' 2.^pmer-1])
At present, the Connexions LaTeX translator does not properly handle the verbatim environment, though this is expected to improve in an updated translator that will be available in a few months. In the meantime, it is best to leave code out of your LaTeX document, and paste it into Connexions manually as a <code> block.
Connexions works well with LaTeX's bibliography tool, BibTeX. This tool allows you to create a .bib file that contains a database of papers and books that you regularly reference. For example, this template is accompanied by a file called mybibfile.bib that contains the three references cited here. You add citations in your LaTeX document using the \cite command. See Lamport [3] for details.
This Connexions module describes work conducted as part of Rice University's VIGRE program, supported by National Science Foundation grant DMS–0739420.