texlive[68464] Master: tikz-osci (6oct23)

commits+karl at tug.org commits+karl at tug.org
Fri Oct 6 22:32:01 CEST 2023


Revision: 68464
          https://tug.org/svn/texlive?view=revision&revision=68464
Author:   karl
Date:     2023-10-06 22:32:01 +0200 (Fri, 06 Oct 2023)
Log Message:
-----------
tikz-osci (6oct23)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/libexec/ctan2tds
    trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/tikz-osci/
    trunk/Master/texmf-dist/doc/latex/tikz-osci/README.md
    trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.pdf
    trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.tex
    trunk/Master/texmf-dist/doc/latex/tikz-osci/example.tex
    trunk/Master/texmf-dist/tex/latex/tikz-osci/
    trunk/Master/texmf-dist/tex/latex/tikz-osci/tikz-osci.sty
    trunk/Master/tlpkg/tlpsrc/tikz-osci.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/tikz-osci/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikz-osci/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tikz-osci/README.md	2023-10-06 20:32:01 UTC (rev 68464)
@@ -0,0 +1,5 @@
+tikz-osci is a package which provides some macros to draw oscilloscope screen captures from math functions provided by the user.
+-----------------------------------------------------------
+Author  : Thibault Giauffret
+email   : contact at ensciences dot fr
+Licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt


Property changes on: trunk/Master/texmf-dist/doc/latex/tikz-osci/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.pdf	2023-10-06 20:30:48 UTC (rev 68463)
+++ trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.pdf	2023-10-06 20:32:01 UTC (rev 68464)

