I am having problems inserting nomenclature entries using Lyx. I enter the symbol and description, press OK, and the nomenclature entry is not made ( ie no box Nom: …) [no error messages]. I haven't worked out what triggers this ( ie sometimes insertion works, sometimes doesn't)…Its very frustrating.
I am mainly dealing with mathematical symbols so I tend to (try to) insert in formula or after formula… I feel that the problem has to do with where I place the insertion, but I haven't worked it out. Similarly I haven't got a little test file to demonstrate it
[Tex/LaTex] Lyx: fails to insert nomenclature
lyxnomenclature
Related Solutions
Mico's suggestion to use \mid
instead of |
is not only for style but will fix your problem:
$E_{\left(A_i\mid B_I\right)}$
EDIT: as egreg notes, \left(
and \right)
do nothing as far as LaTeX is concerned here and in some cases they can add an unwanted space. I leave them here because that's what the OP has. Note that LyX renders the corresponding math differently (the left(
and \right)
parentheses are larger in LyX).
output:
Here is an MWE .lyx file:
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\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 makeindex -g
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\use_mathdots 1
\use_mhchem 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\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
\end_header
\begin_body
\begin_layout Standard
\begin_inset CommandInset nomenclature
LatexCommand nomenclature
symbol "$E_{\\left(A_i\\mid B_I\\right)}$"
description "description..."
\end_inset
\end_layout
\begin_layout Standard
\begin_inset CommandInset nomencl_print
LatexCommand printnomenclature
set_width "auto"
\end_inset
\end_layout
\end_body
\end_document
And exported to LaTeX (pdflatex):
%% LyX 2.1.0dev created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{nomencl}
% the following is useful when we have the old nomencl.sty package
\providecommand{\printnomenclature}{\printglossary}
\providecommand{\makenomenclature}{\makeglossary}
\makenomenclature
\usepackage{babel}
\begin{document}
\nomenclature{$E_{\left(A_i\mid B_I\right)}$}{description...}
\settowidth{\nomlabelwidth}{$E_{\left(A_i\mid B_I\right)}$}
\printnomenclature{}
\end{document}
You are simply missing a closing brace.
\ifthenelse{\equal{#1}{D}}{\item[{Cons}]}{}}}
should be
\ifthenelse{\equal{#1}{D}}{\item[{Cons}]}{}}}}
MWE:
\documentclass{article}
\usepackage{nomencl}
\usepackage{ifthen}
\renewcommand{\nomgroup}[1]{%
\ifthenelse{\equal{#1}{A}}{\item[{Sets and Indicis:}]}{%
\ifthenelse{\equal{#1}{B}}{\item[{Variables:}]}{%
\ifthenelse{\equal{#1}{G}}{\item[{Parameters:}]}{%
\ifthenelse{\equal{#1}{D}}{\item[{Cons}]}{}}}}
}
\makenomenclature
\nomenclature[A1]{$\Omega_N$}{Set of all buses (nodes).}
\nomenclature[A2]{$n,m$}{Index of all buses (nodes). $m$ is alias of $n$.}
\nomenclature[A3]{$\Omega_L$}{Set of all Transmission lines.}
\nomenclature[A4]{$l$}{Index of transmission lines.}
\nomenclature[A5]{$\Omega_{K}$}{Set of all genetors.}
\nomenclature[A6]{$k$}{Index of generator $k\in\Omega_{k}.$}
\nomenclature[A7]{$\Omega_{D}$}{Set of all demand buses.}
\nomenclature[A8]{$d$}{Index of demand, $d\in\Omega_{D}.$\\}
\nomenclature[B1]{$\theta_{n}$}{Voltage angle at bus $n.$}
\nomenclature[B2]{$v_n$}{Voltage magnitude at bus $n.$}
\nomenclature[B3]{$p_{nk}$}{Real power supply from generator $k$ at bus $n.$}
\nomenclature[B4]{$q_{nk}$}{Reactive power supply from generator $k$ at bus$n.$}
\nomenclature[B5]{$p_{nml}$}{Active power flows from bus $m$ to bus $n$ through transmission line $l.$}
\nomenclature[B6]{$\lambda_{nml}$}{compansation level of transmission line $l$ between bus $n$ and $m$.}
\nomenclature[B7]{$u_{nml}$}{Binary variable denoting the placement of TCSC on line $l$ between bus $m$ and $n.$\\}
\nomenclature[D1]{$c_k$}{Cost coefficient of generator $k.$}
\nomenclature[D2]{$p_{nd}$}{Real power demand at bus $n.$}
\nomenclature[D3]{$q_{nd}$}{Reactivel power demand at bus $n.$}
\nomenclature[D4]{$r_{nml}$}{Resistance of transmission line $l$ between bus $m$ and $n.$}
\nomenclature[D5]{$x_{nml}$}{Reactance of transmission line $l$ between bus $m$ and $n$ .}
\nomenclature[D6]{$g_{nml}$}{Conductance of transmission line $l$ between bus $m$ and $n$ .}
\nomenclature[D7]{$b_{nml}$}{Susceptance of transmission line $l$ between bus $m$ and $n$ .}
\nomenclature[D8]{$x_{nml}^{'}$}{Reactance of transmission line $l$ after compansation.}
\nomenclature[D9]{$g_{nml}^{'}$}{Conductance of transmission line $l$ after compansation.}
\nomenclature[D10]{$b_{nml}^{'}$}{Sueceptance of transmission line $l$ after compansation.}
\nomenclature[D11]{$p_{k}^{min}$ ,$p_{k}^{max}$}{Lower and upper bound of active power supplied by generator$ k.$}
\nomenclature[D12]{$p_{k}^{min}$ ,$p_{k}^{max}$}{Lower and upper bound of reactive power supplied by generator$ k.$}
\nomenclature[D13]{$\theta_{n}^{min}$, $\theta_{n}^{max}$}{Lower and upper bound of voltage angle at bus $n.$}
\nomenclature[D14]{$v_{n}^{min}$, $v_{n}^{max}$}{Lower and upper bound of voltage magnitude at bus $n.$}
\nomenclature[D15]{$\lambda^{max}$}{Maximum available compansation level.}
\nomenclature[D16]{$\eta_{TCSC}$}{Number of available TCSCs.}
\nomenclature[D17]{$M$}{Big integer number.}
\nomenclature[D18]{$N_{b}$}{ Number of buses ($\mid\Omega_{N}\mid=N_{b}$).}
\nomenclature[D19]{$N_{l}$}{Number of transmission lines ($\mid\Omega_{L}\mid=N_{l}$).}
\nomenclature[D20]{$\mu_l$}{Dual variable regarding to change in active power generation of unit $k$ in subproblem.}
\nomenclature[D21]{$\alpha_k$}{Dual variable regarding to change in active power generation of unit $k$ in subproblem.}
\nomenclature[D22]{$\beta_l$}{Dual variable in adjusting compansation level of TCSC in trasmission line $l$.}
\nomenclature[D23]{$N_{k}$}{ Number of generators ($\mid\Omega_{K}\mid=N_{k}$).}
\nomenclature[G1]{text}{some explanation}
\begin{document}
Some text
\printnomenclature
\end{document}
Output:
Best Answer
OK well I have "resolved" the issue. If an element of a formula is selected when you press OK, then no nomenclature inset is created/modified. if you have text selected (outside formula inset) then the text is overwritten by the nomenclature inset.
I tend to copy paste my symbols into the nomenclature box from my document and this leads to the symbols being selected (in the formula inset). If you unselect before pressing ok in nomenclature inset then everything works ok.