summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/zennote
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/zennote')
-rw-r--r--macros/latex/contrib/zennote/README.txt25
-rw-r--r--macros/latex/contrib/zennote/zennote.pdfbin0 -> 72865 bytes
-rw-r--r--macros/latex/contrib/zennote/zennote.sty94
-rw-r--r--macros/latex/contrib/zennote/zennote.tex206
4 files changed, 325 insertions, 0 deletions
diff --git a/macros/latex/contrib/zennote/README.txt b/macros/latex/contrib/zennote/README.txt
new file mode 100644
index 0000000000..3115509c61
--- /dev/null
+++ b/macros/latex/contrib/zennote/README.txt
@@ -0,0 +1,25 @@
+Package Name
+
+zennote (Please read the documentation on CTAN for detailed usage.)
+
+
+
+Author
+
+Yifan Liang (Github User Name: futurelyf)
+You may contact me via Github.
+
+
+
+Basic Functions
+
+This zennote package aims to provide you with an easy interface to speed up the process when organizing and producing elegant notes.
+All the tables, figures, equations, and listings are labeled according to the notenumber with the \titlebox command.
+The noteframe environment helps you generate fancy colored boxes to emphasize the important information (e.g. Theorems, Equations, Proof, etc.) in your document. You can customize the style and color to denote different categories, too.
+
+
+
+License
+
+This work is licensed under Creative Commons ”Attribution 4.0 International” license.
+For detailed information about the license, please visit the Creative Commons’ website. \ No newline at end of file
diff --git a/macros/latex/contrib/zennote/zennote.pdf b/macros/latex/contrib/zennote/zennote.pdf
new file mode 100644
index 0000000000..a8fe571a5a
--- /dev/null
+++ b/macros/latex/contrib/zennote/zennote.pdf
Binary files differ
diff --git a/macros/latex/contrib/zennote/zennote.sty b/macros/latex/contrib/zennote/zennote.sty
new file mode 100644
index 0000000000..2bb39f0d49
--- /dev/null
+++ b/macros/latex/contrib/zennote/zennote.sty
@@ -0,0 +1,94 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zennote}[2023/01/10 Version 1.0.0]
+
+\RequirePackage[most]{tcolorbox}
+
+\newcounter{notenumber}
+\setcounter{notenumber}{1}
+\counterwithin{equation}{notenumber}
+\counterwithin{figure}{notenumber}
+\counterwithin{table}{notenumber}
+\AtBeginDocument{\counterwithin{lstlisting}{notenumber}}
+\ExplSyntaxOn
+\keys_define:nn{titlebox}{
+ top-left.tl_set:N = \l_titlebox_topleft_tl,
+ top-right.tl_set:N = \l_titlebox_topright_tl,
+ bottom-left.tl_set:N = \l_titlebox_bottomleft_tl,
+ bottom-right.tl_set:N = \l_titlebox_bottomright_tl,
+ notenumber.code:n = {\setcounter{notenumber}{#1}},
+ topic.tl_set:N = \l_titlebox_topic_tl,
+ type.tl_set:N = \l_titlebox_type_tl,
+}
+
+\NewDocumentCommand{\titlebox}{m}{
+ \group_begin:
+ \keys_set:nn{titlebox}{#1}
+ \begin{center}
+ \framebox{
+ \vbox{\vspace{2mm}
+ \hbox to .98\textwidth {\hspace*{2mm}\tl_use:N \l_titlebox_topleft_tl
+ \hfill \tl_use:N \l_titlebox_topright_tl\hspace*{2mm}}
+ \vspace{4mm}
+ \hbox to .98\textwidth { \large\hfill \tl_use:N \l_titlebox_type_tl{~}\thenotenumber\c_colon_str {~} \tl_use:N \l_titlebox_topic_tl \hfill}
+ \vspace{2mm}
+ \hbox to .98\textwidth {\hspace*{2mm}\tl_use:N \l_titlebox_bottomleft_tl \hfill \tl_use:N \l_titlebox_bottomright_tl\hspace*{2mm}}
+ \vspace{2mm}}
+ }
+ \end{center}
+ \group_end:
+}
+
+\tl_new:N \l_noteframe_style_tl
+
+\tl_const:Nn \c_noteframe_style_zero_tl {}
+\tl_const:Nn \c_noteframe_style_one_tl {
+ borderline~west={3pt}{0pt}{\l_noteframe_color_tl!85!black}
+}
+\tl_const:Nn \c_noteframe_style_two_tl {
+ borderline~west={3pt}{0pt}{\l_noteframe_color_tl!85!black},
+ borderline~east={3pt}{0pt}{\l_noteframe_color_tl!85!black}
+}
+
+\keys_define:nn{noteframe}{
+ color.tl_set:N = \l_noteframe_color_tl,
+ style.tl_set:N = \l_noteframe_style_tl,
+ title.tl_set:N = \l_noteframe_title_tl,
+}
+
+\keys_set:nn{noteframe}{
+ color = {cyan},
+ style = {one},
+ title = {}
+}
+
+\NewDocumentEnvironment{noteframe}{O{}+b}{
+ \group_begin:
+
+ \keys_set:nn{noteframe}{#1}
+ \use:x {
+ \exp_not:n{\begin{tcolorbox}}[
+ enhanced,
+ boxrule=0pt,
+ frame~hidden,
+ \exp_not:v {c_noteframe_style_ \l_noteframe_style_tl _tl},
+ colback=\tl_use:N \l_noteframe_color_tl!10!white,
+ sharp~corners
+ ]
+ \exp_not:n{
+ \tl_if_empty:NTF\l_noteframe_title_tl{}{
+ \textbf{\Large \textcolor{\tl_use:N \l_noteframe_color_tl!85!black}{\tl_use:N \l_noteframe_title_tl}\\\vspace*{-2mm}\\ }
+ }
+ #2
+ \end{tcolorbox}
+ }
+ \group_end:
+ }
+}{
+
+}
+
+\ExplSyntaxOff
+
+\pagestyle{plain}
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/zennote/zennote.tex b/macros/latex/contrib/zennote/zennote.tex
new file mode 100644
index 0000000000..48c59db9eb
--- /dev/null
+++ b/macros/latex/contrib/zennote/zennote.tex
@@ -0,0 +1,206 @@
+\documentclass{article}
+\usepackage[margin = 1in]{geometry}
+% packages %
+\usepackage{graphicx}
+\usepackage{tabularray}
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage[dvipsnames]{xcolor}
+\usepackage{caption}
+\usepackage{hologo}
+\usepackage{fontspec}
+\usepackage{unicode-math}
+\usepackage[hidelinks]{hyperref}
+\usepackage[type={CC},modifier={by},version={4.0}]{doclicense}
+\usepackage{zennote}
+% format %
+\setlength{\parindent}{0pt}
+\linespread{1.3}
+\renewcommand{\contentsname}{\centering Table of Contents}
+% font %
+\setmainfont{TeX Gyre Pagella}
+\setmathfont{TeX Gyre Pagella Math}
+\newfontfamily\textcm{CMU Serif}
+\hypersetup{
+ colorlinks = True,
+ allcolors = cyan
+ }
+
+
+% document %
+\begin{document}
+
+\titlebox{
+ top-left = {{\bf{\textcm \LaTeX}}},
+ top-right = {{\bf Packages}},
+ bottom-left = {{\sl Author: Yifan Liang}},
+ bottom-right = {{\sl Version: 1.0.0}},
+ notenumber = {1},
+ topic = {{\tt zennote} for Fancy Notes},
+ type = {Manual}
+ }
+
+
+\begin{tblr}{
+cell{1}{1} = {r=2}{},
+colspec = {X[1]|X[20]}
+}
+\textbf{Note} & This documentation/manual is suggested to be compiled in {\textcm \hologo{XeLaTeX}} or {\textcm \hologo{LuaLaTeX}}, and is available on the CTAN website. \\
+ & The {\tt zennote} package itself can be compiled in any major {\textcm \hologo{LaTeX}} compiler.
+\end{tblr}
+
+
+\thispagestyle{empty}
+\tableofcontents
+
+\newpage
+\setcounter{page}{1}
+
+\section{Introduction}
+\subsection{Basic Functions}
+This {\tt zennote} package aims to provide you with an easy interface to speed up the process when organizing and producing elegant notes.\\
+\\
+All the tables, figures, equations, and listings are labeled according to the {\tt notenumber} with the \verb+\titlebox+ command.\\
+\\
+The {\tt noteframe} environment helps you generate fancy colored boxes to emphasize the important information (e.g. Theorems, Equations, Proof, etc.) in your document. You can customize the style and color to denote different categories, too.
+
+\subsection{License}
+This work is licensed under \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons "Attribution 4.0 International" license}.\\
+\\
+For detailed information about the license, please visit the Creative Commons' website by clicking the \textcolor{Cyan}{cyan text above} or the license image below.
+\\
+\begin{flushright}
+ \doclicenseImage
+\end{flushright}
+
+\newpage
+
+\section{Note Title}
+{\tt zennote} provides \verb+\titlebox{<settings>}+ command to generate the following title box for your note, where {\tt settings} help you set the key information of your note, including:
+\begin{itemize}
+ \item \verb+top-left+, Text on Top-Left Corner;
+ \item \verb+top-right+, Text on Top-Right Corner;
+ \item \verb+bottom-left+, Text on Bottom-Left Corner;
+ \item \verb+bottom-right+, Text on Bottom-Right Corner;
+ \item \verb+notenumber+, Note Number;
+ \item \verb+topic+, Note Topic;
+ \item \verb+type+, Note Type (e.g. Chapter, Unit, Note).
+\end{itemize}
+
+\subsection{Usage}
+\begin{flushleft}
+\begin{verbatim}
+\titlebox{
+ top-left = {topleft},
+ top-right = {topright},
+ bottom-left = {bottomleft},
+ bottom-right = {bottomright},
+ notenumber = {1},
+ topic = {topic},
+ type = {Note}
+}
+\end{verbatim}
+\end{flushleft}
+
+\subsection{Result}
+\titlebox{
+ top-left = {topleft},
+ top-right = {topright},
+ bottom-left = {bottomleft},
+ bottom-right = {bottomright},
+ notenumber = {1},
+ topic = {topic},
+ type = {Note}
+}
+
+\newpage
+
+\section{Note Highlighter}
+{\tt zennote} provides \verb+noteframe+ environment to generate the following "highlighter boxes." Users can set the key values in options to customize the styles of the frame, which includes:
+\begin{itemize}
+ \item \verb+color+, The color of the frame, which can be chosen from \verb+\usepackage[dvipsnames]{xcolor}+. The default color is \textcolor{cyan}{\bf cyan};
+ \item \verb+style+, The edge of the frame, which can be chosen from \verb+zero+, \verb+one+, and \verb+two+. The default edge style is \verb+one+;
+ \item \verb+title+, The title of the frame.
+\end{itemize}
+
+\subsection{Examples}
+\subsubsection{Usage 1}
+\begin{flushleft}
+\begin{verbatim}
+\begin{noteframe}[title = {Default}]
+ Cyan Box Example Content.
+\end{noteframe}
+\end{verbatim}
+\end{flushleft}
+
+\subsubsection{Result 1}
+\begin{noteframe}[title = {Default}]
+ Cyan Box Example Content.
+\end{noteframe}
+
+\begin{flushright}
+{\sl (To be continued on the next page...)}
+\end{flushright}
+
+\newpage
+
+\subsubsection{Usage 2}
+\begin{flushleft}
+\begin{verbatim}
+\begin{noteframe}[
+ title = {style: two and color: LimeGreen},
+ color = {LimeGreen},
+ style = {two}
+]
+ LimeGreen Box Example Content.
+ \begin{align}
+ a^2 + b^2 = c^2
+ \end{align}
+\end{noteframe}
+\end{verbatim}
+\end{flushleft}
+
+\subsubsection{Result 2}
+\begin{noteframe}[
+ title = {style: two and color: LimeGreen},
+ color = {LimeGreen},
+ style = {two}
+]
+ LimeGreen Box Example Content.
+ \begin{align}
+ a^2 + b^2 = c^2
+ \end{align}
+\end{noteframe}
+
+\begin{flushright}
+{\sl (To be continued on the next page...)}
+\end{flushright}
+
+\newpage
+
+\subsubsection{Usage 3}
+\begin{flushleft}
+\begin{verbatim}
+\begin{noteframe}[style = {zero}]
+ Cyan Box Example Content.
+ \begin{center}
+ \includegraphics[width = 5cm]{example-image-a}
+ \captionof{figure}{this is a picture.}
+ \end{center}
+\end{noteframe}
+\end{verbatim}
+\end{flushleft}
+
+\subsubsection{Result 3}
+\begin{noteframe}[style = {zero}]
+ Cyan Box Example Content.
+ \begin{center}
+ \includegraphics[width = 5cm]{example-image-a}
+ \captionof{figure}{this is a picture.}
+ \end{center}
+\end{noteframe}
+
+\subsection{Caveats}
+It is crucial to write \verb+\usepackage{zennote}+ \textbf{\textit{after}} \verb+\usepackage[dvipsnames]{xcolor}+ to prevent potential error when coloring the frame.
+
+\end{document} \ No newline at end of file