%% $Id: pst-electrolysis-doc.tex 1292 2026-06-10 06:58:56Z herbert $ \DocumentMetadata{} \documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings, headexclude,footexclude,oneside]{pst-doc} \usepackage{pstricks-add,pst-electrolysis} \let\pstFV\fileversion \def\bgImage{\psElectrolysisB} \addbibresource{\jobname.bib} \usepackage{enumitem,xltabular,hvindex,hvlogos,minted-code} %\setkeys{hv}{moveToExampleDir,ExampleDir=./exa-pdf, % %showFilename=true,shiftFN=-30pt, % force=false} \setlist{nosep} \usepackage{makeidx} \makeindex \begin{document} \title{\texttt{pst-electrolysis}\\sample images\\ \small v.\pstFV} \subtitle{A PSTricks package for drawing chemical objects} \author{Manuel Luque\\Herbert Vo\ss} \docauthor{Herbert Vo\ss} \date{\today} \settitle \tableofcontents \section{The macros} \begin{codeblockA}[title=The main Macros] \psElectrolysisA \psElectrolysisA[labelcode] \psElectrolysisA[labelcode][PScode] \psElectrolysisA[labelcode][PScode](x0,y0)(x1,y1) \psElectrolysisB \psElectrolysisB[labelcode] \psElectrolysisB[labelcode][PScode] \psElectrolysisB[labelcode][PScode](x0,y0)(x1,y1) \psElectrolysisC \psElectrolysisC[labelcode] \psElectrolysisC[labelcode][PScode] \psElectrolysisC[labelcode][PScode](x0,y0)(x1,y1) \psElectrolysisD \psElectrolysisD[labelcode] \psElectrolysisD[labelcode][PScode] \psElectrolysisD[labelcode][PScode](x0,y0)(x1,y1) \psComment*[Options]{arrows}(x0,y0)(x1,y1){Text}[line macro][put macro] \end{codeblockA} { The four types of images without any description look like: \begin{exampleM}[]{default use} \psElectrolysisA \hspace{2cm} \psElectrolysisB \\[1cm] \psElectrolysisC \hspace{2cm} \psElectrolysisD \end{exampleM} \section{Electrolysis of a solution of sodium chlorine} \subsection{Without arguments} \begin{exampleM}[]{default use of \Lcs{psElectrolysisA} and \Lcs{psElectrolysisB}} \psElectrolysisA \hspace{2cm} \psElectrolysisB \end{exampleM} %\begin{exampleA}[righthand width=0.5\linewidth]{default use} %\end{exampleA} \subsection{With arguments for PSTricks with a grid} With a grid it is much more easier to place additional comments. \begin{exampleM}[righthand width=0.5\linewidth]{Parameter for PSTricks% \xLcs{psElectrolysisA}\xLcs{psElectrolysisB}} \psElectrolysisA[showgrid] \hspace{2cm} \psElectrolysisB[showgrid] \end{exampleM} %\begin{exampleA}[righthand width=0.5\linewidth]{Parameter for PSTricks} %\psElectrolysisB[showgrid] %\end{exampleA} \begin{exampleM}[]{Parameter for PSTricks with coordinates% \xLcs{psElectrolysisA}} \psElectrolysisA[showgrid](-6,-2)(6,7) \end{exampleM} \begin{exampleM}[]{Parameter for PSTricks with coordinates\xLcs{psElectrolysisB}} \psElectrolysisB[showgrid](-6,-2)(6,7) \end{exampleM} \subsection{With arguments for PSTricks and } \begin{exampleM}[]{Parameter for PSTricks and own comments\xLcs{psElectrolysisA}} \psElectrolysisA[showgrid=b][ {\psComment[ref=r]{->}(-3,0.75)(-1.2,0.75){phenolphthalein}% \psComment[ref=l]{->}(3.1,0.75)(2,0.75){indigo}% \psComment[ref=l]{-*}(2,-1.5)(0,-1.5){Na⁺+Cl⁻ solution} }](-6,-2)(6,7) \end{exampleM} \begin{exampleM}[]{Parameter for PSTricks and own comments\xLcs{psElectrolysisB}} \psElectrolysisB[showgrid=b][ {\psComment[ref=r]{->}(-3,0.75)(-2,0.75){\shortstack{turn of the\\ phenolphthalein}}% \psComment[ref=l]{->}(3.1,0.75)(2,0.75){\shortstack{discoloration of\\indigo}}% \psComment[ref=l]{->}(3,2)(1.6,1.25){release of $\mathrm{Cl_2}$} \psComment[ref=r]{->}(-3,2)(-1.8,1.25){release of $\mathrm{H_2}$}}](-6,-2)(6,7) \end{exampleM} \section{Electrolysis of a copper bromide solution} \subsection{Without arguments} \begin{exampleM}[]{default use\xLcs{psElectrolysisC}\xLcs{psElectrolysisD}} \psElectrolysisC \hspace{2cm} \psElectrolysisD \end{exampleM} \subsection{With arguments for PSTricks (showing grid)} \begin{exampleM}[righthand width=0.5\linewidth]{Parameter for PSTricks% \xLcs{psElectrolysisC}\xLcs{psElectrolysisD}} \psElectrolysisC[showgrid=b] \hspace{2cm} \psElectrolysisD[showgrid=b] \end{exampleM} \begin{exampleM}[]{Parameter for PSTricks and using coordinates\xLcs{psElectrolysisC}} \psElectrolysisC[showgrid=b](-6,-2)(6,7) \end{exampleM} \begin{exampleM}[]{Parameter for PSTricks and using coordinates\xLcs{psElectrolysisD}} \psElectrolysisD[showgrid=b](-6,-2)(6,7) \end{exampleM} \subsection{With arguments for PSTricks and using the switch} \begin{exampleM}[]{Parameter for PSTricks (open switch)\xLcs{psElectrolysisC}} \psElectrolysisC[showgrid=b][{% \psline{<->}(-1.4,2)(1.4,2) \rput*(0,2){\shortstack{graphite\\ electrodes}}% \psComment[ref=l]{-*}(2,-1.5)(0,-1.5){\shortstack{\small copper (II)\\bromide\\solution (II)}}% }](-6,-2)(6,7) \end{exampleM} \begin{exampleM}[]{Parameter for PSTricks (closed switch)\xLcs{psElectrolysisD}} \psElectrolysisD[showgrid=b][{% \psComment[ref=l]{->}(2.5,0.75)(1.7,0.75){\shortstack{formation of\\ $\mathrm{Br_2}$ (orange)}}% \psComment[ref=r]{->}(-2.5,0.75)(-1.6,0.75){\shortstack{copper\\ deposit}}% }](-6,-2)(6,7) \end{exampleM} \nocite{*} \printbibliography \printindex \end{document}