Skip to content Skip to navigation

Connexions

You are here: Home » Content » LaTeX template for VIGRE modules: general guidelines

Navigation

Recently Viewed

This feature requires Javascript to be enabled.

LaTeX template for VIGRE modules: general guidelines

Module by: Mark Embree. E-mail the author

User rating (How does the rating system work?)
Ratings

Ratings allow you to judge the quality of modules. If other users have ranked the module then its average rating is displayed below. Ratings are calculated on a scale from one star (Poor) to five stars (Excellent).

How to rate a module

Hover over the star that corresponds to the rating you wish to assign. Click on the star to add your rating. Your rating should be based on the quality of the content. You must have an account and be logged in to rate content.

:
(0 ratings)

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.

Introduction

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.

Purpose of this Template

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].

General Instructions for Conversion

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.

Rules for Converting LaTeX Source

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 ).

  • The \mbox command is not supported.
  • Nested tables are not supported.
  • LaTeX allows functions like \sqrt to be followed by a single argument without brackets, e.g., \sqrt\pi . The Connexions translator misses this syntax; one instead needs to use brackets \sqrt{\pi} .

Future Editing

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.)

Importing Equations

We list a few sample equations to test the ability of the converter. For example, we have the Pythagorean Theorem, a2+b2=c2a2+b2=c2. This is an example of an inline equation, as is the integral 0e-x2dx0e-x2dx. The same integral can also be typeset as a displayed equation,

0 e - x 2 d x . 0 e - x 2 d x . (1)

To typeset a matrix, use the LaTeX array environment:

A = a b c d . A = a b c d . (2)

(Note that the TeX \matrix command does not properly translate.)

A sample figure

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.

Figure 1: The gap between consecutive prime numbers.
Figure 1 (prime_gap.png)

A sample table

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.)

Table 1: Mersenne primes.
k k 1 2 3 4 5 6 7
kkth Mersenne prime 3 7 31 127 8191 131071 524287

Incorporating code

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.

Adding a Bibliography

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.

Acknowledgements

This Connexions module describes work conducted as part of Rice University's VIGRE program, supported by National Science Foundation grant DMS–0739420.

References

  1. Huxley, M. N. (1971). On the difference between consecutive primes. Inventiones Math., 15, 164–170.
  2. Knuth, Donald E. (1986). The TeXbook. Reading, Massachusetts: Addison–Wesley.
  3. Lamport, Leslie. (1994). LaTeX: A Document Preparation System. Reading, Massachusetts: Addison–Wesley.

Content actions

Give Feedback:

E-mail the module author | Rate module ( How does the rating system work?)

Rating system

Ratings

Ratings allow you to judge the quality of modules. If other users have ranked the module then its average rating is displayed below. Ratings are calculated on a scale from one star (Poor) to five stars (Excellent).

How to rate a module

Hover over the star that corresponds to the rating you wish to assign. Click on the star to add your rating. Your rating should be based on the quality of the content. You must have an account and be logged in to rate content.

(0 ratings)

Download:

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.

| A lens (?)

Definition of a lens

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks