Yesterday I learned the secrets of the universe. Today I struggled to highlight a PDF. How did we get here?

Mark Wiemer
6 min readMar 23, 2023

--

Disclaimer: I have no idea how we got here. This is just me ranting about how terrible technology has remained in some core areas, and maybe coming up with ideas to fix it.

Also, this article mentions products by Microsoft, my employer. I wrote this in my free time and all opinions are my own.

I’m a software engineer who’s been given 5 whole business days to learn whatever I want. I spent the first two writing my intro to AI article, and I spent yesterday reading about the revolutionary core architecture that powers GPT: transformers. It’s so core that it’s literally the “T” in “GPT”.

And boy did I feel smart! I was annotating the paper in one window, looking up math formulas in another, and taking notes in a third. It took a while, but by the end of the day I understood multi-head attention, scaled dot-product attention, how masking preserves the auto-regressive nature of the large language model, and a few other neat tricks. It’s an amazing bit of research, and I have even greater respect for Google’s research teams for having come up with it.

Last night, I wanted to send the annotated PDF from my work PC to my personal one. So I figured I’d attach it in an email.

“Error: file too large.” File too large? More than 25 MB for a 15-page PDF with highlights and comments? No way.

Yes way. Somehow my 2 MB PDF ballooned to 50 MB with highlights using Edge. Why? How has technology continued to fail us in such core ways? Is annotating documents not important?

OK, maybe I’ll upload the file to my work OneDrive and share it with my personal account? Nope: banned by my employer for security. OK, I guess that’s understandable.

Hmm, I guess I’ll try the old-fashioned “convert PDF to Word file” and highlight from there. Let’s just have Word convert the file and…

My eyes! Oh goodness me what a horrendous sight! The formatting, the images of lines, the formulas, everything is… it’s… it’s terrible! The humanity! And that’s not to mention all the red and blue squiggles telling me that the elite researchers who wrote this paper should consider removing a comma or something…

Deep breaths, Mark, deep breaths.

After a bit of researching, I’ve disabled spell check and grammar check on this file only. That’s nice. And I’ve rewritten the core formulas using the Unicode math editor built into Word. Progress. Let’s get to highlighting. I’ll just select some text, click highlight, and…

What are these options?? Bright pink? Dark red? Who… who would use these colors? How can I change them? Where is the change button? Surely there’s a custom color button somewhere, right? It should be… um… OK, maybe the internet can tell me.

Nope. There isn’t a way. You have to apply custom styling. And then save that style and apply it later. Weird. Lots of clicks. Not fun. But do-able.

Or so I thought! The custom style just straight up doesn’t work. So… well, Word has really disappointed me.

And don’t you dare suggest Adobe! That company’s monetization practices are horrendous and the notifications are annoying and the products just feel yucky no way.

So, we turn to the dark side.

Open-source word processors.

(I’m just kidding, I totally love open-source everything. This is a great opportunity to find good alternatives to Word and Adobe!)

The first suggestion the internet gave me was Apache OpenOffice. I opened it. Yikes. I looked online for how it compared to LibreOffice, which I was familiar with from my brief Linux days of yore. LibreOffice wins. OK, let me install that.

Bada bing bada boom I’m in a new file. Let’s open the PDF — please convert please convert please convert — wow! It looks really good! And this stuff is still text! But… um, I can only see the first page. That’s OK. Now, how to highlight. Let me just search in the app — ah, there is no search in this app. Back to the internet!

Oh cool, this forum post from 2019 says I should just press F5 to open Properties. Ah, but actually for me F5 opens Navigator. I don’t know what Navigator is. Where is Properties? Ah, there it is. Cool. Ctrl+Alt+1. Same thing. And there’s highlight! With custom color! I’m saved! Cool, onto page 2! Um… how do I get there?

Ah, I see, just collapse the list of shapes for each page manually and then click the page you want. Or Alt, P, T, N for next page. But really I’d like to scroll, this is annoying.

Oh! Oh! I know something, because I’m an engineer. LaTeX! This PDF was probably generated with LaTeX! But how can I get the source TeX files?

From the same ArXiv.org page, of course! It has an “other formats” link, let me just download this…

aaaand it’s a file without an extension. Is it secretly a PDF again? Let me just change the extension and try to open it with Edge — Nope, not a PDF. Is it a gzipped file? Let me just change the extension and open a terminal and navigate specifically to that file and replace the backslashes with forward slashes because I’m using Bash in a Windows environment because I’m an absolute genius I haven’t done anything wrong — Nope, not a gzipped file.

(I skipped over a good hour of triage as I tried to figure out how to work with gzip and tar on a Windows machine, fortunately arXiv itself and the internet guided me toward the light that is 7zip.)

Alright! I now have the TeX files in a nice regular folder! And here are the figures in high def! This is awesome! Let me just bundle it together…

Oh, yeah, I don’t have an app for that. Let me see… this extension says to use latexmk but doesn’t elaborate, the latexmk page online is stuck in the 90s (welcome to a lot of open-source projects), but hey the download works. And now I have a folder, so let me just give that path to the extension, except I don’t know if it wants 1 backslash or 2 backslashes or 1 forward slash to separate and do I need these quotes or should I escape spaces with a backslash and maybe I should just look up the source code for this extension — well, how about this: Build via terminal without the extension.

Command not found. OK, let’s go directly to it, run latex.cmd and wow here we are a whole page of output that starts with “you don’t need this” and ends with some perl magic. Cool. Do I have to install perl now?

Oh my goodness! I already have perl? Something is going my way for once?? That’s amazing! OK, cool, so we use perl to run latexmk…

“Not in PATH”. Ugh, yeah, that’s a thing. Let me just update the path and do it again — Not in PATH. OK, close terminal, re-open terminal — Not in PATH. Hmm… close terminal, close a lot of other apps, re-open terminal —

“No file found!” Huzzah! Progress! Let me just give it a file, again how do I path this? Meh let me just cd to the containing dir anyway —

latex not found ! Alright! Let me just… install LaTeX? I thought latexmk would cover that… oh, it’s just a listener that asks LaTeX to rebuild on changes? Sure that’s good but how do I install LaTeX? …thanks internet, MiKTeX is installing now…

and it’s done! Let me see if I can get it open —

ooh, a notification! From MiKTeX? Updates available? But — 110 updates?? Oh boy this is a security concern for sure and I’m not just clicking buttons because these are the easy buttons and at least something is working now no way!

So here we are. I’ve almost rebuilt the PDF from the source plaintext files. Once I can do that consistently, I’ll write some macros for styling text to make it look highlighted, and then I’ll be able to edit the raw source of the PDF without worrying about automatic conversions from PDF to Word or random file bloat from Edge’s PDF annotator.

All this work because Edge couldn’t get its act together. One day…

Updated May 7 to add the “Microsoft independent” disclaimer.

--

--

Mark Wiemer

Software engineer at Microsoft helping anyone learn anything. All opinions are my own. linkedin.com/in/markwiemer 🤓