Plotting with TikZ, Part III: Plotting a function defined by a formula, and plotting functions that go through certain points

In the last post, I described how I use TikZ to create a graph that might otherwise be created freehand: In this post, I will describe one method for using TikZ to to plot a function defined by a formula, such as $$y = \left(2x^2 - x - 1\right)e^{-x}.$$ Then I will show two ways to make a function go through a certain point. Plotting from a formula Simple example There are a number of ways to achieve this, and PGF actually includes the functionality to perform calculations in TeX.

Plotting with TikZ, Part II: Functions without formulæ

In the last post, I explained why TikZ is awesome for making plots. One good use case for handmade TikZ plots is to typeset a question like this: (2 points each) A plot of the graph of the function $f$ is below: For each of the following expressions, either evaluate the expression or state that it is undefined: a. $\lim_{x \rightarrow 2^{-}} f(x)$ b. $\lim_{x \rightarrow 2^{+}} f(x)$

Plotting with TikZ, Part I: Why?

This is the first part of a three-part series of posts on generating plots of graphs with TikZ. Last year, I left my position as a mathematics professor, after teaching mathematics at the college level for 15 years (nine years as a faculty member, and six years as a graduate teaching fellow). In that time, I picked up a lot of tricks using LaTeX to produce teaching materials (handouts and slides).

Migrated to Hugo

When I set up this blog in 2012, WordPress was a natural choice for content management system. However, I recently decided to investigate using Hugo to generate this blog, and after some playing around, I made the leap. The biggest reason: I wanted the benefits of a statically-generated site. (Hugo is also more compatible with version control systems.) For the actual migration, I used Cyrill Schumacher’s WordPress to Hugo Exporter plug-in.

“10 PRINT” in PostScript

Back in May, I posted a LaTeX document using TikZ to implement the Commodore 64 BASIC program: 10 PRINT CHR$(205.5+RND(1)); : GOTO 10 The amusement factor (for me) is due to LaTeX’s ability to generate pseudorandom numbers, which may be surprising to some, especially those who think of LaTeX documents as static (deterministic) documents and not computer programs. PostScript can also generate pseudorandom numbers, and hence I present “10 PRINT” in PostScript:

“10 PRINT” in TikZ

The book 10 PRINT CHR$(205.5+RND(1)); : GOTO 10, by Nick Montfort, et. al., uses a one-line Commodore 64 BASIC program “as a gateway into a deeper understanding of how computing works in society and what the writing, reading, and execution of computer code mean” (p. 4). The focus is on the titular program, which the authors call 10 PRINT for short: 10 PRINT CHR$(205.5+RND(1)); : GOTO 10 This program prints an infinite random sequence made up of the box-drawing characters ╱ and ╲ (that’s U+2571 and U+2572, respectively, encoded in the Commodore character set PETSCII as 205 and 206.

LaTeX mailmerge package

The LaTeX mailmerge package is super useful, especially for creating multiple versions of tests. Before I discovered mailmerge, my workflow for writing a test was basically: Write one version of the test. Make a duplicate of the file. Edit the file to change all the constants. At least, that was my intended workflow. But typically I would also: Realize that there was some change I wanted to make to the test.

LaTeX menukeys package

I’d like to put in a quick word in favor the LaTeX menukeys package. This package makes really nice menu sequences, which is useful when you have to explain how to use software. For example, \menu[>]{Tools > Web Developer > Page Source} produces:

Why I use version control

Christophers-MacBook-Pro:t_test chris$ cp t_test3.pg inclass_t_test2.pg Oh, crap! I wanted to copy that to inclass_t_test3.pg, not overwrite inclass_t_test2.pg! Christophers-MacBook-Pro:t_test chris$ git status On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: inclass_t_test2.pg no changes added to commit (use "git add" and/or "git commit -a") Christophers-MacBook-Pro:t_test chris$ git checkout -- inclass_t_test2.