diff options
author | Norbert Preining <norbert@preining.info> | 2023-10-08 03:02:13 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-10-08 03:02:13 +0000 |
commit | 9f6bac4b7884af8d5a457275e30fc5e253ff9de8 (patch) | |
tree | 978ab71be8f7dbda32fb68c38753b132ae37512a /graphics | |
parent | 1ca4946e587189e1924b5a2627aba47c535d3e49 (diff) |
CTAN sync 202310080302
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/pgf/contrib/tikz-osci/README.md | 6 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-osci/doc/doc.pdf | bin | 83881 -> 0 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/tikz-osci/doc/example.tex | 29 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-osci/doc/tikz-osci-doc.pdf | bin | 0 -> 89392 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/tikz-osci/doc/tikz-osci-doc.tex (renamed from graphics/pgf/contrib/tikz-osci/doc/doc.tex) | 144 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-osci/doc/tikz-osci-example.pdf | bin | 0 -> 36190 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/tikz-osci/doc/tikz-osci-example.tex | 71 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-osci/tikz-osci.sty | 70 |
8 files changed, 210 insertions, 110 deletions
diff --git a/graphics/pgf/contrib/tikz-osci/README.md b/graphics/pgf/contrib/tikz-osci/README.md index f997f44e1e..799282d1a6 100644 --- a/graphics/pgf/contrib/tikz-osci/README.md +++ b/graphics/pgf/contrib/tikz-osci/README.md @@ -1,5 +1,7 @@ -tikz-osci is a package which provides some macros to draw oscilloscope screen captures from math functions provided by the user. +tikz-osci enables you to produce oscilloscope “screen shots”. ----------------------------------------------------------- Author : Thibault Giauffret -email : contact at ensciences dot fr + +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 diff --git a/graphics/pgf/contrib/tikz-osci/doc/doc.pdf b/graphics/pgf/contrib/tikz-osci/doc/doc.pdf Binary files differdeleted file mode 100644 index 064db93334..0000000000 --- a/graphics/pgf/contrib/tikz-osci/doc/doc.pdf +++ /dev/null diff --git a/graphics/pgf/contrib/tikz-osci/doc/example.tex b/graphics/pgf/contrib/tikz-osci/doc/example.tex deleted file mode 100644 index f70a760c94..0000000000 --- a/graphics/pgf/contrib/tikz-osci/doc/example.tex +++ /dev/null @@ -1,29 +0,0 @@ -\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 diff --git a/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-doc.pdf b/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-doc.pdf Binary files differnew file mode 100644 index 0000000000..8756706b9a --- /dev/null +++ b/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-doc.pdf diff --git a/graphics/pgf/contrib/tikz-osci/doc/doc.tex b/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-doc.tex index cee5c63fb5..2a9a5eb21f 100644 --- a/graphics/pgf/contrib/tikz-osci/doc/doc.tex +++ b/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-doc.tex @@ -2,25 +2,16 @@ -\usepackage{tikz-osci} +\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} +\def\version{0.2.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} +% Use sans serif font +\renewcommand{\familydefault}{\sfdefault} % Remove paragraph indentation \setlength{\parindent}{0pt} @@ -36,20 +27,61 @@ }, } +\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} \section{Introduction} -\begin{center} - \osci[% - scale=0.8 - ] -\end{center} +\begin{minipage}{0.5\linewidth} + \begin{center} + \osci[% + scale=0.7 + ] + \end{center} +\end{minipage} +\begin{minipage}{0.5\linewidth} + \begin{center} + \osci[% + scale=0.7, + rounded corners=0, + 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, + 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), + indicators=0, + color one=D62626, + color two=1053AF, + color xy=2E8B73, + graph back color=777799, + info back color=333333, + info text color=FFFFFF, + main axis color=DDDDDD, + grid color=CCCCCC, + ] + \end{center} +\end{minipage} +\vspace*{0.5cm} -This package is modest alternative to the \texttt{pst-osci} package, not maintained anymore. +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.\\ -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 : +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} \texttt{ @@ -57,7 +89,14 @@ Some features are not implemented yet, but the package is already usable with th } \end{center} +A bug tracker is available at : +\begin{center} + \url{https://framagit.org/ThibGiauffret/latex_packages/-/issues}. +\end{center} + +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}. \section{Usage} @@ -66,30 +105,45 @@ The package is loaded with the command \verb|\usepackage{tikz-osci}|. It defines \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 (in Hz). & Default: \texttt{200}. \\ + \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{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{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{sub axis color} & Color of the sub axis (in hexadecimal). & Default: \texttt{CCCCCC}. \\ + \texttt{grid color} & Color of the grid (in hexadecimal). & Default: \texttt{CCCCCC}. \\ \end{tabular} \end{tcolorbox} +A quick documentation in french is available here : + +\begin{center} + \url{https://www.ensciences.fr/read.php?article=1220} +\end{center} + +\newpage + \section{Examples} +For more examples, see the \texttt{tikz-osci-example.tex} file. + \begin{tcblisting}{enhanced,breakable,colback=white,colframe=black,width=\textwidth} \osci[% scale=0.8, @@ -101,8 +155,8 @@ The package is loaded with the command \verb|\usepackage{tikz-osci}|. It defines 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), + 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), color one=D62626, color two=1053AF, color xy=2E8B73, @@ -110,33 +164,9 @@ The package is loaded with the command \verb|\usepackage{tikz-osci}|. It defines info back color=D6D6D6, info text color=000000, main axis color=000000, - sub axis color=CCCCCC + grid 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} +\end{tcblisting} \section{License} @@ -155,6 +185,16 @@ This package requires the following packages : \section{Changelog} \begin{itemize} + \item \textbf{0.2.0} : + \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} : + \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. \end{itemize} diff --git a/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-example.pdf b/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-example.pdf Binary files differnew file mode 100644 index 0000000000..b8d0a40282 --- /dev/null +++ b/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-example.pdf diff --git a/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-example.tex b/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-example.tex new file mode 100644 index 0000000000..e36635667e --- /dev/null +++ b/graphics/pgf/contrib/tikz-osci/doc/tikz-osci-example.tex @@ -0,0 +1,71 @@ +\documentclass[11pt,a4paper,usenames,dvipsnames]{article} + +\usepackage{../tikz-osci} + +% Use sans serif font +\renewcommand{\familydefault}{\sfdefault} + +\begin{document} + +\begin{center} + + \osci[% + scale=0.7 + ] + + \vspace*{0.3cm} + + \osci[% + scale=0.7, + rounded corners=5, + 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, + 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), + indicators=0, + color one=D62626, + color two=1053AF, + color xy=2E8B73, + graph back color=777799, + info back color=333333, + info text color=FFFFFF, + main axis color=DDDDDD, + grid color=CCCCCC, + ] + + \vspace*{0.3cm} + + \osci[% + scale=0.7, + rounded corners=0, + second channel=1, + screen offset one=2, + screen offset two=-2, + time div=20, + voltage div one=4, + voltage div two=10, + sample rate=200, + xy mode=0, + func one=2*sin(2*180/0.020*x), + func two=10*sin(2*180/0.010*x)+5*sin(2*180/0.020*x), + indicators=1, + color one=F0DE25, + color text one=000000, + color two=F0DE25, + color text two=000000, + graph back color=668866, + 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 diff --git a/graphics/pgf/contrib/tikz-osci/tikz-osci.sty b/graphics/pgf/contrib/tikz-osci/tikz-osci.sty index d2d59cd525..29d2541911 100644 --- a/graphics/pgf/contrib/tikz-osci/tikz-osci.sty +++ b/graphics/pgf/contrib/tikz-osci/tikz-osci.sty @@ -1,22 +1,21 @@ % ----------------------------------------------------------- % This is TikZ Osci package % -% It provides some macros to draw oscilloscope screen captures -% from math functions provided by the user. +% It allows you to produce oscilloscope "screen shots". % % 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 +% Date: 2013/10/07 +% Version: 0.2.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] +\ProvidesPackage{tikz-osci}[2023/09/30 0.2.0 Tikz Osci package] % Required packages \RequirePackage[dvipsnames]{xcolor} @@ -34,6 +33,8 @@ /osci/.cd, scale/.store in=\scale, scale=1, + rounded corners/.store in=\roundedCorners, + rounded corners=10, second channel/.store in=\secondChannel, second channel=0, screen offset one/.store in=\screenOffsetOne, @@ -50,16 +51,24 @@ 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), + func one/.store in=\funcOne, + func one=2*sin(2*180/0.020*x), + func two/.store in=\funcTwo, + func two=0.6*sin(2*180/0.020*x)+0.2*sin(2*180/0.040*x), + indicators/.store in=\indicators, + indicators=1, color one/.store in=\colorOne, color one=D62626, + color text one/.store in=\colorTextOne, + color text one=FFFFFF, color two/.store in=\colorTwo, 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, graph back color/.store in=\graphBackColor, graph back color=FFFFFF, info back color/.store in=\infoBackColor, @@ -68,8 +77,8 @@ info text color=000000, main axis color/.store in=\mainAxisColor, main axis color=000000, - sub axis color/.store in=\subAxisColor, - sub axis color=AAAAAA, + grid color/.store in=\gridColor, + grid color=AAAAAA, } % The main command @@ -93,12 +102,15 @@ \definecolor{infoBackColor}{HTML}{\infoBackColor} \definecolor{infoTextColor}{HTML}{\infoTextColor} \definecolor{mainAxisColor}{HTML}{\mainAxisColor} - \definecolor{subAxisColor}{HTML}{\subAxisColor} + \definecolor{gridColor}{HTML}{\gridColor} + \definecolor{colorTextOne}{HTML}{\colorTextOne} + \definecolor{colorTextTwo}{HTML}{\colorTextTwo} + \definecolor{colorTextXY}{HTML}{\colorTextXY} % Draw the info box \draw[black,thick, fill= infoBackColor] (0,0) -- - ++(10,0) {[rounded corners=10] -- + ++(10,0) {[rounded corners=\roundedCorners] -- ++(0,-1.5) -- ++(-10,0)} -- cycle @@ -109,13 +121,13 @@ % 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.1) node[anchor=north, color=colorTextOne] {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.1) node[anchor=north, color=colorTextTwo]{CH2}; \draw (9,-0.75) node[anchor=north, color= infoTextColor] {\voltageDivTwo\ V/div}; \fi @@ -128,7 +140,7 @@ % Draw the oscilloscope screen border \draw[black,thick, fill= graphbackcolor] (0,0) -- - ++(10,0) {[rounded corners=10] -- + ++(10,0) {[rounded corners=\roundedCorners] -- ++(0,8) -- ++(-10,0)} -- cycle @@ -143,6 +155,7 @@ \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={-}, + color=mainAxisColor, % Draw major grid grid=both, xticklabels={,,}, @@ -151,7 +164,7 @@ 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}, + major grid style={thick,dashed,draw=gridColor}, 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}, ] @@ -171,26 +184,29 @@ % 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}; + 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]{(\exprTwo)/\voltageDivTwo+\screenOffsetTwo}; + \addplot[color=secondcolor,very thick,domain=-5*(\timeDiv/1000):5*(\timeDiv/1000), smooth, samples=\sampleRate]{(\funcTwo)/\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}; + \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; + \draw (-0.04, \screenOffsetOne+4) node[anchor=west, color=colorTextOne,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=colorTextTwo,font=\fontsize{8}{10}\selectfont] {2}; + \fi \fi \fi |