tikzcd-editor icon indicating copy to clipboard operation
tikzcd-editor copied to clipboard

Add `ampersand replacement` option

Open aDotInTheVoid opened this issue 5 years ago • 6 comments
trafficstars

In the beamer class, one needs [ampersand replacement=\&] to make it work. source

It would be nice if there was an option to do this, or if it was the default. I'm not sure if there is a situation in which this behaviour isn't desirable

I'd be willing to implement this if you could point out the relevant parts of the code.

aDotInTheVoid avatar Jun 01 '20 21:06 aDotInTheVoid

If we use \& as separator as default, how would one specify a literal & in one of the cells?

yishn avatar Jun 01 '20 22:06 yishn

Hmm, as I see it there are 3 approaches

  • Option 1 is to use something really long (\definatly_unique_cell_seperator), but that decreases the readability and editability of the production
  • Option 2 is to make it configurable within the webpage
  • Option 3 is to no nothing, and make beamer users manually tweak the output

I'm not sure which is best.

On Mon, Jun 1, 2020 at 11:32 PM Yichuan Shen [email protected] wrote:

If we use & as separator as default, how would one specify a literal & in one of the cells?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yishn/tikzcd-editor/issues/50#issuecomment-637160142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3SWKRUWC7KQVCPAQEPKHDRUQT7HANCNFSM4NQE5GKQ .

aDotInTheVoid avatar Jun 04 '20 20:06 aDotInTheVoid

One of the StackExchange solutions proposes to specify [fragile] on the frame environment. That looks like the cleanest solution. Are there any drawbacks to that?

yishn avatar Jun 04 '20 22:06 yishn

Not that I know of, so I guess I'll just use that.

aDotInTheVoid avatar Jun 09 '20 20:06 aDotInTheVoid

Sorry for digging this out again.

One of the StackExchange solutions proposes to specify [fragile] on the frame environment. That looks like the cleanest solution. Are there any drawbacks to that?

See https://tex.stackexchange.com/questions/136240/drawbacks-of-using-fragile-frames-in-beamer:

With fragile every contents is written into an external file and read back. Not a big deal but makes compiling slow.

Apparently the fragile option is incompatible with the allowframebreaks option, without some awkward finagling.

Especially the first point about slow compilation is a valid concern that I share, hence, I am always using ampersand replacement. It would be cool if tikzcd-editor supported this as an output and input (for parsing) format.

ComFreek avatar Sep 25 '20 17:09 ComFreek

Hm... in that case we should allow the user to specify their own ampersand replacement inside the code box. Here are some steps that need to be done:

  • [ ] Add an ampersand replacement option to the render function in jsx-tikzcd
  • [ ] Publish new jsx-tikzcd version and update jsx-tikzcd version in tikzcd-editor
  • [ ] Add UI controls for user to specify their ampersand replacement in CodeBox.js
  • [ ] Hook up ampersand replacement input with actual code generation in App.js and diagram.js

yishn avatar Sep 26 '20 11:09 yishn