3

I am looping through authors from YAML, but allowing for a standard block in my template. My author block looks like this:

\author{
    $for(author)$
        $if(author.name)$
            $author.name$$if(author.affiliation)$ \tiny $author.affiliation$$endif$
        $else$
            $author$
        $endif$
    $endfor$
}

Why am I getting "Author" and "True"? I gather the second "True" is because $author$ has attributes (name)? but how can they both be true. If I reformat it like:

\author{
    $for(author)$
        $if(author.name)$
            author.name is true
        $else$
            author.name is also not true
        $endif$
    $endfor$
}

it tells me both.

4
  • 5
    The conditional stuff here doesn't look like it's anything to do with TeX: I assume something is spitting out other code to be filled in. As it is, that makes me suspect the question is off-topic.
    – Joseph Wright
    Commented Aug 13, 2014 at 19:06
  • 1
    Ah drat! You're right, and I was just being daft. This template feature is a function of Pandoc. Do Pandoc questions belong anywhere on this stack? Thanks. Sorry for the silly mistake.
    – theherk
    Commented Aug 13, 2014 at 20:04
  • 2
    Sorry if it's a silly comment, but maybe you could take a look at your for(each) statement. IMHO the conditional is not failing, it's being checked against different iterations. Commented Aug 13, 2014 at 20:30
  • 4
    I'm voting to close this question as off-topic as the question is about Yaml/Pandoc and has nothing to do with TeX.
    – Johannes_B
    Commented Feb 11, 2015 at 16:43

0

Browse other questions tagged .