Property changes on: trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.tex	2023-10-06 20:32:01 UTC (rev 68464)
@@ -0,0 +1,161 @@
+\documentclass[11pt,a4paper,usenames,dvipsnames]{article}
+
+
+
+\usepackage{tikz-osci}
+\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
+\usepackage[most]{tcolorbox}
+\usepackage{hyperref}
+\title{TikZ Oscilloscope Package}
+\author{Thibault Giauffret}
+\def\version{0.1.0}
+
+\begin{document}
+
+\begin{tcolorbox}
+    \begin{center}
+        \vspace{0.3cm}
+        {\huge \textbf{TikZ Oscilloscope Package}}\\[0.3cm]
+        {\Large Thibault Giauffret}\\[0.3cm]
+        \textit{Version \version\ of \today}
+        \vspace{0.3cm}
+    \end{center}
+\end{tcolorbox}
+
+% Remove paragraph indentation
+\setlength{\parindent}{0pt}
+
+% Listings
+\newtcblisting{listing}{
+    listing only,
+    hbox,
+    listing options={
+            basicstyle=\small\ttfamily,
+            breaklines=true,
+            columns=fullflexible
+        },
+}
+
+
+\section{Introduction}
+
+\begin{center}
+    \osci[%
+        scale=0.8
+    ]
+\end{center}
+
+
+
+This package is modest alternative to the \texttt{pst-osci} package, not maintained anymore.
+
+Some features are not implemented yet, but the package is already usable with the basic options. I'm doing this for fun and to learn how to make a \LaTeX{} package. Therefore, I'm open to any suggestion or contribution :
+
+\begin{center}
+    \texttt{
+        contact at ensciences dot fr
+    }
+\end{center}
+
+
+
+\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{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 (in Hz).                                                                    & 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{expr one}          & Expression of the first channel (pgf maths format).                                     & Default: \texttt{2*sin(2*180/0.020*x)}.                          \\
+        \texttt{expr 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{color one}         & Color of the first channel (in hexadecimal).                                            & Default: \texttt{D62626}.                                        \\
+        \texttt{color two}         & Color of the second channel (in hexadecimal).                                           & Default: \texttt{1053AF}.                                        \\
+        \texttt{color xy}          & Color of the XY mode (in hexadecimal).                                                  & Default: \texttt{2E8B73}.                                        \\
+        \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{sub axis color}    & Color of the sub axis (in hexadecimal).                                                 & Default: \texttt{CCCCCC}.                                        \\
+    \end{tabular}
+\end{tcolorbox}
+
+
+\section{Examples}
+
+\begin{tcblisting}{enhanced,breakable,colback=white,colframe=black,width=\textwidth}
+    \osci[%
+        scale=0.8,
+        second channel=1,
+        screen offset one=2,
+        screen offset two=-2,
+        time div=20,
+        voltage div one=4,
+        voltage div two=1,
+        sample rate=200,
+        xy mode=0,
+        expr one=2*sin(2*180/0.020*x),
+        expr 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,
+        main axis color=000000,
+        sub axis color=CCCCCC
+    ]
+    \end{tcblisting}
+
+% \begin{center}
+%     \osci[%
+%         scale=0.8,
+%         second channel=1,
+%         screen offset one=2,
+%         screen offset two=-2,
+%         time div=20,
+%         voltage div one=4,
+%         voltage div two=1,
+%         sample rate=200,
+%         xy mode=0,
+%         expr one=2*sin(2*180/0.020*x),
+%         expr 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,
+%         main axis color=000000,
+%         sub axis color=CCCCCC
+%     ]
+% \end{center}
+
+\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}.
+
+\section{Credits}
+
+This package requires the following packages :
+\begin{itemize}
+    \item \texttt{xcolor} maintained by the \textit{LaTeX3 Project}  (license LPPL 1.3c) ;
+    \item tikz maintained by the \textit{TikZ and PGF Project} (license LPPL 1.3c) ;
+    \item pgfkeys maintained by the \textit{Till Tantau} (license LPPL) ;
+    \item pgfplots maintained by the \textit{Christian Feuersänger} (license LPPL).
+\end{itemize}
+
+\section{Changelog}
+
+\begin{itemize}
+    \item \textbf{0.1.0} : Initial release. XY mode not implemented yet.
+\end{itemize}
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/tikz-osci/doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tikz-osci/example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikz-osci/example.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tikz-osci/example.tex	2023-10-06 20:32:01 UTC (rev 68464)
@@ -0,0 +1,29 @@
+\documentclass[11pt,a4paper,usenames,dvipsnames]{article}
+
+\usepackage{tikz-osci}
+
+\begin{document}
+
+\osci[%
+    scale=0.8,
+    second channel=1,
+    screen offset one=2,
+    screen offset two=-2,
+    time div=20,
+    voltage div one=4,
+    voltage div two=1,
+    sample rate=200,
+    xy mode=0,
+    expr one=2*sin(2*180/0.020*x),
+    expr 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=668866,
+    info back color=D6D6D6,
+    info text color=000000,
+    main axis color=000000,
+    sub axis color=CCCCCC,
+]
+
+\end{document}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/tikz-osci/example.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/tikz-osci/tikz-osci.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tikz-osci/tikz-osci.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/tikz-osci/tikz-osci.sty	2023-10-06 20:32:01 UTC (rev 68464)
@@ -0,0 +1,204 @@
+% -----------------------------------------------------------
+% This is TikZ Osci package
+%
+% It provides some macros to draw oscilloscope screen captures 
+% from math functions provided by the user.
+%
+% It is based on TikZ and pgfplots and is a replacement can-
+% didate to the pstricks pst-osci package which is not main-
+% tained anymore.
+%
+% Author: Thibault Giauffret
+% Date: 2013/10/06
+% Version: 0.1.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.1.0 Tikz Osci package]
+
+% Required packages
+\RequirePackage[dvipsnames]{xcolor}
+\RequirePackage{pgfkeys}
+\RequirePackage{pgfplots}
+\RequirePackage{tikz}
+\usetikzlibrary{arrows,shapes,positioning}
+\usetikzlibrary{decorations.markings,decorations.pathmorphing,
+  decorations.pathreplacing}
+\usetikzlibrary{calc,patterns,shapes.geometric}
+
+
+% Init the keys and get the values
+\pgfkeys{
+  /osci/.cd,
+  scale/.store in=\scale,
+  scale=1,
+  second channel/.store in=\secondChannel,
+  second channel=0,
+  screen offset one/.store in=\screenOffsetOne,
+  screen offset one=0,
+  screen offset two/.store in=\screenOffsetTwo,
+  screen offset two=-0,
+  time div/.store in=\timeDiv,
+  time div=20,
+  voltage div one/.store in=\voltageDivOne,
+  voltage div one=1,
+  voltage div two/.store in=\voltageDivTwo,
+  voltage div two=1,
+  sample rate/.store in=\sampleRate,
+  sample rate=200,
+  xy mode/.store in=\xyMode,
+  xy mode=0,
+  expr one/.store in=\exprOne,
+  expr one=2*sin(2*180/0.020*x),
+  expr two/.store in=\exprTwo,
+  expr two=0.6*sin(2*180/0.020*x)+0.2*sin(2*180/0.040*x),
+  color one/.store in=\colorOne,
+  color one=D62626,
+  color two/.store in=\colorTwo,
+  color two=1053AF,
+  color xy/.store in=\colorXY,
+  color xy=2E8B73,
+  graph back color/.store in=\graphBackColor,
+  graph back color=FFFFFF,
+  info back color/.store in=\infoBackColor,
+  info back color=D6D6D6,
+  info text color/.store in=\infoTextColor,
+  info text color=000000,
+  main axis color/.store in=\mainAxisColor,
+  main axis color=000000,
+  sub axis color/.store in=\subAxisColor,
+  sub axis color=AAAAAA,
+}
+
+% The main command
+\newcommand\osci[1][]{
+
+  % Get the values
+  \pgfkeys{
+    /osci/.cd,
+    #1,
+  }
+
+  \scalebox{\scale}{
+    % Begin the picture
+    \begin{tikzpicture}
+
+      % Set the colors
+      \definecolor{firstcolor}{HTML}{\colorOne}
+      \definecolor{secondcolor}{HTML}{\colorTwo}
+      \definecolor{thirdcolor}{HTML}{\colorXY}
+      \definecolor{graphbackcolor}{HTML}{\graphBackColor}
+      \definecolor{infoBackColor}{HTML}{\infoBackColor}
+      \definecolor{infoTextColor}{HTML}{\infoTextColor}
+      \definecolor{mainAxisColor}{HTML}{\mainAxisColor}
+      \definecolor{subAxisColor}{HTML}{\subAxisColor}
+
+      % Draw the info box
+      \draw[black,thick, fill= infoBackColor]
+      (0,0) --
+      ++(10,0) {[rounded corners=10] --
+        ++(0,-1.5) --
+        ++(-10,0)} --
+      cycle
+        {};
+
+      % Add time/div label
+      \draw (5,-0.15) node[anchor=north, color= infoTextColor] {\timeDiv\ ms/div};
+
+      % 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=white] {CH1};
+      \draw (1,-0.75) node[anchor=north, color= infoTextColor] {\voltageDivOne\ V/div};
+
+      % Add voltage/div label for the second channel
+      \ifnum\secondChannel=1
+        \draw[secondcolor,fill=secondcolor] (8.5,-0.15) rectangle (9.5,-0.6);
+        \draw (9,-0.1) node[anchor=north, color=white] {CH2};
+        \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) --
+      ++(10,0) {[rounded corners=10] --
+        ++(0,8) --
+        ++(-10,0)} --
+      cycle
+        {};
+
+      % Draw the oscilloscope screen graduations
+      \begin{scope}
+
+        % Remove the border
+        \clip (0.05,0.05) rectangle (9.95,7.95);
+
+        \begin{axis}[xmin=-5*(\timeDiv/1000), xmax=5*(\timeDiv/1000), ymin=-4, ymax=4, xtick distance = \timeDiv/1000,
+            axis x line=middle, axis y line=middle,
+            axis line style={-},
+            % Draw major grid
+            grid=both,
+            xticklabels={,,},
+            yticklabels={,,},
+            % Add sub ticks for the x axis
+            minor tick num=4,
+            % Remove minor grid
+            minor grid style={line width=0pt, draw=white, draw opacity=0},
+            major grid style={thick,dashed,draw=subAxisColor},
+            every major tick/.append style={very thick, major tick length=6pt, color=mainAxisColor},
+            every minor tick/.append style={thick, minor tick length=4pt, color=mainAxisColor},
+          ]
+
+          % Change plot width
+          \pgfplotsset{width=11.58cm, height=9.58cm}
+          % Change tick label style
+          \pgfplotsset{ every non boxed x axis/.append style={x axis line style=-},
+            every non boxed y axis/.append style={y axis line style=-}}
+
+          \ifnum\xyMode=1
+
+            % Coming soon...
+
+          \else
+
+            % Draw each channel separately
+            % First channel plot
+            \addplot[color=firstcolor,very thick,domain=-5*(\timeDiv/1000):5*(\timeDiv/1000),
+              smooth, samples=\sampleRate]{(\exprOne)/\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]{(\exprTwo)/\voltageDivTwo+\screenOffsetTwo};
+            \fi
+          \fi
+
+        \end{axis}
+
+        \ifnum\xyMode=0
+          % 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;
+          \draw (-0.04, \screenOffsetOne+4) node[anchor=west, color=white,font=\fontsize{8}{10}\selectfont] {1};
+
+          % Draw the second channel's screen marker
+          \ifnum\secondChannel=1
+            \draw[secondcolor,fill=secondcolor] (0.4, \screenOffsetTwo+4) -- (0, \screenOffsetTwo+4+0.3) -- (0, \screenOffsetTwo+4-0.3) -- cycle;
+            \draw (-0.04, \screenOffsetTwo+4) node[anchor=west, color=white,font=\fontsize{8}{10}\selectfont] {2};
+          \fi
+        \fi
+
+      \end{scope}
+
+    \end{tikzpicture}
+  }
+}
+
+
+


