bartp5 / libtexprintf Goto Github PK
View Code? Open in Web Editor NEWLibrary providing printf-style formatted output routines with tex-like syntax support.
License: GNU General Public License v3.0
Library providing printf-style formatted output routines with tex-like syntax support.
License: GNU General Public License v3.0
CI fails on mac-os with the following log:
8_Clean.txt
Not sure why and I have no mac to reproduce. Error first came up after updating the README, so it seems the problem comes from a change in build environment, rather than a change in libtexprintf itself.
\%
is not supported.
Example:
utftex 'A = 25\% \frac{b}{c}'
b
A = 25
Without the \%
utftex 'A = 25 \frac{b}{c}'
b
A = 25 ─
c
There are several commits that are not yet in a new release. Is it worth to make a new release with them?
Currently t_0
renders as
t
0
However, Unicode has a 0
subscript character, so it could render more cleanly as t₀
.
In general, if a subscript or superscript consists entirely of characters available as such in Unicode, it would be nice to render them that way (with the current behavior as a fallback for characters lacking Unicode sub/superscripts).
The available Unicode superscripts are ²³¹ʰʲʳʷʸˡˢˣᴬᴮᴰᴱᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴿᵀᵁᵂᵃᵇᵈᵉᵍᵏᵐᵒᵖᵗᵘᵛᶜᶠᶻ⁰ⁱ⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ⁿⱽꜝ
and the subscripts are ᵢᵣᵤᵥ₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎ₐₑₒₓₕₖₗₘₙₚₛₜⱼ
(In general, there are a lot of Unicode characters that you could potentially be using. See https://github.com/JuliaLang/julia/blob/master/stdlib/REPL/src/latex_symbols.jl for a list mapping them from LaTeX and LaTeX-like \symbols
.)
target = \left\{
\begin{array}{ll}
cwnd &
\text{if } \mathrm{W_{cubic}}(t + RTT) < cwnd \\
1.5 * cwnd &
\text{if } \mathrm{W_{cubic}}(t + RTT) > 1.5 * cwnd \\
\mathrm{W_{cubic}}(t + RTT) &
\text{otherwise} \\
\end{array} \right.
renders as
⎧
⎪cwnd if W (t + RTT) < cwnd
⎪ cubic
⎨1.5 * cwnd if W (t + RTT) > 1.5 * cwnd
target = ⎪ cubic
⎪W (t + RTT) otherwise
⎩ cubic
the target =
bit isn't vertically centered. Mathjax renders as follows:
utftex '\\sum_{i=6}^{10}\\left[\\binom{A}{i} \\binom{L}{10-i}\\right]
produces
10
⎯⎯
╲ ⎡⎛A⎞ ⎛ L ⎞⎤
╱ ⎢⎜ ⎟ ⎜ ⎟⎥
⎺⎺ ⎣⎝i⎠ ⎝10-i⎠⎦
i=6
Also, the bottom of the sum (⎺⎺
) is using a different dash than the top (⎯⎯
)?
I made a GUI using PyQt6. It should be easily translatable to PySide6. It borrows a lot of ideas from AsciiTeX.
It's designed to be made into an executable file with PyInstaller.
First, nice project! I think it would be cool to have a target on the Makefile
for building as a library to be able to link to. I would like to help, but I don't know about automake
neither autoconf
.
Hello 👋 . I'm a maintainer for the Homebrew project. While packaging v1.18 of utftex we are encountering a build failure:
make[1]: Entering directory '/tmp/utftex-20230524-5877-efo77/libtexprintf-1.18/src'
/bin/bash ./gen_errorflags.sh ./boxes.c ./drawbox.c ./lexer.c ./parser.c
/bin/bash ./gen_errorflags.sh ./boxes.c ./drawbox.c ./lexer.c ./parser.c
Collecting error flags from ./boxes.c
Collecting error flags from ./boxes.c
Collecting error flags from ./drawbox.c
Collecting error flags from ./drawbox.c
Collecting error flags from ./lexer.c
Collecting error flags from ./lexer.c
Collecting error flags from ./parser.c
Collecting error flags from ./parser.c
rm: cannot remove 'tmperrflags': No such file or directory
make[1]: *** [Makefile:1079: errorflags.h] Error 1
make[1]: Leaving directory '/tmp/utftex-20230524-5877-efo77/libtexprintf-1.18/src'
make: *** [Makefile:674: install-recursive] Error 1
The relevant GitHub Actions run can be found here.
Relates to Homebrew/homebrew-core#131899
$ utftex "a_{utc} < a_{ntp}"
a < aₙₜₚ
utc
In github, you may not be able to see the subscript characters that utftex uses for the "ntp" suffix.
(Maybe just copy/paste it to something else, e.g., pbpaste in terminal.)
Even worse than the interoperability problems here is the uneven handling of "utc" and "ntp" -- of course, I know why this happens, but I'd rather have a way to completely switch off the feature that uses subscript characters.
I would love to give up https://github.com/larseggert/asciiTeX for this! But I think it's still missing a bunch of features that we'd need for IETF documents. A bunch of the examples in https://github.com/larseggert/asciiTeX/tree/main/examples throw errors. Are you planning on adding support for more constructs?
Stuff like \frac 1\alpha
or \frac {1}\alpha
, which is valid LaTeX math produce errors:
❯ utftex '\frac 1 \alpha'
ERROR: Too few mandatory arguments to command (1x)
❯ utftex '\frac{1}\alpha'
Error, string is not proper UTF-8 code
Error, string is not proper UTF-8 code
1
─
t'
and t''
get rendered as-is using ASCII quotes, but they could be rendered using Unicode prime characters t′
and t″
.
Here are several Unicode primes.
aclocal: warning: couldn't open directory 'm4': No such file or directory
glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
glibtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.ac:3: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:3: You should run autoupdate.
m4/libtool.m4:100: AC_PROG_LIBTOOL is expanded from...
configure.ac:3: the top level
configure.ac:5: warning: The macro `AM_ENABLE_SHARED' is obsolete.
configure.ac:5: You should run autoupdate.
m4/ltoptions.m4:205: AM_ENABLE_SHARED is expanded from...
configure.ac:5: the top level
configure.ac:3: installing './compile'
configure.ac:3: installing './config.guess'
configure.ac:3: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
configure.ac:48: error: required file 'test/mathjax_examples.tex' not found
configure.ac:70: error: required file 'test/mathjax_examples.ref' not found
configure.ac:93: error: required file 'test/mathjax_examples-A.ref' not found
parallel-tests: installing './test-driver'
src/Makefile.am: installing './depcomp'
autoreconf: error: automake failed with exit status: 1
BuildError: Failed executing: ./autogen.sh
Currently libtexprintf does not support switching back to a math environment from a text block. For example:
\text{blah $math$ blah}
renders as
blag $math$ blah
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.