## 2 Experimental
### Characterization Techniques  
Ultra-high-performance liquid chromatography (UPLC) coupled with UV-VIS detection (LC-UV) and mass spectrometry (LC-MS) were used to perform the chromatographic separation and identification of the NSAIDs and ARVs. LC-UV was performed using an Agilent 1290 Infinity II ultra HPLC System with an Agilent poroshell 120, EC 1.9 \(\upmu\)m, 2.1 \(\times\) 100 mm, C8 reverse-phase column coupled with a binary pump G7120A and multi-sampling system from Agilent Technologies (Waldbronn, Germany). For data collection, the UV-VIS detector was set to 230 and 254 nm for the analysis of the templates and further coupled with an electrospray ionization (ESI) quadrupole time of flight (TOF) mass spectrometer (Waters Synapt G1) for further identification.  
Solid state \({}^{13}\)C CP/MAS NMR was performed on a 4.7T Bruker AVANCE III (Billerica, MA, USA) at 200 MHz. The spectra were collected using a dual channel Bruker 7 mm HX probe with a 4 \(\upmu\)s 1H pulse length. At room temperature, the cross-polarization (CP) spectra were recorded with proton decoupling and a recycle delay of 2 s. The \({}^{13}\)C CP/MAS experiment was conducted on solid glycine and was referred to 176.4 ppm. Cross-polarization contact time was improved to 2.0 ms. Magic-angle-spinning (MAS) was carried out at a rate of 5000 revolutions per second (5 kHz). Infrared spectra of the NIP and MIP were acquired on an Agilent Cary 670 Fourier-Transform infrared (FTIR) spectrometer (Birmingham, AL, USA).  
Morphological images of the polymers were obtained with a JEOL JSM-7500F (Tokyo, Japan) field emission scanning electron microscope (SEM). Thermogravimetric analysis (TGA) was performed with a TGA 55 from TA Instruments (San Jose, CA, USA). A platinum pan loaded with \(\sim\)10 mg was used. The ramp rate was 10 \({}^{\circ}\)C per minute from room temperature up to 500 \({}^{\circ}\)C for the MIP and NIP. A Brunauer-Emmett-Teller (BET) instrument (Micromeritics Instruments Inc. (Norcross, GA, USA). accelerated surface area and porosimetry System (ASAP) 2020) was used to characterize the surface area, pore size, and pore volume of both polymers. The dry samples were loaded into a glass analysis tube. For activation of the as-synthesized samples, the tube was heated at 120 \({}^{\circ}\)C under vacuum for 26 h.  
\begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Compounds** & **Formula** & \
\begin{tabular}{l} **Molecular** \\ **Weight (g/mol)** \\ \end{tabular} &
\begin{tabular}{l} **Water Solubility** \\ **(mg/L)** \\ \end{tabular} & **pKa** \\ \hline Emtricitabine & C\({}_{8}\)H\({}_{10}\)FN\({}_{3}\)O\({}_{5}\)S & 247.25 & 1.12 \(\times\) 10\({}^{6}\) & 2.65 \\ Tenofovir disoproxi & C\({}_{19}\)H\({}_{30}\)N\({}_{5}\)O\({}_{10}\)P & 287.21 & 13400 & 3.8 \\ Naproxen & C\({}_{14}\)H\({}_{14}\)O\({}_{3}\) & 230.26 & 15.9 & 4.2 \\ Diclofenac & C\({}_{14}\)H\({}_{11}\)Cl\({}_{2}\)NO\({}_{2}\) & 296.15 & 4.52 & 4.0 \\ Ibuprofen & C\({}_{13}\)H\({}_{18}\)O\({}_{2}\) & 206.29 & 21 & 4.4 \\ Efavirenz & C\({}_{14}\)H\({}_{9}\)CIF\({}_{3}\)NO\({}_{2}\) & 315.68 & 0.093 & 10.2 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Physiochemical properties of target pharmaceuticals [29; 30].  
Figure 2: Proposed mechanism of template and functional monomer interaction.