Small updates and corrections

This commit is contained in:
Kenneth John Odle 2024-06-05 14:48:54 -04:00
parent 2ff2255222
commit 38b03877c0

View File

@ -129,7 +129,7 @@
\maketitle \maketitle
\section*{Impressum} \section*{Impressum}
All contents \copyright2023 Kenneth John Odle All contents \copyright2024 Kenneth John Odle
Although this is now in your hands, and it's also on the web, so if you really wanted to steal this, I've made it pretty darn easy. I can't imagine why anyone would want to, though. However, you don't need to, because this is licenced under a CC BY-NA-SA 4.0 Creative Commons license. More information is at Although this is now in your hands, and it's also on the web, so if you really wanted to steal this, I've made it pretty darn easy. I can't imagine why anyone would want to, though. However, you don't need to, because this is licenced under a CC BY-NA-SA 4.0 Creative Commons license. More information is at
@ -230,6 +230,8 @@ One of the nice things about Linux is that once you get used to working on the t
Back in issue \#2 I talked about using Bash aliases to make your life easier. I've also started using them with \texttt{git} as well. Here's what they look like: Back in issue \#2 I talked about using Bash aliases to make your life easier. I've also started using them with \texttt{git} as well. Here's what they look like:
\newpage
\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, label=\fbox{Bash aliases for git}] \begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, label=\fbox{Bash aliases for git}]
alias gits="git status" alias gits="git status"
alias gita="git add *" alias gita="git add *"
@ -313,7 +315,7 @@ For what it's worth, I also have a backup script (as I mentioned in issue \#2) j
\section{Reloading the \texttt{.bashrc} File} \section{Reloading the \texttt{.bashrc} File}
For any of these things to work, you need to reload your \texttt{.bashrc} file after you edit it. You can log out and then log in again, or you can just go to the command line and type For any of these things to work, you need to reload your \texttt{.bashrc} file after you edit it. You can log out of your user profile and then log in again, or you can just go to the command line and type
\begin{Verbatim}[] \begin{Verbatim}[]
source ~/.bashrc source ~/.bashrc
@ -329,11 +331,11 @@ And of course, there is also a shorthand version:
\chapter{The Right Ways vs The Wrong Ways} \chapter{The Right Ways vs The Wrong Ways}
A lot of grew up hearing that ``there's a right way to do things and a wrong way to do things.'' I don't disagree that there is always a \textit{wrong} way to do things, but like house maintenance, working on computers quickly teaches you that there are a lot of wrong ways to do things. A lot of us grew up hearing that ``there's a right way to do things and a wrong way to do things.'' I don't disagree that there is always a \textit{wrong} way to do things, but like house maintenance, working on computers quickly teaches you that there are a \textit{lot} of wrong ways to do things.
Experience has shown me that not all wrong ways are wrong in the same way or to the same degree, and that the same is true of right ways. There may be multiple right ways to get something done, but some require less work and some require more work. It is not just a black-and-white issue. Experience has shown me that not all wrong ways are wrong in the same way or to the same degree, and that the same is true of right ways. There may be multiple right ways to get something done, but some require less work and some require more work. It is not just a black-and-white issue.
In the past few years, I've started things less in terms of a particular ``right way'' opposed to a particular ``wrong way'', and started thinking in terms of a spectrum of choices, some of which are obviously wrong (but wrong to varying degrees) and some of which are right because they work, but you have to take different roads to get there. In the past few years, I've started thinking of things less in terms of a particular ``right way'' opposed to a particular ``wrong way'', and started thinking in terms of a spectrum of choices, some of which are obviously wrong (but wrong to varying degrees) and some of which are right because they work, but you have to take different roads to get there.
What I have tried to do here is to create a hierarchy of ``rightness'' and ``wrongness'' as a way to organize my thinking on this subject; I can then jump in and discuss why things fall the way they do. No doubt, other people might have more distinctions or fewer in their hierarchy, or might have things in a separate order, or might have different reasons. What I have tried to do here is to create a hierarchy of ``rightness'' and ``wrongness'' as a way to organize my thinking on this subject; I can then jump in and discuss why things fall the way they do. No doubt, other people might have more distinctions or fewer in their hierarchy, or might have things in a separate order, or might have different reasons.
@ -393,7 +395,7 @@ Wrong ways may work, but they break other things along the way. As we shall see,
\paragraph{It works, but it breaks almost everything else.} This is almost exactly like ``It doesn't work and it breaks almost everything else'' except that your solution \textit{does} work. You just need to look at your overall system and figure out why everything else is going into meltdown mode. \paragraph{It works, but it breaks almost everything else.} This is almost exactly like ``It doesn't work and it breaks almost everything else'' except that your solution \textit{does} work. You just need to look at your overall system and figure out why everything else is going into meltdown mode.
\paragraph{It works, but it still manages to break a few local things.} Even though this is listed as a wrong way---you are still breaking things, after all---this is not always a bad outcome to experience. It's possible that those few things that are breaking are breaking because they are weak. If you strengthen those items and then apply this technique, it turns out that this isn't actually wrong after all, it only seemed wrong at the time. In the end, you have a much project that is much less fragile overall. \paragraph{It works, but it still manages to break a few local things.} Even though this is listed as a wrong way---you are still breaking things, after all---this is not always a bad outcome to experience. It's possible that those few things that are breaking are breaking because they are weak. If you strengthen those items and then apply this technique, it turns out that this isn't actually wrong after all, it only seemed wrong at the time. In the end, you have a much better project that is much less fragile overall.
\section{Wrong\textit{ish} Ways} \section{Wrong\textit{ish} Ways}
@ -407,7 +409,7 @@ Wrong ways may work, but they break other things along the way. As we shall see,
\paragraph{It works, but it requires you to rework some other parts of the project.} I admit, I was at a lost as to where to put this one. And I guess it depends if you are using a kludge or a best practice, so I'm going to assume you are using a best practice. In which case, this shows you places that you were possibly \textit{not} using something which is a best practice, and now you need to make those things better. \paragraph{It works, but it requires you to rework some other parts of the project.} I admit, I was at a lost as to where to put this one. And I guess it depends if you are using a kludge or a best practice, so I'm going to assume you are using a best practice. In which case, this shows you places that you were possibly \textit{not} using something which is a best practice, and now you need to make those things better.
\paragraph{It works, but it's a bit of a kludge.} A kludge is not always a bad thing (sometimes you have to work with what you have) but they are at best, inelegant, and at worst weighty and ugly. But they work for now, they don't break things, and they will last until you learn or can afford a better way. (I created a bit of a kludge when I couldn't figure out how to indent a bibliography entry. \footnote{You can see it in action in this commit for a different project: \kref{https://git.kjodle.net/kjodle/Notes-on-Python/commit/d4f93ec00f1e1078b1cfcb3aacd3481eb82bb0cd}{https://git.kjodle.net/kjodle/Notes-on-Python/commit/d4f93ec00f1e1078b1cfcb3a\\acd3481eb82bb0cd}.} Does it work? Yes. Am I happy with it? Not entirely. I'm 75\% there is a better way to do this, but I haven't found it yet. But it works for now, and I've marked it as a kludge, so I know this is something that I can come back to later. At least I made this less weighty and hid its heft and inelegance by turning it into a macro.) \paragraph{It works, but it's a bit of a kludge.} A kludge is not always a bad thing (sometimes you have to work with what you have) but they are at best, inelegant, and at worst weighty and ugly. But they work for now, they don't break things, and they will last until you learn or can afford a better way. (I created a bit of a kludge when I couldn't figure out how to indent a bibliography entry.\footnote{You can see it in action in this commit for a different project: \kref{https://git.kjodle.net/kjodle/Notes-on-Python/commit/d4f93ec00f1e1078b1cfcb3aacd3481eb82bb0cd}{https://git.kjodle.net/kjodle/Notes-on-Python/commit/d4f93ec00f1e1078b1cfcb3a\\acd3481eb82bb0cd}.} Does it work? Yes. Am I happy with it? Not entirely. I'm 75\% sure there is a better way to do this, but I haven't found it yet. But it works for now, and I've marked it as a kludge, so I know this is something that I can come back to later. At least I made this less weighty and hid its heft and inelegance by turning it into a macro.)
\section{Right Ways} \section{Right Ways}
@ -419,7 +421,7 @@ Unfortunately, sometimes a best practice is arrived at that for no other reason
\paragraph{It's a true hack.} \paragraph{It's a true hack.}
As I said way back in the first issue, I define a hack as ``an appropriate application of ingenuity''\footnote{See \kref{http://www.catb.org/~esr/jargon/html/meaning-of-hack.html}{http://www.catb.org/~esr/jargon/html/meaning-of-hack.html} for more information.}. These are rare, often false (it only resembles a hack; like the wizard in \textit{The Wizard of Oz}, it's based on smoke and mirrors), and even more often small.\footnote{You can usually identify a false hack by how large it is.} If you find one, enjoy it, preserve, and help to disseminate it. As I said way back in the first issue, I define a hack as ``an appropriate application of ingenuity''\footnote{See \kref{http://www.catb.org/~esr/jargon/html/meaning-of-hack.html}{http://www.catb.org/~esr/jargon/html/meaning-of-hack.html} for more information.}. These are rare, often false (it only resembles a hack; like the wizard in \textit{The Wizard of Oz}, it's based on smoke and mirrors), and even more often small.\footnote{You can usually identify a false hack by how large it is.} If you find one, enjoy it, preserve it, and help to disseminate it.
\chapter{Not Another PDF Scanner} \chapter{Not Another PDF Scanner}
@ -435,7 +437,7 @@ I first found out about NAPS2\footnote{\kref{https://www.naps2.com/}{https://www
I was looking for a way to lighten the background of the pages so that it would be easier to read. My usual solution for this would be to open the pdf in GIMP, opening each page as a separate layer. I could then figure out the settings for one page, convert that into a script (GIMP is scriptable!), apply that script to every single layer, and export the entire thing as a pdf, remembering to tick the box that says to export layers as pages, and also to do it in reverse order. I was looking for a way to lighten the background of the pages so that it would be easier to read. My usual solution for this would be to open the pdf in GIMP, opening each page as a separate layer. I could then figure out the settings for one page, convert that into a script (GIMP is scriptable!), apply that script to every single layer, and export the entire thing as a pdf, remembering to tick the box that says to export layers as pages, and also to do it in reverse order.
That's not a huge amount of work, but it's still—work. Surely, there has to be a more automated way to do this, no? That's not a huge amount of work, but still—it's work. Surely, there has to be a more automated way to do this, no?
I searched and I searched, and I was rewarded for that search. Someone mentioned that a program called NAPS2 had this very feature. The name didn't hurt at all—at this point in my life, I am very much in favor of naps, unlike the five year old version of me. I searched and I searched, and I was rewarded for that search. Someone mentioned that a program called NAPS2 had this very feature. The name didn't hurt at all—at this point in my life, I am very much in favor of naps, unlike the five year old version of me.
@ -488,17 +490,21 @@ You're probably not going to get a perfect book back, because the options are pr
Even though NAPS2 was designed to be a pdf scanner, it also has the ability to save individual scans as images. Even more importantly, because each scanned page is basically an image, you can also edit each page as an image by double clicking on it, where you get editing options like crop and rotate, in addition to the ones I mentioned earlier. This is pretty handy if you're scanning something like a manual that has different sized pages, or is printed on large sheets and folded into a box so that you have to scan it in sections,\footnote{Every piece of furniture I've ever assembled has instructions like this, but I've run into quite a few manuals that are miniature versions of this, like the earbuds I wear on my daily walk.} or a package that has care instructions. Even though NAPS2 was designed to be a pdf scanner, it also has the ability to save individual scans as images. Even more importantly, because each scanned page is basically an image, you can also edit each page as an image by double clicking on it, where you get editing options like crop and rotate, in addition to the ones I mentioned earlier. This is pretty handy if you're scanning something like a manual that has different sized pages, or is printed on large sheets and folded into a box so that you have to scan it in sections,\footnote{Every piece of furniture I've ever assembled has instructions like this, but I've run into quite a few manuals that are miniature versions of this, like the earbuds I wear on my daily walk.} or a package that has care instructions.
And if you're wondering why I keep banging on about manuals, it's because I do keep them. For years, I kept them all in a large three ring binder filled with page protectors that I could slip them into. It was big and awkward, and don't dare tip it the wrong way, or you have manuals all over the floor. And if you're wondering why I keep banging on about manuals, it's because I do keep them. For years, I kept them all in a large three ring binder filled with page protectors that I could slip them into. It was big and awkward, and I didn't dare grab it the wrong way, or I'd have manuals all over the floor.
At some point, I realized that most manuals are available in convenient pdf form from the manufacturer's website, so I started just downloading those, making sure the pdf was identical (or identical \textit{enough}) to the original, and then tossing the original in the recycling. At some point, I realized that most manuals are available in convenient pdf form from the manufacturer's website, so I started just downloading those, making sure the pdf was identical (or identical \textit{enough}) to the original, and then tossing the original in the recycling. But for those that aren't—yep, I scan them.
\medskip \medskip
\paragraph{Summary:} In short, NAPS2 is everything I need in a document scanner. It gives me some of the editing features of GIMP, has a simple interface to use (you can create different profile for each kind of scanning you you) and it just plain works. I recommend it. \paragraph{Summary:} In short, NAPS2 is everything I need in a document scanner. It gives me some of the editing features of GIMP, has a simple interface to use (you can create different profile for each kind of scanning you do) and it just plain works. I recommend it.
\chapter{Chemistry in \LaTeX{}} \chapter{Chemistry in \LaTeX{}}
\section{Package \texttt{hmchem}} I used to be a science teacher, and back in the day, typesetting anything chemistry was not all that easy. Well, it would have been if I had known anything at all about \LaTeX{}, but alas, I did not. I do now, though.
As it turns out, people have written a number of different packages over the years to help with this. Let's take a look at some of them.
\section{Package \texttt{mhchem}}
For typesetting chemical equations: For typesetting chemical equations: