diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/mandi/mandistudent.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/mandi/mandistudent.sty | 611 |
1 files changed, 354 insertions, 257 deletions
diff --git a/Master/texmf-dist/tex/latex/mandi/mandistudent.sty b/Master/texmf-dist/tex/latex/mandi/mandistudent.sty index ff5edb5e546..3bfe3b00531 100644 --- a/Master/texmf-dist/tex/latex/mandi/mandistudent.sty +++ b/Master/texmf-dist/tex/latex/mandi/mandistudent.sty @@ -6,7 +6,7 @@ %% %% mandistudent.dtx (with options: `package') %% -%% Copyright (C) 2021 by Paul J. Heafner <heafnerj@gmail.com> +%% Copyright (C) 2021,2022 by Paul J. Heafner <heafnerj@gmail.com> %% --------------------------------------------------------------------------- %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3 of this license or (at @@ -29,14 +29,14 @@ %% and includes the derived files mandi.sty %% mandistudent.sty %% mandiexp.sty -%% vdemo.py +%% vdemo.py (not needed) %% --------------------------------------------------------------------------- %% -\def\mandistudent@version{\mandi@version} -\def\mandistudent@date{\mandi@date} +\def\mandistudent@version{3.1.0} +\def\mandistudent@date{2022-01-27} \NeedsTeXFormat{LaTeX2e}[2020-02-02] -\DeclareRelease{v3.0.0}{2021-08-22}{mandistudent.sty} -\DeclareCurrentRelease{v\mandi@version}{\mandi@date} +\DeclareRelease{v3.1.0}{2022-01-27}{mandistudent.sty} +\DeclareCurrentRelease{v\mandistudent@version}{\mandistudent@date} \ProvidesPackage{mandistudent} [\mandistudent@date\space v\mandistudent@version\space Macros for introductory physics] \newcommand*{\mandistudentversion}{v\mandistudent@version\space dated \mandistudent@date} @@ -50,11 +50,16 @@ \RequirePackage{mandi} \RequirePackage{mathtools} % needed for paired delimiters; extends amsmath \RequirePackage{nicematrix} % needed for column and row vectors +\RequirePackage{qrcode} % needed for QR codes in webvpythonblock +\qrset{height=1.5cm} % set default size of QR code \RequirePackage[most]{tcolorbox} % needed for program listings \RequirePackage{tensor} % needed for index notation \RequirePackage{tikz} % needed for \hilite \usetikzlibrary{shapes,fit,tikzmark} % needed for \hilite \RequirePackage{unicode-math} % needed for Unicode support +\IfFormatAtLeastTF {2020-10-01} % load xparse if necessary + {}% + {\RequirePackage{xparse}}% \RequirePackage{hyperref} % load last \RequireLuaTeX % require this engine \unimathsetup{math-style=ISO} @@ -166,56 +171,73 @@ \typeout{mandistudent: This package changes the default math font(s).}% \typeout{mandistudent: This package redefines the \protect\vec\space command.}% \typeout{}% -\RenewDocumentCommand{\vec}{ s m e{_^} }{% +\RenewDocumentCommand{\vec}{ s m e{_^} }% + {% % Note the \, used to make superscript look better. - \IfBooleanTF {#1} - {\vv{#2}% % * gives an arrow - % Use \sp{} primitive for superscript. - % Adjust superscript for the arrow. - \sp{\IfValueT{#4}{\,#4}\vphantom{\smash[t]{\big|}}} + \IfBooleanTF{#1} + {% + \vv{#2}% % * gives an arrow + % Use \sp{} primitive for superscript. + % Adjust superscript for the arrow. + \IfValueT{#4}% + {\sp{\,#4\vphantom{\smash[t]{\big|}}}} }% - {\symbfit{#2} % no * gives us bold - % Use \sp{} primitive for superscript. - % No superscript adjustment needed. - \sp{\IfValueT{#4}{#4}\vphantom{\smash[t]{\big|}}} + {% + \symbfit{#2} % no * gives us bold + % Use \sp{} primitive for superscript. + % No superscript adjustment needed. + \IfValueT{#4}% + {\sp{#4\vphantom{\smash[t]{\big|}}}} }% - % Use \sb{} primitive for subscript. - \sb{\IfValueT{#3}{#3}\vphantom{\smash[b]{|}}} -}% -\NewDocumentCommand{\dirvec}{ s m e{_^} }{% - \widehat{\makebox*{\(w\)}{\ensuremath{% - \IfBooleanTF {#1} - {% - #2 - }% - {% - \symbfit{#2} - }% - }% + % Use \sb{} primitive for subscript. + \IfValueT{#3}% + {\sb{#3\vphantom{\smash[b]{|}}}} + }% +\NewDocumentCommand{\dirvec}{ s m e{_^} }% + {% + \widehat% + {% + \makebox*{\(w\)}% + {% + \ensuremath{% + \IfBooleanTF {#1}% + {% + #2% + }% + {% + \symbfit{#2}% + }% + }% + }% }% - }% - \sb{\IfValueT{#3}{#3}\vphantom{\smash[b]{|}}} - \sp{\IfValueT{#4}{\,#4}\vphantom{\smash[t]{\big|}}} -}% -\NewDocumentCommand{\zerovec}{ s }{% - \IfBooleanTF {#1} - {\vv{0}}% - {\symbfup{0}}% -}% + \IfValueT{#3}% + {\sb{#3\vphantom{\smash[b]{|}}}}% + \IfValueT{#4}% + {\sp{\,#4\vphantom{\smash[t]{\big|}}}}% + }% +\NewDocumentCommand{\zerovec}{ s }% + {% + \IfBooleanTF {#1} + {\vv{0}}% + {\symbfup{0}}% + }% \ExplSyntaxOn -\NewDocumentCommand{\colvec}{ O{,} m }{% - \vector_main:nnnn { p } { \\ } { #1 } { #2 } -}% -\NewDocumentCommand{\rowvec}{ O{,} m }{% - \vector_main:nnnn { p } { & } { #1 } { #2 } -}% -\seq_new:N \l__vector_arg_seq -\cs_new_protected:Npn \vector_main:nnnn #1 #2 #3 #4 {% - \seq_set_split:Nnn \l__vector_arg_seq { #3 } { #4 } - \begin{#1NiceMatrix}[r] - \seq_use:Nnnn \l__vector_arg_seq { #2 } { #2 } { #2 } - \end{#1NiceMatrix} -}% +\NewDocumentCommand{\colvec}{ O{,} m } + { + \__mandi_vectormain:nnnn { p } { \\ } { #1 } { #2 } + } +\NewDocumentCommand{\rowvec}{ O{,} m } + { + \__mandi_vectormain:nnnn { p } { & } { #1 } { #2 } + } +\seq_new:N \l__mandi_vectorarg_seq +\cs_new_protected:Npn \__mandi_vectormain:nnnn #1#2#3#4 + { + \seq_set_split:Nnn \l__mandi_vectorarg_seq { #3 } { #4 } + \begin{#1NiceMatrix}[r] + \seq_use:Nnnn \l__mandi_vectorarg_seq { #2 } { #2 } { #2 } + \end{#1NiceMatrix} + } \ExplSyntaxOff \NewDocumentCommand{\changein}{}{\Delta} \DeclarePairedDelimiterX{\doublebars}[1]{\lVert}{\rVert}{\ifblank{#1}{\:\cdot\:}{#1}} @@ -227,120 +249,153 @@ \NewDocumentCommand{\magnitude}{}{\doublebars} \NewDocumentCommand{\norm}{}{\doublebars} \NewDocumentCommand{\absolutevalue}{}{\singlebars} -\NewDocumentCommand{\parallelto}{} - {\mkern3mu\vphantom{\perp}\vrule depth 0pt\mkern2mu\vrule depth 0pt\mkern3mu} +\NewDocumentCommand{\parallelto}{}% + {% + \mkern3mu\vphantom{\perp}\vrule depth 0pt\mkern2mu\vrule depth 0pt\mkern3mu% + }% \NewDocumentCommand{\perpendicularto}{}{\perp} -\NewDocumentEnvironment{physicsproblem}{ m }{% - \newpage% - \section*{#1}% - \newlist{parts}{enumerate}{2}% - \setlist[parts]{label=\bfseries(\alph*)}}% +\NewDocumentEnvironment{physicsproblem}{ m }% + {% + \newpage% + \section*{#1}% + \newlist{parts}{enumerate}{2}% + \setlist[parts]{label=\bfseries(\alph*)}% + }% {}% -\NewDocumentEnvironment{physicsproblem*}{ m }{% - \newpage% - \section*{#1}% - \newlist{parts}{enumerate*}{2}% - \setlist[parts]{label=\bfseries(\alph*)}}% +\NewDocumentEnvironment{physicsproblem*}{ m }% + {% + \newpage% + \section*{#1}% + \newlist{parts}{enumerate*}{2}% + \setlist[parts]{label=\bfseries(\alph*)}% + }% {}% \NewDocumentCommand{\problempart}{}{\item}% -\NewDocumentEnvironment{physicssolution}{ +b }{% - % Make equation numbering consecutive through the document. - \begin{align} - #1 - \end{align} -}{}% -\NewDocumentEnvironment{physicssolution*}{ +b }{% - % Make equation numbering consecutive through the document. - \begin{align*} - #1 - \end{align*} -}{}% -\NewDocumentCommand{\reason}{ O{4cm} m } - {&&\begin{minipage}{#1}\raggedright\small #2\end{minipage}} +\NewDocumentEnvironment{physicssolution}{ +b }% + {% + % Make equation numbering consecutive through the document. + \begin{align} + #1 + \end{align} + }% + {}% +\NewDocumentEnvironment{physicssolution*}{ +b }% + {% + % Make equation numbering consecutive through the document. + \begin{align*} + #1 + \end{align*} + }% + {}% +\NewDocumentCommand{\reason}{ O{4cm} m }% + {% + &&\begin{minipage}{#1}\raggedright\small #2\end{minipage}% + }% \newcounter{tikzhighlightnode} -\NewDocumentCommand{\hilite}{ O{magenta!60} m O{rectangle} }{% - \stepcounter{tikzhighlightnode}% - \tikzmarknode{highlighted-node-\number\value{tikzhighlightnode}}{#2}% - \edef\temp{% - \noexpand\AddToShipoutPictureBG{% - \noexpand\begin{tikzpicture}[overlay,remember picture]% - \noexpand\iftikzmarkoncurrentpage{highlighted-node-\number\value{tikzhighlightnode}}% - \noexpand\node[inner sep=1.0pt,fill=#1,#3,fit=(highlighted-node-\number\value{tikzhighlightnode})]{};% - \noexpand\fi - \noexpand\end{tikzpicture}% +\NewDocumentCommand{\hilite}{ O{magenta!60} m O{rectangle} }% + {% + \stepcounter{tikzhighlightnode}% + \tikzmarknode{highlighted-node-\number\value{tikzhighlightnode}}{#2}% + \edef\temp{% + \noexpand\AddToShipoutPictureBG{% + \noexpand\begin{tikzpicture}[overlay,remember picture]% + \noexpand\iftikzmarkoncurrentpage{highlighted-node-\number\value{tikzhighlightnode}}% + \noexpand\node[inner sep=1.0pt,fill=#1,#3,fit=(highlighted-node-\number\value{tikzhighlightnode})]{};% + \noexpand\fi + \noexpand\end{tikzpicture}% + }% }% + \temp% }% - \temp% -}% -\NewDocumentCommand{\image}{ O{scale=1} m m m }{% - \begin{figure}[ht!] - \begin{center}% +\NewDocumentCommand{\image}{ O{scale=1} m m m }% + {% + \par + \begin{figure}[ht!] + \centering% \includegraphics[#1]{#2}% - \end{center}% - \caption{#3}% - \label{#4}% - \end{figure}% -}% -\NewDocumentCommand{\veccomp}{ s m }{% - % Consider renaming this to \vectorsym. - \IfBooleanTF{#1} + \caption{#3}% + \label{#4}% + \end{figure}% + \par + }% +\NewDocumentCommand{\veccomp}{ s m }% {% - \symnormal{#2}% + % Consider renaming this to \vectorsym. + \IfBooleanTF{#1} + {% + \symnormal{#2}% + }% + {% + \symbfit{#2}% + }% }% +\NewDocumentCommand{\tencomp}{ s m }% {% - \symbfit{#2}% + % Consider renaming this to \tensororsym. + \IfBooleanTF{#1}% + {% + \symsfit{#2}% + }% + {% + \symbfsfit{#2}% + }% }% -}% -\NewDocumentCommand{\tencomp}{ s m }{% - % Consider renaming this to \tensororsym. - \IfBooleanTF{#1} +\NewDocumentCommand{\valence}{ s m m }% {% - \symsfit{#2}% + \IfBooleanTF{#1}% + {% + (#2,#3)% + }% + {% + \binom{#2}{#3}% + }% }% +\NewDocumentCommand{\contraction}{ s m }% {% - \symbfsfit{#2} + \IfBooleanTF{#1} + {% + \mathsf{C}% + }% + {% + \symbb{C}% + }% + _{#2} }% -}% -\NewDocumentCommand{\valence}{ s m m }{% - \IfBooleanTF{#1} - {(#2,#3)} - {\binom{#2}{#3}} -}% -\NewDocumentCommand{\contraction}{ s m }{% - \IfBooleanTF{#1} - {\mathsf{C}}% - {\symbb{C}}% - _{#2} -}% -\NewDocumentCommand{\slot}{ s d[] }{% - % d[] must be used because of the way consecutive optional - % arguments are handled. See xparse docs for details. - \IfBooleanTF{#1} +\NewDocumentCommand{\slot}{ s d[] }% {% - \IfValueTF{#2} - {% Insert a vector, but don't show the slot. - \smash{\makebox[1.5em]{\ensuremath{#2}}} + % d[] must be used because of the way consecutive optional + % arguments are handled. See xparse docs for details. + \IfBooleanTF{#1} + {% + \IfValueTF{#2} + {% Insert a vector, but don't show the slot. + \smash{\makebox[1.5em]{\ensuremath{#2}}} + }% + {% No vector, no slot. + \smash{\makebox[1.5em]{\ensuremath{}}} + }% }% - {% No vector, no slot. - \smash{\makebox[1.5em]{\ensuremath{}}} + {% + \IfValueTF{#2} + {% Insert a vector and show the slot. + \underline{\smash{\makebox[1.5em]{\ensuremath{#2}}}} + }% + {% No vector; just show the slot. + \underline{\smash{\makebox[1.5em]{\ensuremath{}}}} + }% }% }% +\NewDocumentCommand{\df}{ s }% {% - \IfValueTF{#2} - {% Insert a vector and show the slot. - \underline{\smash{\makebox[1.5em]{\ensuremath{#2}}}} - }% - {% No vector; just show the slot. - \underline{\smash{\makebox[1.5em]{\ensuremath{}}}} - }% + \mathop{}\!% + \IfBooleanTF{#1}% + {% + \symbfsfup{d}% + }% + {% + \symsfup{d}% + }% }% -}% -\NewDocumentCommand{\diff}{ s }{% - \mathop{}\! - \IfBooleanTF{#1} - {\symbfsfup{d}}% - {\symsfup{d}}% -}% \directlua{% luaotfload.add_colorscheme("colordigits", {["8000FF"] = {"one","two","three","four","five","six","seven","eight","nine","zero"}}) @@ -354,120 +409,162 @@ \definecolor{gspeach} {rgb}{1.00,0.90,0.71} % peach \definecolor{gspearl} {rgb}{0.94,0.92,0.84} % pearl \definecolor{gsplum} {rgb}{0.74,0.46,0.70} % plum -\lstdefinestyle{vpython}{% % style for listings - backgroundcolor=\color{gsbggray},% % background color - basicstyle=\colordigits\footnotesize,% % default style - breakatwhitespace=true% % break at whitespace - breaklines=true,% % break long lines - captionpos=b,% % position caption - classoffset=1,% % STILL DON'T UNDERSTAND THIS - commentstyle=\color{gsgray},% % font for comments - deletekeywords={print},% % delete keywords from the given language - emph={self,cls,@classmethod,@property},% % words to emphasize - emphstyle=\color{gsorange}\itshape,% % font for emphasis - escapeinside={(*@}{@*)},% % add LaTeX within your code - frame=tb,% % frame style - framerule=2.0pt,% % frame thickness - framexleftmargin=5pt,% % extra frame left margin - %identifierstyle=\sffamily,% % style for identifiers - keywordstyle=\gsfontfamily\color{gsplum},% % color for keywords - language=Python,% % select language - linewidth=\linewidth,% % width of listings - morekeywords={% % VPython/GlowScript specific keywords - __future__,abs,acos,align,ambient,angle,append,append_to_caption,% - append_to_title,arange,arrow,asin,astuple,atan,atan2,attach_arrow,% - attach_trail,autoscale,axis,background,billboard,bind,black,blue,border,% - bounding_box,box,bumpaxis,bumpmap,bumpmaps,camera,canvas,caption,capture,% - ceil,center,clear,clear_trail,click,clone,CoffeeScript,coils,color,combin,% - comp,compound,cone,convex,cos,cross,curve,cyan,cylinder,data,degrees,del,% - delete,depth,descender,diff_angle,digits,division,dot,draw_complete,% - ellipsoid,emissive,end_face_color,equals,explog,extrusion,faces,factorial,% - False,floor,follow,font,format,forward,fov,frame,gcurve,gdisplay,gdots,% - get_library,get_selected,ghbars,global,GlowScript,graph,graphs,green,gvbars,% - hat,headlength,headwidth,height,helix,hsv_to_rgb,index,interval,keydown,% - keyup,label,length,lights,line,linecolor,linewidth,logx,logy,lower_left,% - lower_right,mag,mag2,magenta,make_trail,marker_color,markers,material,% - max,min,mouse,mousedown,mousemove,mouseup,newball,norm,normal,objects,% - offset,one,opacity,orange,origin,path,pause,pi,pixel_to_world,pixels,plot,% - points,pos,pow,pps,print,print_function,print_options,proj,purple,pyramid,% - quad,radians,radius,random,rate,ray,read_local_file,readonly,red,redraw,% - retain,rgb_to_hsv,ring,rotate,round,scene,scroll,shaftwidth,shape,shapes,% - shininess,show_end_face,show_start_face,sign,sin,size,size_units,sleep,% - smooth,space,sphere,sqrt,start,start_face_color,stop,tan,text,textpos,% - texture,textures,thickness,title,trail_color,trail_object,trail_radius,% - trail_type,triangle,trigger,True,twist,unbind,up,upper_left,upper_right,% - userpan,userspin,userzoom,vec,vector,vertex,vertical_spacing,visible,% - visual,vpython,VPython,waitfor,white,width,world,xtitle,yellow,yoffset,% - ytitle% - },% - morekeywords={print,None,TypeError},% % additional keywords - morestring=[b]{"""},% % treat triple quotes as strings - numbers=left,% % where to put line numbers - numbersep=10pt,% % how far line numbers are from code - numberstyle=\bfseries\tiny,% % set to 'none' for no line numbers - showstringspaces=false,% % show spaces in strings - showtabs=false,% % show tabs within strings - stringstyle=\gsfontfamily\color{gsgreen},% % color for strings - upquote=true,% % how to typeset quotes -}% -\NewTCBListing[auto counter,list inside=gsprogs]{glowscriptblock} - { O{} D(){glowscript.org} m }{% - breakable,% - center,% - code = \newpage,% - %derivpeach,% - enhanced,% - hyperurl interior = https://#2,% - label = {gs:\thetcbcounter},% - left = 8mm,% - list entry = \thetcbcounter~~~~~#3,% - listing only,% - listing style = vpython,% - nameref = {#3},% - title = \texttt{GlowScript} Program \thetcbcounter: #3,% - width = 0.9\textwidth,% - {#1}, -}% -\NewDocumentCommand{\listofglowscriptprograms}{}{\tcblistof[\section*]{gsprogs} - {List of \texttt{GlowScript} Programs}}% -\NewTCBInputListing[auto counter,list inside=vpprogs]{\vpythonfile} - { O{} m m }{% - breakable,% - center,% - code = \newpage,% - %derivgray,% - enhanced,% - hyperurl interior = https://,% - label = {vp:\thetcbcounter},% - left = 8mm,% - list entry = \thetcbcounter~~~~~#3,% - listing file = {#2},% - listing only,% - listing style = vpython,% - nameref = {#3},% - title = \texttt{VPython} Program \thetcbcounter: #3,% - width = 0.9\textwidth,% - {#1},% -}% -\NewDocumentCommand{\listofvpythonprograms}{}{\tcblistof[\section*]{vpprogs} - {List of \texttt{VPython} Programs}}% -\DeclareTotalTCBox{\glowscriptinline}{ m }{% - bottom = 0pt,% - bottomrule = 0.0mm,% - boxsep = 1.0mm,% - colback = gsbggray,% - colframe = gsbggray,% - left = 0pt,% - leftrule = 0.0mm,% - nobeforeafter,% - right = 0pt,% - rightrule = 0.0mm,% - sharp corners,% - tcbox raise base,% - top = 0pt,% - toprule = 0.0mm,% -}{\lstinline[style = vpython]{#1}}% -\NewDocumentCommand{\vpythoninline}{}{\glowscriptinline}% +\lstdefinestyle{vpython}% + {% % style for listings + backgroundcolor=\color{gsbggray},% % background color + basicstyle=\colordigits\footnotesize,% % default style + breakatwhitespace=true% % break at whitespace + breaklines=true,% % break long lines + captionpos=b,% % position caption + classoffset=1,% % STILL DON'T UNDERSTAND THIS + commentstyle=\color{gsgray},% % font for comments + deletekeywords={print},% % delete keywords from the given language + emph={self,cls,@classmethod,@property},% % words to emphasize + emphstyle=\color{gsorange}\itshape,% % font for emphasis + escapeinside={(*@}{@*)},% % add LaTeX within your code + frame=tb,% % frame style + framerule=2.0pt,% % frame thickness + framexleftmargin=5pt,% % extra frame left margin + %identifierstyle=\sffamily,% % style for identifiers + keywordstyle=\gsfontfamily\color{gsplum},% % color for keywords + language=Python,% % select language + linewidth=\linewidth,% % width of listings + morekeywords={% % VPython/Web VPython specific keywords + __future__,abs,acos,align,ambient,angle,append,append_to_caption,% + append_to_title,arange,arrow,asin,astuple,atan,atan2,attach_arrow,% + attach_trail,autoscale,axis,background,billboard,bind,black,blue,border,% + bounding_box,box,bumpaxis,bumpmap,bumpmaps,camera,canvas,caption,capture,% + ceil,center,clear,clear_trail,click,clone,CoffeeScript,coils,color,combin,% + comp,compound,cone,convex,cos,cross,curve,cyan,cylinder,data,degrees,del,% + delete,depth,descender,diff_angle,digits,division,dot,draw_complete,% + ellipsoid,emissive,end_face_color,equals,explog,extrusion,faces,factorial,% + False,floor,follow,font,format,forward,fov,frame,gcurve,gdisplay,gdots,% + get_library,get_selected,ghbars,global,GlowScript,graph,graphs,green,gvbars,% + hat,headlength,headwidth,height,helix,hsv_to_rgb,index,interval,keydown,% + keyup,label,length,lights,line,linecolor,linewidth,logx,logy,lower_left,% + lower_right,mag,mag2,magenta,make_trail,marker_color,markers,material,% + max,min,mouse,mousedown,mousemove,mouseup,newball,norm,normal,objects,% + offset,one,opacity,orange,origin,path,pause,pi,pixel_to_world,pixels,plot,% + points,pos,pow,pps,print,print_function,print_options,proj,purple,pyramid,% + quad,radians,radius,random,rate,ray,read_local_file,readonly,red,redraw,% + retain,rgb_to_hsv,ring,rotate,round,scene,scroll,shaftwidth,shape,shapes,% + shininess,show_end_face,show_start_face,sign,sin,size,size_units,sleep,% + smooth,space,sphere,sqrt,start,start_face_color,stop,tan,text,textpos,% + texture,textures,thickness,title,trail_color,trail_object,trail_radius,% + trail_type,triangle,trigger,True,twist,unbind,up,upper_left,upper_right,% + userpan,userspin,userzoom,vec,vector,vertex,vertical_spacing,visible,% + visual,vpython,VPython,waitfor,WebVPython,white,width,world,xtitle,% + yellow,yoffset,ytitle% + },% + morekeywords={print,None,TypeError},% % additional keywords + morestring=[b]{"""},% % treat triple quotes as strings + numbers=left,% % where to put line numbers + numbersep=10pt,% % how far line numbers are from code + numberstyle=\bfseries\tiny,% % set to 'none' for no line numbers + showstringspaces=false,% % show spaces in strings + showtabs=false,% % show tabs within strings + stringstyle=\gsfontfamily\color{gsgreen},% % color for strings + upquote=true,% % how to typeset quotes + }% +\AtBeginEnvironment{webvpythonblock}{\catcode`\#=12} +\AtEndEnvironment{webvpythonblock}{\catcode`\#=6} +\NewTCBListing[auto counter,list inside=gsprogs]{webvpythonblock}{ O{} D(){webvpython.org} m }% + {% + breakable,% + center,% + code = \newpage,% + %derivpeach,% + enhanced,% + hyperurl interior = https://#2,% + label = {gs:\thetcbcounter},% + left = 8mm,% + list entry = \thetcbcounter~~~~~#3,% + listing only,% + listing style = vpython,% + nameref = {#3},% + title = \begin{minipage}{1.5cm}% + \protect\qrcode*{https://#2}% + \end{minipage}\hspace{5mm}% + \begin{minipage}{0.7\textwidth}% + \texttt{Web VPython} Program \thetcbcounter: #3% + \end{minipage},% + width = 0.9\textwidth,% + {#1}, + }% +\AtBeginEnvironment{webvpythonblock*}{\catcode`\#=12} +\AtEndEnvironment{webvpythonblock*}{\catcode`\#=6} +\NewTCBListing[use counter from=webvpythonblock,list inside=gsprogs] + {webvpythonblock*}{ O{} D(){webvpython.org} m }% + {% + breakable,% + center,% + code = \newpage,% + %derivpeach,% + enhanced,% + hyperurl interior = https://#2,% + label = {gs:\thetcbcounter},% + left = 8mm,% + list entry = \thetcbcounter~~~~~#3,% + listing only,% + listing style = vpython,% + nameref = {#3},% + title = \texttt{Web VPython} Program \thetcbcounter: #3,% + width = 0.9\textwidth,% + {#1}, + }% +\NewDocumentCommand{\listofwebvpythonprograms}{}% + {% + \tcblistof[\section*]{gsprogs}{List of \texttt{Web VPython} Programs}% + }% +\newcommand*{\vpythonfile}{\catcode`\#=12 \vpythonfile@auxA} +\NewDocumentCommand{\vpythonfile@auxA}{ O{} D(){vpython.org} m m }% + {% + \vpythonfile@auxB[#1](#2){#3}{#4}% + \catcode`\#=6 + }% +\NewTCBInputListing[auto counter,list inside=vpprogs] + {\vpythonfile@auxB}{ O{} D(){vpython.org} m m }% + {% + breakable,% + center,% + code = \newpage,% + %derivgray,% + enhanced,% + hyperurl interior = https://#2,% + label = {vp:\thetcbcounter},% + left = 8mm,% + list entry = \thetcbcounter~~~~~#4,% + listing file = {#3},% + listing only,% + listing style = vpython,% + nameref = {#4},% + title = \texttt{VPython} Program \thetcbcounter: #4,% + width = 0.9\textwidth,% + {#1},% + }% +\NewDocumentCommand{\listofvpythonprograms}{}% + {% + \tcblistof[\section*]{vpprogs}{List of \texttt{VPython} Programs}% + }% +\DeclareTotalTCBox{\webvpythoninline}{ m }% + {% + bottom = 0pt,% + bottomrule = 0.0mm,% + boxsep = 1.0mm,% + colback = gsbggray,% + colframe = gsbggray,% + left = 0pt,% + leftrule = 0.0mm,% + nobeforeafter,% + right = 0pt,% + rightrule = 0.0mm,% + sharp corners,% + tcbox raise base,% + top = 0pt,% + toprule = 0.0mm,% + }% + {\lstinline[style = vpython]{#1}}% +\NewDocumentCommand{\vpythoninline}{}{\webvpythoninline}% \endinput %% %% End of file `mandistudent.sty'. |