@@ -23,45 +23,31 @@ julia> Pkg.add("LibTeXPrintf")
23
23
24
24
# Documentation
25
25
26
- LibTeXPrintf.jl export six three functions
26
+ LibTeXPrintf.jl export nine functions
27
27
28
28
``` julia
29
- texfonts ():: NTuple (N, String)
29
+ texfonts ():: Vector{ String}
30
30
texgetfont ():: String
31
- texsetfont (font:: String ):: String
31
+ texsetfont! (font:: String ):: String # modifies global state, doesn't modify its argument
32
32
33
33
texsymbols ():: ImmutableDict{String, String}
34
34
35
- stexprintf (format:: String , args... ):: String
36
- stexprintf (format:: LaTeXString , args... ; clean= true ):: String
35
+ texstring (tex:: String ; [lw]):: String
37
36
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 ()
40
43
```
41
44
42
45
The documentation of every one of these can be consulted in help mode in the
43
46
REPL (press ` ? ` to change to help mode, ` backspace ` to exit).
44
47
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
-
56
48
** 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.
65
51
66
52
## Examples
67
53
@@ -70,29 +56,30 @@ julia> using LibTeXPrintf
70
56
71
57
julia> using LaTeXStrings
72
58
73
- julia> texprintf (" \\\\ frac{1}{%d}" , 2 )
74
- 1
75
- ─
76
- 2
59
+ julia> texstring (" \\ frac{1}{2}" )
60
+ " 1\n ─\n 2"
77
61
78
- julia> texprintf (" \\\\ sum_{i=0}^{10}{%c }^2" , ' i ' )
62
+ julia> texprintln (" \\ sum_{i=0}^{10}{i }^2" )
79
63
10
80
64
⎯⎯
81
65
╲ 2
82
66
╱ i
83
67
⎺⎺
84
68
i= 0
85
69
86
- julia> texsetfont (" mathbb" )
70
+ julia> texgetfont ()
71
+ " text"
72
+
73
+ julia> texsetfont! (" mathbb" )
87
74
" mathbb"
88
75
89
- julia> texprintf (" This is a LaTeX string." )
76
+ julia> texprintln (" This is a LaTeX string." )
90
77
𝕋𝕙𝕚𝕤 𝕚𝕤 𝕒 𝕃𝕒𝕋𝕖𝕏 𝕤𝕥𝕣𝕚𝕟𝕘.
91
78
92
- julia> texsetfont (" text" )
79
+ julia> texsetfont! (" text" )
93
80
" text"
94
81
95
- julia> texprintf (" This is a LaTeX string." )
82
+ julia> texprint (" This is a LaTeX string." )
96
83
" This is a LaTeX string."
97
84
```
98
85
0 commit comments