From 32f6c066ccad00e1580f1f2a5c1d989153e4a83b Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sun, 8 May 2011 10:06:33 +0000 Subject: [PATCH] Partial fox for bug #6622: Display \utilde on screen correctly. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38633 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/scons/scons_manifest.py | 1 + lib/Makefile.am | 1 + lib/chkconfig.ltx | 1 + lib/doc/LaTeXConfig.lyx | 35 ++++++++++++++++++++++++++++ lib/images/math/utilde.png | Bin 0 -> 286 bytes lib/symbols | 4 ++++ lib/ui/stdtoolbars.inc | 2 ++ src/LaTeXFeatures.cpp | 3 ++- src/mathed/InsetMathDecoration.cpp | 6 +++-- src/mathed/MathSupport.cpp | 1 + 10 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 lib/images/math/utilde.png diff --git a/development/scons/scons_manifest.py b/development/scons/scons_manifest.py index 4bf7c9acfe..13233d1c18 100644 --- a/development/scons/scons_manifest.py +++ b/development/scons/scons_manifest.py @@ -2085,6 +2085,7 @@ lib_images_math_files = Split(''' upsilon2.png upuparrows.png urcorner.png + utilde.png varepsilon.png varkappa.png varnothing.png diff --git a/lib/Makefile.am b/lib/Makefile.am index 2c7aab0d71..c847b23ec2 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -947,6 +947,7 @@ dist_imagesmath_DATA = \ images/math/upsilon2.png \ images/math/upuparrows.png \ images/math/urcorner.png \ + images/math/utilde.png \ images/math/varepsilon.png \ images/math/varkappa.png \ images/math/varnothing.png \ diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 95ea1fe2b1..7f5fcef394 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -309,6 +309,7 @@ \TestPackage{subscript} \TestPackage[turkmen.ldf]{turkmen} \TestPackage{ulem} +\TestPackage{undertilde} \TestPackage{units} \TestPackage{url} \TestPackage{varioref} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index 3b5059a3e0..c6947ca8b6 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -5591,6 +5591,41 @@ ulem to PDF. \end_layout +\begin_layout Subsection +undertilde +\end_layout + +\begin_layout Description +Found: +\begin_inset Info +type "package" +arg "undertilde" +\end_inset + + +\end_layout + +\begin_layout Description +CTAN: +\family typewriter +macros/latex/contrib/undertilde/ +\end_layout + +\begin_layout Description +Notes: The package +\family sans +undertilde +\family default + provides the +\family sans + +\backslash +utilde +\family default + command. + It is needed by LyX to underline symbols with a tilde in formulas. +\end_layout + \begin_layout Subsection units \end_layout diff --git a/lib/images/math/utilde.png b/lib/images/math/utilde.png new file mode 100644 index 0000000000000000000000000000000000000000..9854880dd5b39af29c6a9403e00cbe3b89f7bcf4 GIT binary patch literal 286 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~wj^(N7l!{J zxM1({$v_d#0*}aI1_o|n5N2eUHAey{$X?><>&kwcm4nk*ZNfRLi9n%wo-U3d7N_5a zIPx7(;Mm;#|9?^WK~_P>O|r*ZIj)9nXPWf(^o|@x26r}twTu6}`7Xkgu`BO-;N8#+ zM-^#??;8Rh`gOj`77|aEUL>$w{@^2h{>4{QDjzInUb%kC(?)+$u}40Migm5h$C}z_ z{=Ko*s8MI1{--4?ZD(1u|GHKC`1(mdYiq8|e{E&Po;ty<9)~_Im9#y7>cY}?ZuU2` acQ7thZ?xacJ>41TQU*^~KbLh*2~7a3tZ1MB literal 0 HcmV?d00001 diff --git a/lib/symbols b/lib/symbols index 1dcf0a4191..c75f69d17e 100644 --- a/lib/symbols +++ b/lib/symbols @@ -26,6 +26,10 @@ underleftarrow decoration none amsmath underleftrightarrow decoration none amsmath underline decoration none underrightarrow decoration none amsmath +#Do not load automatically, since it might conflict with user macros and we +#don't have a possibility to turn automatic loading off like for ams +#utilde decoration none undertilde +utilde decoration none vec decoration none widehat decoration none widetilde decoration none diff --git a/lib/ui/stdtoolbars.inc b/lib/ui/stdtoolbars.inc index 30bc22c16d..3db71ce031 100644 --- a/lib/ui/stdtoolbars.inc +++ b/lib/ui/stdtoolbars.inc @@ -398,6 +398,8 @@ ToolbarSet Item "check" "math-insert \check" Item "widehat" "math-insert \widehat" Item "widetilde" "math-insert \widetilde" +# enable this once the undertilde package is loaded automatically +# Item "utilde" "math-insert \utilde" Item "vec" "math-insert \vec" Item "acute" "math-insert \acute" Item "ddot" "math-insert \ddot" diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 61bd0a7a03..2cfc1ce6e2 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -614,7 +614,8 @@ char const * simplefeatures[] = { "amscd", "slashed", "multirow", - "tfrupee" + "tfrupee", + "undertilde", }; int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *); diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index 37fae79911..71973296ea 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -47,7 +47,7 @@ Inset * InsetMathDecoration::clone() const bool InsetMathDecoration::upper() const { - return key_->name.substr(0, 5) != "under"; + return key_->name.substr(0, 5) != "under" && key_->name != "utilde"; } @@ -93,7 +93,8 @@ bool InsetMathDecoration::wide() const key_->name == "widetilde" || key_->name == "underleftarrow" || key_->name == "underrightarrow" || - key_->name == "underleftrightarrow"; + key_->name == "underleftrightarrow" || + key_->name == "utilde"; } @@ -204,6 +205,7 @@ namespace { // this is the macron, again, but it works t["underline"] = Attributes(false, "¯"); t["underrightarrow"] = Attributes(false, "⟶"); + t["utilde"] = Attributes(false, "∼"); t["vec"] = Attributes(true, "→"); t["widehat"] = Attributes(true, "^"); t["widetilde"] = Attributes(true, "∼"); diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index 16cfc46b8c..32ea36e8c4 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -287,6 +287,7 @@ named_deco_struct deco_table[] = { {"underleftarrow", arrow, 1 }, {"underrightarrow", arrow, 3 }, {"underleftrightarrow", udarrow, 1 }, + {"utilde", tilde, 0 }, // Delimiters {"(", parenth, 0 },