Offer-motivated features: :hline defaults, ranged :hpos, @date :days, :bottom none
- @table: a writer's :hline/:vline replaces the default lines; new
boundary name 'none' removes all lines
- @table: ranged :hpos argument overrides :cell_hpos per cell
(\multicolumn{1} in tex; positions a colspan anchor's merged cell)
- @date/@datetime: :days offset argument (sks/date/date.py)
- @document: ":bottom none" suppresses the footer (\pagestyle{empty})
Also carries the escape-system generator/renderer fixes, per-cell-range
:format, and uppercase .TTF/.OTF font recognition from klammertext-dev.
This commit is contained in:
14
mac/eval.cpp
14
mac/eval.cpp
@@ -6,6 +6,7 @@
|
||||
#include "show.h"
|
||||
#include "katom.h"
|
||||
#include "file.h"
|
||||
#include <algorithm>
|
||||
#include <unistd.h>
|
||||
|
||||
std::string shell(State state, std::string command, Locator loc)
|
||||
@@ -151,8 +152,19 @@ katom_list Eval::eval(katom_iter begin, katom_iter end)
|
||||
}
|
||||
katom_list result {};
|
||||
Machine M = m_machine;
|
||||
size_t before = M.m_katoms.size();
|
||||
M.read(eval_result);
|
||||
M.apply(M.m_state.value("K_target"), false, false);
|
||||
// If the @eval produced more Klammertext -- the read-back result still
|
||||
// holds klammers to reduce (a "generator", e.g. a Python klammer returning
|
||||
// a @table call with data) -- then its text is writer content: escape it
|
||||
// for the target before applying, exactly as typed input is escaped, so a
|
||||
// "%" in the data becomes "\%". If it produced final target markup (no
|
||||
// klammers left, a "renderer" such as @table itself emitting \begin{tabular})
|
||||
// leave it untouched. ^'...'^ literal spans are skipped by the escape pass,
|
||||
// so a generator can still carry raw target markup.
|
||||
bool has_klammer = std::any_of(
|
||||
M.m_katoms.begin() + before, M.m_katoms.end(), begin_apply);
|
||||
M.apply(M.m_state.value("K_target"), false, has_klammer);
|
||||
result = trim(M.m_katoms);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user