@@ -23,45 +23,31 @@ julia> Pkg.add("LibTeXPrintf")
2323
2424# Documentation
2525
26- LibTeXPrintf.jl export six three functions
26+ LibTeXPrintf.jl export nine functions
2727
2828``` julia
29- texfonts ():: NTuple (N, String)
29+ texfonts ():: Vector{ String}
3030texgetfont ():: String
31- texsetfont (font:: String ):: String
31+ texsetfont! (font:: String ):: String # modifies global state, doesn't modify its argument
3232
3333texsymbols ():: ImmutableDict{String, String}
3434
35- stexprintf (format:: String , args... ):: String
36- stexprintf (format:: LaTeXString , args... ; clean= true ):: String
35+ texstring (tex:: String ; [lw]):: String
3736
38- texprintf ([io:: IO ], format:: String , args... )
39- texprintf ([io:: IO ], format:: LaTeXString , args... ; clean= true )
37+ texprint (tex:: String ; [lw]):: String
38+ texprintln (tex:: String ; [lw]):: String
39+
40+ texsetascii ()
41+ texsetunicode ()
42+ textogglesupersub ()
4043```
4144
4245The documentation of every one of these can be consulted in help mode in the
4346REPL (press ` ? ` to change to help mode, ` backspace ` to exit).
4447
45- ### Format string
46-
47- The ` format ` positional argument is interpreted as $\LaTeX$ code, but with the
48- extra that format specifiers of ` @printf ` (or the ` printf ` function in the
49- C language) are allowed inside.
50-
51- The argument ` format ` can also be a ` LaTeXString ` , from
52- [ LaTeXStrings.jl] ( https://github.com/stevengj/LaTeXStrings.jl ) , in which case
53- the keyword argument ` clean ` is present (and defaults to ` true ` ). When
54- ` clean=true ` , then format is changed into ` strip(format, '$') ` .
55-
5648** Note**
57- : If you try to print a new line character in (` '\n' ` ) inside a
58- ` LaTeXString ` , it will error saying `ERROR: ArgumentError: Unknown command
59- (1x)` . This is because LaTeXStrings.jl escapes the string from ` "\n"` to
60- ` "\\n" ` and when libtexprintf sees it, it looks like a LaTeX command, just
61- not one that it knows about.
62-
63- There is also the problem that libtexprintf will actually just **ignore**
64- all the new line characters (`'\n'`).
49+ : Newline character is not supported by libtexprintf. If you use it, it will not work or
50+ errors will appear.
6551
6652## Examples
6753
@@ -70,29 +56,30 @@ julia> using LibTeXPrintf
7056
7157julia> using LaTeXStrings
7258
73- julia> texprintf (" \\\\ frac{1}{%d}" , 2 )
74- 1
75- ─
76- 2
59+ julia> texstring (" \\ frac{1}{2}" )
60+ " 1\n ─\n 2"
7761
78- julia> texprintf (" \\\\ sum_{i=0}^{10}{%c }^2" , ' i ' )
62+ julia> texprintln (" \\ sum_{i=0}^{10}{i }^2" )
796310
8064⎯⎯
8165╲ 2
8266╱ i
8367⎺⎺
8468i= 0
8569
86- julia> texsetfont (" mathbb" )
70+ julia> texgetfont ()
71+ " text"
72+
73+ julia> texsetfont! (" mathbb" )
8774" mathbb"
8875
89- julia> texprintf (" This is a LaTeX string." )
76+ julia> texprintln (" This is a LaTeX string." )
9077𝕋𝕙𝕚𝕤 𝕚𝕤 𝕒 𝕃𝕒𝕋𝕖𝕏 𝕤𝕥𝕣𝕚𝕟𝕘.
9178
92- julia> texsetfont (" text" )
79+ julia> texsetfont! (" text" )
9380" text"
9481
95- julia> texprintf (" This is a LaTeX string." )
82+ julia> texprint (" This is a LaTeX string." )
9683" This is a LaTeX string."
9784```
9885
0 commit comments