% Author        : C. Pierquet
% licence       : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
% licence icons : https://www.svgrepo.com/collection/education-vectors/ CC-BY
%               : https://www.svgrepo.com/collection/design-8/ CC0
%               : https://www.svgrepo.com/collection/math-symbols-4 CC0

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{customenvs-icons}[2025/09/06 v0.1.1 Subpackage customenvs-icons]

%====history
% 0.1.1: Math-symbols-4
% 0.1.0: Initial version

%====packages
\RequirePackage{ifthen}
\RequirePackage{calc}
\RequirePackage{graphicx}
\RequirePackage{xstring}
\RequirePackage{simplekv}

%====lenghts
\newlength{\customenvsIconsDefaultTotalHeight}
\newlength{\customenvsIconsDefaultHeight}
\newlength{\customenvsIconsNormalHeight}
\newlength{\customenvsIconsDefaultDepth}
\AtBeginDocument{%
	\setlength{\customenvsIconsDefaultHeight}{\fontcharht\font`X}%
	\setlength{\customenvsIconsNormalHeight}{\fontcharht\font`X}%
}

%====suppress warnings
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname pdfsuppresswarningpagegroup\endcsname\relax
\else
	\pdfsuppresswarningpagegroup=1\relax
\fi

%====macro for generating educ version
\newcommand{\defineceiconseduc}[2]{%
	\expandafter\newcommand\csname ceiconeduc #2\endcsname[1]{%
		\includegraphics[page=#1, ##1]{ce-educationvectors-all.pdf}}%
}%

%====macro for generating design version
\newcommand{\defineceiconsdesign}[2]{%
	\expandafter\newcommand\csname ceicondesign #2\endcsname[1]{%
		\includegraphics[page=#1, ##1]{ce-designvectors-all.pdf}}%
}%

%====macro for generating mathsymbol
\newcommand{\defineceiconsmathsymb}[2]{%
	\expandafter\newcommand\csname ceiconmathsymb #2\endcsname[1]{%
		\includegraphics[page=#1, ##1]{ce-mathsymbols-all.pdf}}%
}%

%====int macros
\newcommand{\ceiconeduc}[2][height=\customenvsIconsDefaultHeight]{%
	\csname ceiconeduc #2\endcsname{#1}%
}%
\newcommand{\ceicondesign}[2][height=\customenvsIconsDefaultHeight]{%
	\csname ceicondesign #2\endcsname{#1}%
}%

\newcommand{\ceiconmathsymb}[2][height=\customenvsIconsDefaultHeight]{%
	\csname ceiconmathsymb #2\endcsname{#1}%
}%

%====main macro
\defKV[customenvsicons]{height=\def\customenvsiconsheigth{#1},style=\def\customenvsiconsstyle{#1},strut=\def\customenvsiconsstrut{#1},dstrut=\def\customenvsiconsdstrut{#1}}
\setKVdefault[customenvsicons]{height=dauto,educ=true,design=false,mathsymb=false,strut={X},dstrut={qX}}

\NewDocumentCommand\ceicon{O{}D<>{}m}{%
	\restoreKV[customenvsicons]%
	\setKV[customenvsicons]{#1}%
	\ifboolKV[customenvsicons]{design}{\setKV[customenvsicons]{educ=false}}{}%
	\ifboolKV[customenvsicons]{mathsymb}{\setKV[customenvsicons]{educ=false}}{}%
	%lengths
	\ifthenelse{\equal{\customenvsiconsheigth}{auto}}%
	{%
		\settoheight\customenvsIconsDefaultHeight{\hbox{\customenvsiconsstrut}}%height of \customenvsiconsstrut
		\ifboolKV[customenvsicons]{educ}{\ceiconeduc[height=\customenvsIconsDefaultHeight,#2]{#3}}{}%
		\ifboolKV[customenvsicons]{design}{\ceicondesign[height=\customenvsIconsDefaultHeight,#2]{#3}}{}%
		\ifboolKV[customenvsicons]{mathsymb}{\ceiconmathsymb[height=\customenvsIconsDefaultHeight,#2]{#3}}{}%
		
	}%
	{%
		\ifthenelse{\equal{\customenvsiconsheigth}{dauto}}%
			{%
				\settototalheight\customenvsIconsDefaultTotalHeight{\hbox{\customenvsiconsdstrut}}%height of \customenvsiconsdstrut
				\settodepth\customenvsIconsDefaultDepth{\hbox{\customenvsiconsdstrut}}%depth of \customenvsiconsdstrut
				\ifboolKV[customenvsicons]{educ}{\raisebox{-\customenvsIconsDefaultDepth}{\ceiconeduc[height=\customenvsIconsDefaultTotalHeight,#2]{#3}}}{}%
				\ifboolKV[customenvsicons]{design}{\raisebox{-\customenvsIconsDefaultDepth}{\ceicondesign[height=\customenvsIconsDefaultTotalHeight,#2]{#3}}}{}%
				\ifboolKV[customenvsicons]{mathsymb}{\raisebox{-\customenvsIconsDefaultDepth}{\ceiconmathsymb[height=\customenvsIconsDefaultTotalHeight,#2]{#3}}}{}%
			}%
			{%
				\IfSubStr{\customenvsiconsheigth}{/}%
					{%
						\StrCut{\customenvsiconsheigth}{/}{\ceiconsmanualheight}{\ceiconsmanualdepth}%
						\setlength\customenvsIconsNormalHeight{\ceiconsmanualheight}%
						\setlength\customenvsIconsDefaultDepth{\ceiconsmanualdepth}%
						\ifboolKV[customenvsicons]{educ}{\raisebox{\customenvsIconsDefaultDepth}{\ceiconeduc[height=\customenvsIconsNormalHeight,#2]{#3}}}{}%
						\ifboolKV[customenvsicons]{design}{\raisebox{\customenvsIconsDefaultDepth}{\ceicondesign[height=\customenvsIconsNormalHeight,#2]{#3}}}{}%
						\ifboolKV[customenvsicons]{mathsymb}{\raisebox{\customenvsIconsDefaultDepth}{\ceiconmathsymb[height=\customenvsIconsNormalHeight,#2]{#3}}}{}%
					}%
					{%
						\setlength\customenvsIconsNormalHeight{\customenvsiconsheigth}%
						\ifboolKV[customenvsicons]{educ}{\ceiconeduc[height=\customenvsIconsNormalHeight,#2]{#3}}{}%
						\ifboolKV[customenvsicons]{design}{\ceicondesign[height=\customenvsIconsNormalHeight,#2]{#3}}{}%
						\ifboolKV[customenvsicons]{mathsymb}{\ceiconmathsymb[height=\customenvsIconsNormalHeight,#2]{#3}}{}%
					}%
			}%
	}%
}

%====EDUC GEN
\defineceiconseduc{1}{abacus}
\defineceiconseduc{2}{trophy}
\defineceiconseduc{3}{atomic}
\defineceiconseduc{4}{seoweb}
\defineceiconseduc{5}{backbag}
\defineceiconseduc{6}{balls}
\defineceiconseduc{7}{blackboard}
\defineceiconseduc{8}{bookcourses}
\defineceiconseduc{9}{compass}
\defineceiconseduc{10}{genetic}
\defineceiconseduc{11}{idea}
\defineceiconseduc{12}{microscop}
\defineceiconseduc{13}{pencilcase}
\defineceiconseduc{14}{puzzle}
\defineceiconseduc{15}{ruler}
\defineceiconseduc{16}{shoes}
\defineceiconseduc{17}{studyy}
\defineceiconseduc{18}{studyscience}
\defineceiconseduc{19}{smartphone}
\defineceiconseduc{20}{books}
\defineceiconseduc{21}{onlinegraduation}
\defineceiconseduc{22}{university}
\defineceiconseduc{23}{calendar}
\defineceiconseduc{24}{champion}
\defineceiconseduc{25}{certifmedal}
\defineceiconseduc{26}{schoolmedal}
\defineceiconseduc{27}{chemistry}
\defineceiconseduc{28}{chemistryliquid}
\defineceiconseduc{29}{diarypencil}
\defineceiconseduc{30}{filefolder}
\defineceiconseduc{31}{document}
\defineceiconseduc{32}{brush}
\defineceiconseduc{33}{pencilruler}
\defineceiconseduc{34}{globe}
\defineceiconseduc{35}{graduatestudy}
\defineceiconseduc{36}{seomathlearning}
\defineceiconseduc{37}{mathlearning}
\defineceiconseduc{38}{signature}
\defineceiconseduc{39}{quill}
\defineceiconseduc{40}{telescope}

%====DESIGN GEN
\defineceiconsdesign{1}{book}
\defineceiconsdesign{2}{browser-html}
\defineceiconsdesign{3}{canvas-easel}
\defineceiconsdesign{4}{canvas-paint}
\defineceiconsdesign{5}{compass-draw}
\defineceiconsdesign{6}{crop}
\defineceiconsdesign{7}{cube-atom}
\defineceiconsdesign{8}{designer-draw}
\defineceiconsdesign{9}{edit-draw}
\defineceiconsdesign{10}{edit-pencil}
\defineceiconsdesign{11}{edit-pencil-b}
\defineceiconsdesign{12}{fountain-pen-tools-and-utensils}
\defineceiconsdesign{13}{glue}
\defineceiconsdesign{14}{grid-pixel}
\defineceiconsdesign{15}{hierarchical-structure-diagram}
\defineceiconsdesign{16}{laptop}
\defineceiconsdesign{17}{magic-wand}
\defineceiconsdesign{18}{marker}
\defineceiconsdesign{19}{monitor-tv}
\defineceiconsdesign{20}{mouse}
\defineceiconsdesign{21}{paint-brush-brush}
\defineceiconsdesign{22}{paint-bucket-bucket}
\defineceiconsdesign{23}{paint-palette-art}
\defineceiconsdesign{24}{paint-roller}
\defineceiconsdesign{25}{paint-tube-art}
\defineceiconsdesign{26}{pantone-paint}
\defineceiconsdesign{27}{pencil-box}
\defineceiconsdesign{28}{pencil-case}
\defineceiconsdesign{29}{pencil-draw}
\defineceiconsdesign{30}{pencil-ruler}
\defineceiconsdesign{31}{pencil}
\defineceiconsdesign{32}{picture-image}
\defineceiconsdesign{33}{protractor-rule}
\defineceiconsdesign{34}{rgb-document}
\defineceiconsdesign{35}{ruler-pencil}
\defineceiconsdesign{36}{ruler}
\defineceiconsdesign{37}{scissors-cut}
\defineceiconsdesign{38}{set-square-geometry}
\defineceiconsdesign{39}{set-square-measure}
\defineceiconsdesign{40}{set-square-measure-b}
\defineceiconsdesign{41}{settings-gear}
\defineceiconsdesign{42}{sharpener-tools-and-utensils}
\defineceiconsdesign{43}{smartphone-edit-tools}
\defineceiconsdesign{44}{spray-paint-graffiti}
\defineceiconsdesign{45}{tablet-touchscreen}
\defineceiconsdesign{46}{tablet-touchscreen-b}
\defineceiconsdesign{47}{vector-design}
\defineceiconsdesign{48}{vector-design-b}
\defineceiconsdesign{49}{vector-design-c}
\defineceiconsdesign{50}{vector-edit-tools}
\defineceiconsdesign{51}{vector-eye}
\defineceiconsdesign{52}{vector-heart}
\defineceiconsdesign{53}{vector-illustration}
\defineceiconsdesign{54}{vector-illustration-b}
\defineceiconsdesign{55}{vector-illustration-c}
\defineceiconsdesign{56}{vector}
\defineceiconsdesign{57}{vector-b}
\defineceiconsdesign{58}{vector-tablet}
\defineceiconsdesign{59}{vector-tablet-b}
\defineceiconsdesign{60}{web-design}

%====MATHSYMBOL GEN
\defineceiconsmathsymb{1}{abacus}
\defineceiconsmathsymb{2}{angle}
\defineceiconsmathsymb{3}{axis}
\defineceiconsmathsymb{4}{braces}
\defineceiconsmathsymb{5}{brackets}
\defineceiconsmathsymb{6}{calculator-keys}
\defineceiconsmathsymb{7}{calculator}
\defineceiconsmathsymb{8}{compass-draw}
\defineceiconsmathsymb{9}{cone}
\defineceiconsmathsymb{10}{cube}
\defineceiconsmathsymb{11}{cylinder}
\defineceiconsmathsymb{12}{division}
\defineceiconsmathsymb{13}{emptyset}
\defineceiconsmathsymb{14}{equal}
\defineceiconsmathsymb{15}{equation}
\defineceiconsmathsymb{16}{function}
\defineceiconsmathsymb{17}{gravity}
\defineceiconsmathsymb{18}{infinity}
\defineceiconsmathsymb{19}{is-an-element-of}
\defineceiconsmathsymb{20}{is-approximately-equal-to}
\defineceiconsmathsymb{21}{is-greater-than}
\defineceiconsmathsymb{22}{is-greater-than-or-equal-to}
\defineceiconsmathsymb{23}{is-identical-with}
\defineceiconsmathsymb{24}{is-less-than}
\defineceiconsmathsymb{25}{is-less-than-or-equal-to}
\defineceiconsmathsymb{26}{is-not-an-element-of}
\defineceiconsmathsymb{27}{is-not-equal-to-not-equal}
\defineceiconsmathsymb{28}{maths-add}
\defineceiconsmathsymb{29}{minus}
\defineceiconsmathsymb{30}{monitor}
\defineceiconsmathsymb{31}{multiply-cancel}
\defineceiconsmathsymb{32}{notebook}
\defineceiconsmathsymb{33}{notepad}
\defineceiconsmathsymb{34}{panel}
\defineceiconsmathsymb{35}{parabolic}
\defineceiconsmathsymb{36}{parenthesis}
\defineceiconsmathsymb{37}{pencil}
\defineceiconsmathsymb{38}{percentage}
\defineceiconsmathsymb{39}{pi-pi}
\defineceiconsmathsymb{40}{pie-chart}
\defineceiconsmathsymb{41}{plus}
\defineceiconsmathsymb{42}{presentation}
\defineceiconsmathsymb{43}{protractor-rule}
\defineceiconsmathsymb{44}{pyramid}
\defineceiconsmathsymb{45}{set-square}
\defineceiconsmathsymb{46}{smartphone}
\defineceiconsmathsymb{47}{sphere}
\defineceiconsmathsymb{48}{square-root}
\defineceiconsmathsymb{49}{the-sum-of-sum}
\defineceiconsmathsymb{50}{triangle}

\endinput