%%%==============================================================================
% WinEdt pragmas
% !Mode:: "TeX:EN"
% Default Compile engines:
% !TEX program = pdflatex
% !PDFTeXify ext =  --enable-etex  --restrict-write18
% !PDFLaTeX ext  =  --enable-etex  --restrict-write18
% !BIB program = none
%%%==============================================================================
%% Copyright 2025-present by Alceu Frigeri
%%
%% This work may be distributed and/or modified under the conditions of
%%
%% * The [LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
%%   version 1.3c (or later), and/or
%% * The [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html),
%%   version 3 (or later)
%%
%% This work has the LPPL maintenance status *maintained*.
%%
%% The Current Maintainer of this work is Alceu Frigeri
%%
%% This is version {1.1} {2026/11/28}
%%
%% The list of files that compose this work can be found in the README.md file at
%% https://ctan.org/pkg/afperpack
%%
%%%==============================================================================
\documentclass[10pt]{article}
\RequirePackage[verbose,a4paper,marginparwidth=27.5mm,top=2.5cm,bottom=1.5cm,hmargin={40mm,20mm},marginparsep=2.5mm,columnsep=10mm,asymmetric]{geometry}
\usepackage[infograb]{codedescribe}
\RequirePackage[inline]{enumitem}
\SetEnumitemKey{miditemsep}{parsep=0ex,itemsep=0.4ex}

\usepackage[math,tikz,listings,graphicx,english]{afperpack}

\RequirePackage[hidelinks,hypertexnames=false]{hyperref}

\begin{document}
\tstitle{
  author={Alceu Frigeri\footnote{\tsverb{https://github.com/alceu-frigeri/afperpack}}},
  date={\tsdate},
  title={The afperpack Package\break Personal settings and preferences \break Version \PkgInfo{afperpack}{version}}
  }
  

\begin{typesetabstract}
This is  a personal package, which (selectively) loads package sets with the author's preferences.

\end{typesetabstract}

\tableofcontents


\section{Introduction}

This is what is left from ``my personal packages''. I started, a few years ago (2022), to untangle the many personal packs/hacks that I was using, documenting them and publishing them at CTAN, and, finally, after almost 3 years (2025), this is what is left: Just an auxiliary package that pre-loads the packages I use the most, and define a few command(s). So, now, when I share a \LaTeX\ file with a colleague, he/she won't come back asking me how to compile it (because they lack ``my hacks'').

\section{Package Options}

\begin{describelist}{key}
  \describe{showframe}{For geometry/format proofing. This will just load the \tsobj[pkg]{showframe} package.}
  \describe{showlabels}{For labels placement/location proofing. This will just load the \tsobj[pkg]{showlabels} package.}
  \describe{english}{Babel will be loaded with \tsobj[option]{english} option. Otherwise \tsobj[option]{brazilian}. }
  \describe{beamer}{This will suppress the loading of the \tsobj[pkg]{geometry,titlesec,listings} packages. This doesn't load the package \tsobj[pkg]{beamer} itself.}
  \describe{xpacks}{The packages \tsobj[pkg]{longtable,xpacks,csquotes,caption,supcaption,url,multirow,bigdelim} will be loaded.}
  \describe{times}{This will load the \tsobj[pkg]{mathptmx} package (times roman) instead of (default) \tsobj[pkg]{lmodern}.}
  \describe{noquests}{This will suppress the loading of the \tsobj[pkg]{tikzquests} package.}
  \describe{tikz}{This will load \tsobj[pkg]{tikz,circuitikz,tikzquads,tikzdotncross,pgfplots,tikzfxgraph} packages (and \tsobj[pkg]{tikzquests}, if not suppressed).}
  \describe{graphicx}{This will load the \tsobj[pkg]{graphicx} package.}
  \describe{math}{This will load the \tsobj[pkg]{
  amsmath , amsfonts , amssymb , amsthm , mathrsfs , mathtools, empheq , extarrows, steinmetz, mathfixs , siunitx , cases } packages.}
  \describe{listings}{This will load the \tsobj[pkg]{listings} package. (if \tsobj[option]{beamer} is false)}
  \describe{landscape}{Sets geometry for a landscape document}
  \describe{fxgraph}{(defaults to nothing) Options passed along to \tsobj[pkg]{tikzfxgraph} package, e.g. \tsobj[option]{fxgraph=\{use file\}}.}
  \describe{quests}{(defaults to nothing) Options passed along to \tsobj[pkg]{tikzquests} package, e.g. \tsobj[option]{quests=\{xtrakeys=\{D\}\}}.}
  \describe{dotncross}{(defaults to nothing) Options passed along to \tsobj[pkg]{tikzdotncross} package, e.g. \tsobj[option]{dotncross=\{coordcolor=\{blue\}\}}.}
\end{describelist}

Note that \tsobj[pkg]{etoolbox,fontenc,inputenc,xcolors,enumitem} will always be loaded. Besides those \tsobj[pkg]{geometry} will (if not already) as well \tsobj[pkg]{titlesec,listings} if \tsobj[option]{beamer} is false.

\section{Commands}


\begin{codedescribe}{\cab}
\begin{codesyntax}%
\tsmacro{\cab}{options}\tsargs[oarg]{extra}
\end{codesyntax}
This will typesets, in a new page, a typical exam header. \tsobj[oarg]{extra} will be (if present) typeset as is, in a box below the main cab. \tsobj[marg]{options} is a key=val list of:
\begin{describelist*}{key}
  \describe{uni}{University's name. (default: Universidade Federal do Rio Grande do Sul)}
  \describe{dept}{Department's name. (default: Escola de Engenharia / DELAE)}
  \describe{class}{Class' name. (default: disciplina)}
  \describe{classcode}{Class' code. (default: ENGcode)}
  \describe{exam}{Exam text. (default: Verificação de Aproveitamento)}
  \describe{sem}{Semester. (default: 202x/Y)}
  \describe{semester}{alias to \tsobj[key]{sem}.}
  \describe{name label}{Student`s label. (default: Nome)}
  \describe{id label}{Student`s ID label. (default: Cartão)}
  \describe{duo label}{Duo label. (default: Dupla)}
  \describe{duo}{If true, a duo label will be added to the identification lines (default: false)}
  \describe{nonames}{If true, the identification lines will be suppressed.}
  \describe{simplegrad}{If true, the grad option box will be used, with a preset text. (default: false)}
  \describe{simplegrad text}{Changes the default text of a simplegrad box.}
\end{describelist*}
\end{codedescribe}

For example:
\begin{codestore}[af-01]
  \cab{
    class={Eletrônica I} , classcode=ENG10044 , 
    exam = {$1^a$ Verificação} , sem = {2025/1} , simplegrad 
  }
\end{codestore}
\tscode*[emph={class,classcode,exam,sem,simplegrad,uni,dept,name,id,duo,label,nonames}]{af-01}




\begin{codedescribe}{\pgfmathparseFPU}
  \begin{codesyntax}
    \tsmacro{\pgfmathparseFPU}{math-expr}
  \end{codesyntax}
  This command is defined if, and only if, the \tsobj[option]{tikz} option is used. It will process \tsobj[marg]{math-expr} with \tsobj{\pgfmathparse} whilst the \tsobj[key]{/pgf/fpu} key is active, which greatly extends the \TeX\ number's range. See the \tsobj[pkg]{fpu} library from \tsobj[pkg]{tikz} for more details.
\end{codedescribe}


\begin{codedescribe}[code,new=2026/11/28]{\SetHs}
\begin{codesyntax}%
\tsmacro{\SetHs}[options]{num,den}
\end{codesyntax}
Options can be any combination of the following keys:
\begin{describelist*}{key}
  \describe{base name}{(default: \tsobj[value]{Hs}) The \tsobj[marg]{base} name to be used.}
  \describe{prefix}{(default: \tsobj{& &} two alignment marks) When constructing \tsobj{\<base>db,\<base>phi}, these tokens will prefix each term, starting by the second one. The default value is meant to be used, for instance, in a \tsobj[env]{eqarray} environment.}
  \describe{postfix}{(default: \tsobj{\\}) When constructing \tsobj{\<base>db,\<base>phi}, these tokens will postfix each term. The default value is meant to be used, for instance, in a \tsobj[env]{eqarray} environment. }
  \describe{infix}{(default: \tsobj{{}} empty) When constructing \tsobj{\<base>db,\<base>phi}, these tokens will be inserted between the \tsobj[marg]{num,den}  terms.}
\end{describelist*}
\tsobj[marg]{num,den} are supposed to be two comma separated lists of terms, defining a transfer function \[H(s)=\frac{\prod{\langle num \rangle_i}}{\prod{\langle den \rangle_i}}\]
This will create 4 commands, \tsobj{\<base>frac,\<base>db,\<base>phi,\<base>fx}, as follow:
  \begin{describelist*}{code}
    \describe{\<base>frac}
      {Will be defined as 
      
      \tsobj{\frac} 
      
      \tsfmt{\{} \tsfmt{$( \langle num \rangle_1 ) *$}\tsfmt{$( \langle num \rangle_2 ) *\dots$ }\tsfmt{$( \langle num \rangle_n )$} \tsfmt{\}}  
      
      \tsfmt{\{} \tsfmt{$( \langle den \rangle_1 ) *$}\tsfmt{$( \langle den \rangle_2 ) *\dots$ }\tsfmt{$( \langle den \rangle_m )$ }\tsfmt{\}}} 
    \describe{\<base>db}
      {Will be defined as  
      
      \tsobj{20\!\cdot\! log_{10}\left|} \tsfmt{$\langle num \rangle_1$} \tsobj{\right|} 
      \tsobj{+ 20\!\cdot\! log_{10}\left|} \tsfmt{$\langle num \rangle_2$} \tsobj{\right|} 
      \tsfmt{\dots} 
      \tsobj{+20\!\cdot\! log_{10}\left|} \tsfmt{$\langle num \rangle_n$} \tsobj{\right|}
      
      \tsobj{- 20\!\cdot\! log_{10}\left|} \tsfmt{$\langle den \rangle_1$} \tsobj{\right|} 
      \tsobj{- 20\!\cdot\! log_{10}\left|} \tsfmt{$\langle den \rangle_2$} \tsobj{\right|} 
      \tsfmt{\dots} 
      \tsobj{-20\!\cdot\! log_{10}\left|} \tsfmt{$\langle den \rangle_m$} \tsobj{\right|}
      
      with the variable $s$ replaced by $jw$.
      } 
    \describe{\<base>phi}
      {Similarly this will be defined as
      
      \tsobj{\phi(} \tsfmt{$\langle num \rangle_1$} \tsobj{)} 
      \tsobj{+ \phi(} \tsfmt{$\langle num \rangle_2$} \tsobj{)} 
      \tsfmt{\dots} 
      \tsobj{+\phi(} \tsfmt{$\langle num \rangle_n$} \tsobj{)}
      
      \tsobj{- \phi(} \tsfmt{$\langle den \rangle_1$} \tsobj{)} 
      \tsobj{- \phi(} \tsfmt{$\langle den \rangle_2$} \tsobj{)} 
      \tsfmt{\dots} 
      \tsobj{-\phi(} \tsfmt{$\langle den \rangle_m$} \tsobj{)}
      
      with the variable $s$ replaced by $jw$.
      }
    \describe{\<base>fx}
      {Finally, this will be defined as:
      
      \tsfmt{(} \tsfmt{$( \langle num \rangle_1 ) *$}\tsfmt{$( \langle num \rangle_2 ) *\dots$ }\tsfmt{$( \langle num \rangle_n )$} \tsfmt{)}  
      \tsfmt{ / }
      \tsfmt{(} \tsfmt{$( \langle den \rangle_1 ) *$}\tsfmt{$( \langle den \rangle_2 ) *\dots$ }\tsfmt{$( \langle den \rangle_m )$ }\tsfmt{)}
    
      with the variable $s$ replaced by  $x*\{0,1\}$. Note this is meant to construct a \tsobj[pkg]{gnuplot} function.
      }
  \end{describelist*}
\end{codedescribe}

\begin{codestore}[demo00]
\SetHs [ prefix={},  postfix={}, infix = { \\ && } ]
  { 2*800 , s+0.1 }
  { 0.1 , s+2 ,  s+800 }

\[ H(s) = \Hsfrac \]

\begin{eqnarray*}
  20\!\cdot\!log_{10}\left|H(jw)\right| &=& \Hsdb
\end{eqnarray*}

\begin{eqnarray*}
  \phi (H(jw)) &=& \Hsphi
\end{eqnarray*}

Definition of \string\Hsfx\,: \  
\meaning\Hsfx
\end{codestore}

For example:
\tsdemo*[codeprefix={},resultprefix={}]{demo00}
%
%\newpage
%\PkgInfoMapOver
%  {
%   \PkgInfoDescription{#1}
%  }

\end{document} 