Show HN: PreTeX, a LaTeX preprocessor to make math typesetting easier
github.com
github.com
As another tip to make LaTeX typesetting easier, I'd recommend using a custom keyboard distribution to input symbols easily, (e.g., alt + d for δ instead of \delta). In TeX.sx Jon Wickerson published [2] a layout for the british keyboard and the corresponding package to make LaTeX understand the unicode symbols. If you happen to have a spanish keyboard, I made an adaptation of that code [3].
And another thing: if you plan on using pretex a lot, it may be useful to parse the file on save (maybe before compilation). inotify-tools [4] or watchdog (OS X) [5] can help you, it's easy to create a script that will execute pretex whenever your LaTeX file changes.
Great work!
1: http://tex.stackexchange.com/questions/77589/what-do-the-pie... 2: http://tex.stackexchange.com/questions/110042/entering-unico... 3: https://github.com/gjulianm/MathUnicode 4: https://github.com/rvoicilas/inotify-tools/wiki 5: https://github.com/gorakhargosh/watchdog
Or even better |ψ> using `{ v:k for k,v in unicodeit.net }` -- though I don't know of a convenient way to input Unicode characters (alpha, beta, ...) so maybe that's not too useful.
Attempt:
re_ket = re.compile(r"""
\|(
[^\|<>]+
)>
""", re.VERBOSE)
What could that possibly interfere with? `R_+ = { x \in R | x>0 }` ?I'm not entirely sure what you mean with the unicode thing. You mean Unicode psi input, latex \psi output? I've started doing those in an earlier version before I realized that there is probably no practical situation where you have unicode input. Any use case that I haven't thought of?
Still a bit confused about those unicode inputs though
So \alpha would become a unicode α and \int would be ∫.
Emacs has an input method that does the transformation automatically [1]. Yet most of my collaborators have not yet caught that bug..
Still interested? Or maybe there could be an export-mode where the pretex math is backuped in a comment or a separate file to help reconstruction. But that might get awkward fast. Hmm
I was hoping that most of the changes are so trivial that this would be unncecessary
"Instead of writing $\displaymath \int_i^\infty$, just write d\int_i^\infty$"
should be d$, right?