Skip to content

Commit ff96838

Browse files
Merge pull request #14 from JuliaStrings/suave-delete-cbinding
delete CBinding
2 parents 7cd3049 + 297806d commit ff96838

File tree

7 files changed

+281
-320
lines changed

7 files changed

+281
-320
lines changed

Project.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ authors = ["José Joaquín Zubieta Rico <[email protected]>"]
44
version = "0.1.0"
55

66
[deps]
7-
CBinding = "d43a6710-96b8-4a2d-833c-c424785e5374"
8-
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
97
LibTeXPrintf_jll = "31c4d84e-4279-5ed4-9345-4512eef47f95"
10-
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
118

129
[compat]
13-
CBinding = "1"
14-
LaTeXStrings = "1"
1510
LibTeXPrintf_jll = "1"
1611
julia = "1.6"
1712

README.md

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -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}
3030
texgetfont()::String
31-
texsetfont(font::String)::String
31+
texsetfont!(font::String)::String # modifies global state, doesn't modify its argument
3232

3333
texsymbols()::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

4245
The documentation of every one of these can be consulted in help mode in the
4346
REPL (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

7157
julia> using LaTeXStrings
7258

73-
julia> texprintf("\\\\frac{1}{%d}", 2)
74-
1
75-
76-
2
59+
julia> texstring("\\frac{1}{2}")
60+
"1\n\n2"
7761

78-
julia> texprintf("\\\\sum_{i=0}^{10}{%c}^2", 'i')
62+
julia> texprintln("\\sum_{i=0}^{10}{i}^2")
7963
10
8064
⎯⎯
8165
2
8266
╱ i
8367
⎺⎺
8468
i=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

Comments
 (0)