Skip to content

Commit

Permalink
Comments within comments creates inline comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
MLopez-Ibanez committed May 17, 2024
1 parent c6d4c60 commit c04f77b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ This package defines 3 commands:

For a more detailed example see: <https://github.com/MLopez-Ibanez/revision/blob/main/example.pdf>

## ChangeLog

- 0.7: A comment within a comment creates an inline comment. Example:

```latex
\MANUEL{Creates a footnote\MAURA{Creates an inline comment within the footnote}}
```


## Limitations

* It is currently not possible to mark `equation` environments for deletion (see issue [#7](https://github.com/MLopez-Ibanez/revision/issues/7)).
8 changes: 5 additions & 3 deletions newrevisor.sty
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{newrevisor}[2023/05/12 v0.6 newrevisor]
\ProvidesPackage{newrevisor}[2023/05/12 v0.7 newrevisor]
% A LaTeX style file for providing comments and revising text
%
% Author: Manuel Lopez-Ibanez <[email protected]>
Expand Down Expand Up @@ -153,9 +153,10 @@
\else
\RequirePackage{pdfcolfoot} % For colored footnotes split across pages.
\let\svthefootnote\thefootnote
\gdef\infootnote{F}
\newcommand\colorfootnote[2][black]{%
\def\thefootnote{\color{#1}\svthefootnote}%
\footnote{\color{#1}#2}\def\thefootnote{\color{black}\svthefootnote}}
\footnote{\def\infootnote{T}\color{#1}#2\def\infootnote{F}}\def\thefootnote{\color{black}\svthefootnote}}
%% TODO: Make this a package option
%% A different implementation in case the above one does not work, not sure which one is better
% \makeatletter
Expand All @@ -166,8 +167,9 @@
\NewDocumentCommand\newrevisor@RevInlineComment{O{red}m+m}{%
\hskip 0pt\begingroup\ifmmode\text{\color{#1}\normalfont\footnotesize\bfseries\rmfamily[{\smaller #2}: #3]}\else\color{#1}\normalfont\footnotesize\bfseries\rmfamily[{\smaller #2}: #3]\fi\endgroup}
\NewDocumentCommand\newrevisor@RevComment{O{red}m+m}{%
\if T\infootnote\newrevisor@RevInlineComment[#1]{#2}{#3}\else%
\@ifundefined{@captype}{\protect\colorfootnote[#1]{{\textbf{[{\smaller #2}: #3]}}}}%
{\newrevisor@RevInlineComment[#1]{#2}{#3}}}
{\newrevisor@RevInlineComment[#1]{#2}{#3}}\fi}
\else
\newcommand\newrevisor@RevInlineComment[3][red]{}
\newcommand{\newrevisor@RevComment}[3][red]{}
Expand Down

0 comments on commit c04f77b

Please sign in to comment.