Zettelkasten Forum


Handling references with BibTeX/BibLaTeX, The Archive and Emacs

Hi everyone,

I am a PhD student using (at the moment), The Archive as a slip-box for literature notes and forum (seminars, lectures, workshops) notes. For academic writing, I have started to use Emacs (Kieran Healy’s social science setup). There I use Magit and GitHub as a version control system, and ebib as a reference management (I am storing all my references in various bibfiles (BibTeX syntax) in a single bibfile folder. The bibfiles are called thesis-article1.bib: thesis-article2.bib: thesis-kappa.bib, in order to keep a certain order of which references I use in which text.

Furthermore, I have a folder called bibpdfs in which I store all pdfs (I can find) of the references I use. They are named in the following way: firstauthorlastnameYEARfirstwordinarticle. For example ahrens2017how.pdf.

I would like to write notes in The Archive of the literature I read and to be able to include the metadata from the bibfiles in The Archive and also connect the zettels (one overarching structure note + about 15 notes/zettels per read article/book) with Emacs somehow, but I have not found out how this could be done. Would therefore be grateful for any advice that could help me out.

Best regards,
Joakim

Comments

  • I'd recommend to give us more detailed information about your setup. I think only a fraction of the users know about Kieran Healy’s social science setup. I certainly don't.

    I am a Zettler

  • Hi again,

    You are right, @Sascha. Sorry for not being so clear. I was referring to Kieran Healy's The Plain Person's Guide to Plain Text Social Science and Emacs Starter Kit for the Social Sciences.

    When speaking of Magit I meant this, and Ebib referred to this. Hope that my post became easier to understand now. Look forward to feedback.

  • Interesting links, thanks for sharing! :)

    Side note, I use 1 literature .bib file for all my stuff. I do copy relevant things into project files when I compile LaTeX, because I don't want illegal BibTeX markup in a totally unrelated place mess with the project. I also name PDFs like the cite keys I use so I get both the .bib results and the PDFs with full-text Spotlight search.

    Your request puzzles me a bit:

    I would like to write notes in The Archive of the literature I read and to be able to include the metadata from the bibfiles in The Archive and also connect the zettels (one overarching structure note + about 15 notes/zettels per read article/book) with Emacs somehow, but I have not found out how this could be done. Would therefore be grateful for any advice that could help me out.

    What does break down in this process? I tried to isolate the parts:

    • is writing notes in The Archive a problem?
    • do you want to have a tip for putting the "metadata from the bibfiles" (Markdown reference definitions I presume)?
    • What's the expected outcome of "connect the zettels [...] with Emacs somehow"? E.g. do you want to have clickable links in Emacs that lead to the note?

    Author at Zettelkasten.de • https://christiantietze.de/

  • Thanks for your input @ctietze! ????

    So, my idea is this:

    When reading an article or attending a seminar I am taking notes on paper, from out of which I in The Archive create a structure note + 5-20 zettel notes with clickable links.

    Now, when I start writing an article (in markdown) in Emacs, I normally press c-x e to launch ebib and then automatically the bibfile I have chosen to be pre-loaded opens up and it looks like this.

    Here you can see that it is possible to associate a certain reference, lets say Brentari (that is shown here) with a ’Note’, ’Annotation’ and ’File’. Here I would like to be able to link my structure note, so that I will be able to open the structure note in an Emacs buffer. In that way, as I write my article, I can have easy access to it. And I would like then that the references I have used in The Archive when writing my notes, for example @andersson1985true, will be recognized by Emacs and Ebib so that if I used pandoc or Marked 2, the correct references would be exported and listed.

    In addition I would like, inside of Emacs, the zettelnotes links in the structure note ([[201809231156]]; [[201901081623]], etc.) to be clickable and possible to open in an Emacs buffer, (and the references recognized here as well).

    So, my question is basically, what method and syntax should I use in The Archive for my notes in order to be able to get The Archive and Emacs to work together in this way?

  • Those initial question marks, should have been a smiley. I don’t know what happened. Sorry for the confusion.

  • I'm not working with bibliography per se right now, but I have done a bunch of work trying to integrate emacs and The Archive. I recommend looking into deft and @EFLS 's excellent zetteldeft. I use the zd-search-at-point function in zetteldeft as a "link", because if you have point on a zk-style UID it will open all related links in deft. I've been experimenting with making a custom link style so that deft will respect an archive-style link, but honestly I have zd-search-at-point set to a hotkey with evil-leader and it's maybe better.

  • Thanks for the advice @mediapathic! As for now I am thinking that the best option would maybe still be to keep the zettels in The Archive and my writing in Emacs separetely, and not mix them. After all, handling zettels in The Archive seems smoother and more intuitive compared to writing and editing them in Emacs, or what are your thoughts?

    Following this logic, the best thing would then be if I could just link to the zettel structure note (that includes my understanding of a certain text) in the field ’note’ in Ebib. (Here you can see which field of ebib I am talking about). I will ask the developer of Ebib about this.

    @mediapathic, are you, btw, using version control through magit in Emacs? Are your zettels under version control or do you just use a cloud service backup like Dropbox? Maybe being able to have version control of the zettels would be a reason for writing and editing them in Emacs, or what are your thoughts @mediapathic?

  • @joachiedere said:
    Thanks for the advice @mediapathic! As for now I am thinking that the best option would maybe still be to keep the zettels in The Archive and my writing in Emacs separetely, and not mix them. After all, handling zettels in The Archive seems smoother and more intuitive compared to writing and editing them in Emacs, or what are your thoughts?

    I'm a bit of an outlier on this question, as I mostly write fiction, and so keeping my writing in the Zettel rarely makes sense ( see the discussion here. ) At the moment I use Emacs for both writing prose outside of the Zettel directory, and working in the Zettel using deft and zetteldeft, so for me the experience is fairly seamless, independent of directory structure. One thing I love about Emacs is that most of the time you can just sort of ignore the filesystem :).

    @mediapathic, are you, btw, using version control through magit in Emacs? Are your zettels under version control or do you just use a cloud service backup like Dropbox? Maybe being able to have version control of the zettels would be a reason for writing and editing them in Emacs, or what are your thoughts @mediapathic?

    I use magit for version control for my fiction, but I don't use it on my ZK directory. I don't see any reason one couldn't, it just doesn't seem to serve enough purpose for me to bother with the overhead. I keep my ZK on dropbox (along with the rest of my writing), and its history and syncing has been good enough, as I rarely care about things such as diff on a Zettel.

  • @joachiedere THANKYOU!! (where's the thanks button?!) for the Kieran Healy link, it looks like just what I need as I effect a transition from my default oldfashioned Word existence to a more reproducible and plain way of working

    @joachiedere said:
    Hi again,

    You are right, @Sascha. Sorry for not being so clear. I was referring to Kieran Healy's The Plain Person's Guide to Plain Text Social Science and Emacs Starter Kit for the Social Sciences.

    When speaking of Magit I meant this, and Ebib referred to this. Hope that my post became easier to understand now. Look forward to feedback.

  • You're most welcome, @Steph! I am happy to hear someone else likes it. For me as an Emacs newbie and a PhD student it was very useful and I also liked the look of it. Are you also a PhD student? In what subject in that case?

  • @joachiedere I am not quite at PhD level but I am doing a masters atm (human cognitive neuropsychology). I am doing it part time over two years to give myself time to work and earn money (in a respite care home for people with neurodegenerative conditions), and to give myself enough time to pick up good new working practices and find the most strategic research questions as possible. I want nothing less than to get closer to understanding the big questions: how can the brain generate the mind, basically it boils down to: "what is a human"?!

  • @joachiedere I want nothing less than to get closer to understanding the big questions: how can the brain generate the mind, basically it boils down to: "what is a human"?!

    It's an ape with an extended consciousness, necessary for its genomes predominant will to survive and procreate.

  • @johnny said:

    @joachiedere I want nothing less than to get closer to understanding the big questions: how can the brain generate the mind, basically it boils down to: "what is a human"?!

    It's an ape with an extended consciousness, necessary for its genomes predominant will to survive and procreate.

    yeah we all know THAT but how does it all actually work??!

  • @joachiedere said:
    Hi again,

    You are right, @Sascha. Sorry for not being so clear. I was referring to Kieran Healy's The Plain Person's Guide to Plain Text Social Science and Emacs Starter Kit for the Social Sciences.

    When speaking of Magit I meant this, and Ebib referred to this. Hope that my post became easier to understand now. Look forward to feedback.

    @joachiedere I am currently setting up all this way of working, according to Kieran Healy. I am downloading and installing the programs he recommends. But I've got to a command I don't understand. Can you help? (As assuming you must have passed through this stage yourself). Apologies if it should be obvious or if I'm being dense! This is all just new from scratch to me. Also if anyone else can help, please do.

    Orientation:
    On p.34 of https://kieranhealy.org/files/papers/plain-person-text.pdf?fbclid=IwAR0VQAVoH2V_8b0t0Ah6r56v2ND5ySluhbVVPtM_ybcXxRwcM52oUeUAjRk , the instruction is for setting up the emacs package by cloning the starter kit from GitHub.

    Then:
    As requested for Step 1., I ran the line of code
    $ git clone git://github.com/kjhealy/emacs-starter-kit ~/.emacs.d
    in the terminal.

    Then there is the instruction 2:

    Inside the file kjhealy.org, change the paths to any BibTeX databases as described at the top of that file.

    Now, my question is, where is this file? Where do I find it? The last thing I did was to 'clone the starter kit from github' but I don't know what that actually means, or where it now exists. (This was all the second option so as not to actually download and unzip the package).
    I have just signed up to GitHub. Is the file on there? How do I find it?

    Again everyone pls be patient with the noob who has never done anything but word files before.

  • wait wait wait maybe I should set up GitHub first... maybe all will become clear

  • Update: GitHub does not seem to work with emacs anyway, does not recognise it as a text editor (does it for anyone else?). Neither did I get anywhere with bib latex package, couldn't find a way to install and get started. So now I am downloading Atom as text editor as it goes naturally with GitHub, and am currently downloading mactex. More later on whether it does the same as bib latex for ref handling...

  • Inside the file kjhealy.org, change the paths to any BibTeX databases as described at the top of that file.

    A BibTeX database is your .bib file. You can find .bib files for testing anywhere on the web. Store it someplace safe, then put the path in there.

    On my Mac, the file is located at ~/Archive/literature.bib, so that's my path. (Or, expanded: /Users/ct/Archive/literature.bib). You can drag & drop files from Finder into the Terminal to see the full "POSIX path" which you can copy into the emacs settings.

    Author at Zettelkasten.de • https://christiantietze.de/

  • @ctietze thanks for your help! But I am still confused. Do you mean that instead of downloading a huge package of LaTex and Biber things, I should just find a .bib file 'for testing anywhere on the web'? The bit I am having trouble with is the downloading, probably because it is quite large packages and I am only on wifi, no network cable, so if I can use the whole reference manager just by getting some .bib file, then that would be awesome

    @ctietze said:

    Inside the file kjhealy.org, change the paths to any BibTeX databases as described at the top of that file.

    A BibTeX database is your .bib file. You can find .bib files for testing anywhere on the web. Store it someplace safe, then put the path in there.

    On my Mac, the file is located at ~/Archive/literature.bib, so that's my path. (Or, expanded: /Users/ct/Archive/literature.bib). You can drag & drop files from Finder into the Terminal to see the full "POSIX path" which you can copy into the emacs settings.

  • Also, sorry for totally derailing this thread and taking it off topic...!
    I'm at the stage where I really want to get started compiling my Archive, but I don't want to start without a reference manager

  • edited September 2019

    The instructions say that you need to rename the file to match your user name. On Linux/macOS, you can get the name by running whoami in the Terminal/shell. Here's the output of my machine:

    $ whoami
    ctm
    

    So I'd have to rename kjhealy.org to ctm.org.

    Most of the stuff in there can be discarded. A BibTeX sections where you need to change your paths: https://github.com/kjhealy/emacs-starter-kit/blob/e11482557aa6dab6d0b7ff911301d227ee2d22c9/kjhealy.org#local-reftex-settings

    Quoted:

    ;; Make RefTex able to find my local bib files
    (setq reftex-bibpath-environment-variables
    '("/Users/kjhealy/Library/texmf/bibtex/bib"))
    
    ;; Default bibliography
    (setq reftex-default-bibliography
    '("/Users/kjhealy/Documents/bibs/socbib.bib"))
    

    That's the only BibTeX-related stuff I could find on quick notice. Maybe you can put this configuration someplace else if you have other emacs setting in place and don't want to inherit khealy's cruft.

    You may have to have TeXLive installed either way (~1.5GB download) for PDF creation to work. The RefTeX package seems to be preinstalled and doesn't need the real TeX programs to understand the bib files. You will need to point it to your default bibliography file at the very least, though:

    ;; Default bibliography
    (setq reftex-default-bibliography
    '("/Users/kjhealy/Documents/bibs/socbib.bib"))
    

    Change that path to wherever you want to keep your main bibliography file.

    Here you can find a sample .bib file with a handful of entries for testing: http://shelah.logic.at/eindex.html

    I don't know anything else about this setup or the emacs packages, so that's as far as I can help you. Finger's crossed!

    By the way: With your new GitHub account, you can open issues to ask the author support questions.

    Author at Zettelkasten.de • https://christiantietze.de/

  • @joachiedere -- thanks for posting this!

    I will be entering a PhD in the fall and this is so helpful.

    I am new to Zettelkasten, though, so I have a question. If I am starting to use the Archive for writing my research notes, why would I also need Emacs? Couldn't the Archive meet the needs that Healy addresses with Emacs?

  • @Sociopoetic, I don't know this setup exactly, but you may not need Emacs. At least I got through the PhD in a lit-heavy field without using it. (I unfortunately also did not use the Archive but had my own way of creating/maintaining a kind of Zettelkasten -- mostly proprietary software which was not a great idea long-term but at least I had a database and it worked when I needed it.)
    I'm very late to the party here, but I also use Bibdesk (and Atom and all that), and started out with a similar idea as @joachiedere -- having different bib files for different chapters/projects. It's a terrible idea. Later it's a huge pain to find that reference/file you sure you've filed somewhere already, but don't quite remember where. It's much better on the long-term to have a central bib file and then have tags/folders for the different projects. (I have about 1500 references now in my bib database, no way I would remember what went where.) Oh and make sure you note your bibtex key on all your text notes (and don't ask why I say it...). :) Good luck!

  • @Sociopoetic I can imagine two uses of Emacs: one for project task management, and one for the actual writing. Not that I recommend this to anybody, since getting used to Emacs takes a while. As @mediapathic said, it's more a "questionable lifestyle choice" than a simple editor :)

    If you're invested into Emacs already, you'll look for ways to suck in more stuff from the rest of the world, including your Zettel notes. It's like a black hole, only you're inside the hole and cannot see the rest of the world as time and space dilates around you.

    But if you're still sane and live in the real world, continue using your favorite writing app and the task manager of your liking. As long as it fits your workflow to get from notes to a PDF, it's probably fine.

    Author at Zettelkasten.de • https://christiantietze.de/

  • FWIW, my usual setup nowadays is Archive (Zetteln), Scrivener (first draft), and then Atom (typesetting). Agree with @ctietze that some programs will “suck you” into them (Scrivener tried the same but I resisted; it really is great for writing but not for ZK).

    As long as your setup works for you, it should be fine. You shouldn’t assume the softwares you’re using will be around forever, so do some software-agnostic backups sometimes (I didn’t always and that sucked).

  • @ctietze and @zvt,

    I'm not invested in Emacs, I was going off of the document linked for Healy's setup for social science research. Because I'm starting my Ph.D. in the fall, I'm hoping to get a very good workflow going (including ZKM, since I'm new to it). Having done grad school before years ago, I want a better system to go from lecture and reading notes (commonplace book) to organized ideas (Zettelkasten) to drafted papers and PDFs. Hence the questions about BibTeX, Emacs, etc. I'm figuring it out slowly, but I'm also open to suggestions from others.

  • @Sociopoetic, I think -- bad news -- there is no workflow that's a complete "holy grail". Once you start doing what you do, you'll see how you can mold things to your liking. Find a good pdf reader that you like; take notes in a format that you can use with multiple programs (or can at least backup in another format); and find a writing program that you like and that doesn't make writing too cumbersome. And yes, do have a citation manager, but if you're using Bibdesk, you already have that.

    When I started grad school (10 yrs ago -- ouch....) I really tried to find a program that would do just the kind of thing I wanted it to do, and all of that. I started to put my notes into all kinds of proprietary softwares because I thought they are just the exact thing I needed and would make writing so much easier. By the time I finished my diss, most of them were defunct, and with a couple of them I wasted a lot of time getting my notes out of them (they had terrible export functions that I had not thought about when I should have). What I learned from all this is 1) don't try to find the perfect program, because there isn't such; 2) choose something that you won't spend 2 weeks digging your notes out of when you decide to leave; 3) think long-term. Think about the forgotten notes you wrote 10 years ago that now suddenly you want to look at. Can you still?

    Good luck figuring out your starting workflow!

Sign In or Register to comment.