Skip to content

Commit

Permalink
norelsize option
Browse files Browse the repository at this point in the history
  • Loading branch information
MLopez-Ibanez committed Aug 27, 2024
1 parent 92b9dd2 commit b7c212c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* `inline` : make comments appear inline instead of footnotes or margin notes.
* `hide=[before|after]`: hide all comments. Furthermore, either keep added text and hide deleted text (`hide=before`) or keep deleted text and hide added text (`hide=after`). Just using `hide` is equivalent to `hide=before`.
* `soul`: Use package [soul](https://ctan.org/pkg/soul?lang=en) instead of [ulem](https://ctan.org/pkg/ulem?lang=en) for crossing out deleted text. This may be useful if a conflict with another package prevents using the [ulem](https://ctan.org/pkg/ulem?lang=en) package.

* `norelsize`: Disable use of the [relsize](https://ctan.org/pkg/relsize?lang=en) package. Useful to keep compatibility with broken LaTeX templates like the one from Wiley.

## Usage

This package defines 3 commands:
Expand Down
12 changes: 9 additions & 3 deletions newrevisor.sty
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
\PassOptionsToPackage{dvipsnames}{xcolor}
\RequirePackage{xcolor}
\RequirePackage{amstext} % \text
\RequirePackage{relsize}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family=REVISOR,
Expand All @@ -45,6 +44,13 @@
\DeclareBoolOption{inline} % inline comments
\ProcessKeyvalOptions*

\ifREVISOR@norelsize
\let\newrevisor@smaller\footnotesize
\else
\RequirePackage{relsize}
\let\newrevisor@smaller\smaller
\fi

% https://tex.stackexchange.com/questions/110780/remove-macro-from-list-like-lof
\def\vanishprotect{\ifx\protect\@typeset@protect%
\expandafter\@firstofone\else\expandafter\@gobble\fi}
Expand Down Expand Up @@ -165,10 +171,10 @@
% \makeatother
\ifx\REVISOR@hide\@empty
\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}
\hskip 0pt\begingroup\ifmmode\text{\color{#1}\normalfont\footnotesize\bfseries\rmfamily[{\newrevisor@smaller #2}: #3]}\else\color{#1}\normalfont\footnotesize\bfseries\rmfamily[{\newrevisor@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]}}}}%
\@ifundefined{@captype}{\protect\colorfootnote[#1]{{\textbf{[{\newrevisor@smaller #2}: #3]}}}}%
{\newrevisor@RevInlineComment[#1]{#2}{#3}}\fi}
\else
\newcommand\newrevisor@RevInlineComment[3][red]{}
Expand Down

0 comments on commit b7c212c

Please sign in to comment.