Open your favourite wordprocessor (eg Libre Office, Microsoft Word, Apple Pages, Google Docs, etc)
Create a new, completely empty document (no template)
Type the single word LaTeX
Save the file (call it LaTeX-test or something obvious) in an obvious folder that you will remember (eg Home, Documents, Desktop, My Documents, ~/, or similar)
Close and quit the wordprocessor completely
Open your text editor (eg Emacs, Linux vi, Microsoft Notepad, Apple TextEdit,VS Code, Sublime, etc)
Open the document you just saved
See if you can find the word LaTeX that you typed in it
If it’s not visible, that’s because wordprocessors don’t use plaintext
In this chapter…
LATEX documents are all plaintext files. This means printable characters only (in whatever writing system is native to your language and culture), no hidden internal binary gubbins like fonts or formatting (except for spaces and linebreaks). If you haven’t seen a plaintext file before, it looks like this:
This means printable characters only (in whatever writing system is native to your language and culture), no hidden internal binary gubbins like fonts or formatting (except for spaces and linebreaks).
By comparison, wordprocessor files saying the same thing often actually look something like this inside:
@A@[@O@B@@@@@@@h@@PñÿB@h@@@M@D@e@f@a@u@l@t@ @S@t@y@l @e@@@*$A3@B*@OJC@QJC@CJX@mHIXsHIXKHA@PJD@nHDHtHDHJE@ aJX@_H9D@@@@@@@@@@@@@@@@@@@@@@F@þ_A@BAF@@@G@H@e@z@d@ i@n@g@@@M@O@S£ðA@X@OJF@QJF@CJ\@PJD@JE@aJ\@.@BPA@BA.@ @@I@T@e@x@t@ @B@o@d@kj@mHIXs@X@OJF@aJX@_H9D@@@@
The big advantage of plaintext is not just that it’s readable; it’s that the files can be copied, downloaded, or uploaded to any computer system running LATEX and they will typeset exactly the same. Because they are plain text they cannot corrupt your system, and they cannot be used for hiding virus infections in the way that binary (coded non-plaintext) files can be. Everything you can see is in the file and everything in the file is there for you to see: there is nothing hidden or secret and there are no manufacturers’ proprietary ‘gotchas’ like suddenly going out of date with a new version or imposing selective Digital Restrictions Management (DRM), leaving you unable to open your files.
Exercise 1.1 — Plaintext and wordprocessor files
So, you may ask, if LATEX files are all plaintext, how does LATEX know how to format them? The answer is that it uses markup: a system of labels which identifies what’s what in your document. LATEX and its packages recognise the labels and know how to format them, so you don’t usually need to add formatting by hand unless you want to do something very special or invent something out of the ordinary.
Wordprocessors use markup too (Libre Office and Microsoft Word actually use XML internally nowadays) but it’s extraordinarily complex, and encoded to prevent casual inspection. It’s then packaged up (often into a zip file) with all the stylesheets, images, and other bits and pieces. LATEX prefers to keep everything out in the open, making it very obvious how you are constructing your documents, so you can come back to them in the future and not have to worry about what you did.