3

I needed help from Marmot on the arrows of this program because my skills are weak, but I made a few attempts alone and got errors I knew were wrong. Removing the package flexisym did the job. Why? It was apart of a larger template so while I don't use it, it was conflicting with the tikzmark package.

\documentclass{article}
\usepackage{amsmath,mathtools,geometry}
\usepackage{flexisym} % Use % to make the program work properly
\usepackage{tikz}
\usetikzlibrary{tikzmark}

\newbox\aebox
\newcommand\aecomment[2][0pt]{%%
  \begin{lrbox}\aebox
    \begin{minipage}[t]{2.5in}
   \raggedright
  \textcolor{blue}{#2}%%
  \end{minipage}%%
 \end{lrbox}%%
 \raisebox{#1}[\height][0pt]{\usebox{\aebox}}}

\begin{document}
For $f(x)=\dfrac{1}{x}$, we have

\begin{align*}
      f(x+h)&=\dfrac{1}{x+h} \\
 \shortintertext{then}\\
                 f(x+h)-f(x)&=\dfrac{1}{x+h}-\dfrac{1}{x} \\ \\
                        &=\dfrac{1}{x+h} \cdot \textcolor{red} 
   {\dfrac{\tikzmarknode{C}{x}}{x}}-\dfrac{1}{x}\cdot \textcolor{red} 
   {\dfrac{x\tikzmarknode{C'}{+}h}{x+h}} && \aecomment[1.3ex] 
   {\textcolor{red}{\tikzmarknode{A} 
   {}Multiplying by $1$ to get a common denominator}}\\
  \end{align*}

 \begin{tikzpicture}[overlay,remember picture]
 \draw[red,-latex] ([yshift=3pt,xshift=-5pt]A.west) -- ++(-7pt,0pt)-- ++ 
  (0pt,12pt) coordinate (aux)-| (C.north);
  \draw[red,-latex] (aux) -| (C'.north);
  \end{tikzpicture}


 \end{document}

This will output with 2 errors the following:

enter image description here

By removing \usepackage{flexisym} the output properly gives:

enter image description here

I don't know what flexisym is but it was incompatible with the tikzmark program!

MathScholar
  • 2,513
  • 2
    it's generally a bad idea to use any packages unless you know you need them. I have never seen flexisym used directly, it is basically a support package for breqn and both packages are a highly experimental re- implementation of the entire math layout of tex, and are by design incompatible with more or less everything. Anyone using them really needs to be prepared to accept and work round low level tex conflicts. – David Carlisle Nov 22 '18 at 08:02
  • Thank you David, I will be removing it from the template I am using and as a rookie with LaTex I should be taking your advice and understand which package performs which needed output. It is so easy to copy paste and get things to work without mentally recording details and syntax. – MathScholar Nov 22 '18 at 14:17
  • Aside: Have a look at https://tex.stackexchange.com/a/391022. – TeXnician Nov 22 '18 at 17:50

0 Answers0