texlive[68491] Master/texmf-dist: tikz-osci (9oct23)

commits+karl at tug.org commits+karl at tug.org
Mon Oct 9 22:20:24 CEST 2023


Revision: 68491
          https://tug.org/svn/texlive?view=revision&revision=68491
Author:   karl
Date:     2023-10-09 22:20:24 +0200 (Mon, 09 Oct 2023)
Log Message:
-----------
tikz-osci (9oct23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-doc.pdf
    trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-doc.tex
    trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-example.pdf
    trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-example.tex
    trunk/Master/texmf-dist/tex/latex/tikz-osci/tikz-osci.sty

Modified: trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-doc.tex	2023-10-09 16:18:57 UTC (rev 68490)
+++ trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-doc.tex	2023-10-09 20:20:24 UTC (rev 68491)
@@ -8,7 +8,7 @@
 \usepackage{hyperref}
 \title{TikZ Oscilloscope Package}
 \author{Thibault Giauffret}
-\def\version{0.2.0}
+\def\version{0.3.0}
 
 % Use sans serif font
 \renewcommand{\familydefault}{\sfdefault}
@@ -66,7 +66,6 @@
             indicators=0,
             color one=D62626,
             color two=1053AF,
-            color xy=2E8B73,
             graph back color=777799,
             info back color=333333,
             info text color=FFFFFF,
@@ -79,8 +78,10 @@
 \vspace*{0.5cm}
 
 
-This package is modest alternative to the \texttt{pst-osci} package (not maintained anymore). It allows you to draw oscilloscope "screen shots" with \LaTeX{}, TikZ and pgfplots.\\
+This package is a modest alternative to the \texttt{pst-osci} package (not maintained anymore). It allows you to draw oscilloscope "screen shots" with \LaTeX{}, TikZ and pgfplots.
 
+\subsection*{Contact}
+
 Some features are not implemented yet, but the package is already usable for basic representations. I'm doing this for fun and still learning how to make \LaTeX{} packages. Therefore, I'm open to any suggestion or contribution :
 
 \begin{center}
@@ -89,7 +90,9 @@
     }
 \end{center}
 
