Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Catppuccin
Copyright (c) 2025 Catppuccin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
72 changes: 67 additions & 5 deletions catppuccinpalette.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%
% MIT License
%
% Copyright (c) 2024 Catppuccin
% Copyright (c) 2025 Catppuccin
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -142,11 +142,19 @@
% style hyperref according to the style guide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#typography}}.
% Possible values: \verb|false| (initial), \verb|true| (default)
% \newline
% \textbf{Note:} in order to make this work, \verb|catppuccinpalette| needs to
% \textbf{Note:} In order to make this work, \verb|catppuccinpalette| needs to
% be loaded \emph{before} the \verb|hyperref| package.
% \\
% \verb|listings| &
% style listings according to the style guide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#code-editors}}.
% Possible values: \verb|false| (initial), \verb|true| (default)
% \newline
% \textbf{Note:} In order to make this work, \verb|catppuccinpalette| needs to
% be loaded \emph{after} the \verb|listings| package.
% \\\midrule
% \verb|styleAll| &
% shortcut for setting \verb|pagecolor|, \verb|textcolor| and \verb|hyperref|
% shortcut for setting \verb|pagecolor|, \verb|textcolor|, \verb|listings|
% and \verb|hyperref|
% \\\bottomrule
% \end{tabularx}
%
Expand All @@ -163,6 +171,35 @@
% The command processes the same options like the ones you can pass when
% loading the package (see documentation above).
%
% \subsection{Package specific notes}
% \subsubsection{listings}
% With the \verb|listings| option set, this package adjusts the listings
% settings in order to conform to the style guide
% \footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#code-editors}}.
%
% Still, the highlighting setup is only quite rudimentary. If the chosen
% listings language splits the keywords in multiple groups, like keywords and
% builtins, the highlighting can be improved (manually). There is no
% standardization here though, which is why this package cannot do more sadly.
%
% The codesnippet shown in the examples
% \footnote{\url{https://github.com/catppuccin/latex/tree/main/examples}} for
% example do this by setting the following keys (with a custom language or with
% \verb|\lstset| globally) manually in addition to what this package does:
%
% \noindent
% | keywordstyle = [2]{\color{CtpBlue}}, |\\
% | keywordstyle = [3]{\color{CtpYellow}}, |\\
% | keywordstyle = [4]{\color{CtpLavender}}, |\\
% | keywordstyle = [5]{\color{CtpPeach}}, |\\
% | keywordstyle = [6]{\color{CtpTeal}}, |\\
% | otherkeywords = {<, =, ?}, |\\
% | morekeywords = [2]{new, create, present, email, description, ...}, |\\
% | morekeywords = [3]{PageController, ApplicationController, Page}, |\\
% | morekeywords = [4]{@page}, |\\
% | morekeywords = [5]{exception, do_some_for_pages, @page, @admin}, |\\
% | morekeywords = [6]{<, ||, =, ?}, |\\
%
% \subsection{Colors}
% \textbf{Note:} The colors with the prefix |Cat| are deprecated and will be removed in a future version!
% \newcommand{\showCol}[1]{\raisebox{0.5ex}{\fcolorbox{black}{#1}{\hspace{1em}}} #1}
Expand Down Expand Up @@ -342,6 +379,7 @@
\newif\ifcatppuccinpalette@pagecolor
\newif\ifcatppuccinpalette@textcolor
\newif\ifcatppuccinpalette@hyperref
\newif\ifcatppuccinpalette@listings
\pgfkeys{
/catppuccinPalette/.cd,
% \end{macrocode}
Expand Down Expand Up @@ -369,14 +407,17 @@
textcolor/.default = true,
hyperref/.is if = catppuccinpalette@hyperref,
hyperref/.default = true,
listings/.is if = catppuccinpalette@listings,
listings/.default = true,
pagecolor/.is if = catppuccinpalette@pagecolor,
pagecolor/.default = true,
styleAll/.style = {pagecolor,textcolor,hyperref},
styleAll/.style = {pagecolor,textcolor,hyperref,listings},
% \end{macrocode}
% Set initial values for all options
% \begin{macrocode}
textcolor = false,
hyperref = false,
listings = false,
pagecolor = false,
style = Latte,
}
Expand Down Expand Up @@ -768,7 +809,9 @@
\color{CtpText}%
\fi%
% \end{macrocode}
% Style hyerref according to the styleguide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#typography}} if the user wants it
% Style hyperref\footnote{\url{https://ctan.org/pkg/hyperref}} according to the
% styleguide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#typography}}
% if the user wants it.
% \begin{macrocode}
\ifcatppuccinpalette@hyperref%
\PassOptionsToPackage{
Expand All @@ -778,6 +821,25 @@
\fi%
% \end{macrocode}
% \begin{macrocode}
% \end{macrocode}
% Style listings\footnote{\url{https://ctan.org/pkg/listings}} according to the
% styleguide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#code-editors}}
% if the user wants it. Though, as listings e\,.g.\,does not know a standardized
% group for \emph{builtins} this can only offer a rudimentary highlighting. In
% case the listing language definition breaks keywords in multiple groups, a
% more fine grained highlighting is possible.
% \begin{macrocode}
\ifcatppuccinpalette@listings%
\lstset{
emphstyle=\color{CtpYellow},
stringstyle=\color{CtpGreen},
commentstyle=\color{CtpOverlay2},
keywordstyle=\color{CtpMauve},
backgroundcolor=\color{CtpBase},
}%
\fi%
% \end{macrocode}
% \begin{macrocode}
}
\CtpReinit[]
% \end{macrocode}
Expand Down
Binary file modified catppuccinpalette.pdf
Binary file not shown.
70 changes: 66 additions & 4 deletions latex.tera
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,19 @@ versionDate:
% style hyperref according to the style guide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#typography}}.
% Possible values: \verb|false| (initial), \verb|true| (default)
% \newline
% \textbf{Note:} in order to make this work, \verb|catppuccinpalette| needs to
% \textbf{Note:} In order to make this work, \verb|catppuccinpalette| needs to
% be loaded \emph{before} the \verb|hyperref| package.
% \\
% \verb|listings| &
% style listings according to the style guide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#code-editors}}.
% Possible values: \verb|false| (initial), \verb|true| (default)
% \newline
% \textbf{Note:} In order to make this work, \verb|catppuccinpalette| needs to
% be loaded \emph{after} the \verb|listings| package.
% \\\midrule
% \verb|styleAll| &
% shortcut for setting \verb|pagecolor|, \verb|textcolor| and \verb|hyperref|
% shortcut for setting \verb|pagecolor|, \verb|textcolor|, \verb|listings|
% and \verb|hyperref|
% \\\bottomrule
% \end{tabularx}
%
Expand All @@ -155,6 +163,35 @@ versionDate:
% The command processes the same options like the ones you can pass when
% loading the package (see documentation above).
%
% \subsection{Package specific notes}
% \subsubsection{listings}
% With the \verb|listings| option set, this package adjusts the listings
% settings in order to conform to the style guide
% \footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#code-editors}}.
%
% Still, the highlighting setup is only quite rudimentary. If the chosen
% listings language splits the keywords in multiple groups, like keywords and
% builtins, the highlighting can be improved (manually). There is no
% standardization here though, which is why this package cannot do more sadly.
%
% The codesnippet shown in the examples
% \footnote{\url{https://github.com/catppuccin/latex/tree/main/examples}} for
% example do this by setting the following keys (with a custom language or with
% \verb|\lstset| globally) manually in addition to what this package does:
%
% \noindent
% | keywordstyle = [2]{\color{CtpBlue}}, |\\
% | keywordstyle = [3]{\color{CtpYellow}}, |\\
% | keywordstyle = [4]{\color{CtpLavender}}, |\\
% | keywordstyle = [5]{\color{CtpPeach}}, |\\
% | keywordstyle = [6]{\color{CtpTeal}}, |\\
% | otherkeywords = {<, =, ?}, |\\
% | morekeywords = [2]{new, create, present, email, description, ...}, |\\
% | morekeywords = [3]{PageController, ApplicationController, Page}, |\\
% | morekeywords = [4]{@page}, |\\
% | morekeywords = [5]{exception, do_some_for_pages, @page, @admin}, |\\
% | morekeywords = [6]{<, ||, =, ?}, |\\
%
% \subsection{Colors}
% \textbf{Note:} The colors with the prefix |Cat| are deprecated and will be removed in a future version!
% {{ '\newcommand{\showCol}[1]{\raisebox{0.5ex}{\fcolorbox{black}{#1}{\hspace{1em}}} #1}' }}
Expand Down Expand Up @@ -192,6 +229,7 @@ versionDate:
\newif\ifcatppuccinpalette@pagecolor
\newif\ifcatppuccinpalette@textcolor
\newif\ifcatppuccinpalette@hyperref
\newif\ifcatppuccinpalette@listings
\pgfkeys{
/catppuccinPalette/.cd,
% \end{macrocode}
Expand Down Expand Up @@ -219,14 +257,17 @@ versionDate:
textcolor/.default = true,
hyperref/.is if = catppuccinpalette@hyperref,
hyperref/.default = true,
listings/.is if = catppuccinpalette@listings,
listings/.default = true,
pagecolor/.is if = catppuccinpalette@pagecolor,
pagecolor/.default = true,
styleAll/.style = {pagecolor,textcolor,hyperref},
styleAll/.style = {pagecolor,textcolor,hyperref,listings},
% \end{macrocode}
% Set initial values for all options
% \begin{macrocode}
textcolor = false,
hyperref = false,
listings = false,
pagecolor = false,
style = Latte,
}
Expand Down Expand Up @@ -346,7 +387,9 @@ versionDate:
\color{CtpText}%
\fi%
% \end{macrocode}
% Style hyerref according to the styleguide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#typography}} if the user wants it
% Style hyperref\footnote{\url{https://ctan.org/pkg/hyperref}} according to the
% styleguide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#typography}}
% if the user wants it.
% \begin{macrocode}
\ifcatppuccinpalette@hyperref%
\PassOptionsToPackage{
Expand All @@ -356,6 +399,25 @@ versionDate:
\fi%
% \end{macrocode}
% \begin{macrocode}
% \end{macrocode}
% Style listings\footnote{\url{https://ctan.org/pkg/listings}} according to the
% styleguide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md\#code-editors}}
% if the user wants it. Though, as listings e\,.g.\,does not know a standardized
% group for \emph{builtins} this can only offer a rudimentary highlighting. In
% case the listing language definition breaks keywords in multiple groups, a
% more fine grained highlighting is possible.
% \begin{macrocode}
\ifcatppuccinpalette@listings%
\lstset{
emphstyle=\color{CtpYellow},
stringstyle=\color{CtpGreen},
commentstyle=\color{CtpOverlay2},
keywordstyle=\color{CtpMauve},
backgroundcolor=\color{CtpBase},
}%
\fi%
% \end{macrocode}
% \begin{macrocode}
}
\CtpReinit[]
% \end{macrocode}
Expand Down