summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-01-12 21:43:05 +0000
committerKarl Berry <karl@freefriends.org>2024-01-12 21:43:05 +0000
commiteaf52ad9494969897c5a6481f41b1b6374b40b70 (patch)
treebbfb4650fc02ca0acc8a727b986196ab06e884c0 /Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty
parent2b479325adfbaa083a213791b7961e9cd8db241a (diff)
bodeplot (12jan24)
git-svn-id: svn://tug.org/texlive/trunk@69397 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty')
-rw-r--r--Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty164
1 files changed, 123 insertions, 41 deletions
diff --git a/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty b/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty
index 2121a2e04a3..1e3b9ff6aa6 100644
--- a/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty
+++ b/Master/texmf-dist/tex/latex/bodeplot/bodeplot.sty
@@ -18,7 +18,7 @@
\ProvidesPackage{bodeplot}
\RequirePackage{pdftexcmds}
\RequirePackage{ifplatform}
-\RequirePackage{environ}
+\RequirePackage{xparse}
\RequirePackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{groupplots}
@@ -69,6 +69,9 @@
\fi
\fi
\fi
+\newif\if@babel@french\@babel@frenchfalse
+\@ifpackagewith{babel}{french}{\@babel@frenchtrue}{}
+\@ifpackagewith{babel}{main=french}{\@babel@frenchtrue}{}
\pgfplotsset{
bode@style/.style = {
label style={font=\footnotesize},
@@ -285,6 +288,17 @@
\end{groupplot}
\end{tikzpicture}
}
+\if@babel@french
+ \let\Orig@BodeZPK\BodeZPK
+ \renewcommand{\BodeZPK}{%
+ \shorthandoff{;:!?}%
+ \BodeZPK@Shorthandoff
+ }
+ \newcommand{\BodeZPK@Shorthandoff}[4][]{%
+ \Orig@BodeZPK[#1]{#2}{#3}{#4}%
+ \shorthandon{;:!?}%
+ }
+\fi
\newcommand{\BodeTF}[4][]{
\parse@opt{#1}
\gdef\func@mag{}
@@ -341,6 +355,17 @@
\end{groupplot}
\end{tikzpicture}
}
+\if@babel@french
+ \let\Orig@BodeTF\BodeTF
+ \renewcommand{\BodeTF}{%
+ \shorthandoff{;:!?}%
+ \BodeTF@Shorthandoff
+ }
+ \newcommand{\BodeTF@Shorthandoff}[4][]{%
+ \Orig@BodeTF[#1]{#2}{#3}{#4}%
+ \shorthandon{;:!?}%
+ }
+\fi
\newcommand{\addBodeZPKPlots}[3][true/{}]{
\foreach \approx/\opt in {#1} {
\gdef\plot@macro{}
@@ -430,10 +455,14 @@
};
\fi
}
-\NewEnviron{BodePhPlot}[3][]{
+\if@babel@french
+ \AddToHook{env/BodePhPlot/begin}{\shorthandoff{;:!?}}
+\fi
+\NewDocumentEnvironment{BodePhPlot}{O{}mm+b}{
\parse@env@opt{#1}
- \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]
- \noexpand\begin{semilogxaxis}[
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]}
+ \temp@cmd
+ \edef\temp@cmd{\noexpand\begin{semilogxaxis}[
ph@y@label,
freq@label,
bode@style,
@@ -442,17 +471,20 @@
domain=#2:#3,
height=2.5cm,
\unexpanded\expandafter{\opt@axes}
- ]
- }
- \temp@cmd
- \BODY
+ ]}
+ \temp@cmd
+ #4
\end{semilogxaxis}
\end{tikzpicture}
-}
-\NewEnviron{BodeMagPlot}[3][]{
+}{}
+\if@babel@french
+ \AddToHook{env/BodeMagPlot/begin}{\shorthandoff{;:!?}}
+\fi
+\NewDocumentEnvironment{BodeMagPlot}{O{}mm+b}{
\parse@env@opt{#1}
- \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]
- \noexpand\begin{semilogxaxis}[
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]}
+ \temp@cmd
+ \edef\temp@cmd{\noexpand\begin{semilogxaxis}[
bode@style,
freq@label,
xmin={#2},
@@ -461,17 +493,20 @@
height=2.5cm,
ylabel={Gain (dB)},
\unexpanded\expandafter{\opt@axes}
- ]
- }
- \temp@cmd
- \BODY
+ ]}
+ \temp@cmd
+ #4
\end{semilogxaxis}
\end{tikzpicture}
-}
-\NewEnviron{BodePlot}[3][]{
+}{}
+\if@babel@french
+ \AddToHook{env/BodePlot/begin}{\shorthandoff{;:!?}}
+\fi
+\NewDocumentEnvironment{BodePlot}{O{}mm+b}{
\parse@env@opt{#1}
- \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]
- \noexpand\begin{semilogxaxis}[
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]}
+ \temp@cmd
+ \edef\temp@cmd{\noexpand\begin{semilogxaxis}[
bode@style,
freq@label,
xmin={#2},
@@ -479,13 +514,12 @@
domain=#2:#3,
height=2.5cm,
\unexpanded\expandafter{\opt@axes}
- ]
- }
- \temp@cmd
- \BODY
+ ]}
+ \temp@cmd
+ #4
\end{semilogxaxis}
\end{tikzpicture}
-}
+}{}
\newcommand*{\add@feature}[3]{
\ifcat$\detokenize\expandafter{#1}$
\xdef#1{\unexpanded\expandafter{#1 0+#2}}
@@ -734,6 +768,17 @@
\end{axis}
\end{tikzpicture}
}
+\if@babel@french
+ \let\Orig@NyquistZPK\NyquistZPK
+ \renewcommand{\NyquistZPK}{%
+ \shorthandoff{;:!?}%
+ \NyquistZPK@Shorthandoff
+ }
+ \newcommand{\NyquistZPK@Shorthandoff}[4][]{%
+ \Orig@NyquistZPK[#1]{#2}{#3}{#4}%
+ \shorthandon{;:!?}%
+ }
+\fi
\newcommand{\NyquistTF}[4][]{
\parse@N@opt{#1}
\gdef\func@mag{}
@@ -768,6 +813,17 @@
\end{axis}
\end{tikzpicture}
}
+\if@babel@french
+ \let\Orig@NyquistTF\NyquistTF
+ \renewcommand{\NyquistTF}{%
+ \shorthandoff{;:!?}%
+ \NyquistTF@Shorthandoff
+ }
+ \newcommand{\NyquistTF@Shorthandoff}[4][]{%
+ \Orig@NyquistTF[#1]{#2}{#3}{#4}%
+ \shorthandon{;:!?}%
+ }
+\fi
\newcommand{\addNyquistZPKPlot}[2][]{
\gdef\func@mag{}
\gdef\func@ph{}
@@ -802,24 +858,27 @@
};
\fi
}
-\NewEnviron{NyquistPlot}[3][]{
+\if@babel@french
+ \AddToHook{env/NyquistPlot/begin}{\shorthandoff{;:!?}}
+\fi
+\NewDocumentEnvironment{NyquistPlot}{O{}mm+b}{
\parse@env@opt{#1}
- \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]
- \noexpand\begin{axis}[
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]}
+ \temp@cmd
+ \edef\temp@cmd{\noexpand\begin{axis}[
bode@style,
height=5cm,
domain=#2:#3,
xlabel={$\Re$},
ylabel={$\Im$},
\unexpanded\expandafter{\opt@axes}
- ]
- }
- \temp@cmd
+ ]}
+ \temp@cmd
\addplot [only marks,mark=+,thick,red] (-1 , 0);
- \BODY
+ #4
\end{axis}
\end{tikzpicture}
-}
+}{}
\newcommand{\parse@N@opt}[1]{
\gdef\opt@axes{}
\gdef\opt@plot{}
@@ -885,6 +944,17 @@
\end{axis}
\end{tikzpicture}
}
+\if@babel@french
+ \let\Orig@NicholsZPK\NicholsZPK
+ \renewcommand{\NicholsZPK}{%
+ \shorthandoff{;:!?}%
+ \NicholsZPK@Shorthandoff
+ }
+ \newcommand{\NicholsZPK@Shorthandoff}[4][]{%
+ \Orig@NicholsZPK[#1]{#2}{#3}{#4}%
+ \shorthandon{;:!?}%
+ }
+\fi
\newcommand{\NicholsTF}[4][]{
\parse@N@opt{#1}
\gdef\func@mag{}
@@ -926,23 +996,35 @@
\end{axis}
\end{tikzpicture}
}
-\NewEnviron{NicholsChart}[3][]{
+\if@babel@french
+ \let\Orig@NicholsTF\NicholsTF
+ \renewcommand{\NicholsTF}{%
+ \shorthandoff{;:!?}%
+ \NicholsTF@Shorthandoff
+ }
+ \newcommand{\NicholsTF@Shorthandoff}[4][]{%
+ \Orig@NicholsTF[#1]{#2}{#3}{#4}%
+ \shorthandon{;:!?}%
+ }
+ \AddToHook{env/NicholsChart/begin}{\shorthandoff{;:!?}}
+\fi
+\NewDocumentEnvironment{NicholsChart}{O{}mm+b}{
\parse@env@opt{#1}
- \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]
- \noexpand\begin{axis}[
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]}
+ \temp@cmd
+ \edef\temp@cmd{\noexpand\begin{axis}[
ph@x@label,
bode@style,
domain=#2:#3,
height=5cm,
ylabel={Gain (dB)},
\unexpanded\expandafter{\opt@axes}
- ]
- }
- \temp@cmd
- \BODY
+ ]}
+ \temp@cmd
+ #4
\end{axis}
\end{tikzpicture}
-}
+}{}
\newcommand{\addNicholsZPKChart}[2][]{
\gdef\func@mag{}
\gdef\func@ph{}