Hi,

I've found a way to implement ibid. and idem support in the SBL specification under development at https://github.com/jjmccollum/context-sbl (this e-mail essentially repeats my comments in https://github.com/jjmccollum/context-sbl/issues/5), but I'm not sure if my solution is a recommended way to solve the problem, and I'm curious about why the more straightforward approach doesn't work.

I've added useibid and useidem options for the \definebtx command (making them language-dependent by adding them to mult-def.lua, which seems to be how the other options have been implemented). Ideally, I'd like to follow the pattern of the chicago:list:sameauthor setup and use a macro similar to \btxdoifsameaspreviouselse. But since \btxdoifsameaspreviouselse relies on the indexed structure of the bibliographic list to determine what the "previous" entry is, it won't work for my purposes; I need to retrieve the tag of the last entry passed to the \cite command.

I ended up making this work by initializing a global variable via

```
\setxvariables[btx:sbl][previousinlinetag=\empty]
```

in the publ-imp-sbl.mkvi file, resetting it at the end of each citation via

```
\setxvariables[btx:sbl][previousinlinetag=\currentbtxtag]  
```

and checking it in the appropriate places via

```
getvariable{btx:sbl}{previousinlinetag}
```

I initially tried to do this with a simple macro \btx_sbl_previousinlinetag defined in publ-imp-sbl.mkvi (in the same scope as the rest of the specification), but attempting to reset it in the cite setups with \let or \def didn't work. Why doesn't this work? Is the setup for a cite alternative executed in its own scope in a way that would prevent me from updating a variable defined in the scope of the rendering specification? And is there a way to do this that is preferable to using global variables?

Thanks!

Joey