2

I'd like to create a style file that lets me choose between two versions of a document, one that contains identifying information and one that does not---is "suitable for blind review".

My idea is to enclose the identifying information in the argument \full{...}, the alternative for blind review in \blind{...}, and then select via an option in the style file which of these to print. Here's the minimal style file and a MWE of a corresponding .tex file.

Style file:

\ProvidesPackage{blinding}

\DeclareOption{blind}{%
%%% Code to print blinded version
%
% This code and the next option ("Full") are designed so that the
% source code contains alternatives for identifying
% information. Identifying information is enclosed in \full{...},
% blinded alternative information is enclosed in \blind{...}.
 \newcommand{\blind}[1]{#1}
 \newcommand{\full}[1]{}
}

\DeclareOption{full}{%
%%% Code to print the full version, including identifying information
\newcommand{\blind}[1]{}
\newcommand{\full}[1]{#1}
}

% Sets the default option to "full". (????)
\ExecuteOptions{full}

\ProcessOptions \relax

The idea is that when the "full" option is called, all of the material in \blind{...} is simply skipped, and mutatis mutandis for the "blind" option. And the simple MWE is this.

\documentclass{article}

\usepackage{blinding}

\begin{document}
Some regular materials

\full{something in the full version}

\blind{something blinded}
\end{document}

The options work exactly as I want them to when I call them explicitly from within the .tex document and if the .sty file doesn't have the \ExecuteOptions command. The only problem is that I don't know how to make "full" the default in such a way that I can override

The end result I'm shooting for is this behavior:

  • No option declared by author: print full version
  • "full" option declared by author: print full version
  • "blind" option declared by author: print blind version
1

Your problem is, that the full option in your example is executed first and then the options are evaluated. Because of that, the \newcommand{...}[1]{...} doesn't work in the blind option. Instead you should use \renewcommand:

\ProvidesPackage{blinding}

\DeclareOption{blind}{%
%%% Code to print blinded version
%
% This code and the next option ("Full") are designed so that the
% source code contains alternatives for identifying
% information. Identifying information is enclosed in \full{...},
% blinded alternative information is enclosed in \blind{...}.
 \renewcommand{\blind}[1]{#1}
 \renewcommand{\full}[1]{}
}

\DeclareOption{full}{%
%%% Code to print the full version, including identifying information
\newcommand{\blind}[1]{}
\newcommand{\full}[1]{#1}
}

% Sets the default option to "full". (????)
\ExecuteOptions{full}

\ProcessOptions \relax

This should work when you use the blind option for the blinding-package.

EDIT: But the option full still doesn't work because the \newcommands would be called twice. You might further change it to:

\ProvidesPackage{blinding}

\newcommand{\blind}[1]{}
\newcommand{\full}[1]{#1}

\DeclareOption{blind}{%
%%% Code to print blinded version
%
% This code and the next option ("Full") are designed so that the
% source code contains alternatives for identifying
% information. Identifying information is enclosed in \full{...},
% blinded alternative information is enclosed in \blind{...}.
 \renewcommand{\blind}[1]{#1}
 \renewcommand{\full}[1]{}
}

\DeclareOption{full}{%
%%% Code to print the full version, including identifying information
\renewcommand{\blind}[1]{}
\renewcommand{\full}[1]{#1}
}

\ProcessOptions \relax

This way the full option works (but is completely obsolete, since it doesn't change anything).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.