Debian Codegraph @

texmf-dist/tex/latex/vectorlogos/vectorlogos.sty

raw
1 % Author..........: C. Pierquet
2 % licence.........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
3 % Sources.........: I converted the logos from their original SVG or other forms, as found on the given urls, to PDF
4 % Scratch.........: Public https://commons.wikimedia.org/wiki/File:Scratchlogo.svg
5 % Scratch alt.....: Public https://commons.wikimedia.org/wiki/File:Scratchlogo.svg
6 % Scratch cat.....: CC40 https://fr.scratch-wiki.info/wiki/Fichier:Scratch_Cat_(cat-a).svg
7 % Texstudio.......: FREE https://en.m.wikipedia.org/wiki/File:TeXstudio_Logo.svg
8 % Emacs...........: FREE https://commons.wikimedia.org/wiki/File:EmacsIcon.svg
9 % Emacs alt.......: FREE https://fr.m.wikipedia.org/wiki/Fichier:Emacs-logo.svg
10 % Geogebra........: CC30 https://wiki.geogebra.org/en/File:Geogebra-logo-name.svg
11 % Geogebra icon...: CC30 https://fr.m.wikipedia.org/wiki/Fichier:Geogebra.svg
12 % Texmaker........: FREE https://en.wikipedia.org/wiki/File:TeXmaker_Logo.svg
13 % Texmaker alt....: FREE https://en.wikipedia.org/wiki/File:TeXmaker_New_Logo.svg
14 % MikTex logo.....: Public https://fr.wikipedia.org/wiki/Fichier:Logo_MiKTeX.svg
15 % Miktex icons....: FREE https://github.com/MiKTeX/miktex/tree/next/Resources/Icons/MiKTeX/scalable/apps
16 % CTAN Lion.......: FREE CTAN lion drawing by Duane Bibby
17 % LaTeX project...: CC40 https://github.com/latex3/latex3.github.io/tree/ba511d2fd43dc08ad301e31b2a32c472b252b76b/_site/img from Jonas Jacek (https://www.j15k.com/)
18 % TeXworks........: GPL 2.0 https://github.com/TeXworks/texworks/blob/main/res/images/TeXworks.png
19
20
21 \NeedsTeXFormat{LaTeX2e}
22 \ProvidesPackage{vectorlogos}[2024/03/30 0.1.3 Vectorial logos of 'classic' softwares, for inline use.]
23
24 %====HISTORY
25 % v 0.1.3 Miktex logo/icons + LaTeX-projext + CTAN lion + TeXworks (from png)
26 % v 0.1.2 Alt command for manual insertion, with existing img
27 % v 0.1.1 Licenses update
28 % v 0.1.0 Initial Version
29
30 %====BASE
31 \RequirePackage{calc}
32 \RequirePackage{graphicx}
33 \RequirePackage{xstring}
34
35 %====LENGTHS
36 \newlength{\tmp@logosvg@total@height}
37 \newlength{\tmp@logosvg@depth}
38
39 %====MACRO CREATOR
40 \NewDocumentCommand\GenMacroLogoVect{ m m }{%1=macro,2=base
41 \NewDocumentCommand#1{ O{} }{%
42 \settototalheight{\tmp@logosvg@total@height}{\hbox{ABCDEFGHIJKLMNOPQQRSTUVWXYZabcdefghijklmnopqqrstuvwxyz}}%
43 \settodepth{\tmp@logosvg@depth}{\hbox{q}}%
44 \IfFileExists{vectorlogo-#2-##1.pdf}%
45 {%
46 \raisebox{-\tmp@logosvg@depth+0.05\tmp@logosvg@total@height}{\includegraphics[height=0.9\tmp@logosvg@total@height]{vectorlogo-#2-##1.pdf}}%
47 }%
48 {%
49 \raisebox{-\tmp@logosvg@depth+0.05\tmp@logosvg@total@height}{\includegraphics[height=0.9\tmp@logosvg@total@height]{vectorlogo-#2.pdf}}%
50 }%
51 }%
52 }
53
54 %====SIMPLE MACRO
55 \NewDocumentCommand\simplevectorlogo{ s O{} m }{%
56 \IfBooleanTF{#1}%
57 {%
58 \IfFileExists{vectorlogo-#3.pdf}%
59 {%
60 \includegraphics[#2]{vectorlogo-#3.pdf}%
61 }%
62 {}%
63 }%
64 {%
65 \IfStrEq{#2}{}%
66 {%
67 \def\tmp@raiseper@logo{0.9}%
68 }%
69 {%
70 \def\tmp@raiseper@logo{#2}%
71 }%
72 \IfFileExists{#3}%
73 {%
74 %2=percent of height of box qB
75 \def\tmp@raise@logo{\fpeval{(1-\tmp@raiseper@logo)*0.5}}%
76 \settototalheight{\tmp@logosvg@total@height}{\hbox{ABCDEFGHIJKLMNOPQQRSTUVWXYZabcdefghijklmnopqqrstuvwxyz}}%
77 \settodepth{\tmp@logosvg@depth}{\hbox{q}}%
78 \raisebox{-\tmp@logosvg@depth+\tmp@raise@logo\tmp@logosvg@total@height}{\includegraphics[height=\tmp@raiseper@logo\tmp@logosvg@total@height]{#3}}%
79 }%
80 {}%
81 }%
82 }
83
84 %====GENERIC MACROS
85 \NewDocumentCommand\vectorlogo{ O{} m }{%
86 \IfEq{#2}{scratch}{\logoscratch[#1]}{}%
87 \IfEq{#2}{geogebra}{\logogeogebra[#1]}{}%
88 \IfEq{#2}{texstudio}{\logotexstudio[#1]}{}%
89 \IfEq{#2}{emacs}{\logoemacs[#1]}{}%
90 \IfEq{#2}{texmaker}{\logotexmaker[#1]}{}%
91 \IfEq{#2}{miktex}{\logomiktex[#1]}{}%
92 \IfEq{#2}{ctanlion}{\logoctanlion[#1]}{}%
93 \IfEq{#2}{latexproject}{\logolatexproject[#1]}{}%
94 \IfEq{#2}{texworks}{\logotexworks[#1]}{}%
95 }
96
97 %====SPECIFIC MACROS
98 \GenMacroLogoVect{\logoscratch}{scratch}
99 \GenMacroLogoVect{\logogeogebra}{geogebra}
100 \GenMacroLogoVect{\logotexstudio}{texstudio}
101 \GenMacroLogoVect{\logoemacs}{emacs}
102 \GenMacroLogoVect{\logotexmaker}{texmaker}
103 \GenMacroLogoVect{\logomiktex}{miktex}
104 \GenMacroLogoVect{\logoctanlion}{ctanlion}
105 \GenMacroLogoVect{\logolatexproject}{latexproject}
106 \GenMacroLogoVect{\logotexworks}{texworks}
107
108 \endinput