Replacements in footnotes to MMD

After plenty of forum searching I haven’t seen my issue mentioned anywhere, so here goes a report in the hopes that it will be helpful. I’m using the MMD->Latex option with Scrivener and am making use of the Replacements pane on Compile to make things easier on my workflow between the two. For example, I use !cp($@) to get \citep{$@}. Easier to type, and also lets me easily search all my citations. :slight_smile:

I’m getting to the stage where I am starting to turn comments to myself into footnotes, and was fiddling around with how I wanted to do this now that the Windows version has inspector footnotes. (I like those a lot, by the way.) In both inline and linked footnotes, the following things happened when I tried testing references inside the text and compiling. The first half is what I typed in the footnote in Scrivener and the second half is what showed up in my PDF after going through MMD and LaTeX.

!cp(citationkey) --> !cp(citationkey)

\citep{citationkey} --> extbackslashcitep{citationkey}

--> (Citation)

From this, I’m guessing that MMD works alright (?) inside both types of footnotes, or if not I can at least tell it to bugger off and let me TeX it out. However, replacements don’t work at all. Is there a reason for this, and could it be fixed? Perhaps it’s me just wanting to skip an easy step, but I don’t enjoy having to type the ignore tags everywhere. Usually I shortcut this with inline annotations, but I’m guessing those won’t work in footnotes…

On that note, I was also wondering if there was(/will be/could be) a way to export inspector comments from the whole project but not inline annotations. With my workflow, one of these is helpful for revision purposes and the other is a mess of gunky code… :slight_smile:

Coming at this from a completely different angle, is there a particular aversion to using MMD’s own built-in citation syntax? You need only type [b][][#citationkey][/b], and it will handle the [b]~\citep{citationkey}[/b] conversion for you. Note the hash tag is a required part of the syntax. That distinguishes it from a normal [b][][internal cross-reference][/b].

I prefer replacements for several reasons:

  • Both brackets and the hash symbol are less automatic for my fingers than ! and parentheses, so they take longer to type.
  • The difference between \citep and \citet is less obvious in MMD. (a semicolon? it always confuses me and is much easier to mess up.)
  • I have !cite anyway as a note to myself, which replaces to just “(needs citation)” on the final product.
  • I’ve also added my own command, !cg() or \citegen{}, which leaves me a citation in the genitive for an in-text reference something like “Smith’s (DATE) work on applicatives…”. There is no MMD equivalent for a user-defined command so I have to have it anyway.
  • These all group together nicely and if I want to search citations, I can just put !c in the search bar.

But if replacements in general don’t work in footnotes, then this will impact more than just my particular citation method. Say you are lazy (like me) and have a preset replacement for a name like Koptvetskaja-Tamm (/kopt) or Bo\v{s}kovi’{c} (/bosk) or \phi-complementarity (/PC)-- none of these will replace in a footnote, potentially leaving you with an embarrassing mistake if you don’t notice. Why shouldn’t replacements work in footnotes, especially inline ones?