# Editing-like style in Lyx

Is it possible to achieve the below in Lyx (words above/under sentences)?

• Yes, if you're willing to fork out some ERTs... – Werner May 20 '14 at 21:32
• I am aware that I will have to go through that road. – blackened May 20 '14 at 22:41
• You don't have to use ERT, see my answer below. LyX has come quite far. – Rasmus May 21 '14 at 9:22

Yes, you can do that using \overset, found under Frame decoration in the Math toolbar.

In the \overset, you'll be in math mode, so you have to enter normal text mode (type \mbox, or use the same shortcut you entered math mode with). Then enter the text you want something under.

You have to do something similar for the upper box. The first thing I found that gets you a small font while italic was to enter text mode, then math mode again, and then choose Script (small) style from the Styles icon in the math tool bar. Space between words in math mode may be inserted using the Math spaces icon also in the math toolbar. There may be a more elegant way to do it.

With a longer sentence over a single word, the words around will be pushed "out of the way" as the word in the lower box and the box above become one entity. I handled this in two different way: In the second paragrapg, the \overset contains only [the], and then I inserted a vertical space on each side, with a custom space of -18pt. In the third paragraph, the lower \overset box contains operation [is the variety of] services and the content of the upper is centered by insert a couple of math space before the text (start with \phantom, else they will be ignored.

The content of the .lyx file is below. If you just copy that into an empty file (or create a .lyx file and overwrite it's content), you should be good to go (except replace families with households ;) ). If not, clear out the preample (or install any missing package -- but that's just for the font).

#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\textclass article
\begin_preamble

\usepackage{charter}
\usepackage[bitstream-charter]{mathdesign}

\end_preamble
\use_default_options true
\begin_modules
theorems-ams-bytype
\end_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman charter
\font_sans default
\font_typewriter default
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 0
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 0
\use_package mhchem 1
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 2cm
\topmargin 2cm
\rightmargin 11cm
\bottommargin 2cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false

\begin_body

\begin_layout Standard
\noindent
Poor families pay more for
\begin_inset Formula $\overset{\mbox{\ensuremath{{\scriptstyle their}}}}{\mbox{[the]}}$
\end_inset

food [that they buy]
\begin_inset Newline linebreak
\end_inset

because local merchants exploit them.

\begin_inset VSpace defskip
\end_inset

\end_layout

\begin_layout Standard
\noindent
This is a development
\begin_inset space \hspace{}
\length -18pt
\end_inset

\begin_inset Formula $\overset{\mbox{\ensuremath{{\scriptstyle with\,\, indeterminate}}}}{\mbox{[the]}}$
\end_inset

\begin_inset space \hspace{}
\length -18pt
\end_inset

social consequences [of which are indeterminiate].
\end_layout

\begin_layout Standard
\noindent
(Or: This development has indeterminate social
\end_layout

\begin_layout Standard
\noindent
consequences.)
\end_layout

\begin_layout Standard
\noindent
\begin_inset VSpace defskip
\end_inset

\end_layout

\begin_layout Standard
\noindent
Fundamental to our
\begin_inset Formula $\overset{\mbox{\ensuremath{{\scriptstyle \phantom{{\}}}\,\,\,\, are\, our\, many\, community}}}}{\mbox{operation [is the variety of] services}}$
\end_inset

\begin_inset Newline linebreak
\end_inset

[that our company has to offer to the community].
\end_layout

\end_body
\end_document
• You're welcome. If it is what you were looking for, then please mark it as an Accepted using the check mark on the top left :) – Rasmus May 21 '14 at 10:09