4 ms·
Alright, so I work as a mathematician and I'll strongly agree that there's not good substitute for TeX at the moment for producing mathematical documents. That
by kxyvr 9y ago
Alright, so I work as a mathematician and I'll strongly agree that there's not good substitute for TeX at the moment for producing mathematical documents. That said, I do periodically look for something better because it's far from perfect. In large documents, I find it difficult to produce easily maintainable mathematical statements since the macro situation in LaTeX is a complete mess. Often times, I have a large formulation that I want to modify only a small part. Now, yes, we could just number all of the equations, change one of them, and then say that the result is the combination of (4), (27), (43), and (45). In fact, we can link them, so that everyone could flip back to these equations. That also makes really hateful to read documents. Really, I want to display all of the equations and I don't want to retype them since I may very well make a mistake and I want that correction propagated around the document. So, we can use macros to help with this, but the definitions have to occur before \begin{document}, which is not where I want to look for an equation. I want a local definition since it's next to what I'm looking at. We could use something like \newsavebox, which I often do, but I often want to just make a reference to part of an equation and this is not a good solution for that. Maybe there's a better macro or way to do that out there, and if anyone knows, I'd love to hear. I could write my own macros, but, really, I find TeX to be a difficult language to work with. I am curious to know if LuaTeX makes this much easier to do and I've been meaning to experiment to find out.
So, yes, in a vacuum I think that math notation in LaTeX works really, really well. However, for a larger document, there's a lot of other features that would be nice to have and they're difficult to implement in TeX.
- phkahler 9y agoSounds like you want the capabilities of a tool like Mathematica, MathCAD, or Maxima at hand in your document editor. This part I understand, you would actually DO the math and document the train of thought as you go. You also want to be able to define subexpressions and reuse them as needed. Is that correct? And you don't want to define those ahead of time? This sounds like the math equivalent of a lazy programmer that wants to use goto and highly unstructured coding practices. You want to write arbitrary expressions and then pull parts of them into other areas of the document without defining them individually. At least that's what I got from your comment. How about a nice math-document editor with a mode where expressions can be seen as an assembly of previously defined items. Then you could right-click on one and select "go to definition" from a popup menu. That's how the software people do things these days. But if you want to use non-math aware text editors for writing math papers I fear you're never going to get what you want. TL;DR my impression is that poster wants a very sophisticated math-aware document creating program that has a sort of development mode and display mode. I like it, but am not aware of such. I could also have totally misinterpreted the comment.
- kxyvr 9y agoYes, I think we have a misunderstanding. I use Maxima actively, but I do not want to include its calculations in my document. Really, what I'd like specifically is: 1. LaTeX document 2. Ability to define macros locally and more easily. For me, a macro is most of the time just easy textual substitution. However, there are times when I want to generate a piece of text repeatedly with some mild variations. And, look, LaTeX does most of these things, but there's a huge amount of redundancy when writing up a math document. We sort of get away with things by labeling equations with numbers and referring back to them, but this is largely a remnant from the physical typesetting days when repeatedly typesetting the same expression was laborious and error prone. When we build up a completed theorem from a discussion, I don't want to refer back to old expressions, I want to repeat everything I have there. It creates a contained presentation for the reader. It's easier for everyone, including me, to refer back to later. I should not have to retype everything to do this. TeX is basically a programming language. I should be able to locally define functions and call them when I need them. My complaint with TeX is that it doesn't make this usage all that easy to accomplish and it's, frankly, not all that much to ask for. --- Edit 1 --- One concrete example that I'm typing up now: I'm currently typing up some circuit equations from some project. We have a three-phase inverter, so we used a dq0 transformation to simplify things. The equations been the d and q axis are basically the same except for some differences in the subscripts (some are d, some are q, sometimes we reverse things.) In a reasonable programming language, I could just write a function to swap back and forth and code the equations once. When I implement things, that's what I do. When I type them in LaTeX, I type them twice. I shouldn't have to.
- tomsmeding 9y agoIf I understand you correctly, you can in LaTeX. \newcommand can be used before \begin{document}, sure, but it really can be used everywhere. The only catch is that the resulting definitions are global, and I know (as a programmer and mathematician) that this is all sorts of bad, but it's workable. It's definitely not an excuse to repeat yourself everywhere. ;)
- kxyvr 9y ago
- gciruelos 9y agoi agree completely on the large document problem that LaTeX has, especially when you have big formulas, statements or diagrams that are hard to parse after you have written them and, say, you want to find where you committed a syntax error or made a typo. i think semantic macros really help with that, but they are not a silver bullet. i'd really like to see editor plugins that convert LaTeX commands to actual symbols (for example, as soon as you write the space after the q in "\neq ", it gets converted to a "=/=", and when you type backspace to erase the "=/=" you get "\ne"). that has been already implemented for languages like agda, and in a simple form is present in text editors that support fonts with ligatures. i know that what i'm proposing more on the "wysiwyg" side (which some LaTeX fundamentalists might dislike), but i think it would be a very nice thing to have when editing complicated formulas or diagrams.
- theOnliest 9y agoAucTeX in Emacs can do this, and it’s really nice.
- brians 9y agoIt’s best, in my experience, for simple expressions. We usually have a lot of those, and this helps it flow like text. Big expressions are so complex,you really want to keep your eyes on the real input.
- xelxebar 9y agoI'm just a lowly grad student, but for my Master's thesis, I decided to sit down and learn TeX which just means reading through the TeXBook for a start. Know thy tools, and all that. In fact, I ended up writing my thesis in plain TeX, and was able to write some nifty macros to solve exactly the kinds of "code reuse" problems you mention. Anyway, the whole exercise turned TeX from "arcane and painful" to "quirky but powerful" for me. I kind of enjoy hacking around on TeX now. Plain TeX library support is also surprisingly good. I used amstex for the document style and eplain for some commutative diagram and indexing stuff.
- thanatropism 9y agoWell, fixing the macro situation looks like an entirely different problem than arriving at a new math notation. Thanks to ubiquitous MathJax and so on much of the TeX-like out there is already some subset that hasn't got the standard programming features of TeX. There's already some core behavioural standard that is arguably better (at what it does) than HTML/CSS as an universal document language. And: we're starting to talk about massively transpiling to JavaScript rather than adopting a better language for remote applications. JavaScript isn't even that ensconced -- it's much easier to get programmers to change. Maybe the entire LaTeX document model, based on the idea that the ordinary user doesn't get to do layout, needs to be scrapped. Maybe people want MS Word where you paste your figures where it well damn pleases you. But even Word has taken to letting you type equations in TeX-like.
- KGIII 9y agoFellow mathematician, albeit retired. If I had to make a guess, you may not have spent enough time getting intimate with LaTeX. I don't think I've really encountered the problems you're having and, unfortunately, it has been so long since I've used it that I can't be specific. I suspect I don't recall having those issues because I avoided them in the first place. LaTeX requires thinking about the whole document before you start it. It isn't easy to work with if you don't approach it that way. Before pressing any keys, think about the document in its entirety. In my case, I took shorthand notes on paper, did the outline, and then began working on it. It requires a holistic view, and should be envisioned before even pressing a single key. It sounds more like you're fighting it, instead of thinking within it. These were some of the first things taught to us in the intro to LaTeX class. I realize this is a horribly generic response, but I'd suggest you take an intro to LaTeX class to go back to learning the basics. LaTeX is pretty versatile and I can't see any reason to replace it. It just means you'll have to learn something new, so you might just as well master the tools you already have. Again, I realize this is a very generic reply. You're not self-taught with LaTeX, are you? If you are, then I really would like to stress the value of a good professional class. You can do an intro class in just a single semester and there's almost certainly something adequate locally. There are probably some acceptable online courses but you may have to unlearn some stuff and I suspect a classroom will be easier for that. I strongly suspect I don't recall having those problems because I never encountere them. Of all the classes I took, the intro to LaTeX was one of the more valuable. Heck, it has been so long that I should probably take it again. It is one of those use it or lose it things and I haven't used it for well over a decade.
- nikdaheratik 9y agoIf you're interesting in retooling your approach, you can try using a stripped down format, like Multi-markdown (http://fletcherpenney.net/multimarkdown/features/ http://fletcherpenney.net/multimarkdown/features/) and then converting from there to LaTeX or other formats using Pandoc (https://pandoc.org/ https://pandoc.org/) or other tools. This has a learning curve by can definitely be easier than trying to wrangle TeX directly. I did kind of a roll-your-own publishing system (focusing on ePub) in an experimental fashion and it worked okay but I didn't spend too much time on it as I had other concerns. I did a writeup on that here (http://theheratik.net/books/tech-epub/ http://theheratik.net/books/tech-epub/), not that it matters much.
- kxyvr 9y agoThanks for the links! I haven't looked at multi-markdown before, but I had looked at a variety of pandoc/markdown/latex solutions in the past. In truth, it's still on my radar and I do think that pandoc represents a really nice, powerful toolchain that is more flexible than latex in many ways. Though, to be sure, they solve related, but different problems. That said, there are a couple of fiddly things that I have not had the chance to investigate such as the algorithmic generation of text, which I alluded to in other posts. In any case, yes, I think that pandoc may work well. Right now, the two approaches that I'd like to experiment with more are the pandoc/markdown/latex toolchain as well as LuaTex.