finished functionality

master
Alex Jordan 5 years ago
parent 886e00cc83
commit ef2946b8bd
  1. 275
      .gitignore
  2. 2
      env/HEAD.tex
  3. 23
      env/auto/HEAD.el
  4. 46
      generate.py

275
.gitignore vendored

@ -0,0 +1,275 @@
# Created by https://www.gitignore.io/api/latex
# Edit at https://www.gitignore.io/?templates=latex
### LaTeX ###
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb
## Intermediate documents:
*.dvi
*.xdv
*-converted-to.*
# these rules might exclude image files for figures etc.
# *.ps
# *.eps
# *.pdf
## Generated if empty string is given at "Please type another file name for output:"
.pdf
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
## Build tool auxiliary files:
*.fdb_latexmk
*.synctex
*.synctex(busy)
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
## Build tool directories for auxiliary files
# latexrun
latex.out/
## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
*.loa
# achemso
acs-*.bib
# amsthm
*.thm
# beamer
*.nav
*.pre
*.snm
*.vrb
# changes
*.soc
# comment
*.cut
# cprotect
*.cpt
# elsarticle (documentclass of Elsevier journals)
*.spl
# endnotes
*.ent
# fixme
*.lox
# feynmf/feynmp
*.mf
*.mp
*.t[1-9]
*.t[1-9][0-9]
*.tfm
#(r)(e)ledmac/(r)(e)ledpar
*.end
*.?end
*.[1-9]
*.[1-9][0-9]
*.[1-9][0-9][0-9]
*.[1-9]R
*.[1-9][0-9]R
*.[1-9][0-9][0-9]R
*.eledsec[1-9]
*.eledsec[1-9]R
*.eledsec[1-9][0-9]
*.eledsec[1-9][0-9]R
*.eledsec[1-9][0-9][0-9]
*.eledsec[1-9][0-9][0-9]R
# glossaries
*.acn
*.acr
*.glg
*.glo
*.gls
*.glsdefs
# uncomment this for glossaries-extra (will ignore makeindex's style files!)
# *.ist
# gnuplottex
*-gnuplottex-*
# gregoriotex
*.gaux
*.gtex
# htlatex
*.4ct
*.4tc
*.idv
*.lg
*.trc
*.xref
# hyperref
*.brf
# knitr
*-concordance.tex
# TODO Comment the next line if you want to keep your tikz graphics files
*.tikz
*-tikzDictionary
# listings
*.lol
# luatexja-ruby
*.ltjruby
# makeidx
*.idx
*.ilg
*.ind
# minitoc
*.maf
*.mlf
*.mlt
*.mtc[0-9]*
*.slf[0-9]*
*.slt[0-9]*
*.stc[0-9]*
# minted
_minted*
*.pyg
# morewrites
*.mw
# nomencl
*.nlg
*.nlo
*.nls
# pax
*.pax
# pdfpcnotes
*.pdfpc
# sagetex
*.sagetex.sage
*.sagetex.py
*.sagetex.scmd
# scrwfile
*.wrt
# sympy
*.sout
*.sympy
sympy-plots-for-*.tex/
# pdfcomment
*.upa
*.upb
# pythontex
*.pytxcode
pythontex-files-*/
# tcolorbox
*.listing
# thmtools
*.loe
# TikZ & PGF
*.dpth
*.md5
*.auxlock
# todonotes
*.tdo
# vhistory
*.hst
*.ver
# easy-todo
*.lod
# xcolor
*.xcp
# xmpincl
*.xmpi
# xindy
*.xdy
# xypic precompiled matrices
*.xyc
# endfloat
*.ttt
*.fff
# Latexian
TSWLatexianTemp*
## Editors:
# WinEdt
*.bak
*.sav
# Texpad
.texpadtmp
# LyX
*.lyx~
# Kile
*.backup
# KBibTeX
*~[0-9]*
# auto folder when using emacs and auctex
./auto/*
*.el
# expex forward references with \gathertags
*-tags.tex
# standalone packages
*.sta
### LaTeX Patch ###
# glossaries
*.glstex
# End of https://www.gitignore.io/api/latex

2
env/HEAD.tex vendored

@ -46,4 +46,4 @@ Tome of Foes
\rowcolors{2}{gray!25}{white}
\begin{longtabu} to \linewidth {lXXXlrrX}
\rowfont{\bfseries} Name & Size & Type & Tags & Alignment & CR & XP & Source \\ \endhead
\rowfont{\bfseries} Name & Size & Type & Tags & Alignment & CR & XP & Source \\ \endhead

23
env/auto/HEAD.el vendored

@ -1,23 +0,0 @@
(TeX-add-style-hook
"HEAD"
(lambda ()
(TeX-add-to-alist 'LaTeX-provided-class-options
'(("article" "20pt" "a4paper")))
(TeX-add-to-alist 'LaTeX-provided-package-options
'(("inputenc" "utf8") ("fontenc" "T1") ("fullpage" "cm" "empty") ("xcolor" "table")))
(TeX-run-style-hooks
"latex2e"
"article"
"art10"
"inputenc"
"fontenc"
"longtable"
"hyperref"
"tabu"
"booktabs"
"fullpage"
"xcolor"
"etoolbox"
"tcolorbox"))
:latex)

@ -0,0 +1,46 @@
#!/usr/bin/env python3
'''
THIS CODE IS TOTALLY SCUFFED.
It works, but is in no way smart or efficient. It may break any second.
Use at own risk.
'''
import os
head_file = open("env/HEAD.tex", "r")
head_text = head_file.readlines()
head_file.close()
foot_file = open("env/FOOT.tex", "r")
foot_text = foot_file.readlines()
foot_file.close()
def convert_table(table):
result = []
for line in table:
line = line[1:-2]
line = line.replace("|", "&")
line = line + " \\\\"
result.append(line)
return(result)
def generate_tex(filename, env, env_content):
table = convert_table(env_content)
with open(filename, "w") as file_object:
for line in head_text:
line = line.replace("ENVIRON", env)
file_object.write(line)
file_object.write("\n")
for line in table:
file_object.write(line + "\n")
for line in foot_text:
file_object.write(line)
for root, dirs, files in os.walk("env"):
for filename in files:
if filename.endswith(".org"):
with open(os.path.join(root, filename), "r") as file_content:
text = file_content.readlines()
env = filename.split(".")[0]
generate_tex("ua-ranger-favored-environment-" + env + ".tex", env, text)
Loading…
Cancel
Save