Skip to content
Snippets Groups Projects
Commit 71e797c0 authored by Michael Kohlhase's avatar Michael Kohlhase
Browse files

adding a hideOP option that hides old parts

parent 25fb1e58
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
% %
% \iffalse % \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{ed}[2020/02/12 v1.9 Editorial Notes] %<package>\ProvidesPackage{ed}[2020/03/24 v1.9 Editorial Notes]
% %
%<*driver> %<*driver>
\documentclass[twoside]{ltxdoc} \documentclass[twoside]{ltxdoc}
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
% \changes{v1.8}{2012/01/29}{adding \texttt{edstub} environment} % \changes{v1.8}{2012/01/29}{adding \texttt{edstub} environment}
% \changes{v1.8}{2012/06/29}{adding \texttt{marginnote} option} % \changes{v1.8}{2012/06/29}{adding \texttt{marginnote} option}
% \changes{v1.9}{2020/02/12}{documenting \texttt{pdfbookmarks} option} % \changes{v1.9}{2020/02/12}{documenting \texttt{pdfbookmarks} option}
% \changes{v1.9}{2020/03/24}{adding the \texttt{hideOP} option}
% %
% \GetFileInfo{ed.sty} % \GetFileInfo{ed.sty}
% %
...@@ -106,11 +107,17 @@ ...@@ -106,11 +107,17 @@
% whitespace-collapsing algorithm and bring it to output two spaces in the document % whitespace-collapsing algorithm and bring it to output two spaces in the document
% instead of just one as expected |text\ednote{|\ldots|}|\textvisiblespace|text| should be % instead of just one as expected |text\ednote{|\ldots|}|\textvisiblespace|text| should be
% used instead! This |hide| option useful for preparing ``clean'' version for outside % used instead! This |hide| option useful for preparing ``clean'' version for outside
% consumption without losing the management metadata. In some situations the |\marginpar| % consumption without losing the management metadata.
% decorations generated by editorial notes are disallowed, for these situations the |ed| %
% package has the \DescribeMacro{marginnote} that uses notes by the |marginnote| package, % The \DescribeMacro{hideOP}|hideOP| option signals the |ed| package to hide the |oldpart|
% and if that does not help, the \DescribeMacro{nomargins}|nomargins| option that disables % environments (and the corresponding notes) as well.
% them completely. Finally, the \DescribeMacro{pdfbookmarks}|pdfbookmarks| option propts %
% In some situations the |\marginpar| decorations generated by editorial notes are
% disallowed, for these situations the |ed| package has the \DescribeMacro{marginnote}
% that uses notes by the |marginnote| package, and if that does not help, the
% \DescribeMacro{nomargins}|nomargins| option that disables them completely.
%
% Finally, the \DescribeMacro{pdfbookmarks}|pdfbookmarks| option propts
% the |ed| package to add ``ednote entries'' into the pdf table of contents (the toc at % the |ed| package to add ``ednote entries'' into the pdf table of contents (the toc at
% the left of your PDF reader) that give a good overview over the ednote distribution. % the left of your PDF reader) that give a good overview over the ednote distribution.
% %
...@@ -253,6 +260,7 @@ ...@@ -253,6 +260,7 @@
% \begin{macrocode} % \begin{macrocode}
%<*package> %<*package>
\newif\ifshowednotes\showednotesfalse \newif\ifshowednotes\showednotesfalse
\newif\ifhideOP\hideOPfalse
\newif\ifmargins\marginstrue \newif\ifmargins\marginstrue
\newif\ifmarginnote\marginnotefalse \newif\ifmarginnote\marginnotefalse
\newif\ifednotebookmarks\ednotebookmarksfalse \newif\ifednotebookmarks\ednotebookmarksfalse
...@@ -264,6 +272,7 @@ ...@@ -264,6 +272,7 @@
\DeclareOption{hide}{\showednotesfalse\message{ed.sty: hiding ednotes}} \DeclareOption{hide}{\showednotesfalse\message{ed.sty: hiding ednotes}}
\DeclareOption{draft}{\showednotestrue\message{ed.sty: showing ednotes}} \DeclareOption{draft}{\showednotestrue\message{ed.sty: showing ednotes}}
\DeclareOption{final}{\showednotesfalse\message{ed.sty: hiding ednotes}} \DeclareOption{final}{\showednotesfalse\message{ed.sty: hiding ednotes}}
\DeclareOption{hideOP}{\hideOPtrue\message{ed.sty: hiding oldparts}}
\DeclareOption{nomargins}{\marginsfalse} \DeclareOption{nomargins}{\marginsfalse}
\DeclareOption{marginnote}{\marginnotetrue} \DeclareOption{marginnote}{\marginnotetrue}
\DeclareOption{pdfbookmarks}{\ednotebookmarkstrue} \DeclareOption{pdfbookmarks}{\ednotebookmarkstrue}
...@@ -279,9 +288,8 @@ ...@@ -279,9 +288,8 @@
\else \else
\RequirePackage{verbatim} \RequirePackage{verbatim}
\fi \fi
\ifednotebookmarks \ifhideOP\RequirePackage{comment}\fi
\RequirePackage{hyperref} \ifednotebookmarks\RequirePackage{hyperref}\fi
\fi
% \end{macrocode} % \end{macrocode}
% This ends the package setup code, so we can come to the implementation of the % This ends the package setup code, so we can come to the implementation of the
% functionality of the package. % functionality of the package.
...@@ -461,6 +469,7 @@ ...@@ -461,6 +469,7 @@
\newenvironment{oldpart}[1]% \newenvironment{oldpart}[1]%
{\ed@part{#1}{Old Part}\b@oldpart@label\b@oldpart@margin\ifshowednotes\color{gray}\fi} {\ed@part{#1}{Old Part}\b@oldpart@label\b@oldpart@margin\ifshowednotes\color{gray}\fi}
{\ended@part\e@oldpart@margin} {\ended@part\e@oldpart@margin}
\ifhideOP\excludecomment{oldpart}\excludecomment{Oldpart}\fi
% \end{macrocode} % \end{macrocode}
% \end{environment} % \end{environment}
% %
......
No preview for this file type
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
%% ed.dtx (with options: `package') %% ed.dtx (with options: `package')
%% %%
\NeedsTeXFormat{LaTeX2e}[1999/12/01] \NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{ed}[2012/01/29 v1.8 Editorial Notes] \ProvidesPackage{ed}[2020/03/24 v1.9 Editorial Notes]
\newif\ifshowednotes\showednotesfalse \newif\ifshowednotes\showednotesfalse
\newif\ifhideOP\hideOPfalse
\newif\ifmargins\marginstrue \newif\ifmargins\marginstrue
\newif\ifmarginnote\marginnotefalse \newif\ifmarginnote\marginnotefalse
\newif\ifednotebookmarks\ednotebookmarksfalse \newif\ifednotebookmarks\ednotebookmarksfalse
...@@ -16,6 +17,7 @@ ...@@ -16,6 +17,7 @@
\DeclareOption{hide}{\showednotesfalse\message{ed.sty: hiding ednotes}} \DeclareOption{hide}{\showednotesfalse\message{ed.sty: hiding ednotes}}
\DeclareOption{draft}{\showednotestrue\message{ed.sty: showing ednotes}} \DeclareOption{draft}{\showednotestrue\message{ed.sty: showing ednotes}}
\DeclareOption{final}{\showednotesfalse\message{ed.sty: hiding ednotes}} \DeclareOption{final}{\showednotesfalse\message{ed.sty: hiding ednotes}}
\DeclareOption{hideOP}{\hideOPtrue\message{ed.sty: hiding oldparts}}
\DeclareOption{nomargins}{\marginsfalse} \DeclareOption{nomargins}{\marginsfalse}
\DeclareOption{marginnote}{\marginnotetrue} \DeclareOption{marginnote}{\marginnotetrue}
\DeclareOption{pdfbookmarks}{\ednotebookmarkstrue} \DeclareOption{pdfbookmarks}{\ednotebookmarkstrue}
...@@ -27,9 +29,8 @@ ...@@ -27,9 +29,8 @@
\else \else
\RequirePackage{verbatim} \RequirePackage{verbatim}
\fi \fi
\ifednotebookmarks \ifhideOP\RequirePackage{comment}\fi
\RequirePackage{hyperref} \ifednotebookmarks\RequirePackage{hyperref}\fi
\fi
\newcommand\ednoteshape{\sffamily} \newcommand\ednoteshape{\sffamily}
\newcounter{ednote} \newcounter{ednote}
\newcommand\ed@foot[3]% text, type, label \newcommand\ed@foot[3]% text, type, label
...@@ -87,6 +88,7 @@ ...@@ -87,6 +88,7 @@
\newenvironment{oldpart}[1]% \newenvironment{oldpart}[1]%
{\ed@part{#1}{Old Part}\b@oldpart@label\b@oldpart@margin\ifshowednotes\color{gray}\fi} {\ed@part{#1}{Old Part}\b@oldpart@label\b@oldpart@margin\ifshowednotes\color{gray}\fi}
{\ended@part\e@oldpart@margin} {\ended@part\e@oldpart@margin}
\ifhideOP\excludecomment{oldpart}\excludecomment{Oldpart}\fi
\newcommand\todolabels[2]{\def\b@todo@label{#1}\def\e@todo@label{#2}} \newcommand\todolabels[2]{\def\b@todo@label{#1}\def\e@todo@label{#2}}
\newcommand\todomargins[2]{\def\b@todo@margin{#1}\def\e@todo@margin{#2}} \newcommand\todomargins[2]{\def\b@todo@margin{#1}\def\e@todo@margin{#2}}
\newcommand\b@todo@label{ToDo}\newcommand\e@todo@label{Done} \newcommand\b@todo@label{ToDo}\newcommand\e@todo@label{Done}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment