alfredholmes / TeXNotes

Zettelkasten or Slip box with notes written in LaTeX
MIT License
45 stars 4 forks source link

Problems with the description how references work #1

Closed gro1729 closed 1 year ago

gro1729 commented 1 year ago

I like the idea of a Zettelkasten. Probably my English is not the best and also isn't my understanding of LaTeX. Would you be so kind to provide some examples, how to build new Zettel and how to reference between them. An explanation of the optional ,,label'' also would be great. Thanks in advance

alfredholmes commented 1 year ago

Sure, I plan to improve the documentation over the next few weeks.

I'm going to assume that you have latex installed and can run pdflatex from the command line. If you run python manage.py newnote main python manage.py newnote reference_example

Then this will create two files: /notes/slipbox/main.tex and /notes/slipbox/reference_example.tex. Both of these files will have the contents of `/template/note.tex'. If we change edit main to


\RequirePackage{import}
\subimport{../template}{preamble.tex}

\title{Main Example}

\begin{document}
    \maketitle \currentdoc{note}
    %<*note>
     \begin{definition} \label{definition:example definition}
             This is an example definition
     \end{definition}
    %</note>
    %\printbibliography
\end{document}

And change reference_example.tex to


\RequirePackage{import}
\subimport{../template}{preamble.tex}

\title{Reference Example}

\begin{document}
    \maketitle \currentdoc{note}
    %<*note>
     \excref[definition:example definition]{Main} is in \exhyperref{Main}{the main file}. The exhyperref command also takes an optional argument being the label of the thing being referneced: \exhyperref[definition:example definition]{Main}{this text references the definition}. 
    %</note>
    %\printbibliography
\end{document}

then this should compile and give a good example of the references. To compile these documents, create a folder in the root of the directory /pdf and then, from this directory run

pdflatex ../notes/slipbox/main.tex pdflatex ../notes/slipbox/reference_example.tex

and the result should be

image image

If this doesn't work then please post more details about what you've tried, what the output looks like and any error messages you get.

gro1729 commented 1 year ago

Sorry for not yet having responded. Your explanations are pretty well, I understood, hopefully.

A file, called ,,documents'' is updated after each manage.py - call. This file seems (not yet) to be used?

There is a sqlite-DB, currently containing only few entries. How do I update my current entries, after your last changes of some Python-Files?

What is the idea of introducing a database?

(By the way, I had to change the template-files in order to get the current folder structure get working.)

My personal Zettelkasten consists of many, much little peaces of paper in several notebooks, which I would like to organize by using your software-solution idea.

Thanks for your work.

alfredholmes commented 1 year ago

The file documents.tex is used to define the externaldocument commands for the xr-hyper LaTeX package that allows you to reference labels in different documents (if you delete the documents.tex file then the above won't work). The database currently offers limited functionality, but if you run python manage.py synchronize then this will keep track of the notes and the links between different notes. At the moment the only use of this is the command python manage.py listunreferenced lists all the notes that aren't linked to from another note, but I plan to add similar functionality to obsidian where you can draw a graph of the network of note.

The synchronize command will also ask to add notes that aren't in the documents.tex file to this file.

gro1729 commented 1 year ago

In my understanding of the Zettelkasten idea, a tree (forest?) structure of documents is defined. Could the Database be used to decide in which order the documents have to be compiled in order to get a complete Zettelkasten of my thoughts? Am I wrong?

alfredholmes commented 1 year ago

Yeah - that is another reason for keeping the database. (If you look at the file LatexZettel/database.py then you'll see that the database is set up to be able to store information about when the files were edited and last built, so this shouldn't be too difficult to do.)

alfredholmes commented 1 year ago

I've added a wiki page documenting how to reference files.