Hacker News new | past | comments | ask | show | jobs | submit login
Visual Macros in TeXmacs [video] (twitter.com/gnu_texmacs)
33 points by amichail on May 6, 2020 | hide | past | favorite | 7 comments



Very nice, but not a stitch on LyX's math editor [1]. Especially good are its user-defined math macros (scroll down to point 6 in [1], or look at this video [2]); you can even define different versions for the output and for editing. Entering macros (both built-in and user-defined) and positioning your cursor in the arguments can be done with keyboard or mouse.

Unfortunately LyX tends to get dismissed a lot because long-term LaTeX users naively assume that it's just for beginners. Ironically I think you need to be a fairly advanced LaTeX user to start with before you can use it effectively.

[1] https://www.lyx.org/VisualTour

[2] https://www.youtube.com/watch?v=68Gys4rp3u4


I played with LyX a long time ago, when exploring options for editing XML documents.

The way it presents the structure of the document was great.


It's not obvious to me what "TeXmacs's macro arguments can be edited visually" means at a glance. It seems to mean: after defining a macro, in this case a commutative diagram, you can paste the 'skeleton' of a macro, and fill in arguments in the skeleton rather than having to write out the invocation of the macro. Here, each argument appears several times in the commutative diagram, and the diagram remains 'consistent'; changing an entry in one place changes all of the other entries that the macro defines to be the same. That's pretty neat as an effect, although not something I think I've ever wanted.

On the other hand, the process of defining the macro looks hideously painful, with a separate mouse hunt-and-click just to insert a macro argument. I understand the argument for structured text editing, but does it have to be mouse-driven? That is, do I have to use a mouse to insert macro argument A, or can I just type A within the macro definition, or is there possibly some middle ground where I can just type A, but pre- or post-pend some modifier key? (I've never used TeXmacs, though I've always been interested to give it a try ever since I realised it wasn't just "emacs + TeX"; I'm too wedded to the vim system.)


I did the video, and I was lazy: you can type Ctrl+arrow (as indicated in the tooltip) to insert more placeholders, no need to use the mouse. and then references are inserted with \A, etc.. Anyway you can define VIM modal keybindings ;) http://forum.texmacs.cn/t/a-very-tiny-vim-in-texmacs/176/7


vim emulation is always dangerous, because it falls so easily into an uncanny valley—it lulls you into feeling comfortable, and then is more jarring when you hit a bump than if you knew all along you were in a different editing paradigm. Anyway, thanks!

(Also, to be clear, I wasn't criticising the use of the mouse, just hoping that it wasn't the only way.)


This reminds me a lot of JetBrains MPS and their projectional editing features. https://www.youtube.com/watch?v=iN2PflvXUqQ


I didn't knew MPS but indeed seems quite similar. Both are structured editors, in the sense that you never work with "text" but with some projection of the underlying tree structure. For example you can ask TeXmacs to show you a representation where every node tree is explicit (which look very much HTML, but where you cannot have an open environment tag without the corresponding closing tag).




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: