You can think of your Project as being some form of a dictionary and to manage a dictionary you will need a database. Here you have many choices and they depend on your knowledge of a computer language that you are comfortable with. Another issue to consider is if you will insert the notes yourself or other people will assist you.
I will assume no prior computer programming knowledge but a willingness to invest your time in effortful learning of TeX/LaTeX. The basic approach in building a TeX database was described in Managing hundreds of separate components in a large document
In the comments of the above post, it was suggested by predrag that a versioning control system be introduced. If you are not familiar with one I would either recommend either Git with github or fossil. When Predrag recommended the latter this was new to me as well. Fossil has a great advantage besides its ease of use; for one it has a built-in wiki, which can be invaluable on its own for a Project like yours or a thesis and can be published on the web very easily if you will have collaborators. It took me about 5 minutes to set it up on windows (which I normally battle with). As I had WAMP installed for other work it worked well with localhost
.
Now let us consider how to organize the information and the TeX database.
We will keep an index for each record in lists. For example the english verses can be saved in a list such as:
\enverse{verse0001,verse0002..verse1000}
Similarly the other language verses can be also be stored in list:
\latinverse{verse0001,verse0002..verse1000}
The author comments can be done similarly:
\author@name@i{comments0001,...,comments1000}
and
\author@name@ii
If you have more authors this can be extended at a later stage. Building flexibility into the system at this stage is important.
To add english verses, sanskrit and commentary you will type:
\addenglish{verse-3}{verse1......}
\addenglish{verse-1}{verse2......}
\addenglish{verse-2}{verse3......}
\addsanskrit{verse-2}{verse3......}
\addcomments{author1}{verse-3}{....}
Here is a MWE for english verses only, the rest is similar and you can extend.
\documentclass[11pt]{book}
\usepackage{lstdoc,lipsum,filecontents}
\begin{filecontents*}{verylongverse.tex}
\lipsum[5]
\end{filecontents*}
\begin{document}
\makeatletter
\def\enverse{}
\let\sort\lst@BubbleSort
\def\addtolist#1#2{%
\lst@lAddTo\enverse{#2}
}
\long\gdef\addverse#1#2{\addtolist\enverse{#1,}}
\def\addenglish#1#2{%
\long\expandafter\def\csname#1\endcsname{\textbf{#1}: #2}
\addverse{#1}{#2}
\sort\enverse
}
\def\PrintEnglishVerses{%
\@for \next:=\enverse\do{%
\csname\next\endcsname}
}
%example
\addenglish{verse-3}{\lipsum[1]}
\addenglish{verse-1}{\lipsum[2]}
\addenglish{verse-2}{\lipsum[3]}
\addenglish{verse-4}{\input{verylongverse}}
% print the activities
\PrintEnglishVerses
\makeatother
\end{document}
Of course it will be preferable if you had a small GUI (graphical user interface) for entering the records rather than typing it out \addenglish
, although you can alias the commands to shorter versions. In this case I would also let go of the TeX database and use ansqlite
database with a browser front end and only describe the typesetting macros. Using Lua for this might be a good idea as it opens up many more opportunities to use LuaLaTeX. Whatever you decide spent a week or two preparing and trying things out before you commit to a final solution.
(Alternative solution brew for the brave. Use LuaLaTeX
. Use luasqlite3
and sqlite
3 to store the records. Create a lua GUI interface using wxLua
for ease of capturing, export to LaTeX. If you get it working please let us know).
datatool
package to display and manipulate them. It was aimed at a word-by-word gloss style, but the basic idea could easily adapted to your purpose.