How to output "No Author" for works with no author
I am right now putting together a citation style where works with an unknown author are introduced by the term "Anon." (or O. A. as the style is in German). I am using a this macro, but this does not lead to the required results.
The relevant macro is called "primary-contributor" (beginning on line 14).
<term name="anonymous">No Author</term>
After the similar term line for editor that is already there.
You can also remove the choose/if logic at the start of the primary-contributors macro and just add
<text term="anonymous"/>
after editor in the substitute section.It works if I change match ="none" to match="any", which is, of course, something different?
Still no change. I've also tried adding another substitute section, but this does not give me "o.A." either.
Oh, I am using the example citations in the visual editor. (The Webpage CSL by example has no author and editor, so I think it should give me o.A., right?)
https://validator.citationstyles.org/?url=https://hastebin.com/raw/eyobezamuq&version=1.0.1
Still no "no author"-term.
<macro name="anon">
<text term="anonymous"/>
</macro>
And then call that in substitute.
I'd be also interested in why calling a text term directly doesn't work.
By the way: How do you post code in this forum?
<names>
get treated as a group. Groups have an implicit conditional that, if the group contains any variable, any terms or values in that group are only rendered if at least one variable is present (see http://docs.citationstyles.org/en/stable/specification.html#group ). That's obviously not the case for names if no author or editor is present, so the term doesn't get printed. You can prevent the implicit conditional in groups by wrapping terms in macros, which is the solution above.