Coder Social home page Coder Social logo

j0s3f / matrix2latex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thechymera/matrix2latex

0.0 3.0 1.0 2.41 MB

Python/MATLAB matrix to LaTeX table converter, originally by Øystein Bjørndal

Home Page: https://code.google.com/p/matrix2latex/

License: GNU General Public License v3.0

Python 78.70% Makefile 4.77% MATLAB 12.75% TeX 3.77%
python3 numpy-arrays numpy latex

matrix2latex's Introduction

Build Status Matrix2LaTeX

Takes a Python or MATLAB matrix and outputs a LaTeX table, a LaTeX matrix, or a complete LaTeX document (and optionally calls latex for compilation). A number of configuration options are available. The default table output is geared towards the standard recommended by IEEE, and uses the latex package booktabs. Check out the documentation for more example output and usage.

Example

The following python code:

from matrix2latex import matrix2latex
m = [[1, 1], [2, 4], [3, 9]] # python nested list
t = matrix2latex(m)
print t

or equivalent matlab code:

m = [1, 1; 2, 4; 3, 9];
filename = '' % do not write to file
t = matrix2latex(m, filename)

produces

\begin{table}[ht]
  \begin{center}
    \begin{tabular}{cc}
      \toprule
        $1$ & $1$\\
        $2$ & $4$\\
        $3$ & $9$\\
      \bottomrule
    \end{tabular}
  \end{center}
\end{table}

alt text

Various options are available to change the latex environment (e.g. to a matrix) or to provide header, footer, caption, label, format and/or alignment. Please see the documentation for details.

History

Inspired by the work of [email protected] who has written a similar package only for matlab http://www.mathworks.com/matlabcentral/fileexchange/4894-matrix2latex

This project was moved from https://code.google.com/p/matrix2latex/ after code.google.com was discontinued.

Future goals

Feel free to contribute to any of the following improvements or open an issue if you want something done.

  • Clean up the code (object oriented?)
  • Make the matlab version identical to the python version
  • Add support for more advanced tables. Highlights and multirow.
  • Command line interface (say, read in a csv, take arguments on the command line)
  • Additional languages (R/perl/julia?)

Author

Øystein Bjørndal

matrix2latex's People

Contributors

obtitus avatar thechymera avatar

Watchers

 avatar  avatar  avatar

Forkers

agerbes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.