I have to use a preamble (see below) which is outdated (and, in my opinion, clogged with garbage).
My task is to set up the given preamble for using with pdfLaTex, and if possible to clean it from outdated stuff (packages and settings) and garbabe or even replace with current stuff and if applicable to change the package order in order to avoid package conflicts. The present PSTricks figure (see below) is an example in order to prove the success of the taken changes. I use TeXnicCenter with an up-to-date MiKTeX and ActivePerl. The whole document
\documentclass[
a4paper,
10pt,
fleqn,
twoside,
onecolumn,
openright
]{memoir}
\usepackage[
usenames,
dvipsnames
]{color}
\usepackage[
russian,
english,
ngerman
]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american voltages]{circuitikz}
%\usepackage[pdf]{pstricks} % added, leads to many ''Undefined control sequence.''-errors
%\usepackage{auto-pst-pdf} % alternatively added, leads to ''Command \psfragfig already defined.''-error
\usepackage{
dsfont,
psfrag,
pstricks,
pst-plot,
pstricks-add,
calc,
subfig,
pstool,
subfig,
subfloat,
psfrag
}
\usepackage{
lmodern,
xcolor,
graphicx,
epsfig,
epsf,
ifthen,
calc,
icomma,
array,
url,
bbding,
amsmath,
amsthm,
amssymb,
mathtools,
calrsfs,
siunitx,
booktabs,
appendix,
boxedminipage,
comment
}
\usepackage[text]{esdiff}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{4}
\setsecnumdepth{subsection}
\newlength{\tempdim}
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Satz}
\newtheorem{lemma}{Lemma}
\newtheorem{example}{Beispiel}[chapter]
\newtheorem{exercise}{Übung}[chapter]
\makeatletter
\makeatother
\ifpdf
\usepackage[
bookmarks = false,
colorlinks
]{hyperref}
\else
\usepackage[
dvips,
bookmarks = false,
colorlinks
]{hyperref}
\fi
\title{Aufgaben- und Lösungskatalog zu Grundlagen der Mess- und Regelungstechnik}
\includecomment{Frage}
\includecomment{KurzAntwort}
\includecomment{LangAntwort}
\begin{document}
\frontmatter
\maketitle
\thispagestyle{empty}
\clearpage
\mainmatter
\begin{figure}\centering\hfill
\subfloat[Spannungsverlauf]{
\setlength{\tempdim}{.4\linewidth/10}\psset{unit=\tempdim}
\begin{pspicture}(-1,-0.5)(6,4)
\psline{->}(0,4)
\psline{->}(-1,0)(6,0)
\pslinelinestyle=dashed,linewidth=.2pt(6,3)
\psplot[linecolor=blue,linewidth=.4pt,plotpoints=50,plotstyle=curve]{0}{5.9}{3 1 2.71828 x neg exp sub mul}
\pslinelinecolor=blue,linewidth=0.4pt(0,.05)
\uputl{\tiny $v_\mathrm{c}(t)$}
\uputl{\tiny $1$}
\uputd{\tiny \strut$t$}
\uputd{\tiny \strut$0$}
\end{pspicture}\label{fig_capacitor_charge}}\hfill
\subfloat[Audiosignal]{
\setlength{\tempdim}{.4\linewidth/10}\psset{unit=\tempdim}
\begin{pspicture}(-1,-2.5)(6.5,2.5)
\psline{->}(0,-2)(0,2.5)
\psline{->}(0,-2)(6.5,-2)\uputd{\tiny \strut$t$}
\pslinelinecolor=blue,linewidth=.4pt(0.01,0.21)(0.02,-0.66)(0.03,0.02)(0.04,-0.69)(0.05,0.25)(0.06,-0.00)(0.07,-0.47)(0.08,0.01)(0.09,-0.52)(0.10,0.02)(0.11,-1.20)(0.12,-0.30)(0.13,0.12)(0.14,-0.47)(0.15,-0.72)(0.16,-0.32)(0.17,0.42)(0.18,0.42)(0.19,-0.09)(0.20,-0.40)(0.21,-0.02)(0.22,-0.92)(0.23,0.38)(0.24,-1.01)(0.25,-0.01)(0.26,-0.18)(0.27,-0.04)(0.28,0.49)(0.29,-0.18)(0.30,-0.11)(0.31,-0.12)(0.32,1.53)(0.33,-0.12)(0.34,1.03)(0.35,-0.02)(0.36,0.64)(0.37,0.36)(0.38,0.35)(0.39,0.98)(0.40,-0.35)(0.41,-0.18)(0.42,-0.15)(0.43,1.41)(0.44,-0.01)(0.45,0.63)(0.46,0.37)(0.47,-0.23)(0.48,0.25)(0.49,-0.06)(0.50,0.33)(0.51,0.14)(0.52,-0.14)(0.53,0.91)(0.54,-0.73)(0.55,0.15)(0.56,1.44)(0.57,0.03)(0.58,-0.31)(0.59,-0.12)(0.60,-0.54)(0.61,0.39)(0.62,-0.14)(0.63,0.02)(0.64,-0.44)(0.65,-1.84)(0.66,0.18)(0.67,0.22)(0.68,-0.16)(0.69,0.53)(0.70,0.41)(0.71,-0.22)(0.72,0.20)(0.73,0.23)(0.74,0.22)(0.75,0.25)(0.76,-1.21)(0.77,0.78)(0.78,2.52)(0.79,0.33)(0.80,-0.36)(0.81,-0.36)(0.82,-0.40)(0.83,0.10)(0.84,-0.03)(0.85,0.02)(0.86,0.32)(0.87,0.63)(0.88,1.06)(0.89,-0.06)(0.90,-0.07)(0.91,-1.24)(0.92,-0.41)(0.93,0.13)(0.94,0.66)(0.95,-0.06)(0.96,0.49)(0.97,-0.35)(0.98,-0.06)(0.99,-0.78)(1.00,0.22)(1.01,1.14)(1.02,-0.94)(1.03,0.74)(1.04,-1.35)(1.05,0.07)(1.06,1.82)(1.07,0.70)(1.08,-0.01)(1.09,0.38)(1.10,0.10)(1.11,0.46)(1.12,-1.23)(1.13,-1.49)(1.14,-0.18)(1.15,-0.19)(1.16,0.40)(1.17,-0.05)(1.18,-0.80)(1.19,0.24)(1.20,0.30)(1.21,-0.03)(1.22,-1.42)(1.23,0.43)(1.24,-0.90)(1.25,0.41)(1.26,0.26)(1.27,0.07)(1.28,0.12)(1.29,-0.64)(1.30,0.10)(1.31,-0.02)(1.32,-0.08)(1.33,0.46)(1.34,0.01)(1.35,0.37)(1.36,0.31)(1.37,-0.45)(1.38,0.89)(1.39,0.67)(1.40,0.52)(1.41,-0.45)(1.42,-0.17)(1.43,-0.28)(1.44,-0.16)(1.45,0.12)(1.46,0.23)(1.47,1.10)(1.48,-0.08)(1.49,0.39)(1.50,0.01)(1.51,-0.66)(1.52,0.28)(1.53,1.34)(1.54,-0.82)(1.55,-0.22)(1.56,0.52)(1.57,-0.42)(1.58,1.20)(1.59,-0.19)(1.60,0.13)(1.61,0.81)(1.62,-0.04)(1.63,1.63)(1.64,1.45)(1.65,0.01)(1.66,-0.35)(1.67,0.14)(1.68,-0.19)(1.69,0.07)(1.70,-0.81)(1.71,-0.15)(1.72,1.11)(1.73,0.23)(1.74,-0.28)(1.75,0.01)(1.76,0.13)(1.77,0.35)(1.78,-0.20)(1.79,0.03)(1.80,-1.14)(1.81,1.04)(1.82,0.11)(1.83,-0.03)(1.84,-0.49)(1.85,0.47)(1.86,0.40)(1.87,0.27)(1.88,-0.09)(1.89,-0.84)(1.90,-0.79)(1.91,-1.01)(1.92,-0.14)(1.93,0.18)(1.94,-0.07)(1.95,0.18)(1.96,-0.13)(1.97,-0.48)(1.98,-1.00)(1.99,-0.06)(2.00,-0.28)(2.01,0.37)(2.02,1.96)(2.03,-1.49)(2.04,0.07)(2.05,-1.21)(2.06,0.05)(2.07,0.11)(2.08,1.51)(2.09,0.01)(2.10,-0.48)(2.11,1.30)(2.12,0.06)(2.13,-0.02)(2.14,1.34)(2.15,0.19)(2.16,0.85)(2.17,0.49)(2.18,-0.11)(2.19,-1.82)(2.20,-1.11)(2.21,0.25)(2.22,-0.31)(2.23,0.22)(2.24,-0.80)(2.25,-0.31)(2.26,-0.46)(2.27,-0.02)(2.28,-1.48)(2.29,-1.16)(2.30,0.16)(2.31,0.04)(2.32,0.14)(2.33,1.52)(2.34,0.26)(2.35,0.05)(2.36,0.20)(2.37,-0.46)(2.38,-0.23)(2.39,0.40)(2.40,0.32)(2.41,0.27)(2.42,-0.58)(2.43,-0.90)(2.44,0.51)(2.45,0.05)(2.46,-0.80)(2.47,0.00)(2.48,-0.52)(2.49,-0.73)(2.50,-0.46)(2.51,0.01)(2.52,-0.41)(2.53,0.58)(2.54,0.02)(2.55,0.40)(2.56,-1.33)(2.57,-0.47)(2.58,1.55)(2.59,-0.26)(2.60,-0.33)(2.61,0.07)(2.62,-0.66)(2.63,0.71)(2.64,-0.43)(2.65,-0.39)(2.66,0.91)(2.67,0.43)(2.68,-0.05)(2.69,-0.19)(2.70,-0.08)(2.71,0.60)(2.72,-1.09)(2.73,-0.13)(2.74,0.08)(2.75,0.12)(2.76,0.43)(2.77,-0.70)(2.78,0.43)(2.79,1.15)(2.80,0.06)(2.81,0.04)(2.82,-0.61)(2.83,-0.49)(2.84,-0.41)(2.85,-0.50)(2.86,1.49)(2.87,0.72)(2.88,-0.26)(2.89,0.13)(2.90,-0.48)(2.91,-0.29)(2.92,-0.85)(2.93,0.52)(2.94,-0.22)(2.95,-0.21)(2.96,0.11)(2.97,-1.03)(2.98,0.12)(2.99,-1.35)(3.00,1.74)(3.01,-0.22)(3.02,0.12)(3.03,-0.02)(3.04,0.59)(3.05,1.37)(3.06,0.37)(3.07,0.61)(3.08,-0.44)(3.09,-0.15)(3.10,0.23)(3.11,0.90)(3.12,0.72)(3.13,0.22)(3.14,-0.06)(3.15,-0.28)(3.16,0.29)(3.17,0.30)(3.18,-0.48)(3.19,0.56)(3.20,0.62)(3.21,0.06)(3.22,0.01)(3.23,0.78)(3.24,-0.04)(3.25,0.11)(3.26,-0.24)(3.27,-0.01)(3.28,-0.27)(3.29,0.24)(3.30,0.44)(3.31,0.20)(3.32,0.19)(3.33,-0.63)(3.34,1.03)(3.35,-0.36)(3.36,-0.08)(3.37,-0.31)(3.38,0.43)(3.39,-1.73)(3.40,0.65)(3.41,0.09)(3.42,-1.14)(3.43,0.35)(3.44,0.46)(3.45,0.67)(3.46,-0.06)(3.47,-0.20)(3.48,-0.49)(3.49,0.26)(3.50,-0.73)(3.51,0.22)(3.52,-0.87)(3.53,-0.58)(3.54,0.04)(3.55,-0.59)(3.56,-0.34)(3.57,0.89)(3.58,-0.55)(3.59,0.67)(3.60,0.59)(3.61,0.06)(3.62,0.15)(3.63,-0.15)(3.64,0.99)(3.65,1.09)(3.66,-0.15)(3.67,-0.38)(3.68,1.26)(3.69,-0.20)(3.70,0.08)(3.71,-0.05)(3.72,0.16)(3.73,0.27)(3.74,0.22)(3.75,-0.08)(3.76,0.83)(3.77,0.84)(3.78,-1.15)(3.79,0.06)(3.80,0.51)(3.81,-0.30)(3.82,-0.92)(3.83,-0.34)(3.84,-0.03)(3.85,0.59)(3.86,-0.64)(3.87,1.01)(3.88,0.83)(3.89,0.05)(3.90,0.57)(3.91,1.75)(3.92,-0.28)(3.93,0.58)(3.94,0.02)(3.95,-0.55)(3.96,0.55)(3.97,-0.23)(3.98,-1.15)(3.99,0.21)(4.00,-0.53)(4.01,0.17)(4.02,-0.63)(4.03,-0.68)(4.04,0.33)(4.05,0.27)(4.06,-0.06)(4.07,0.43)(4.08,0.00)(4.09,-0.19)(4.10,0.43)(4.11,0.09)(4.12,-2.11)(4.13,0.16)(4.14,0.47)(4.15,-0.18)(4.16,-0.17)(4.17,-1.16)(4.18,-0.15)(4.19,1.09)(4.20,0.08)(4.21,-2.15)(4.22,0.40)(4.23,1.28)(4.24,0.04)(4.25,0.63)(4.26,0.90)(4.27,-0.71)(4.28,0.12)(4.29,-0.25)(4.30,-0.48)(4.31,0.65)(4.32,-0.10)(4.33,-0.57)(4.34,-0.02)(4.35,-0.20)(4.36,0.50)(4.37,0.15)(4.38,-0.43)(4.39,0.44)(4.40,-0.73)(4.41,-0.37)(4.42,0.28)(4.43,-0.07)(4.44,1.52)(4.45,-0.29)(4.46,-0.37)(4.47,-0.18)(4.48,-0.12)(4.49,1.06)(4.50,-0.48)(4.51,2.53)(4.52,-1.57)(4.53,0.09)(4.54,-0.76)(4.55,-0.36)(4.56,0.35)(4.57,-0.27)(4.58,-0.55)(4.59,-0.04)(4.60,0.43)(4.61,-0.14)(4.62,-0.28)(4.63,-0.20)(4.64,0.04)(4.65,0.46)(4.66,-0.84)(4.67,0.73)(4.68,-0.40)(4.69,-1.28)(4.70,-0.50)(4.71,0.59)(4.72,-0.30)(4.73,0.87)(4.74,1.47)(4.75,0.14)(4.76,0.75)(4.77,-0.85)(4.78,0.19)(4.79,0.51)(4.80,-0.60)(4.81,0.11)(4.82,-1.04)(4.83,0.26)(4.84,-0.00)(4.85,-0.11)(4.86,-1.06)(4.87,-0.95)(4.88,0.06)(4.89,-0.75)(4.90,0.52)(4.91,-0.33)(4.92,0.89)(4.93,0.86)(4.94,-0.06)(4.95,0.12)(4.96,-0.09)(4.97,0.80)(4.98,0.46)(4.99,0.37)(5.00,-0.27)(5.01,-1.24)(5.02,0.34)(5.03,0.46)(5.04,0.60)(5.05,0.41)(5.06,0.50)(5.07,0.46)(5.08,0.76)(5.09,-0.05)(5.10,1.43)(5.11,-0.10)(5.12,0.46)(5.13,-0.06)(5.14,0.97)(5.15,0.60)(5.16,-0.40)(5.17,1.44)(5.18,0.32)(5.19,-0.26)(5.20,-0.20)(5.21,-0.19)(5.22,0.55)(5.23,-0.78)(5.24,1.41)(5.25,-0.06)(5.26,1.90)(5.27,-0.15)(5.28,-0.26)(5.29,1.01)(5.30,-0.19)(5.31,-0.61)(5.32,-0.17)(5.33,0.01)(5.34,0.32)(5.35,0.09)(5.36,0.03)(5.37,-0.00)(5.38,-0.68)(5.39,-0.25)(5.40,0.19)(5.41,1.70)(5.42,-0.52)(5.43,0.38)(5.44,0.18)(5.45,-0.27)(5.46,-0.08)(5.47,-0.34)(5.48,-0.26)(5.49,-0.11)(5.50,0.29)(5.51,-0.03)(5.52,-0.87)(5.53,0.26)(5.54,0.16)(5.55,0.22)(5.56,0.52)(5.57,-0.36)(5.58,0.13)(5.59,0.41)(5.60,0.11)(5.61,-0.14)(5.62,0.32)(5.63,0.07)(5.64,-1.30)(5.65,0.84)(5.66,-1.17)(5.67,0.28)(5.68,-0.01)(5.69,0.35)(5.70,0.41)(5.71,-0.65)(5.72,0.06)(5.73,0.43)(5.74,0.19)(5.75,0.00)(5.76,1.39)(5.77,0.78)(5.78,0.24)(5.79,-0.60)(5.80,0.39)(5.81,-0.21)(5.82,-0.71)(5.83,0.56)(5.84,-0.15)(5.85,0.00)(5.86,-0.23)(5.87,0.31)(5.88,1.56)(5.89,0.11)(5.90,0.08)(5.91,-0.75)(5.92,0.28)(5.93,-0.65)(5.94,0.55)(5.95,0.03)(5.96,-0.29)(5.97,1.49)(5.98,-0.15)(5.99,0.41)(6.00,0.21)
\end{pspicture}\label{fig_audio}}\hfill
\subfloat[Anzahl der Kunden]{
\setlength{\tempdim}{.4\linewidth/12}\psset{unit=\tempdim}
\begin{pspicture}(-1,-0.5)(8,5)
\psline{->}(0,5)
\psline{->}(8,0)
\uputd{\tiny \strut$9$}
\uputd{\tiny \strut$10$}
\uputd{\tiny \strut$11$}
\uputd{\tiny \strut$12$}
\uputd{\tiny \strut$13$}
\uputd{\tiny \strut$14$}
\uputd{\tiny \strut$15$}
\uputd{\tiny \strut$16$}
\uputl{\tiny $1$}
\uputl{\tiny $2$}
\uputl{\tiny $3$}
\uputl{\tiny $4$}
\uputl{\tiny $5$}
\uputl{\tiny $6$}
\uputl{\tiny $7$}
\uputl{\tiny $8$}
\uputl{\tiny $x$}
\pslinelinewidth=0.2pt(.5,2)\pscircle(.5,2){.1}
\pslinelinewidth=0.2pt(1.5,1)\pscircle(1.5,1){.1}
\pslinelinewidth=0.2pt(2.5,1)\pscircle(2.5,1){.1}
\pslinelinewidth=0.2pt(3.5,2.5)\pscircle(3.5,2.5){.1}
\pslinelinewidth=0.2pt(4.5,3.5)\pscircle(4.5,3.5){.1}
\pslinelinewidth=0.2pt(5.5,4)\pscircle(5.5,4){.1}
\pslinelinewidth=0.2pt(6.5,2.5)\pscircle(6.5,2.5){.1}
\pslinelinewidth=0.2pt(7.5,.5)\pscircle(7.5,.5){.1}
\end{pspicture}\label{fig_customer}}\hfill\\hfill
\subfloat[Frequenzantwort eines Bandpassfilters]{
\setlength{\tempdim}{.4\linewidth/6}\psset{unit=\tempdim}
\begin{pspicture}(-1,-0.5)(8,2)
\psline{->}(0,2)
\psline{->}(8,0)
\pslinelinecolor=blue,linewidth=.4pt,plotpoints=50,plotstyle=curve(0.16,0.00)(0.33,0.00)(0.49,0.01)(0.65,0.01)(0.82,0.01)(0.98,0.02)(1.14,0.03)(1.31,0.04)(1.47,0.06)(1.63,0.09)(1.80,0.12)(1.96,0.18)(2.12,0.26)(2.29,0.38)(2.45,0.54)(2.61,0.76)(2.78,1.02)(2.94,1.31)(3.10,1.57)(3.27,1.76)(3.43,1.87)(3.59,1.94)(3.76,1.97)(3.92,1.98)(4.08,1.98)(4.24,1.97)(4.41,1.94)(4.57,1.87)(4.73,1.76)(4.90,1.57)(5.06,1.31)(5.22,1.02)(5.39,0.76)(5.55,0.54)(5.71,0.38)(5.88,0.26)(6.04,0.18)(6.20,0.12)(6.37,0.09)(6.53,0.06)(6.69,0.04)(6.86,0.03)(7.02,0.02)(7.18,0.01)(7.35,0.01)(7.51,0.01)(7.67,0.00)(7.84,0.00)(8.00,0.00)
\uputl{\tiny $\left|H(f)\right|$}
\uputd{\tiny \strut$f$}
\uputd{\tiny \strut$0$}
\end{pspicture}\label{fig_passbandfilter}}\hfill
\subfloat[Digitales Bild]{
\setlength{\tempdim}{.4\linewidth/20}\psset{unit=\tempdim}
\begin{pspicture}(-1,-1)(9,9)
\uputd{\tiny $\rightarrow$ $x$}
\uputl{\tiny $\uparrow$}
\uputl{\tiny $y$}
\psframe(2,8)(7,9)\psframe(7,7)(8,8)\psframe(8,2)(9,7)\psframe(7,1)(8,2)\psframe(2,0)(7,1)\psframe(1,1)(2,2)\psframe(0,2)(1,7)\psframe(1,7)(2,8)
\psframe(2,6)(3,7)\psframe(6,6)(7,7)
\psframe(4,4)(5,6)
\psframe(2,3)(3,4)\psframe(3,2)(6,3)\psframe(6,3)(7,4)
\end{pspicture}\label{fig_picture}}\hfill\strut
\caption{Unterschiedliche Signale}\label{fig_exasignals}
\end{figure}
\end{document}
compiles with LaTeX -> DviPs -> ps2pdf. In detail:
LaTeX:
Filepath: D:\TeXnicCenter\MiKTeX\texmfs\install\miktex\bin\x64\latex.exe
Arguments: --enable-write18 -interaction=nonstopmode "%wm"
DviPs (PDF):
Filepath: D:\TeXnicCenter\MiKTeX\texmfs\install\miktex\bin\x64\dvips.exe
Arguments: -P pdf -R0 "%bm.dvi"
and Ghostscript (ps2pdf):
Filepath: D:\TeXnicCenter\MiKTeX\texmfs\install\miktex\bin\x64\mgs.exe
Arguments: -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile="%bm.pdf" -c save pop -f "%bm.ps"
With this source I adapted TeXnicCenter and the given document (added lines are commented out) for the use with pdfLaTeX (LaTeX -> PDF):
Filepath: D:\TeXnicCenter\MiKTeX\texmfs\install\miktex\bin\x64\pdflatex.exe
Arguments: --enable-write18 -interaction=nonstopmode "%wm"
However both possibilities from here it didn't compile on my machine. If I use \usepackage[pdf]{pstricks}, it leads to many
Undefined control sequence.
errors. If I use \usepackage{auto-pst-pdf}, so it leads to a
Command
\psfragfigalready defined.
error. Indeed in both cases I only added one of this two lines (\usepackage[pdf]{pstricks} or \usepackage{auto-pst-pdf}) and let the preamble unchanged, because I don't exactly know, what can I remove/replace (with current stuff) and what should stay in any case.
What am I doing wrong? Every solution is welcome! Please feel also free to clean up/change/modify/optimize the preamble!
Thank you for your help and effort in advance!




epsfandepsfigpackages, also the\ifpdftest around hyperref is not recommended just load hyperref wihoutdvipsorpdfopion and let it choose the right thing. – David Carlisle May 24 '22 at 14:02