# Best way to render name variable twice

**URL:** https://discourse.citationstyles.org/t/best-way-to-render-name-variable-twice/1600
**Category:** CSL Usage
**Created:** [February 28, 2020, 3:09pm UTC](https://discourse.citationstyles.org/t/best-way-to-render-name-variable-twice/1600 "2020-02-28T15:09:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Denis\_Maier](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@Denis\_Maier](https://discourse.citationstyles.org/u/Denis_Maier)
#### Post date: [February 28, 2020, 3:09pm UTC](https://discourse.citationstyles.org/t/best-way-to-render-name-variable-twice/1600/1 "2020-02-28T15:09:47Z")

</div>

Hey, I need to render the variable `editor` twice in a reference to get this output:

> **Hancké, Rhodes, and Thatcher 2007**  
> Bob Hancké, Martin Rhodes, and Mark Thatcher, editors, _Beyond Varieties of Capitalism: Conflict, Contradiction, and Complementarities in the European Economy_ . Oxford and New York, NY: Oxford University Press, 2007.

What would be the best way to achieve this? The combination of these macros does not work:

```auto
  <macro name="label">
    <choose>
      <if variable="issued accessed" match="any">
        <group delimiter=" ">
          <text macro="contributors-short"/>
          <text macro="date-in-text"/>
        </group>
      </if>
      <else>
        <group delimiter=", ">
          <text macro="contributors-short"/>
          <text macro="date-in-text"/>
        </group>
      </else>
    </choose>
  </macro>
  <macro name="contributors">
    <group delimiter=". ">
      <names variable="author">
        <name and="text" delimiter-precedes-last="always"/>
        <substitute>
          <text macro="editor"/>
          <text macro="translator"/>
          <choose>
            <if type="webpage post-weblog" match="any">
              <text variable="container-title"/>
            </if>
          </choose>
        </substitute>
      </names>
      <text macro="recipient"/>
    </group>
  </macro>

```

This works well for items with authors, but fails for editors. I get:

> **Hancké, Rhodes, and Thatcher 2007**  
> _Beyond Varieties of Capitalism: Conflict, Contradiction, and Complementarities in the European Economy_ . Oxford and New York, NY: Oxford University Press, 2007.

The problem is that the editors are rendered in `cs:substitute` will be suppressed in the remainder of the cite. What would be the best and most elegant way to circumvent this? Should I replace the  
first `substitute`-construction with `choose`, `if`, `else`? Or is there something simpler?

---

<div class="post-metadata">

### Author: ![Sebastian\_Karcher](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/sebastian_karcher/32/176_2.png) [@Sebastian\_Karcher](https://discourse.citationstyles.org/u/Sebastian_Karcher)
#### Post date: [February 28, 2020, 3:28pm UTC](https://discourse.citationstyles.org/t/best-way-to-render-name-variable-twice/1600/2 "2020-02-28T15:28:35Z")

</div>

> [@Denis\_Maier](#):
>
> What would be the best and most elegant way to circumvent this? Should I replace the  
> first `substitute` -construction with `choose` , `if` , `else` ?

Yes, this exactly; there’s no simpler way.

---

<div class="post-metadata">

### Author: ![bwiernik](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/bwiernik/32/438_2.png) [@bwiernik](https://discourse.citationstyles.org/u/bwiernik)
#### Post date: [February 29, 2020, 8:24am UTC](https://discourse.citationstyles.org/t/best-way-to-render-name-variable-twice/1600/3 "2020-02-29T08:24:44Z")

</div>

Specifically, I would suggest changing your label macro to not call the other macros, but rather to have its own logic.

---

<div class="post-metadata">

### Author: ![Denis\_Maier](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@Denis\_Maier](https://discourse.citationstyles.org/u/Denis_Maier)
#### Post date: [February 29, 2020, 3:21pm UTC](https://discourse.citationstyles.org/t/best-way-to-render-name-variable-twice/1600/4 "2020-02-29T15:21:32Z")

</div>

Ok. Thank you both for your feedback.