Property changes on: trunk/Master/texmf-dist/tex/latex/tikz-osci/tikz-osci.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2023-10-06 20:30:48 UTC (rev 68463)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2023-10-06 20:32:01 UTC (rev 68464)
@@ -834,7 +834,7 @@
     tikz-feynhand tikz-feynman tikz-imagelabels tikz-inet
     tikz-kalender tikz-karnaugh tikz-ladder tikz-lake-fig tikz-layers
     tikz-mirror-lens tikz-nef tikz-network tikz-nfold tikz-opm tikz-optics
-    tikz-page tikz-palattice tikz-planets tikz-qtree
+    tikz-osci tikz-page tikz-palattice tikz-planets tikz-qtree
     tikz-relay tikz-sfc tikz-swigs tikz-timing tikz-trackschematic tikz-truchet
     tikzbricks tikzcodeblocks tikzducks tikzfill tikzinclude tikzlings
     tikzmark tikzmarmots tikzorbital

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2023-10-06 20:30:48 UTC (rev 68463)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2023-10-06 20:32:01 UTC (rev 68464)
@@ -1418,6 +1418,7 @@
  'tikz-karnaugh',"&MAKEflatten",
  'tikz-ladder',	 "&MAKEflatten",
  'tikz-mirror-lens',"&MAKEflatten",
+ 'tikz-osci',	"&MAKEflatten",
  'tikz-relay',	"&MAKEflatten",
  'tikz-sfc',	"&MAKEflatten",
  'tikztosvg',	"&MAKEflatten",

Modified: trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2023-10-06 20:30:48 UTC (rev 68463)
+++ trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2023-10-06 20:32:01 UTC (rev 68464)
@@ -191,6 +191,7 @@
 depend tikz-nfold
 depend tikz-opm
 depend tikz-optics
+depend tikz-osci
 depend tikz-page
 depend tikz-palattice
 depend tikz-planets

Added: trunk/Master/tlpkg/tlpsrc/tikz-osci.tlpsrc
===================================================================


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