2

I am typing an article in LyX. I use ERT to input tikz-cd. The diagram is faithfully shown in the output, but always inline. I would like to make it display, precisely like a Display Formula in LyX, so that the diagram's alignment is Center but the alignment of the rest of the paragraph remains Justified. How could I achieve that?

I have tried to put the ERT box containing tikz-cd into a Display Formula box by selecting the ERT box and pressing Ctrl+Shift+M, but that just removes the ERT from the tikz-cd code leaving it as plain text.

I have also tried to save the diagram in a separate document and to insert it using Insert -> File -> Child Document, and selecting Input for the Include Type, but again I get the diagram inline.

Note that I can make the diagram's alignment Center by putting it into a separate paragraph and selecting Center alignment for the paragraph, but that is not what I am looking for because the diagram is a part of the sentence so I don't want to rip it out, I just want to display it.

Here is an example of the issue.

lyx code pdf output

Regardless of the outcome, thank you for your good will!

2
  • Welcome to tex.se. Please give a minimal example .lyx file. wiki.lyx.org/FAQ/MinimalExample
    – scottkosty
    Oct 25 '20 at 1:40
  • @scottkosty I haven't found an option to upload a file, so I have uploaded screenshots, instead. I hope that they suffice.
    – A. Lane
    Oct 25 '20 at 2:00
2

I have resolved the issue by simple typing \[ and \], respectively, before and after the tikz-cd code within the ERT box. Now it seems like an obvious thing to try in the first place, but last night I was too busy trying to find a LyX way to display the diagram written within the ERT box that it didn't occur to me to display it from within the ERT box.

I apologize for posting the question too soon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.