summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/vectorlogos/tex/vectorlogos.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/vectorlogos/tex/vectorlogos.sty')
-rw-r--r--macros/latex/contrib/vectorlogos/tex/vectorlogos.sty73
1 files changed, 73 insertions, 0 deletions
diff --git a/macros/latex/contrib/vectorlogos/tex/vectorlogos.sty b/macros/latex/contrib/vectorlogos/tex/vectorlogos.sty
new file mode 100644
index 0000000000..e78247fee2
--- /dev/null
+++ b/macros/latex/contrib/vectorlogos/tex/vectorlogos.sty
@@ -0,0 +1,73 @@
+% Author : C. Pierquet
+% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
+% licenses svg :
+% python : PSF license v2 https://www.python.org/community/logos/
+% scratch : Public https://commons.wikimedia.org/wiki/File:Scratchlogo.svg
+% scratch alt : Public https://commons.wikimedia.org/wiki/File:Scratchlogo.svg
+% scratch cat : CC40 https://fr.scratch-wiki.info/wiki/Fichier:Scratch_Cat_(cat-a).svg
+% texstudio : FREE https://en.m.wikipedia.org/wiki/File:TeXstudio_Logo.svg
+% emacs logo : FREE https://commons.wikimedia.org/wiki/File:EmacsIcon.svg
+% emacs logo alt : FREE https://fr.m.wikipedia.org/wiki/Fichier:Emacs-logo.svg
+% geogebra icon : CC30 https://fr.m.wikipedia.org/wiki/Fichier:Geogebra.svg
+% geogebra logo : CC30 https://fr.m.wikipedia.org/wiki/Fichier:Geogebra.svg
+% texmaker : FREE https://en.wikipedia.org/wiki/File:TeXmaker_Logo.svg
+% texmaker old : FREE https://en.wikipedia.org/wiki/File:TeXmaker_New_Logo.svg
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{vectorlogos}[2023/11/25 0.1.0 Vectorial logos of 'classic' softwares, for inline use.]
+
+%====HISTORY
+% v 0.1.0 Initial Version
+
+%====BASE
+\RequirePackage{calc}
+\RequirePackage{graphicx}
+\RequirePackage{xstring}
+
+%====LENGTHS
+\newlength{\tmp@logosvg@total@height}
+\newlength{\tmp@logosvg@depth}
+
+%====MACRO CREATOR
+\NewDocumentCommand\GenMacroLogoVect{ m m }{%1=macro,2=base,3=default
+ \NewDocumentCommand#1{ O{} }{%
+ \settototalheight{\tmp@logosvg@total@height}{\hbox{qB}}%
+ \settodepth{\tmp@logosvg@depth}{\hbox{q}}%
+ \IfFileExists{vectorlogo-#2-##1.pdf}%
+ {%
+ \raisebox{-\tmp@logosvg@depth+0.05\tmp@logosvg@total@height}{\includegraphics[height=0.9\tmp@logosvg@total@height]{vectorlogo-#2-##1.pdf}}%
+ }%
+ {%
+ \raisebox{-\tmp@logosvg@depth+0.05\tmp@logosvg@total@height}{\includegraphics[height=0.9\tmp@logosvg@total@height]{vectorlogo-#2.pdf}}%
+ }%
+ }%
+}
+
+%====SIMPLE MACRO
+\NewDocumentCommand\simplevectorlogo{ O{} m }{%
+ \IfFileExists{vectorlogo-#2.pdf}%
+ {%
+ \includegraphics[#1]{vectorlogo-#2.pdf}%
+ }%
+ {}%
+}
+
+%====GENERIC MACROS
+\NewDocumentCommand\vectorlogo{ O{logo} m }{%
+ \IfEq{#2}{python}{\logopython[#1]}{}%
+ \IfEq{#2}{scratch}{\logoscratch[#1]}{}%
+ \IfEq{#2}{geogebra}{\logogeogebra[#1]}{}%
+ \IfEq{#2}{texstudio}{\logotexstudio[#1]}{}%
+ \IfEq{#2}{emacs}{\logoemacs[#1]}{}%
+ \IfEq{#2}{texmaker}{\logotexmaker[#1]}{}%
+}
+
+%====SPECIFIC MACROS
+\GenMacroLogoVect{\logopython}{python}
+\GenMacroLogoVect{\logoscratch}{scratch}
+\GenMacroLogoVect{\logogeogebra}{geogebra}
+\GenMacroLogoVect{\logotexstudio}{texstudio}
+\GenMacroLogoVect{\logoemacs}{emacs}
+\GenMacroLogoVect{\logotexmaker}{texmaker}
+
+\endinput \ No newline at end of file