-A bug tracker is available at :
+\subsection*{Issues tracker}
+
+An issues tracker is available at :
 \begin{center}
     \url{https://framagit.org/ThibGiauffret/latex_packages/-/issues}.
 \end{center}
@@ -96,38 +99,40 @@
 
 Feel free to report any bug you find or send suggestions.\\
 
-\textbf{Important note :} Please indicate the concerned package name in the title of the issue. For example, if you want to report a bug about this package, please use the following title : \texttt{[tikz-osci] My bug report title}.
+\textbf{Important note :} Please indicate the concerned package name in the title of the issue. For example, if you want to report an issue about this package, please use the following title : \texttt{[tikz-osci] My issue report title}.
 
 \section{Usage}
 
 The package is loaded with the command \verb|\usepackage{tikz-osci}|. It defines a single command, \verb|\osci|, which takes a list of options as argument. The options allow you to configure and customize the oscilloscope screen view :
 
-\begin{tcolorbox}[enhanced,breakable,colback=white,colframe=black,width=\textwidth]
-    \begin{tabular}{lp{7cm}p{3cm}}
-        \texttt{scale}             & Scale of the oscilloscope (with \texttt{scalebox}).                                     & Default: \texttt{1}.                                             \\
-        \texttt{rounded corners}   & Radius of the oscilloscope corners (in pt).                                             & Default: \texttt{10}.                                            \\
-        \texttt{second channel}    & 1 if the second channel is enabled, 0 otherwise.                                        & Default: \texttt{0}.                                             \\
-        \texttt{screen offset one} & Vertical screen offset of the first channel.                                            & Default: \texttt{0}.                                             \\
-        \texttt{screen offset two} & Vertical screen offset of the second channel.                                           & Default: \texttt{0}.                                             \\
-        \texttt{time div}          & Time division (in ms).                                                                  & Default: \texttt{20}.                                            \\
-        \texttt{voltage div one}   & Voltage division of the first channel (in V).                                           & Default: \texttt{1}.                                             \\
-        \texttt{voltage div two}   & Voltage division of the second channel (in V).                                          & Default: \texttt{1}.                                             \\
-        \texttt{sample rate}       & Sample rate.                                                                            & Default: \texttt{200}.                                           \\
-        \texttt{xy mode}           & 1 if the oscilloscope is in XY mode, 0 otherwise. \textbf{\color{red}Not working yet !} & Default: 0.                                                      \\
-        \texttt{func one}          & Expression of the first channel (pgf maths format).                                     & Default: \texttt{2*sin(2*180/0.020*x)}.                          \\
-        \texttt{func two}          & Expression of the second channel (pgf maths format).                                    & Default: \texttt{1*sin(2*180/0.020*x) + 0.2*sin(2*180/0.040*x)}. \\
-        \texttt{indicators}        & 1 if the channel indicators are enabled, 0 otherwise.                                   & Default: \texttt{1}.                                             \\
-        \texttt{color one}         & Color of the first channel (in hexadecimal).                                            & Default: \texttt{D62626}.                                        \\
-        \texttt{color text one}    & Text color of the first channel (in hexadecimal).                                       & Default: \texttt{FFFFFF}.                                        \\
-        \texttt{color two}         & Color of the second channel (in hexadecimal).                                           & Default: \texttt{1053AF}.                                        \\
-        \texttt{color text two}    & Text color of the second channel (in hexadecimal).                                      & Default: \texttt{FFFFFF}.                                        \\
-        \texttt{color xy}          & Color of the XY mode (in hexadecimal).                                                  & Default: \texttt{2E8B73}.                                        \\
-        \texttt{color text xy}     & Text color of the XY mode (in hexadecimal).                                             & Default: \texttt{FFFFFF}.                                        \\
-        \texttt{graph back color}  & Background color of the graph (in hexadecimal).                                         & Default: \texttt{FFFFFF}.                                        \\
-        \texttt{info back color}   & Background color of the information box (in hexadecimal).                               & Default: \texttt{D6D6D6}.                                        \\
-        \texttt{info text color}   & Text color of the information box (in hexadecimal).                                     & Default: \texttt{000000}.                                        \\
-        \texttt{main axis color}   & Color of the main axis (in hexadecimal).                                                & Default: \texttt{000000}.                                        \\
-        \texttt{grid color}        & Color of the grid (in hexadecimal).                                                     & Default: \texttt{CCCCCC}.                                        \\
+\begin{tcolorbox}[enhanced,breakable,colback=white,colframe=black,width=\textwidth,left=0mm,right=0mm,top=0mm,bottom=0mm,boxsep=0mm]
+    \begin{tabular}{p{0.2\textwidth}|p{0.47\textwidth}|p{0.255\textwidth}}
+        \texttt{scale}                 & Scale of the oscilloscope (with \texttt{scalebox}).                                                                    & Default: \texttt{1}                                             \\\hline
+        \texttt{rounded corners}       & Radius of the oscilloscope corners (in pt).                                                                            & Default: \texttt{10}                                            \\\hline
+        \texttt{second channel}        & 1 if the second channel is enabled, 0 otherwise.                                                                       & Default: \texttt{0}                                             \\\hline
+        \texttt{screen offset one}     & Vertical screen offset of the first channel.                                                                           & Default: \texttt{0}                                             \\\hline
+        \texttt{screen offset two}     & Vertical screen offset of the second channel.                                                                          & Default: \texttt{0}                                             \\\hline
+        \texttt{time div}              & Time division (in ms).                                                                                                 & Default: \texttt{20}                                            \\\hline
+        \texttt{voltage div one}       & Voltage division of the first channel (in V).                                                                          & Default: \texttt{1}                                             \\\hline
+        \texttt{voltage div two}       & Voltage division of the second channel (in V).                                                                         & Default: \texttt{1}                                             \\\hline
+        \texttt{sample rate}           & Sample rate.                                                                                                           & Default: \texttt{200}                                           \\\hline
+        \texttt{xy mode}               & 1 if the oscilloscope is in XY mode (Lissajou curve), 0 otherwise.                                                     & Default : 0                                                     \\\hline
+        \texttt{math mode}             & 1 for addition, 2 for subtraction, 3 for multiplication, 4 for division, 0 otherwise. xy mode option must be set to 0. & Default: \texttt{0}                                             \\\hline
+        \texttt{math mode hide source} & 0 to display channels CH1 and CH2 with the third channel, 1 to hide them.                                              & Default : \texttt{0}                                            \\\hline
+        \texttt{func one}              & Expression of the first channel (pgf maths format). Trigonometric functions are defined in degrees.                    & Default: \texttt{2*sin(2*180/0.020*x)}                          \\\hline
+        \texttt{func two}              & Expression of the second channel (pgf maths format). Trigonometric functions are defined in degrees.                   & Default: \texttt{1*sin(2*180/0.020*x) + 0.2*sin(2*180/0.040*x)} \\\hline
+        \texttt{indicators}            & 1 if the channel indicators are enabled, 0 otherwise.                                                                  & Default: \texttt{1}                                             \\\hline
+        \texttt{color one}             & Color of the first channel (in hexadecimal).                                                                           & Default: \texttt{D62626}                                        \\\hline
+        \texttt{color text one}        & Text color of the first channel (in hexadecimal).                                                                      & Default: \texttt{FFFFFF}                                        \\\hline
+        \texttt{color two}             & Color of the second channel (in hexadecimal).                                                                          & Default: \texttt{1053AF}                                        \\\hline
+        \texttt{color text two}        & Text color of the second channel (in hexadecimal).                                                                     & Default: \texttt{FFFFFF}                                        \\\hline
+        \texttt{color three}              & Color of the XY mode and the math mode (in hexadecimal).                                                                                 & Default: \texttt{2E8B73}                                        \\\hline
+        \texttt{color text three}         & Text color of the XY mode and the math mode (in hexadecimal).                                                                            & Default: \texttt{FFFFFF}                                        \\\hline
+        \texttt{graph back color}      & Background color of the graph (in hexadecimal).                                                                        & Default: \texttt{FFFFFF}                                        \\\hline
+        \texttt{info back color}       & Background color of the information box (in hexadecimal).                                                              & Default: \texttt{D6D6D6}                                        \\\hline
+        \texttt{info text color}       & Text color of the information box (in hexadecimal).                                                                    & Default: \texttt{000000}                                        \\\hline
+        \texttt{main axis color}       & Color of the main axis (in hexadecimal).                                                                               & Default: \texttt{000000}                                        \\\hline
+        \texttt{grid color}            & Color of the grid (in hexadecimal).                                                                                    & Default: \texttt{CCCCCC}                                        \\
     \end{tabular}
 \end{tcolorbox}
 
@@ -144,9 +149,9 @@
 
 For more examples, see the \texttt{tikz-osci-example.tex} file.
 
-\begin{tcblisting}{enhanced,breakable,colback=white,colframe=black,width=\textwidth}
+\begin{tcblisting}{enhanced,colback=white,colframe=black,width=\textwidth, title=\bfseries Two channels plot with custom background color, sidebyside}
     \osci[%
-        scale=0.8,
+        scale=0.7,
         second channel=1,
         screen offset one=2,
         screen offset two=-2,
@@ -156,10 +161,9 @@
         sample rate=200,
         xy mode=0,
         func one=2*sin(2*180/0.020*x),
-        func two=1*sin(2*180/0.020*x)+0.2*sin(2*180/0.040*x),
+        func two=1*sin(2*180/0.020*x) + 0.2*sin(2*180/0.040*x),
         color one=D62626,
         color two=1053AF,
-        color xy=2E8B73,
         graph back color=669966,
         info back color=D6D6D6,
         info text color=000000,
@@ -168,6 +172,51 @@
     ]
 \end{tcblisting}
 
+\begin{tcblisting}{enhanced,colback=white,colframe=black,width=\textwidth, title=\bfseries Lissajou curve (XY mode) and no rounded corner, sidebyside}
+    \osci[%
+        scale=0.7,
+        rounded corners=0,
+        second channel=1,
+        time div=300,
+        voltage div one=1,
+        voltage div two=0.5,
+        sample rate=500,
+        xy mode=1,
+        func one=sin(7*x),
+        func two=sin(2*x),
+        indicators=1,
+        graph back color=FFFFFF,
+        info back color=D6D6D6,
+        info text color=000000,
+        main axis color=000000,
+        grid color=CCCCCC,
+    ]
+\end{tcblisting}
+
+\begin{tcblisting}{enhanced,colback=white,colframe=black,width=\textwidth, title=\bfseries Math mode (multiply) with hidden sources and dark mode, sidebyside}
+    \osci[%
+        scale=0.7,
+        second channel=1,
+        time div=10,
+        voltage div one=2,
+        voltage div two=2,
+        sample rate=500,
+        xy mode=0,
+        math mode=3,
+        math mode hide source=1,
+        func one=2*sin(2*180/0.040*x),
+        func two=3*sin(2*180/0.005*x),
+        indicators=0,
+        color three=F0DE25,
+        color text three=000000,
+        graph back color=777799,
+        info back color=333333,
+        info text color=FFFFFF,
+        main axis color=DDDDDD,
+        grid color=CCCCCC,
+    ]
+\end{tcblisting}
+
 \section{License}
 
 This package is distributed under the terms of the \textbf{LaTeX Project Public License} (LPPL), version 1.3c or later. The latest version of this license is available at \url{http://www.latex-project.org/lppl.txt}.
@@ -185,17 +234,19 @@
 \section{Changelog}
 
 \begin{itemize}
-    \item \textbf{0.2.0} :
+    \item \textbf{0.3.0} (2023/10/08) :
+          \subitem Implemented XY mode and math (add, subtract, multiply, divide) functionality.
+    \item \textbf{0.2.0} (2023/10/07) :
           \subitem Added \texttt{color text one}, \texttt{color text two} and \texttt{color text xy} options.
           \subitem Added \texttt{indicators} option.
           \subitem Added \texttt{rounded corners} option.
           \subitem Fixed the main axis color not being applied.
           \subitem Reworded the documentation and the example file.
-    \item \textbf{0.1.1} :
+    \item \textbf{0.1.1} (2023/10/06) :
           \subitem Renamed \texttt{sub axis color} to \texttt{grid color}.
           \subitem Renamed \texttt{expr one} and \texttt{expr two} to \texttt{func one} and \texttt{func two}.
           \subitem Updated package files names.
-    \item \textbf{0.1.0} : Initial release. XY mode not implemented yet.
+    \item \textbf{0.1.0} (2023/10/06) : Initial release. XY mode not implemented yet.
 \end{itemize}
 
 \end{document}

Modified: trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-example.tex	2023-10-09 16:18:57 UTC (rev 68490)
+++ trunk/Master/texmf-dist/doc/latex/tikz-osci/tikz-osci-example.tex	2023-10-09 20:20:24 UTC (rev 68491)
@@ -31,7 +31,6 @@
         indicators=0,
         color one=D62626,
         color two=1053AF,
-        color xy=2E8B73,
         graph back color=777799,
         info back color=333333,
         info text color=FFFFFF,
@@ -68,4 +67,96 @@
 
 \end{center}
 
+\newpage
+
+\begin{center}
+    \osci[%
+        scale=0.7,
+        second channel=1,
+        time div=300,
+        voltage div one=1,
+        voltage div two=0.5,
+        sample rate=500,
+        xy mode=1,
+        func one=sin(7*x),
+        func two=sin(2*x),
+        indicators=1,
+        graph back color=FFFFFF,
+        info back color=D6D6D6,
+        info text color=000000,
+        main axis color=000000,
+        grid color=CCCCCC,
+    ]
+
+    \vspace*{0.3cm}
+
+    \osci[%
+        scale=0.7,
+        second channel=1,
+        time div=1000,
+        voltage div one=1,
+        voltage div two=1,
+        sample rate=500,
+        xy mode=1,
+        func one=3*sin(2*x),
+        func two=3*sin(2*x+45),
+        indicators=1,
+        graph back color=FFFFFF,
+        info back color=D6D6D6,
+        info text color=000000,
+        main axis color=000000,
+        grid color=CCCCCC,
+    ]
+
+    \vspace*{0.3cm}
+
+    \osci[%
+        scale=0.7,
+        second channel=1,
+        time div=10,
+        voltage div one=2,
+        voltage div two=2,
+        sample rate=500,
+        xy mode=0,
+        math mode=3,
+        math mode hide source=0,
+        func one=2*sin(2*180/0.040*x),
+        func two=3*sin(2*180/0.005*x),
+        indicators=0,
+        graph back color=FFFFFF,
+        info back color=D6D6D6,
+        info text color=000000,
+        main axis color=000000,
+        grid color=CCCCCC,
+    ]
+
+\end{center}
+
+\newpage
+
+\begin{center}
+
+    \osci[%
+        scale=0.7,
+        second channel=1,
+        time div=10,
+        voltage div one=2,
+        voltage div two=2,
+        sample rate=500,
+        xy mode=0,
+        math mode=3,
+        math mode hide source=1,
+        func one=2*sin(2*180/0.040*x),
+        func two=3*sin(2*180/0.005*x),
+        indicators=0,
+        graph back color=FFFFFF,
+        info back color=D6D6D6,
+        info text color=000000,
+        main axis color=000000,
+        grid color=CCCCCC,
+    ]
+
+\end{center}
+
+
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/tikz-osci/tikz-osci.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tikz-osci/tikz-osci.sty	2023-10-09 16:18:57 UTC (rev 68490)
+++ trunk/Master/texmf-dist/tex/latex/tikz-osci/tikz-osci.sty	2023-10-09 20:20:24 UTC (rev 68491)
@@ -8,14 +8,14 @@
 % tained anymore.
 %
 % Author: Thibault Giauffret
-% Date: 2013/10/07
-% Version: 0.2.0
+% Date: 2013/10/08
+% Version: 0.3.0
 % Licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
 % Not an expert... Just doing it for fun.
 % -----------------------------------------------------------
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tikz-osci}[2023/09/30 0.2.0 Tikz Osci package]
+\ProvidesPackage{tikz-osci}[2023/10/08 0.3.0 Tikz Osci package]
 
 % Required packages
 \RequirePackage[dvipsnames]{xcolor}
@@ -51,6 +51,10 @@
   sample rate=200,
   xy mode/.store in=\xyMode,
   xy mode=0,
+  math mode/.store in=\mathMode,
+  math mode=0,
+  math mode hide source/.store in=\mathModeHideSource,
+  math mode hide source=0,
   func one/.store in=\funcOne,
   func one=2*sin(2*180/0.020*x),
   func two/.store in=\funcTwo,
@@ -65,10 +69,10 @@
   color two=1053AF,
   color text two/.store in=\colorTextTwo,
   color text two=FFFFFF,
-  color xy/.store in=\colorXY,
-  color xy=2E8B73,
-  color text xy/.store in=\colorTextXY,
-  color text xy=FFFFFF,
+  color three/.store in=\colorThree,
+  color three=2E8B73,
+  color text three/.store in=\colorTextThree,
+  color text three=FFFFFF,
   graph back color/.store in=\graphBackColor,
   graph back color=FFFFFF,
   info back color/.store in=\infoBackColor,
@@ -97,7 +101,7 @@
       % Set the colors
       \definecolor{firstcolor}{HTML}{\colorOne}
       \definecolor{secondcolor}{HTML}{\colorTwo}
-      \definecolor{thirdcolor}{HTML}{\colorXY}
+      \definecolor{thirdcolor}{HTML}{\colorThree}
       \definecolor{graphbackcolor}{HTML}{\graphBackColor}
       \definecolor{infoBackColor}{HTML}{\infoBackColor}
       \definecolor{infoTextColor}{HTML}{\infoTextColor}
@@ -105,7 +109,7 @@
       \definecolor{gridColor}{HTML}{\gridColor}
       \definecolor{colorTextOne}{HTML}{\colorTextOne}
       \definecolor{colorTextTwo}{HTML}{\colorTextTwo}
-      \definecolor{colorTextXY}{HTML}{\colorTextXY}
+      \definecolor{colorTextThree}{HTML}{\colorTextThree}
 
       % Draw the info box
       \draw[black,thick, fill= infoBackColor]
@@ -119,6 +123,51 @@
       % Add time/div label
       \draw (5,-0.15) node[anchor=north, color= infoTextColor] {\timeDiv\ ms/div};
 
+      % Add XY mode indicator
+      % Lissajou mode
+      \ifnum\xyMode=1
+
+        \draw[thirdcolor,fill=thirdcolor] (4,-0.78) rectangle (6,-1.28);
+        \draw (5,-0.75) node[anchor=north, color=colorTextThree] {XY mode};
+
+      \else
+
+        % Add mode
+        \ifnum\mathMode=1
+
+          \draw[thirdcolor,fill=thirdcolor] (4,-0.78) rectangle (6,-1.28);
+          \draw (5,-0.75) node[anchor=north, color=colorTextThree] {Add};
+
+        \else
+
+          % Substract mode
+          \ifnum\mathMode=2
+
+            \draw[thirdcolor,fill=thirdcolor] (4,-0.78) rectangle (6,-1.28);
+            \draw (5,-0.75) node[anchor=north, color=colorTextThree] {Substract};
+
+          \else
+
+            % Multiply mode
+            \ifnum\mathMode=3
+
+              \draw[thirdcolor,fill=thirdcolor] (4,-0.78) rectangle (6,-1.28);
+              \draw (5,-0.75) node[anchor=north, color=colorTextThree] {Multiply};
+
+            \else
+
+              % Divide mode
+              \ifnum\mathMode=4
+
+                \draw[thirdcolor,fill=thirdcolor] (4,-0.78) rectangle (6,-1.28);
+                \draw (5,-0.75) node[anchor=north, color=colorTextThree] {Divide};
+
+              \fi
+            \fi
+          \fi
+        \fi
+      \fi
+
       % Add voltage/div label for the first channel
       \draw[firstcolor,fill=firstcolor] (0.5,-0.15) rectangle (1.5,-0.6);
       \draw (1,-0.1) node[anchor=north, color=colorTextOne] {CH1};
@@ -131,12 +180,6 @@
         \draw (9,-0.75) node[anchor=north, color= infoTextColor] {\voltageDivTwo\ V/div};
       \fi
 
-      % Add the XY mode label
-      \ifnum\xyMode=1
-        % \draw (5,-0.75) node[anchor=north, color=thirdcolor] {XY mode};
-        % Coming soon...
-      \fi
-
       % Draw the oscilloscope screen border
       \draw[black,thick, fill= graphbackcolor]
       (0,0) --
@@ -175,27 +218,73 @@
           \pgfplotsset{ every non boxed x axis/.append style={x axis line style=-},
             every non boxed y axis/.append style={y axis line style=-}}
 
+          % Lissajou mode
           \ifnum\xyMode=1
 
-            % Coming soon...
+            \addplot
+            [domain=0:360,variable=\x,
+              samples=200,smooth,very thick,color=thirdcolor]
+            ({(\funcOne)/\voltageDivOne},{(\funcTwo)/\voltageDivTwo});
+            \draw[thirdcolor,fill=thirdcolor] (4,-0.78) rectangle (6,-1.28);
+            \draw (5,-0.75) node[anchor=north, color=white] {XY mode};
 
           \else
 
-            % Draw each channel separately
-            % First channel plot
-            \addplot[color=firstcolor,very thick,domain=-5*(\timeDiv/1000):5*(\timeDiv/1000),
-              smooth, samples=\sampleRate]{(\funcOne)/\voltageDivOne+\screenOffsetOne};
+            \ifnum\mathModeHideSource=0
+              % Draw each channel separately
+              % First channel plot
+              \addplot[color=firstcolor,very thick,domain=-5*(\timeDiv/1000):5*(\timeDiv/1000),
+                smooth, samples=\sampleRate]{(\funcOne)/\voltageDivOne+\screenOffsetOne};
 
-            % If the second channel is enabled, draw it
-            \ifnum\secondChannel=1
-              % Draw the second channel
-              \addplot[color=secondcolor,very thick,domain=-5*(\timeDiv/1000):5*(\timeDiv/1000), smooth, samples=\sampleRate]{(\funcTwo)/\voltageDivTwo+\screenOffsetTwo};
+              % If the second channel is enabled, draw it
+              \ifnum\secondChannel=1
+                % Draw the second channel
+                \addplot[color=secondcolor,very thick,domain=-5*(\timeDiv/1000):5*(\timeDiv/1000), smooth, samples=\sampleRate]{(\funcTwo)/\voltageDivTwo+\screenOffsetTwo};
+
+              \fi
             \fi
+
+            % Add mode
+            \ifnum\mathMode=1
+              \addplot[color=thirdcolor,very thick,domain=-5*(\timeDiv/1000):5*(\timeDiv/1000),
+                smooth, samples=\sampleRate]{(\funcOne)/\voltageDivOne + (\funcTwo)/\voltageDivTwo};
+
+            \else
+
+              % Substract mode
+              \ifnum\mathMode=2
+                \addplot[color=thirdcolor,very thick,domain=-5*(\timeDiv/1000):5*(\timeDiv/1000),
+                  smooth, samples=\sampleRate]{(\funcOne)/\voltageDivOne - (\funcTwo)/\voltageDivTwo};
+                \draw[thirdcolor,fill=thirdcolor] (4,-0.78) rectangle (6,-1.28);
+                \draw (5,-0.75) node[anchor=north, color=white] {Substract};
+
+              \else
+
+                % Multiply mode
+                \ifnum\mathMode=3
+                  \addplot[color=thirdcolor,very thick,domain=-5*(\timeDiv/1000):5*(\timeDiv/1000),
+                    smooth, samples=\sampleRate]{(\funcOne)/\voltageDivOne * (\funcTwo)/\voltageDivTwo};
+                  \draw[thirdcolor,fill=thirdcolor] (4,-0.78) rectangle (6,-1.28);
+                  \draw (5,-0.75) node[anchor=north, color=white] {Multiply};
+
+                \else
+
+                  % Divide mode
+                  \ifnum\mathMode=4
+                    \addplot[color=thirdcolor,very thick,domain=-5*(\timeDiv/1000):5*(\timeDiv/1000),
+                      smooth, samples=\sampleRate]{(\funcOne)/\voltageDivOne / (\funcTwo)/\voltageDivTwo};
+                    \draw[thirdcolor,fill=thirdcolor] (4,-0.78) rectangle (6,-1.28);
+                    \draw (5,-0.75) node[anchor=north, color=white] {Divide};
+                  \fi
+                \fi
+              \fi
+            \fi
           \fi
 
         \end{axis}
 
-        \ifnum\xyMode=0
+        \ifnum\xyMode=1
+        \else
           \ifnum\indicators=1
             % Draw the first channel's screen marker
             \draw[firstcolor,fill=firstcolor] (0.4, \screenOffsetOne+4) -- (0, \screenOffsetOne+4+0.3) -- (0, \screenOffsetOne+4-0.3) -- cycle;



More information about the tex-live-commits mailing list.