8

I would like to use the tagging package to tag parts of a document, which not only contain text, but also other environments like enumerate. If I use the taggedblock-environment for this, this creates additional vertical space after the taggedblock, see the minimal example below. Is there any way to avoid that? This effectively ruins the layout of my document. :/

One solution would be to replace the taggedblock-environment by the \tagged-command, but I don't want to do that, since the parts of the documents are quite large and every time I forget a } to close the \tagged-command it becomes a mess.

\documentclass{scrartcl}

\usepackage{tagging}

\usetag{mytag}

\begin{document}

%a tagged block
\begin{taggedblock}{mytag}
\begin{enumerate}
    \item 
    foo
    \item
    bar
\end{enumerate}
\end{taggedblock}
%here you have additional vertical space
\begin{enumerate}
    \item 
    foo
    \item
    bar
\end{enumerate}
%here you don't 
\begin{enumerate}
    \item 
    foo
    \item
    bar
\end{enumerate}

\end{document}
7

For strange reasons, the taggedblock environment adds \leavevmode at the end, which is clearly wrong.

\documentclass{scrartcl}

\usepackage{tagging}
\def\endtaggedblock{\endcomment} % we can't use \renewcommand

\usetag{mytag}

\begin{document}

%a tagged block
\begin{taggedblock}{mytag}
\begin{enumerate}
    \item 
    foo
    \item
    bar
\end{enumerate}
\end{taggedblock}
% normal spacing
\begin{enumerate}
    \item 
    foo
    \item
    bar
\end{enumerate}
% normal spacing
\begin{enumerate}
    \item 
    foo
    \item
    bar
\end{enumerate}

\end{document}

enter image description here

  • 3
    "I'm pretty sure there was a reason for the \leavevmode at the time, but the margin of my memory is too small to contain it." – Brent.Longborough Aug 17 '16 at 19:35
  • @Brent.Longborough LOL :) :) – egreg Aug 17 '16 at 19:37
3

This is a clarificatory answer; as the person who "caused the problem in the first place", I don't expect upvotes (nor, hopefully, downvotes)

I am in the process of deprecating the tagged package; Boris Veytsman's multiaudience package is much better thought-out, and Boris is a much better TeXnician than I am.

Here's your original problem, rewritten to use multiaudience:

\documentclass{scrartcl}

\usepackage{multiaudience}

\SetNewAudience{mytag}
\DefCurrentAudience{mytag}

\begin{document}

%a tagged block
\begin{shownto}{mytag}
\begin{enumerate}
    \item 
    foo
    \item
    bar
\end{enumerate}
\end{shownto}
%here you have additional vertical space
\begin{enumerate}
    \item 
    foo
    \item
    bar
\end{enumerate}
%here you don't 
\begin{enumerate}
    \item 
    foo
    \item
    bar
\end{enumerate}

\end{document}
  • 1
    You deserve an upvote, also for the person who "caused the problem in the first place" ! – CarLaTeX Aug 17 '16 at 16:59
0

Just for others which have a similar problem...the tagged command doesn't cause the problem.

The taggedblock blocks also cause problem when using before part and chapter commands. I get unwanted empty pages.

\documentclass[
    paper=a5,
    fontsize=12,
    ]{scrbook}

\usepackage{tagging}

\usetag{myTag-A}
\usetag{myTag-B}

\droptag{myTag-A}

\usepackage{blindtext}

\begin{document}

\begin{taggedblock}{myTag-A}
\part{Test Part A}
\end{taggedblock}

\begin{taggedblock}{myTag-B}
\part{Test Par B}
\end{taggedblock}

\end{document}

I don't have this problem with the tagged command:

\tagged{myTag-A}{
\part{Test Part A}
}

\tagged{myTag-B}{
\part{Test Par B}
}

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.