Locating and managing the bibliography
Sources.xml file on your Mac

Clark Elliott

Background

Keep in mind that Microsoft (MS) and Apple/Mac are business adversaries. They only reluctantly support software on one another's operating system. MS has a separate software team that re-writes the MS software (such as Word) to run on the Mac. Relative to the main development division it is small. They make choices about what to implement, and how what they do implement appears on the Mac. Relative to this assignment: some of the Word functionality on the Mac appears in different locations, and some of it does not exist. With different version updates, you may very well have to look around and experiment with the software tabs, links and icons to find MS functionality on the Mac.

Unix tools

In 2001 Apple moved to Unix. Since then, the Mac interface has been sitting on top of unix, which is generally a very good thing, because unix is a superbly robust operating system. All self-respecting Mac users that have any relationship whatsoever to computer science, should know the basics of how to get around in a unix terminal window, including how to navigate directories, and how to find, create/view/edit (with a text editor), move, delete, and list files. Additionally you should understand at least the basics of how to use shell scripts. If you don't know the basics, look up a rudimenatary unix command line tutorial for the commands ls, ls -a, ls -l, pwd, cd, chmod, rm, mv, echo, cat, mkdir, rmdir, head and man.

Text Editor

To work with some of the following suggestions, you will need to be able to edit text files, covered elsewhere. On the Mac the most basic default editor is TextEdit and you'll have to know how to save files in text format with the right file extension. I recommend upgrading to at least something like Atom.

Terminal Windows

First, for basic use, by default Mac gives you an inconvenient prompt that can take up half of your command line. You can always set it back if you like, but let's get rid of it for now, as follows.

Your default prompt probably looks something stupid like the following:

Users-iMac-2:~ clarkelliott$ 
In the worst case we want to avoid it looking completely moronic like this:
Users-iMac-2:~/Library/Containers/com.microsoft.Word/Data/Library/Application Support/Microsoft/Office/ clarkelliott$ 
So, let's fix it. If you already have a .bash_profile file in your home directory you have to add the one line below to it using your text editor. Otherwise, using your text editor, in your home directory, create a file called .bash_profile and add the following line to it, then save the file:
export PS1="> "
Then, exit your Terminal Window, start up a new Terminal Window and your prompt should look like this:
> 
Alternatively you can use $ in place of > to be consistent with bash style:
$ 
At this point, you will no longer see where you are in your directory tree as part of the prompt. But when you want to check where you are (as opposed to seeing this information repeated ad nauseum as part of the prompt) you type the print working directory command:
> pwd
~clarkelliott
Using the instructions listed elsewhere, make sure that you have created a Sources.xml file with at least one entry in it. To find where it is in your directory tree, we use the find command in one of two ways:
> cd
> find . -name Sources.xml
> find . -name *.xml
which will probably return a location like the following, but you may have to adapt:
~/Library/Containers/com.microsoft.Word/Data/Library/Application Support/Microsoft/Office/Sources.xml
If you don't see it, you probably have not yet created it.

You are going to have to return to this directory from time to time as you manipulate your sources. But you don't want to have to type that long string in over and over again. So, lets fix that by creating a symbolic link shortcut:

> cd
> ln -s mybib '~/Library/Containers/com.microsoft.Word/Data/Library/Application Support/Microsoft/Office'
Now we can easily change to that directory and perform tasks such as making a backup of our Sources.xml file (and the mybib symbolic link will also show up in finder):
> cd
> pwd
~clarkelliott
> cd mybib
> pwd
> ~clarkelliott/mybib
> ls
Sources.xml
> cp Sources.xml Backup1-Sources.xml
> ls
Sources.xml Backup1-Sources.xml
> 
If you ever want to get rid of the handy symbolic link (or if you make a mistake setting it up) use:
> unlink mybib
Note: In Finder on the Mac, your Library folder may be hidden from you. To see the hidden files, open the Finder and press:
 Command + Shift + .		[<--That is, end with a full stop/period]
(When you no longer want to see the hidden folders just press Command + Shift + . again.)

At this point, you should be able to navigate to the directory where Word will be looking for the file named Sources.xml. If you have created a symbolic link to the directory (e.g., mybib) you may well be able to do this in Finder. After creating your permanent bibliography in .xml format (e.g., using the JabRef technique), you will need to replace the dummy Sources.xml file with your new one. Always be careful to make backup copies of your .xml files so that you don't risk permanently deleting all of your previous bibliographic work!