summaryrefslogtreecommitdiff
path: root/src/tex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tex.cc')
-rw-r--r--src/tex.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tex.cc b/src/tex.cc
new file mode 100644
index 0000000000..ae9dc1b5f3
--- /dev/null
+++ b/src/tex.cc
@@ -0,0 +1,32 @@
+#include "dimen.hh"
+#include "tex.hh"
+#include "symbol.hh"
+#include "const.hh"
+
+String
+vstrut(Real h)
+{
+ return String("\\vrule height ") + print_dimen(h) + "depth 0pt width 0pt";
+}
+
+
+static void
+substitute_arg(String& r, String arg)
+{
+ int p = r.pos('%');
+ if (!p ) return ;
+ else p--;
+ r = r.left(p) + arg + r.right(r.len() - p -1);
+}
+
+
+String
+substitute_args(String source, svec<String> args)
+{
+ String retval (source);
+ for (int i = 0 ; i < args.sz(); i++)
+ substitute_arg(retval, args[i]);
+ while (retval.pos('%'))
+ substitute_arg(retval, "");
+ return retval;
+}