GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - st--/annotate-equations: LaTeX package and annotated examples for annotating equations using TikZ.

BranchesTags
Open more actions menu

Latest commit

 

History

63 Commits
63 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
.gitignore
.gitignore
 
 
DEPENDS.txt
DEPENDS.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
annotate-equations.pdf
annotate-equations.pdf
 
 
annotate-equations.sty
annotate-equations.sty
 
 
annotate-equations.tex
annotate-equations.tex
 
 

Repository files navigation

Annotate equations in LaTeX using TikZ

( Documentation | License: MIT | CTAN )

This package provides commands that make it easy to highlight terms in equations & add annotation labels (based on TikZ). Tested with pdflatex and lualatex, but should work with most other LaTeX engines such as xelatex as well.

Inspired by Sibin Mohan's https://github.com/synercys/annotated_latex_equations/

Please report any bugs, issues, contribute changes & improvements on https://github.com/st--/annotate-equations/ :)

Package author: ST John, http://www.infinitecuriosity.org/

A package with reusable commands

rendering of annotated equation

Using annotate-equations.sty, an equation can easily be annotated as follows:

\begin{equation*}
    \mathcal{O}\big(
        (
        \eqnmarkbox[NavyBlue]{p1}{p}
        \eqnmarkbox[OliveGreen]{k1}{\kappa}^3  % note that we have the ^3 outside the \eqnmark/\tikzmarknode arguments
        )
        \eqnmarkbox[WildStrawberry]{T1}{T}
        +
        (
        \eqnmarkbox[NavyBlue]{p2}{p}  % tikz nodes need distinct names!
        \eqnmark[OliveGreen]{k2}{\kappa}
        )
        (
        \eqnmarkbox[WildStrawberry]{T2}{T}^2
        \tikzmarknode{Is}{|\mathcal{I}^*|}  % manual \tikzmarknode works, too
        \eqnmarkbox[Plum]{Nb}{N_b}
        \eqnmark[RoyalPurple]{M}{M}
        )
    \big)
\end{equation*}
\annotatetwo[yshift=1em]{above}{p1}{p2}{\# of nodes}
\annotatetwo[yshift=-1em,xshift=0.2ex]{below}{T1}{T2}{\# of graphs in $\hat{\mathcal{G}}_T$}
\annotatetwo[yshift=-2em]{below}{k1}{k2}{max.\ indegree in $\hat{\mathcal{G}}_T$}
\annotate[yshift=3em]{above,left}{Is}{size of set of allowed interventions}
\annotate[yshift=1em]{above}{Nb}{\# of samples per batch}
\annotate[yshift=-1em]{below}{M}{\# of samples for $\mathbb{E}_y$}

More details are in the user manual. Should work with both pdflatex and lualatex.

How to do it from scratch: annotated examples

rendering of annotated equation

Inspired by Sibin Mohan's https://github.com/synercys/annotated_latex_equations/, but with significantly simplified TikZ code, and with lots of comments to explain what is going on.

Two versions, one as Beamer slides with transitions, one as an article. For further examples, see https://github.com/synercys/annotated_latex_equations/.

Giving all highlight boxes the same height

Simply add a \mathstrut within the colorbox:

-\newcommand{\highlight}[2]{\colorbox{#1!17}{$#2$}}
+\newcommand{\highlight}[2]{\colorbox{#1!17}{$\mathstrut #2$}}

rendering of annotated equation with equal-height highlights

Much more information...

...in the answers to this TeX StackExchange question.

About

LaTeX package and annotated examples for annotating equations using TikZ.

Topics

annotationsequationslatex

Resources

Readme
MIT license
Activity

Stars

582 stars

Watchers

6 watching

Forks

26 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.