Skip to content

Commit 17b1d82

Browse files
author
Kasper Peeters
committed
1 parent 40f334a commit 17b1d82

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

cmake/version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(CADABRA_VERSION_MAJOR 2)
22
set(CADABRA_VERSION_MINOR 3)
33
set(CADABRA_VERSION_PATCH 9)
4-
set(CADABRA_VERSION_TWEAK 4)
4+
set(CADABRA_VERSION_TWEAK 5)
55
set(COPYRIGHT_YEARS "2001-2022")
66
math(EXPR SYSTEM_BITS "${CMAKE_SIZEOF_VOID_P} * 8")
77
find_program(GIT git PATHS ${GIT_DIR})

core/Props.hh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace cadabra {
3333
class Properties;
3434
class Kernel;
3535
class Accent;
36+
class LaTeXForm;
3637
class Ex_comparator;
3738

3839
class pattern {
@@ -375,7 +376,8 @@ namespace cadabra {
375376
// tree, because it would lead to an endless recursion (and it would
376377
// not make sense anyway). At the moment, this is only for Accent.
377378
bool ignore_properties=false;
378-
if(std::is_same<T, Accent>::value) ignore_properties=true;
379+
if(std::is_same<T, Accent>::value)
380+
ignore_properties=true;
379381

380382
for(;;) {
381383
property_map_t::const_iterator walk=pit.first;
@@ -410,6 +412,11 @@ namespace cadabra {
410412
else break;
411413
}
412414

415+
// Do not walk down the tree if the property cannot be passed up the tree.
416+
// FIXME: see issue/259.
417+
if(std::is_same<T, LaTeXForm>::value)
418+
inherits=false;
419+
413420
// If no property was found, figure out whether a property is inherited from a child node.
414421
if(!ret.first && inherits) {
415422
// std::cout << "no match but perhaps inheritance?" << std::endl;

tests/display.cdb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11

22
def test01():
3+
__cdbkernel__ = create_scope()
34
ex:= 3 A_{m n} B^{m n} + q(x) r s;
45
tst=Ex(repr(ex))
56
assert(tst==ex)
67
print("Test 01 passed")
78

89
test01()
910

11+
def test02():
12+
__cdbkernel__ = create_scope()
13+
\psia::LaTeXForm("\psi_{a}").
14+
\bar{#}::DiracBar.
15+
ex:= \bar{\psia};
16+
print(ex._latex_())
17+
assert(ex._latex_()==r"\bar{\psi_{a}}")
18+
print("Test 02 passed")
1019

20+
test02()
21+

web2/cadabra2/source/changelog.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ <h3>github master (2.3.9)</h3>
2929
<li>Fix for automatic cleanup of <tt>Diagonal</tt> objects.</li>
3030
<li>Fix crash with tab-completion.</li>
3131
<li>Make '+' operator add lists component-wise, and introduce the
32-
tie operator '~' to join lists.</li>
32+
tie operator '~' and <tt>join</tt> function to join lists.</li>
33+
<li>Fix printing of objects with <tt>LaTeXForm</tt> which are
34+
wrapped in another LaTeX operator.</li>
3335
</ul>
3436

3537
<a name="2.3.8"></a>

0 commit comments

Comments
 (0)