Tag Info

New answers tagged

2

Your problem is not to expand the \Author (\index will do it anyway) but to prevent the expansion of \DTLformatauthor when the index is written. So use \index[test]{\protect\DTLformatauthor\Author}}


2

Instead of trying to get the expanded authorlist in the toc, you could pass only the cite key and then call the database again in the toc: \documentclass{memoir} \usepackage{databib} \newcommand\printauthorlist{} \DeclareRobustCommand\printauthorlist[1]{% \DTLforeachbibentry[\DTLbibfieldiseq{CiteKey}{#1}]{data}{\DTLformatauthorlist}} \begin{document} ...


1

The \DTLformatauthorlist seems to be meant just for printing immediately the current author list. I propose to get its definition and convert it to another macro with an argument, which we extract from the database in expandable form with \DTLbibfieldlet. The same macro should be used for the title and the temporary macros should be expanded (once) ...


0

This is too long for a comment I suspect, so I'll just put it here. Something that helped me a lot but I don't see it mentioned anywhere is the following. It might be really obvious, but it might also not. Take the situation as follows. You have your two macros, one which you want to expand, the other which must hold the expanded definition: ...


2

A solution with expl3: \documentclass{article} \usepackage{xcolor} \usepackage{expl3} \ExplSyntaxOn \cs_new_protected:Npn \ae_test:n #1 { \textcolor{red}{\fbox{#1}}~ \textcolor{green}{\fbox{#1}}~ \textcolor{blue}{\fbox{#1}} } \group_begin: \tl_set:No \l_tmpa_tl { \ae_test:n { #1 } } \use:x { \group_end: \cs_new:Npn \exp_not:N \aetest ##1 { ...


4

You can use \unexpanded from eTeX using the following code: \def\aeAtest#1{\textcolor{red}{\fbox{#1}}} \def\eonce#1{\unexpanded\expandafter{#1{##1}}} \edef\tmp{\def\noexpand\OUT##1{expanded before \eonce{\aeAtest} after.}}\tmp \message{\meaning\OUT} % \OUT#1 -> expanded before \textcolor {red}{\fbox {#1}} after. Edit Another usage of the same idea ...


3

To work around the expansion issues point to by @HeikoOberdiek, I've come up with the following work around \edef\aetest#1{\noexpand\def\noexpand\ae@tmp{#1}%% \unexpanded\expandafter{\ae@test{\ae@tmp}}} though I'll have to test it out a bit before I'm sure that it really does accomplish what I want.


7

The # gets doubled inside \unexpanded. A workaround with \expandafter: \documentclass{article} \usepackage{xcolor} \makeatletter \def\ae@test#1{\textcolor{red}{\fbox{#1}}} \expandafter\def\expandafter\aetest\expandafter#\expandafter1\expandafter{% \ae@test{#1}% } \makeatother \begin{document} \aetest{Hello} \end{document} Then \aetest has the ...


0

This is not a direct answer to the question. Rather it illustrates the outcome of the process which involved this question. %% Copyright 2015 Clea F. Rees \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{prooftrees}[2015/05/10 v0.05 prooftrees] \RequirePackage{forest} \newcounter{prooftree@countlevels}% count the levels in the proof tree ...


4

replace by and other dynamic tree keys check if their argument is a node specification simply by checking if the argument starts with a [ (see the definition of \forest@nodehandleby@nnb@checkfirst). In your case, it does not, so forest tries to interpret @+\prooftreeleaping{#1}{#2} as a node walk. I guess this should be mentioned in the documentation. Will ...


1

This won't work. \citet is a much to complicated macro, you can't retrieve its output is a simple way. If you really want to stick to natbib (in biblatex language support is build in) you should manipulate the .bst-file. Save it under another name in your document folder and then change the fixed words so that they issue commands. E.g. FUNCTION{fr.and}{ ...


3

Package acronym The internal expandable version of \acl is \AC@acl. Then \index inside the macro \acidx will write the expanded long version of the acronym: \documentclass{article} \usepackage{acronym} \usepackage{makeidx} \makeindex \makeatletter \newcommand*{\acidx}[1]{% \ac{#1}\index{\AC@acl{#1}}% } \makeatother \acrodef{ABC}{alphabet} ...



Top 50 recent answers are included