Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chakravala/vertex.jl
Typeset scattered graph data rewriter based on LaTeX nodes
https://github.com/chakravala/vertex.jl
academic-publishing graph julia latex latex-editor latex-template pdf-generation pdf-generator repl tex typesetting vertex
Last synced: 3 months ago
JSON representation
Typeset scattered graph data rewriter based on LaTeX nodes
- Host: GitHub
- URL: https://github.com/chakravala/vertex.jl
- Owner: chakravala
- License: mit
- Created: 2018-03-06T22:08:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-07T19:49:17.000Z (almost 4 years ago)
- Last Synced: 2024-05-09T23:42:31.805Z (8 months ago)
- Topics: academic-publishing, graph, julia, latex, latex-editor, latex-template, pdf-generation, pdf-generator, repl, tex, typesetting, vertex
- Language: Julia
- Homepage:
- Size: 53.7 KB
- Stars: 14
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VerTeX.jl
*Typeset scattered graph data rewriter based on LaTeX nodes*
[![DOI](https://zenodo.org/badge/124144717.svg)](https://zenodo.org/badge/latestdoi/124144717)
[![Build Status](https://travis-ci.org/chakravala/VerTeX.jl.svg?branch=master)](https://travis-ci.org/chakravala/VerTeX.jl)
[![Build status](https://ci.appveyor.com/api/projects/status/8poc90nqimq5903s/branch/master?svg=true)](https://ci.appveyor.com/project/chakravala/vertex-jl/branch/master)
[![Coverage Status](https://coveralls.io/repos/chakravala/VerTeX.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/chakravala/VerTeX.jl?branch=master)
[![codecov.io](http://codecov.io/github/chakravala/VerTeX.jl/coverage.svg?branch=master)](http://codecov.io/github/chakravala/VerTeX.jl?branch=master)
[![Liberapay patrons](https://img.shields.io/liberapay/patrons/chakravala.svg)](https://liberapay.com/chakravala)For now, this project is a prototype concept for maintaining a body of research and citations via a computational graph database.
The `VerTeX` typeset scattered graph data rewriter is based on a new graph data format called VerTeX, which parses and generates LaTeX documents from nodes.
Current specifications are concerned with how to construct new documents from theorems and definitions using graph data.
This enables research collaborators to maintain databases of LaTeX nodes. The `VerTeX` julia package automatically parses this database of LaTeX nodes to extract citations and references.
This system can also generate graph diagrams depicting the inter-relationships and dependencies of definitions, theorems, calculations, references, and results.For convenience, the `vtx>` REPL can be used by pressing the `,` key with commands such as `help,vim,pdf,status,dictionary,ranger,preview,search,cd,cdpkg`.
The REPL code was adapted and modifed from the REPL code of [Pkg.jl](https://github.com/JuliaLang/Pkg.jl) using their [MIT](https://julialang.org/license) Julia license.#### Requirements
The general API is functional out of the box. To use some of the additional terminal user interface features from the REPL, the following unix-like programs are required:
* [vim](https://github.com/vim/vim) for editing nodes as LaTeX documents
* [vimtex](https://github.com/lervag/vimtex) plugin for `vim` for compiling and preview
* [latexmk](http://www.phys.psu.edu/~collins/software/latexmk-jcc/) for compiling LaTeX to PDF formats
* [zathura](https://git.pwmt.org/pwmt/zathura) for viewing PDF output
* [ranger](https://github.com/ranger/ranger) for browsing directoriesSee some of [chakravala's dot files](https://github.com/chakravala/dotfiles) for examples of `startup.jl`, `.vimrc`, `.latexmkrc`, `zathurarc`.
## Serialization of VerTeX node data
The format is not specific to any kind of file extension or way of saving, as the format is defined only by what data is saved.
Therefore, `VerTeX` data can be saved in any type of serializtion format the database maintainer wants to choose.To start with, the TOML format has been implemented.
An example `TOML` file generated by `VerTeX` is
```TOML
author = "example"
pre = "%vtx:~/.julia/v0.7/JuliaTeX/vtx/default.tex"
revised = "2018-03-06T20:00:25.559"
uuid = "e87e02c0-2178-11e8-1787-d7c816143f3c"
created = "2018-03-06T19:59:41.514"
title = "testing"
editor = "Person Nameson"
date = "2018"
version = ["VerTeX", "v\"0.1.0\""]
tex = "hello world"
```These are the main fields for any VerTeX data file:
* **pre** is the LaTeX document preamble data (what packages to load, etc)
* **title** is the title of the VerTeX file and also the `\title{}` field from latex doc
* **author** is the creator of the content (simultaneously it is `\author{}` field of latex doc)
* **date** is the latex doc `\date{}` field
* **tex** is the main body of the LaTeX content for the VerTeX file
* **uuid** is a unique identifier (not necessarily cryptographically secure, but it can be)
* **created** is the date of creation of the uuid
* **revised** is the last editing date and time UTC
* **editor** is the person who was editing the VerTeX file
* **version** is the VerTeX version data
* **depot** is the repository nameThere are more data fields envisioned which are not implemented in the protype yet.
The data from this example TOML file results in the following LaTeX document when combined:
```LaTeX
\documentclass[]{article}
\usepackage[active,tightpage]{preview}
\setlength\PreviewBorder{7.77pt}
\usepackage{varwidth}
\AtBeginDocument{\begin{preview}\begin{varwidth}{\linewidth}}
\AtEndDocument{\end{varwidth}\end{preview}}
%vtx:~/.julia/v0.7/JuliaTeX/vtx/default.tex\title{testing}
\author{example}
\date{2018}
\begin{document}
hello world
\end{document}
```The program automatically handles the conversion from TOML to LaTeX and vice versa.
Suppose you have some mathematical data (e.g. a theorem, an example, or a proof) and you wish to categorize it in a database. Then the LaTeX form of the data can be converted and stored away in the TOML data format.
Thus it becomes possible to retrieve the database file; automatically convert it into a LaTeX document with all the headers; then edit it as a LaTeX document in an editor; and finally store the update in the TOML data format automatically when the editor is closed.
Hence, edits are automatically made available for search and other features.### Specifying and extracting relational meta-data
There is more relational meta-data that can be extracted, which will be investigated.
Specifically, it is possible to automatically extract relational edge data (as well as automatically erase it properly if necessary).
It works as follows:
In a local directory somewhere, suppose I have a `vtx` file stored that holds some `key => value` data, which can be loaded using the VerTeX program.
```Julia
julia> using VerTeXjulia> f = VerTeX.load("testdir/pnt.vtx")
Dict{String,Any} with 14 entries:
"label" => ["PNT"]
"pre" => "%vtx:~/.julia/v0.7/VerTeX/vtx/default.tex"
"depot" => "julia"
"author" => "Gauss"
"created" => "2018-03-08T20:04:13.151"
"editor" => "Person Nameson"
"version" => ["VerTeX", "v\"0.1.0\""]
"tex" => "\$\$ \\lim_{x\\rightarrow +\\infty} \\frac{\\pi(x)}{\\int_2^x\\frac{du}{\\log(…
"ids" => Dict{String,Any}()
"date" => "unknown"
"revised" => "2018-03-09T15:12:09.635"
"uuid" => "df3c6ade-230b-11e8-09d3-1b9aec48cc35"
"title" => "Prime Number Theorem"
"dir" => "test/pnt.vtx"
```In this case, it is a statement of the Prime Number Theorem by Gauss (simple example).
The vertex data was generated after editing the information with `vtx> vim test/pnt.vtx` as a regular LaTeX document:
```LaTeX
\documentclass[]{article}
% hidden preamble stuff not worth showing
\newcommand{\deps}[1]{} % VerTeX dependencies
%vtx:~/.julia/v0.7/VerTeX/vtx/default.tex\author{Gauss}
\title{Prime Number Theorem}
\begin{document}
$$ \lim_{x\rightarrow +\infty} \frac{\pi(x)}{\int_2^x\frac{du}{\log(u)}} = 1 $$
This is the PNT\label{PNT}.
\end{document}
```This `.tex` file is converted by VerTeX into the above `key => value` format, and vice versa, so making changes to the graph database is done by simply editing the `.tex` files as if it were a regular LaTeX document (with background scripts).
Now if you save another VerTeX which references the prime number theorem using `\ref{PNT}` then the VerTeX system will automatically update both the new VerTeX and also the other VerTeX file containing the referred to prime number theorem with a UUID to mark the reference.
```Julia
julia> VerTeX.save(ans)
┌ Info: saving VerTeX: Prime Number Theorem
└ testdir/pnt.vtx saved in julia
┌ Info: saving VerTeX: a note on pnt
│ updated \ref{PNT}
│ at testdir/pnt.vtx in julia
└ testdir/note.vtx saved in julia
```
Note that an additional VerTeX at `testdir/note.vtx` is updated to track the reference.This means that theorems and definitions can be tagged with `\label{}` and `\ref{}` to maintain the connections between the VerTeX files automatically.
All one has to do is edit the LaTeX files, save them as VerTeX, and once all is saved all of the VerTeX data already contains all of the graph edges, ready to be used for analysis.
This is going to make mapping out mathematical theories into graphs superbly easy and useful!
In order to extend it to a conversation / email system, all one needs to do is add a list of receivers / recipients to a VerTeX, and it is now a letter between authors.