2

I'm fairly new to LyX. I recently imported a template for my Math homework, and it's working perfectly, except for when I use \stackrelthree; my parameters above and below the summation (big sigma) are all over the place, and oddly occurs only for \stackrelthree - not for things like \underset. I'm guessing this has something to do with the templates I'm importing, since it does not have the same affect when using LyX (as a default) without templates. I've attached a picture below to illustrate what my LyX document appears to be and what the evaluation (PDF) appears as

How it appears in the PDF:

Appearance in PDF

How it appears in Lyx:

Appearance in PDF

Here's a Lyx Minimal Example:

#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass scrartcl
\begin_preamble
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Short Sectioned Assignment
% LaTeX Template
% Version 1.0 (5/5/12)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Frits Wenneker (http://www.howtotex.com)
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

% A4 paper and 11pt font size

% Use 8-bit encoding that has 256 glyphs
%\usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage[english]{babel}
% English language/hyphenation
\usepackage{amsfonts}\usepackage{amsthm}% Math packages

\usepackage{lipsum}% Used for inserting dummy 'Lorem ipsum' text into the template

\usepackage{sectsty}% Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps

\usepackage{fancyhdr}% Custom headers and footers
 % Makes all pages in the document conform to the custom headers and footers
\fancyhead{} % No page header - if you want one, create it in the same way as the footers below
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt} % Customize the height of the header

\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)

 % Removes all indentation from paragraphs - comment this line for an assignment with lots of text

%----------------------------------------------------------------------------------------
%   TITLE SECTION
%----------------------------------------------------------------------------------------

\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height

\title{ 
\normalfont \normalsize 
\textsc{AUSTRALIAN NATIONAL UNIVERSITY} \\ [25pt] % Your university, school and/or department name(s)
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge MATH1116, Advanced Mathematics and Applications 2, Assignment 2 \\ % The assignment title
\horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule
}

\author{Charles Bray} % Your name

\date{17 August, 2015} % Today's date or a custom date
\end_preamble
\options paper=a4,fontsize=11pt
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding T1
\font_roman default
\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 false
\use_package amsmath 2
\use_package amssymb 0
\use_package cancel 0
\use_package esint 1
\use_package mathdots 0
\use_package mathtools 0
\use_package mhchem 0
\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
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle fancyplain
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\begin_inset Formula ${\displaystyle \stackrel[i=1]{n}{\sum}a_{i}f_{i}}$
\end_inset


\end_layout

\end_body
\end_document
  • Would like to help but you need to post a LyX minimal example (not that a .lyx file is just a text file so you can copy/paste into your question). Please read this: wiki.lyx.org/FAQ/MinimalExample – scottkosty Aug 17 '15 at 4:48
  • @scottkosty I uploaded a minimal example (lyx file) to OneDrive; is that okay? – charl1e Aug 17 '15 at 5:07
  • actually it's better if you paste it here. It is just a text file. And who knows how long you will keep the link to your OneDrive. People might find this question with the same problem you had and it might help them to see your minimal example. – scottkosty Aug 17 '15 at 5:31
  • 1
    Also, instead of using stackrel you might consider the following: create the sum sign. Then, in LyX press _ to put it in subscript. Put i=1 in the subscript. Then press space (this gets you out of the subscript). Then press ^ (this puts you in the super script) and type n. Finally (with the cursor still in the superscript), go to Edit > Math > Change Limits Type and check "Display". Does that work how you want it? – scottkosty Aug 17 '15 at 5:44
  • I added two answers. One quick fix for your example document, and one using the explanation of how to use the subscript and superscript. – scottkosty Aug 17 '15 at 6:30
3

Add the line

\usepackage{stackrel}

to the top of your preamble in Document > Settings > LaTeX Preamble.

Alternatively, instead of using stackrel you might consider the following: create the sum sign. Then, in LyX press _ to put it in subscript. Put i=1 in the subscript. Then press space (this gets you out of the subscript). Then press ^ (this puts you in the super script) and type n. Finally (with the cursor still in the superscript), go to Edit > Math > Change Limits Type and check "Display".

  • 1
    Thank you so much for putting in the time to write this out, much appreciated! – charl1e Aug 18 '15 at 6:58
  • @charl1e Glad it worked. Welcome to stackexchange! – scottkosty Aug 18 '15 at 13:44

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.