Code Monkey home page Code Monkey logo

ahptablegenerator's Introduction

AHPtableGenerator

Simple interactive Python script that generates a Analitic Hierarchy Process table, it exports a fully editable .tex code file and a .pdf file.

Requirements

  1. LaTeX installed

     sudo apt-get install texlive-full
    
  2. Python >= 3.6 installed

     python3 -V
    
  3. numpy package

     pip3 install numpy
    
  4. PyLaTeX package

     pip3 install pylatex
    

For the venv enjoyers

  1. Move to your venv folder

     cd ~/.venv
    
  2. Create the venv

     python3 -m venv PyLaTeXvenv
    
  3. Activate the virtual enviroment

     source PyLaTeXvenv/bin/activate
    
  4. Install the required packages

     pip install -r requirements.txt
    
  5. View the installed packages

     pip3 list
    

Installation

git clone https://github.com/hasecilu/AHPtableGenerator.git

Usage in terminal

  1. Open the folder via terminal

     cd AHPtableGenerator
    
  2. Run the script via terminal

     python3 AHPtableGenerator.py
    

or

source ~/.venvs/PyLaTeXvenv/bin/activate
python3 AHPtableGenerator.py
  1. Follow the instructions in the terminal

  2. Open the .pdf file

     xdg-open filename.pdf
    
  3. View the .tex file

     less filename.tex
    
  4. Modify the .tex file if needed it and add it to your document

Example of generated file

Code

Small portion of generated code (indentation not included).

\usepackage{booktabs} % Add this line to the preamble (before \begin{document})
...
\begin{table}[!ht]
	\centering
	\begin{tabular}{ccccccc}
		\toprule
		Criterios &   R    &   G    &   B    &   W    & Total de fila & Vector de prioridad \\ \midrule
		    R     & 0.0769 & 0.0345 & 0.1053 & 0.0704 &    0.2871     &    {[}0.0718{]}     \\
		    G     & 0.1538 & 0.069  & 0.0526 & 0.0845 &    0.3599     &     {[}0.09{]}      \\
		    B     & 0.3077 & 0.5517 & 0.4211 & 0.4225 &     1.703     &    {[}0.4258{]}     \\
		    W     & 0.4615 & 0.3448 & 0.4211 & 0.4225 &    1.6499     &    {[}0.4125{]}     \\ \midrule
		  Suma    & 0.9999 &  1.0   & 1.0001 & 0.9999 &    3.9999     &    {[}1.0001{]}     \\ \bottomrule
	\end{tabular}
	\caption{Table caption}
\end{table}

pdf file

Example

ahptablegenerator's People

Contributors

hasecilu avatar

Watchers

 avatar

Forkers

shuvadeepmaity

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.