Created
July 11, 2023 20:46
-
-
Save dschaehi/1b14cb421e2378fe62a97619caf27db6 to your computer and use it in GitHub Desktop.
A LaTeX package for commenting. It allows line breaks and environments inside comments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\NeedsTeXFormat{LaTeX2e} | |
\ProvidesPackage{commenting}[2022/10/29 by Jae Hee Lee (http://jaeheelee.de)] | |
\RequirePackage{hyperref} | |
\RequirePackage{ifdraft} | |
\RequirePackage{graphicx} | |
\RequirePackage{xcolor} | |
\RequirePackage{xspace} | |
\RequirePackage{environ} | |
\RequirePackage{soul} | |
\RequirePackage{twemojis} | |
\ifdraft{% | |
\setkeys{Gin}{draft=false} % | |
\hypersetup{final} % | |
\interfootnotelinepenalty=\@M | |
\RequirePackage[ruled,perpage]{manyfoot}% | |
\DeclareNewFootnote{A}[fnsymbol] \renewcommand{\thefootnoteA}{\texttwemoji{left speech bubble}\Alph{footnoteA}} % | |
% Colored text | |
\newcommand{\added}[2]{{\leavevmode\color{#1}#2\textsuperscript{#1}}} % | |
% Colreed environment | |
\NewEnviron{colored}[1]{\leavevmode\color{#1}\BODY\textsuperscript{#1}}% | |
\newcommand{\deleted}[2]{{\leavevmode\color{#1}\st{#2}\textsuperscript{#1}}} \newcommand{\inlinenote}[2]{{\noindent\footnotesize\leavevmode\color{#1}\xspace\texttwemoji{left speech bubble} #2\textsuperscript{#1}}}% | |
\newcommand{\note}[2]{\protect\footnoteA{\color{#1}#2\textsuperscript{#1}}} % | |
}{% | |
\newcommand{\added}[2]{#2}% | |
\newenvironment{colored}[1]{}{}% | |
\newcommand{\deleted}[2]{}% | |
\newcommand{\inlinenote}[2]{}% | |
\newcommand{\note}[2]{}% | |
} | |
% Custom color definitions | |
% Colors are from https://latexcolor.com | |
\definecolor{jazzberryjam}{rgb}{0.65, 0.04, 0.37} % | |
\colorlet{JL}{jazzberryjam} | |
% For adding texts in color. The color disappears when the draft mode is turned off. | |
\newcommand{\jae}[1]{\added{JL}{#1}} | |
\NewEnviron{jlenv}{\let\body\BODY\begin{colored}{JL}\body\end{colored}} | |
% For adding footnote comments in color. Comments disappear when the draft mode is turned off. | |
\newcommand{\jlnote}[1]{\note{JL}{#1}} | |
% For adding inline comments in color. Comments disappear when the draft mode is turned off. | |
\newcommand{\jlinline}[1]{\inlinenote{JL}{#1}} | |
% For deleting text. Text disappears when the draft mode is turned off. | |
\newcommand{\jldel}[1]{\deleted{JL}{#1}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment