3

I am writing a document in the revtex4-1 class in LyX. I would like to apply widetext to some of my longer formulas. However, selecting the widetext environment in Lyx would cause the entire paragraph to switch to a single column, including all regular text, instead of just the equation. How would I target the equation specifically?

Torbjørn T.
  • 206,688
Deep Blue
  • 163

1 Answers1

6
  1. Hit enter to start a new paragraph.
  2. Add the widetext environment
  3. Add equation inside widetext enviroment.

Another option could be using ERTs for starting and ending the environment:

  1. Hit Ctrl + L to open an ERT, and write \begin{widetext} in it.
  2. Hit , the right arrow key, to move the cursor outside the ERT.
  3. Start a displayed math env with for example Ctrl + Shift + M, and write your equation.
  4. Hit , the right arrow key, to move the cursor outside the math inset.
  5. Without hitting enter or anything, hit Ctrl + L to open a second ERT, and write \end{widetext} in it.
  6. Continue the sentence immediately after the ERT, no space, no line feed.

Here is what it might look like in LyX, and the code it generates:

enter image description here

You could also add a newline inside the ERTs, before \begin{widetext} and after \end{widetext}. It wouldn't make a new paragraph, but it would place those on their own lines of code.

Torbjørn T.
  • 206,688
  • I'd rather not go that route. Syntactically, there is a reason that text and equations are grouped together in a single paragraph. For example, day I would like to write: "... are related by Einstein's famous formula, $$E=mc^2,$$ where $c$ is the speed of light." – Deep Blue Feb 12 '18 at 08:05
  • 1
    @BenjiRemez Looking at the generated code, you don't actually get a paragraph break before the widetext, though you do get one after. Using ERTs to start and end the widetext might be an option, I'll edit in a bit. (Completely unrelated: if you find yourself writing LaTeX code, don't use $$ ... $$ for displaymath, cf. https://tex.stackexchange.com/q/503) – Torbjørn T. Feb 12 '18 at 08:28
  • Yes, I was thinking along the lines of manual ERTs, but I just wondered if there might be a more elegant solution than that. – Deep Blue Feb 12 '18 at 09:42