Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Since keyreader is based on xkeyval i wonder if it’s possible to make it wokr with xkvview which comes with xkeyval.

\documentclass{scrartcl}

\usepackage{xkvview}
\usepackage{keyreader}

\makeatletter

% recorded
\define@boolkey{LI@package}[li@]{savemode}[true]{}
% not recorded
\krddefinekeys{LI@all}[li@]{%
   cmd/testa/;
}


\begin{document}
\xkvview{}
\end{document}

The example shows that keys defined with the xkeyval way are recognized but not the ones defined via keyreader. I thought keyreader uses the xkeyval commands internally so I expect it to be also in the \xkvview{} list

share|improve this question

1 Answer 1

up vote 3 down vote accepted

keyreader works with xkvview. Load keyreader before xkvview. Here is an example:

\documentclass{article}
\usepackage{keyreader}
\usepackage{xkvview}
\makeatletter
\krddefinekeys{fama}{%
  ord/keya/default;
  cmd/keyb;
  choice/keyc/center/center.do=\def\x##1{#1xx##1},left,right;
  bool/keyd/true;
}
\krddefinekeys{famb}{%
  choice/planet/Earth/Earth.do=\def\x##1{#1##1},Mars,Jupiter;
  bool/space travel/true;
}
\makeatother
\begin{document}
%\xkvview{family=fama,default=[none]}
\xkvview{family=fama}
\end{document}

enter image description here

I have to investigate why keyc is shown twice in this table.

EDIT:

keyc is shown twice because of a bug in the package xkvview. I provide a patch below:

\def\XKV@d@fine@ch@icekey#1[#2]{%
  \let\d@fault\relax
  \XKVV@tabulate{#1}{choice}{#2}%
  \XKV@define@default{#1}{#2}%
  \XKV@d@fine@ch@ic@key{#1}%
}
\def\XKV@d@fine@ch@ic@key#1{%
  \ifx\d@fault\relax
    \let\d@fault\@undefined
  \else
    \XKVV@tabulate{#1}{choice}{[none]}%
  \fi
  \ifXKV@pl\XKV@afterelsefi
    \expandafter\XKV@d@f@ne@ch@ic@k@y
  \else\XKV@afterfi
    \expandafter\XKV@d@f@ne@ch@ic@key
  \fi
  \csname\XKV@header#1\endcsname
}

The patch should be inserted at the end of xkvview or after loading xkvview.

share|improve this answer
    
Thanks for the fast response. I didn’t thick about the loading order. Sometimes it’s a too simple solution … I assume that you’ll fix the bug in a future release, won’t you? –  Tobi Mar 20 '12 at 10:28
    
@Tobi: I am not the maintainer of xkvview package. I will inform the maintainer. I have always wanted to write the keyreader-view package, because I would like to improve xkvview in some ways. –  Ahmed Musa Mar 20 '12 at 13:13
    
Ahh sorry, I misread your answer and thought it was a keyreader bug O:-) Thanks for informing the maintainer :-) –  Tobi Mar 20 '12 at 13:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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