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.

Well, I'm not going to do new screenshots now...

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.

enter image description here

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
\textclass article


\use_default_options true
\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
\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_layout Standard
Poor families pay more for 
\begin_inset Formula $\overset{\mbox{\ensuremath{{\scriptstyle their}}}}{\mbox{[the]}}$

 food [that they buy]
\begin_inset Newline linebreak

because local merchants exploit them.

\begin_inset VSpace defskip


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

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

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

 social consequences [of which are indeterminiate].

\begin_layout Standard
(Or: This development has indeterminate social

\begin_layout Standard

\begin_layout Standard
\begin_inset VSpace defskip


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

\begin_inset Newline linebreak

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

|improve this answer|||||
  • 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

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.