Gp2mv3 / Syntheses

Synthèses et travaux pour l'EPL
Other
97 stars 220 forks source link

Ajout de l'exam d'ELEC2900 de Juin 2022 #899

Closed Tougherdread2 closed 1 year ago

Tougherdread2 commented 1 year ago

Ajout de l'examen de "LELEC2900 - Signal processing" de Juin 2022. L'utilisation du package "eplunit" ne permet pas d'afficher les unités en local. Je n'ai donc pas su vérifier que l'utilisation de la commande \SI{\second} (par exemple) fonctionnait correctement.

blegat commented 1 year ago

Il est ici: https://github.com/Gp2mv3/Syntheses/blob/a2a728d401b9325cd11d88b3acc21946ba6e0ad6/src/eplunits.sty If it doesnt work, maybe try copy-pasting this file in the folder src/q8/sigproc-ELEC2900/exam/2022/Juin/All with the .tex file and remove the ../../... but it's weird it's not finding it. Maybe Windows expects \ instead of /... Can you check and confirm it compiles ?

Tougherdread2 commented 1 year ago

Actually it finds the file in the correct location and compiles it. When I build it using TeXnicCenter, it says "Unknown option 'binary-units=true' for package 'siunitx'" and "Undifined control sequence \$ \SI{5}{\mega\text{ samples}\per\second}\$" and on the build pdf the units just don't appear as shown on the following picture (it should show 5 M samples/s and not 5 samples).

77ee9e129fe04600822cda1d718a621d

Whereas, when I compile it on overleaf (with every packages imported in the project) everything appears correctly as shown on the following image.

9271061dabd96643d724052a8f048c48

I'm tempted to say that the issue comes from my TeXnicCentre application and therefore the compilation could be done correctly on the drive.

Let me know if something is not clear.

blegat commented 1 year ago

It seems the binary-units options has been removed in v3.0.0 of siunitx: https://github.com/josephwright/siunitx/blob/main/CHANGELOG.md It think it is now enabled by default, it provides \bit and \byte, can you confirm that https://github.com/Gp2mv3/Syntheses/blob/a2a728d401b9325cd11d88b3acc21946ba6e0ad6/src/q4/os-SINF1252/summary/os-SINF1252-summary.tex#L606 is still compiling if you remove this option ?

Tougherdread2 commented 1 year ago

Yes that was an issue. But another thing I have noticed is that it systematically enters in the following if and therefore never defines the \si[2]{\numprint[#2]{#1} :

\ifthenelse{\isundefined{\SIunitschosen}}{ \RequirePackage[binary-units=true]{siunitx} } { \RequirePackage{ifthen} \RequirePackage[squaren, Gray]{SIunits} \RequirePackage{sistyle} \RequirePackage[autolanguage]{numprint} \newcommand\si[2]{\numprint[#2]{#1}} \newcommand\np[1]{\numprint{#1}} }

The only way to compile it correctly by my side was to remove the entire \ifthenelse condition and save the eplunits package as follows :

\NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesPackage{eplunits}[2014/01/14 EPL units package]

\DeclareOption{SIunits}{\newcommand{\SIunitschosen}{}}

\ProcessOptions\relax

\typeout{I see you will format your unit correctly, excellent !} \typeout{Don't forget to criticize people that don't.}

\RequirePackage{ifthen} \RequirePackage[squaren, Gray]{SIunits} \RequirePackage{sistyle} \RequirePackage[autolanguage]{numprint} \newcommand\si[2]{\numprint[#2]{#1}} \newcommand\np[1]{\numprint{#1}}

\endinput

blegat commented 1 year ago

If you want SIunits you need to do \usepackage[SIunits]{../../../eplunits} however, that's kind of legacy, you should use siunitx now with \num instead of numprint.

Tougherdread2 commented 1 year ago

Indeed this is why it never entered the else condition. I have committed the updated source code and it is now compiling without any error. Thank you for you help !

blegat commented 1 year ago

Thanks for the contribution ;)