You are not logged in.
Project page: http://xyne.archlinux.ca/projects/tex2png
After fiddling with other converters I ended up writing my own to do what I needed. I currently use this in my backend toolchain on xyne.archlinux.ca to insert formulae automatically.
I know about texvc but I found it to be poorly documented and very annoying to use. tex2png is a relatively simple bash script with a few convenience options that should be easy to tweak if necessary.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
He, this is funky; I recently needed to create a hell lot of png's of single equations and more or less used the approach you took.
Offline
@xyne: Can you provide an example of how to use the command? I can't seem to get it to do anything.
Jay
Offline
@xyne: Can you provide an example of how to use the command? I can't seem to get it to do anything.
Jay
I'm not xyne but 'tex2png -c "$\alpha$"' works for me.
Offline
jt512 wrote:@xyne: Can you provide an example of how to use the command? I can't seem to get it to do anything.
Jay
I'm not xyne but 'tex2png -c "$\alpha$"' works for me.
OK. Your example works for me, too. But why doesn't 'tex2png -c "a + b"'?
Offline
kazuo wrote:jt512 wrote:@xyne: Can you provide an example of how to use the command? I can't seem to get it to do anything.
Jay
I'm not xyne but 'tex2png -c "$\alpha$"' works for me.
OK. Your example works for me, too. But why doesn't 'tex2png -c "a + b"'?
Because "a+b" is not math environment. It has no mathematical meaning (within LaTeX). This is how \usepackage{preview} works. You will not to enclude a+b either in inline math ($ $) or inside a math environment (\begin{equation} \end{equation}). (You might want to replace equation by equation* if you don't want to have numbering.)
Offline
OK, so why do I get no output with tex2png -c '"$a+b$"'?
Offline
OK, so why do I get no output with tex2png -c '"$a+b$"'?
I don't know what you are doing, but I do get an output.
(In addition to what I said earlier, the only possible way is to put the equation within inline math $ $; Xyne uses the textmath options.)
Offline
Use single quotes if you pass the tex string on the command line. If you use double-quotes, bash will try to interpolate "$a" as a variable, e.g.
# echo "$a+b$"
+b$
You can also use STDIN to pass it tex. Just invoke it "tex2png" then type in what you want. Press ctrl+d to end the input.
That also allows you to pipe in tex. E.g. you can create a plain text file with "$a+b$", save it as "input", then use
tex2png <input
Last edited by Xyne (2010-05-20 00:20:11)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thanks, Xyne. I think I'll find a lot of use for this utility.
Offline
Thanks again Xyne! Haven't tried it yet, but looks promising like always. Good job!
Offline
(In addition to what I said earlier, the only possible way is to put the equation within inline math $ $; Xyne uses the textmath options.)
I didn't fully register that bit when I read your post. It only hit me after I hit my own stumbling block while trying to embed plain text.
I don't understand .sty files at all so there might be a much better way to do it, but for now I've implemented a workaround using "\mbox". It seems to handle everything as expected.
I've also added a new option (-i) to specify inline tex. In combination with the aforementioned workaround and the preview package, dvipng's depth and height output should be correct for everything.
Last edited by Xyne (2010-10-30 16:45:03)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline