Giter Site home page Giter Site logo

annotate-equations's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

annotate-equations's Issues

Declare package's dependencies for CTAN

At least the package pgf (for tikz) and tikzmark are required to use annotate-equations. It should be a good idea to declare the dependency on these packages by listing them in DEPENDS.txt (see the usage).

There are other tools to locate all dependencies, but I did not try.

"No shape named `{whatever}` is known" with the annotate macro on overleaf.

To whom it may concern,

I attempted to load this package on Overleaf and run the examples, but the annotate functions didn't work correctly, apparently because they couldn't find the nodes in the equation.

If you need any further information (e.g. my preamble) to replicate this result, please let me know. However, I noticed it does work with a test project, when I pull in the dependencies from the .sty file. Any reason why that would work?

Thanks for your help, I greatly appreciate it.

Best,
John

Need to process twice

As a positioning solution using TikZ, it needs to be processed twice before getting everything in the proper place. I have not seen that mentioned in the manual. My suggestion is for right afte the text:

There is still a bit of manual tweaking required (such as adding vertical space before/after the
equation), but hopefully this package will already make it a bit more inviting to annotate your equations!

on the top of the first page.

Annotations do not behave well across page flips

If the equation to be labeled is on the bottom of one page and LaTeX does a pagebreak right after the equation, the labels will show up in the next page with no error messages. e.g.

\[ ... \eqnmarkbox[...]{...} ...
\]
% page flip here
\annotate{...} % shows up on the next page

This can be solved by inserting a \pagebreak right after \annotate.

Known issue: `\tikzmarknode` & Co. break spacing of mathematical relations such as "="

Every once in a while it dislocates a piece of the equation inapropriately, like the equal sign on the second one:

\documentclass{report}
\usepackage{annotate-equations}

\begin{document}
\[
a \tikzmarknode{node1}{=} b
\]
\annotate[yshift=-1em]{below}{node1}{change of variables}

\[
\int_0^{\infty}F_X(x)dx =\int_0^{\infty}F_X(-x)dx \tikzmarknode{node2}{=} \int^0_{-\infty}F_X(x)dx.
\]
\annotate[yshift=-1em]{below}{node2}{change}
\end{document}

image

A solution is suggested here.

compatibility with standalone (answer: yes for this package, just amsmath's `equation*` isn't)

with standalone it doesn't work

\documentclass{standalone}

\usepackage{amsmath}
\usepackage{annotate-equations}

\begin{document}
	
	\renewcommand{\eqnhighlightheight}{\mathstrut}
	
	\begin{equation*}
		\eqnmark{post}{p(\theta | D)} = \frac{\eqnmark{lik}{p(D|\theta)} 
		\eqnmark{prior}{p(\theta)}} {\eqnmark{marglik}{p(D)}}
	\end{equation*}
	\annotate[yshift=2.5em]{above,right}{lik}{likelihood}
	\annotate[yshift=1em]{above,right}{prior}{prior}
	\annotate[yshift=1em]{above,left}{post}{posterior}
	\annotate[yshift=-1em]{below,right}{marglik}{marginal likelihood}
	
\end{document}

Feature request: adding the possibility to customize the style of the arrows

For exemple, with \annotatetwo, we obtain a <-------> arrow (with corners). Currently, I don't see how to pass an tikz option to the command in order to have the tip only in one side (or to have dotted or dashed or thick lines).

I thought I could use the annotate-equations package to answer this question:
https://tex.stackexchange.com/questions/676227/how-to-draw-a-simple-curved-arrow-inside-of-an-equation

But currently, I cannot, because in the picture illustrating the question, the tip is only in one side, and \annotatetwo create an arrow with two tips, one in each side.

Option \tikzset{annotate equations/arrow/.style={->}} does not work

environment : overleaf
compiler=lualatex or xelatex

\begin{equation*}
    \eqnmarkbox[blue]{node1}{e_q^n}
    \eqnmark[red]{node2}{f(x)}
    \tikzmarknode{node3}{kT}
\end{equation*}
\tikzset{annotate equations/arrow/.style={->}}
\annotatetwo[yshift=1em]{above}{node1}{node3}{text}
%\annotate[yshift=1em]{left}{node1}{my}
\annotate[yshift=-0.5em]{below, left}{node2}{annotation}
\annotate[yshift=-0.1em]{below, label below}{node3}{text}

though I changed the default settings, the arrow lines compiled still keep the original style. \tikzset{annotate equations/arrow/. style = {color=ForestGreen, >=latex', very thick, dashed}} also has no effect.

Snipaste_2023-07-13_10-23-21

Backwards-incompatible changes not mentioned in manual

Hi. Thank you very much for this nice package, it is quite useful for me.

I believe I have found a bug in the pdf documentation. At some point, you mention that to change the font size/style, the following command should be used:

\renewcommand{\eqnannotationfont}{\sffamily\tiny}

When I do that, the compiler complains that the command \eqnannotationfont doesn't exist. When I check the sty file available in my installation (using MikTeX in Windows, if that matters) I can confirm that it really doesn't.

To change the font, this is the command that I had to include:

\renewcommand{\eqnannotationtext}[1]{\sffamily\tiny#1\strut}

By the way, it would be nice to have a way to change the color of the annotation (arrow and text) without changing the color of the equation or having to add a box around it. I did this by defining \renewcommand{\eqnhighlightshade}{0}, but this is a global option (for all annotations). There could be a way to do it for individual annotations. If you think this is interesting, I can try to implement and make a pull request.

can't layer eqnmarkbox with eqnmark (can't make hierarchical labels)

I want to create layered/hierarchical labels. For example, a group of terms within parentheses are the "background contribution" and the individual terms might be the "first order" and "trailing order". The overbar/curly brace shown in the original demo by Sibin covers this usecase but there is no easy way of replicating that with the current package.

Right now, in the following cod the annotation for \eqnmarkbox{Background} does not appear, only the colored box appears:

\begin{equation}
y(x) = \eqnmarkbox[blue]{Background}{
    (\eqnmark[red]{term1}{A}     +       \eqnmark[green]{term2}{B})
}
\end{equation}
\annotate[yshift=-1em]{below}{Background}{background term}
\annotate[yshift=0.5em]{left}{A}{first term}
\annotate[yshift=1em]{}{B}{second term}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.