Skip to main content

Converter from latex to edX XML format course content files.

Project description

=========
latex2edx
=========

Converts latex to edX XML format.

Uses plasTeX

Installation
============

pip install -e git+https://github.com/mitocw/latex2edx.git#egg=latex2edx

Note that xmllint and lxml are required; for ubuntu, this may work:

apt-get install libxml2-utils python-lxml

Usage
=====

Usage: latex2edx [options] filename.tex

Options:

--version show program's version number and exit
-h, --help show this help message and exit
-v, --verbose verbose error messages
-o OUTPUT_FN, --output-xbundle=OUTPUT_FN
Filename for output xbundle file
-d OUTPUT_DIR, --output-directory=OUTPUT_DIR
Directory name for output course XML files
-c CONFIG_FILE, --config-file=CONFIG_FILE
configuration file to load
-m, --merge-chapters merge chapters into existing course directory

Example
=======

See live demo course: https://edge.edx.org/courses/MITx/MIT.latex2edx/2014_Spring/about

The source code for the demo course is here: https://github.com/mitocw/content-mit-latex2edx-demo

Here is an annotated input tex file which generates the source for an edX course:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt]{article}

\usepackage{edXpsl} % edX "problem specification language"

\begin{document}

% edXcourse: {course_number}{course display_name}[optional arguments like semester]
\begin{edXcourse}{MIT.latex2edx}{latex2edx demo course}[semester="2014 Spring"]

% edXchapter: {chapter display_name}[optional arguments like url_name]
\begin{edXchapter}{Basic examples}

% edXsection: {section display_name}[optional arguments like url_name]
% this turns into a <sequential> in the XML
\begin{edXsection}{Basic example problems}

% edXvertical: {vertical display_name}[optional arguments like url_name]
\begin{edXvertical}

% edXproblem: {problem display_name}{attributes: url_name, weight, attempts}
\begin{edXproblem}{Numerical response}{attempts=10}

What is the numerical value of $\pi$?

% \edXabox: answer box, specifying question type and expected response
\edXabox{expect="3.14159" type="numerical" tolerance='0.01' }

\end{edXproblem}
\end{edXvertical}
\end{edXsection}
\end{edXchapter}
\end{edXcourse}
\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

History
=======

* v1.0: python package; unit tests; xbundle and modular code
* v1.1.0: Support for jsinput, custom mathjax filtering, formularesponse
* .1: Fix optargs bug with plastex
* .2: Allow spaces in semester; give example in README
* .3: Fix bug in eqnarray table widths
* .4: Fix showhide to work under firefox
* .5: Allow multiple correct answers in multichoice
* .6: Add \edXgitlink for link to specific line in source file
* .7: Add \edXaskta for "Ask TA!" buttons
* .8: bugfix for edxxml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

latex2edx-1.1.8.tar.gz (90.1 kB view details)

Uploaded Source

File details

Details for the file latex2edx-1.1.8.tar.gz.

File metadata

  • Download URL: latex2edx-1.1.8.tar.gz
  • Upload date:
  • Size: 90.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for latex2edx-1.1.8.tar.gz
Algorithm Hash digest
SHA256 dfd4e6eddac7e48651977f52176bab4620b64c20e28270ccd7fa646277f4da91
MD5 c8d3c3f1c87944685306ce1f6e57c289
BLAKE2b-256 8e0b5d6842e14507dee6b474cab16156c26ee12f359d75e0bc2877ad985f7f5d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page