Commit ebbc13cb authored by Jakob Stierhof's avatar Jakob Stierhof

Better help with tex

to fix the tex issue for formulas we use the underscore package.
Here the _ in text mode is replaced by \_ so no character substitutions
are necessary.
parent 9a3ebe22
Pipeline #6122 passed with stages
in 55 seconds
......@@ -42,6 +42,10 @@ define headingv_fun () {
insert(sprintf("##### %s\n%s", s1, s2));
}
define math_fun (s) {
vinsert("$%s", s);
}
define synopsis_fun (s) {headingv_fun("Synopsis", sprintf(" %s\n", s));}
define usage_fun (s) {headingv_fun("Usage", sprintf("```c\n %s\n```\n\n", s));}
......@@ -71,6 +75,7 @@ tm_add_macro("USAGE", &usage_fun, 1, 1);
tm_add_macro("ALTUSAGE", &altusage_fun, 1, 1);
tm_add_macro("SEEALSO", &seealso_fun, 1, 1);
tm_add_macro("WIKILINK", &wikilink_fun, 1, 1);
tm_add_macro("math", &math_fun, 1, 1);
%#% tm_map_character ('{', "\\{"R);
%#% tm_map_character ('}', "\\}"R);
#s-
......
......@@ -21,7 +21,12 @@
#d __verbatim_end \end{verbatim}
#s+
tm_map_character ('_', "\\_"R);
define math_function (s)
{
vinsert("$%s$", s);
}
tm_add_macro("math", &math_function, 1, 1);
tm_map_character ('_', "_"R);
tm_map_character ('%', "\\%"R);
tm_map_character ('#', "\\#"R);
tm_map_character ('<', "$<$");
......@@ -33,11 +38,14 @@ tm_map_character ('|', "$|$"R);
%#% tm_map_character ('}', "\\}"R);
#s-
\\documentclass{article}
\\usepackage[a4paper,hmargin=2cm,vmargin=1cm,bottom=0.5cm,includefoot]{geometry}
\\usepackage[colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref}
\\usepackage{multicol}
\\usepackage[utf8]{inputenc}
\\usepackage{underscore}
\\begin{document}
\\setcounter{page}{1}
......
......@@ -26,12 +26,14 @@ tm_add_macro("WIKILINK", &wikilink_fun, 1, 1);
#d variable#1 \__newline__{}$1\__newline__
#d datatype#1 \__newline__{}$1\__newline__
#d math#1 $1
#d synopsis#1 \_hlp_section{SYNOPSIS}\__newline__{}\__space__{4}$1\__newline__
#d usage#1 \_hlp_section{USAGE}\__newline__\__space__{4}$1
#d altusage#1 \__space__{4}% or\__newline__\__space__{4}$1
#d description \_hlp_section{DESCRIPTION}
#d qualifiers#1 \_hlp_section{QUALIFIERS}$1
#d qualifier#2 \__space__{4}; $1: $2
#d qualifier#2 \__space__{4}* $1: $2
#d example \_hlp_section{EXAMPLE}
#d examples \_hlp_section{EXAMPLES}
#d notes \_hlp_section{NOTES}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment