Sekai 🌐 πŸ—Ί

Sekai is the kanji for δΈ–η•Œ, meaning “the world”. That’s a great word because of the scale it designates.

Simpler Diagram for Trigonometric Functions With Unit Circle

Background In my previous post about unit circle and trigonometric functions, I included a graph with three trigonometry functions. I’m quite satisfied with my TikZ picture. Problem Unluckily, a secondary school student found that my diagram was too complicated. Solution \documentclass[tikz,border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{calc} \newcommand\mytheta{110} %angle theta \begin{document} \begin{tikzpicture}[scale=2] \coordinate[label=left:$O$] (O) at (0,0); \coordinate[label=above left:${A = (\cos\theta, \sin\theta)}$] (A) at (\mytheta:1); \coordinate[label=below left:${B = (\cos(-\theta), \sin(-\theta))}$] (B) at (-\mytheta:1); \coordinate[label=right:$E$] (E) at (1,0); \draw (O) circle (1); \draw (A) -- (O) node [midway, left] {$1$} -- (E); \draw (B) -- (O); \draw[-stealth] ($(O)! [Read More]
LaTeX 

Tikz Illustration for Triangle Inequality

I thought the code would be easy, but it turned out that I spent one hour and half to draw this figure. \documentclass[border=2pt,preview]{standalone} \usepackage{tikz} \usepackage{caption} \newcommand{\sideA}{2} \newcommand{\sideB}{3} \newcommand{\sideC}{6} \colorlet{myred}{red!40!yellow} \colorlet{mygreen}{green!40} \colorlet{myblue}{blue!20} \begin{document} \begin{figure} \centering \begin{tikzpicture}[thick] \coordinate (A) at (0,0); \coordinate (B) at (\sideC,0); \draw[<->,>=stealth,myred] (A) -- ++ (-\sideA, 0) node [pos=0.5,below] {$\color{myred}{a}$}; \draw[<->,>=stealth,mygreen] (B) -- ++ (\sideB, 0) node [pos=0.5,below] {$\color{mygreen}{b}$}; \draw[<->,>=stealth,myblue] (A) -- (B) node [pos = 0.5, below]{$\color{myblue}{c}$}; \draw[dashed,myred] (A) circle (\sideA); \draw[dashed,mygreen] (B) circle (\sideB); \end{tikzpicture} \captionsetup{labelformat=empty} \caption{triangle inequality ${\color{myred}{a}} + {\color{mygreen}{b}} > {\color{myblue}{c}}$ with $\color{myred}{a = \sideA}$, $\color{mygreen}{b = \sideB}$, $\color{myblue}{c = \sideC}$} \end{figure} \end{document} The colors are customized for the Discord bot TeXit. [Read More]
LaTeX 

Git Warning: LF Will Be Replaced by CRLF

I’m using Git Bash while writing this post. I’ve never tested the commands on *nix. Background Some of the tags and titles were written as “LateX”/“latex” in the source files. I batch corrected them with Git Grep and GNU Sed. git grep --name-only -IiE ^-\ latex$'\r'? content/{post,page} | \ xargs -n1 sed -i "s/^- latex/- LaTeX/I" I tried to match a leading - using ^- a whitespace \ escaped by a backslash to avoid wrapping the special character below with double quotes the string “latex” (case-insensitive) the carriage return \r, which is represented by $'\r' in bash, for at most once (? [Read More]
Git  sed 

LaTeX Table Background Color for TeXit

Problem In my previous post about LaTeX tables, I used \cellcolor{white} to override the \rowcolor{cyan} in a cell in the leftmost column, which was the column type name. On Discord, that cell became black because TeXit inverted black and white. Discussion I first tried blending black and white, and I found that black!27 and black!28 give a good approximation to Discord’s background color. Thanks to this Discord Color Palette and a bot command channel on a server, I’ve observed that the desired color is RGB(54,57,62). [Read More]
LaTeX  TeXit 

Line Equation in Intercept Form

LaTeX code for a TikZ figure

This is a first draft of a TikZ picture illustraing this classical formula to be used for math help channels. Adding \caption{for the picture} without “Figure 1:” requires \usepackage{caption} and wrapping with \begin{figure}. It also possible to use the primitive TeX command \par, but it would be complicated to use that with standalone. In the previous post, the SVG picture from the LaTeX table in an article has too much useless whitespace around the table. [Read More]
LaTeX 

LaTeX Multirow Multicol Table Coloring

Inspiration Number of two-digit numbers not containing the digit ‘8’. Code The standalone class can’t be used with \caption. *{8}{c} means 8 c. >{\columncolor{cyan}}c gives the column color. It \usepackage[table]{xcolor}. \rowcolor{cyan} overrides the column colors. \cellcolor{white} overrides the above two commands. It has to be carried out one-by-one without any fancy package. \multicolumn{n}{<alignment>}{content} defines a multi-column cell. \multirow{n}{*}{content} defines a multi-row cell. It \usepackage{multirow}. It can’t contain \multicolumn. \cline{i-j} draws a horizontal line above the row from column i to column j. [Read More]
LaTeX  table 

Upgrade Font Awesome in Beautiful Hugo Theme

Technical adjustment to Font Awesome's official guide

Background Beautiful Hugo comes with Font Awesome icons. However, it seems that it’s no longer maintained. Goal To upgrade Font Awesome to the current stable version (6.1.1). Problem The official guide for self-hosting Font Awesome Web Fonts + CSS suggests users to place the following files filepath role /fontawesome/webfonts/ Free Web Fonts /fontawesome/css/all.min.css CSS file for using Free Web Fonts into somewhere in my theme. The left column of the diagram features the folder assets/. [Read More]

Second Homothety between Nine-Point Circle and Circumcircle

Proof of Euler line by h(G, βˆ’1/2)

Motivation I saw someone illustrating his/her solution with a “superior triangle”. This reminds me the homothety about the centroid of factor βˆ’1/2. The above picture \usetikzlibrary{calc} for computing coordinates from those of existing points. (A)!.25!(B) means $(A)+.25[(B)-(A)]$. \begin{tikzpicture}[scale=2] \coordinate (D) at (-0.7,1); \coordinate (E) at (-1,0); \coordinate (F) at (1,0); \coordinate (A) at ($(E)!.5!(F)$); \coordinate (B) at ($(F)!.5!(D)$); \coordinate (C) at ($(D)!.5!(E)$); \coordinate (G) at ($(D)!.5!(E)!1/3!(F)$); \draw (A) -- (B) -- (C) -- cycle; \draw (D) -- (E) -- (F) -- cycle; \begin{scriptsize} \fill (G) circle (0. [Read More]

Basic Symmetries in Nine-Point Circle

Personal reading report

Motivation Someone on Discord asked about the existence of the nine-point circle. It’s well-known that that can be proved by homothety. Little reminder about homothety Homothety preserves angles (and thus parallel lines). Homothetic polygons are similar, so the ratio of the corresponding sides is the same. Considering the radii of a circle under a homothety, we see that a homothety maps a circle to another circle. Notation H: orthocenter G: centroid O: circumcenter Ο‰: circumcircle HA: feet of altitude with respect to A. [Read More]

Dvisvgm's Issue With Fill Pattern

Goal Generate SVG file for TikZ graphics. Method TeX β†’ PDF with PDFLaTeX PDF β†’ SVG with dvisvgm -P filename Example: I generated a PGF plot from the source code on my personal template. Problem When I applied this method to the following TeX code in my previous post, dvisvgm -P returns a blank SVG. \documentclass[tikz,border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.6} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines=center,legend style={at={(0.7,0.7)},anchor=south west}] \addplot [domain=-3:3, thick, smooth, yellow] { 1/sqrt(2*pi)*exp(-x^2/2) }; \addlegendentry{$y = \frac{1}{\sqrt{2\pi}} e^{-x^2/2}$}; \addplot [dashed, yellow] coordinates {(1. [Read More]
LaTeX  dvisvgm  SVG