 Friendship ended with LaTeX. Now, Giraffe is my best friend. Okay, so if you watch this channel, you know that I have a lot of videos on LaTeX, I have a lot of videos on R Markdown, I have a lot of videos on Markdown, and compiling it with Pandoc and stuff like that. If you're never watching any of those, it's no big deal, but whatever. I'm a big proponent of writing documents, I guess in the command line, in the terminal, or in, you know, whatever your preferred text editor is, and compiling them with some kind of compilation software. It is much more extensible, it is much more versatile than writing something into what you see as what you get editor, like Word or LibreOffice. So I'm very glad that I've gotten a lot of people involved with that kind of stuff. But however, we have to go deeper because, you know, LaTeX, Pandoc, all these things, I guess Pandoc is using LaTeX when it's compiling or something like that, but you know, the thing about LaTeX is that it is very big, it's very bloated. I mean, to have a full LaTeX install, it's like two gigabytes. And you may not know this, but there is a document formatting service that comes with Unix platforms by default. Now, on GNU Linux, it is called GROF. Or, well, someone is going to interject for a moment because it's actually pronounced GROF. G is in GNU, of course. But I just say GROF because, I mean, I'm a minimalist. I don't like using all these syllables. You know, one is enough. So there's GROF on GNU Linux and on non-GNU systems. There is trough that, of course, came beforehand. But in this video, I'm going to talk about... You can go ahead and look at, you know, a man page for it. You probably have it already installed. This is not... There's like no resources on this. One of the reasons I haven't done a video on this is because I can't like... I can't just watch someone else's video and like get the basics. I basically had to figure a lot of the stuff out myself because the documentation, it's out there, but it's not very accessible. So hopefully this will help you if you're interested in this. Now, anyway, so first off, it's similar to... You write whatever in a text document. There are macros. There are shortcuts for formatting stuff. And then you compile it like you would LaTeX. Except for it's way quicker. It is way more efficient. It's way more Unix compliant. You can use text streams and all of this stuff. Now, the thing about... One thing you have to keep in mind is, if you go to the bottom of the GROF manual, it mentions... There are actually a whole bunch of different macro packages. And this means there are going to be different packages with different commands that do slightly different formatting and stuff like this. Now, one you might be familiar with, maybe if you don't even know the word GROF, is I think either man or mandoc. That's what people write manuals in, you know, like this document here. You may be familiar with that. There are a bunch of other macro formats. The one I'm going to talk about today is GROF underscore MS. I like this one. It just happens to be the one that I was playing around with. So I'll show you how it works. But all of these sort of work the same. Without further ado, you know, we're talking too much. Let's just get into the action and we'll talk... Once you understand it, we can talk more about the details. So I'm going to make a document. I'm going to call it GROF dot MS. Again, because I'm using the MS macros. So some basic macros. Title is TL. So my first GROF document. If you want to add an author, it's AU. So I'm going to put my author name in here. Actually, I noticed that Vim is not detecting the file type. So I'm going to... Okay, great. Just had to run that. And you can put in your institution, author institution. So let's say University of Arizona, et cetera. So this is just like in LaTeX when you have your title, your author, your institution command. Or we can have paragraph text. So this is a paragraph. I always forget how to type when people are watching. So this is really how a GROF document looks. Now I'm going to go ahead and say all the commands. This is one... This is going to be really weird when I tell you this. But all the commands in a GROF have to be at the beginning of a line. Now there are good Unix-like reasons for that. It's much easier to manipulate these kind of text files if all the commands are at the beginning. This is going to cause some things that look really weird, but it happens for a reason and it's very nice. So it's going to just say... I'm just saying this because it looks weird right now. Now I'm going to pull up now to compile this. I mean, since it's so instantaneous, it doesn't really feel like it's even compiling. But in order to put this into a real document, you just run GROF. And since we're using the MS macros, I'm going to give it the MS option. And I'm going to select our file. And if you just run it, it's going to output all of this stuff. This is just PostScript. By default, it outputs in PostScript. But let's say who uses PostScript, you know, whatever. I mean, we could output this to GROF.ps or something like that, but I'm a PDF fan. I think everyone else is. That's sort of the standard nowadays. So I'm going to use the T option and output this to PDF format. And again, by default, it's just going to output to the terminal. You know, GROF PDF. So now that is in a file. So I'm going to open this up with my PDF reader. GROF PDF. And there we go. So my first GROF document. The title is formatted, the user is formatted, or the author, whatever. And the institution. And we have our paragraph text. So that looks very, very nice. So we can keep going. So let's say we want a section heading. To make one of those, we just say NH. I guess that's for new heading or something like that. I don't know. So introduction. Okay, so let's recompile that. We'll see if we have a section heading and like LawTag or something, it's the section heading, at least in this macro set is automatically numbered. So we can have another section heading here. So let's say second section. And you'll see that it automatically has number two on it. Now we can also, let's see, what else can we do here? Now some things on basic formatting. Let's say I want to continue this paragraph. Now I could add some text here. That's going to show up in the paragraph as well. Or I could go down to the next line. One habit that I found is very useful with writing in LawTag or any kind of thing. Or any kind of like, you know, the, I guess document formatter. It's very nice to like add a sentence. Add like other sentences to, you know, the following line. And this is just so you can diff documents a little easier. So this way, you know, we can have another sentence and another and, you know, something like that. So we can very easily like diff them or do other kind of operations on it or detect what's in what document. But all of these are going to show up in the same paragraph. And that's going to be true unless you make a double space. So if I double space this or put two new lines, you're going to see that this is now formatted as a sort of new paragraph. It's not going to be indented though. If we want indentation, you should use the pp command because that is going to indent everything. It doesn't really look indented because we don't have a, actually I guess we could throw some more text here. So you can see that yes, both of these are in fact indented. Okay. So anyway, that's basic formatting here. Additionally, if you want subsections, I would say we want some subsections. So I can do nh2. And what that means is a section at the second level. So this is a subsection. Let me capitalize that because of autism or something. And go back up here, format it, and you'll see that this is now 2.1. Now, keep in mind this 2 here has nothing to do with the 2 that appears here. This just means at the second level. So if we redo this, I mean, if we have another section heading here, another section heading, the 2 just means at the second level from the top. Now, these other nh commands implicitly, they have a 1 argument. If you put a 1 here, it's not going to change anything because 1 just means the top level and that's inferred if you don't have anything. So that's headings, that's paragraphs. Now, if you want to format text, if you want to do bolding, italics, it's just as easy although it's going to, again, it's going to come off as a little weird. Let me show you what I mean. So let's start a new paragraph here. So here is some more text. I want the word bold to be bold. Now, what I'm going to do here, now this is a little strange, actually let me, for simplicity's sake, I'm going to get rid of those quotation marks. Now, as I said before, all commands, all macros have to be initial, like line initial. So in order to bold this word here, what you actually have to do is you go down here and you put it on its own line and I'm, well, I'm going to put this in quotation marks. Now, what this in effect is doing is this is running the B command on the first argument and I put this argument in quotation marks. These quotation marks are not going to show up. I mean, I could put in escaped quotation marks if I wanted them, but this is effectively saying run the B macro on this argument. Well, anyway, I'll just show you. It looks like what you would expect. This is now bold. I could add in, of course, multiple, however much stuff I want. If I wanted to, so again, this is going to be a little bit weird because if we want bolding or italics inside of our line, we actually have to, in the document, we have to start a new line, put it there and then start another new line to continue. Now, as I said, this is something you can actually avoid. I'll talk about that maybe later, maybe in another video, but this is just something that makes it easier to do basic stream manipulation if you're sending the output somewhere, if you want to perform operations on it, if you want to detect what arguments or what macros are being run. It's easier to do it with this kind of constraint on where they can appear. Just keep that in mind. Anyway, so we have bolds. We can have italic text with i. Run that. Notice also that even though I typed in dot i, since it's not at the beginning of a line, it's not going to appear as an argument, it's just going to appear as a dot i. You can have italic text or let's say this is bold italic text. I'll put the period in here. So recompile that. You'll see that. Now, you can check out the manual for more of these kind of macros, but this is just the basic formatting. There are some other things. Let's say I want one other thing that they'll often have is macros for starting or ending particular types of formatting. Let's say we want... I'm actually going to duplicate. I'm going to go to this paragraph here and I'm going to duplicate it. I'm just going to copy it a couple of times just so we have an example. And recompile that so we have some paragraphs. Now, let's say I wanted this middle paragraph to be indented a little more. So one thing we can do for that, we can use the... I'm trying to confuse which one we're on. We can use RS. That means I guess start and end. I don't actually know what the RS... It never occurred to me. I don't know what the RS stands for. But you have RS and you end it with RE. That just means start and end your indent. So I'm going to put these commands here. I'm going to run graph again and you'll see that now this paragraph is indented a little bit further in the second paragraph. So that's one thing you can do. Also, at the beginning of your document, abstracts are with AE for abstract... excuse me, AS for abstract start. So this is an abstract and AE for in the abstract. And so I'm going to recompile that. Wait, oh, AB. Sorry, I guess I messed that up. It's really AB for begin instead of AS. Apologies for that. But anyway, so we have an abstract here. It appears here nice and formatted and we can write however much we want. Let's see what else. Well, I think this is about it for this video. I'm going to probably do... Actually, I am going to do more on this. So this should give you all you need for basic formatting. You can compile it very easily. Now there are other very useful things. So let's say you want to have pictures. Let's say you want to have citations. Let's say you want to have tables. Other things like that. To do that kind of stuff, that's what the next video is going to be on. But to do that, you have to use what's called a preprocessor. Now there are other commands besides graph. Well, we'll just talk about it in the next video. In the next video, I'll talk about citations and probably some other stuff. And I'll see you guys next time. So stay tuned.