Simple interactive Python script that generates a Analitic Hierarchy Process table, it exports a fully editable .tex code file and a .pdf file.
-
LaTeX installed
sudo apt-get install texlive-full
-
Python >= 3.6 installed
python3 -V
-
numpy package
pip3 install numpy
-
PyLaTeX package
pip3 install pylatex
-
Move to your venv folder
cd ~/.venv
-
Create the venv
python3 -m venv PyLaTeXvenv
-
Activate the virtual enviroment
source PyLaTeXvenv/bin/activate
-
Install the required packages
pip install -r requirements.txt
-
View the installed packages
pip3 list
git clone https://github.com/hasecilu/AHPtableGenerator.git
-
Open the folder via terminal
cd AHPtableGenerator
-
Run the script via terminal
python3 AHPtableGenerator.py
or
source ~/.venvs/PyLaTeXvenv/bin/activate
python3 AHPtableGenerator.py
-
Follow the instructions in the terminal
-
Open the .pdf file
xdg-open filename.pdf
-
View the .tex file
less filename.tex
-
Modify the .tex file if needed it and add it to your document
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}