1

I am using the \processifversion{tag} to create various versions of report. I have two questions on how to use this command or its equivalent \begin{tag} ... \end{tag}:

In a table, I wanted to pick up a specific line for a "tag" using "\processifversion{tag}{a & b & c \\\hline}", but got error message "Missing } inserted". How to have \processifversion work together with table (tabular environment)?

I intended to use \processifversion{tag1, tag2}{TEXT} to include "TEXT" when tag1 or tag2 is included. However, I found with this, "TEXT" is always included even tag1 and tag2 are both excluded. How to fix this?

I added the following simple sample. This code works. However, if I want to output "Hello PDF world!" by turn on either "PDF1" and "PDF2", what is the most efficient way to do it?

The real case I am working is more complicated: 1. I need to output 8 different versions, where some versions may have common part; 2. the common part could be very lengthy. So it may not be reasonable to repeat the common part for each tag.

\documentclass[a4paper,11pt]{article}
\author{Al Alexander}
\title{}

\usepackage{versions} \includeversion{PDF} \excludeversion{HTML}

\begin{document} \maketitle \tableofcontents

% if "PDF" has been included, do this: \processifversion{PDF}{Hello PDF world!}

% if "HTML" has been included, do this: \processifversion{HTML}{Hello HTML world!}

\end{document}

Ulrike Fischer
  • 327,261
  • Please, make a minimal example, in particular do mention the packages you're using. There are thousands of them and it's likely that just a few here have ever heard about \processifversion. I didn't, for instance. – egreg Apr 02 '21 at 21:22
  • Here is a short sample: \documentclass[a4paper,11pt]{article} \author{Al Alexander} \title{}

    \usepackage{versions} \includeversion{PDF} \excludeversion{HTML}

    \begin{document} \maketitle \tableofcontents

    % if "PDF" has been included, do this: \processifversion{PDF}{Hello PDF world!}

    % if "HTML" has been included, do this: \processifversion{HTML}{Hello HTML world!}

    \end{document}

    – Tommy Cat Apr 02 '21 at 21:36
  • Please, add the code to your question. – egreg Apr 02 '21 at 21:44

0 Answers0