Emacs users: how would you do this in Emacs? I've included a vi solution under the cut, but I suspect (based on the kind of thing we've been talking about recently) that, while the vi solution would work within Emacs, the most natural Emacs solution would look rather different
(
Read more... )
Comments 11
Using AUCTeX LaTeX/M mode (M means with the additional maths keybindings that all compski emacsers should be using by default), enter some $ signs to get into a math region. Then enter the whole greek alphabet in lowercase, using two keystrokes for each letter ("`a" becomes "\alpha", etc). All on one line saves keystrokes.
Once you've done that, use a keyboard macro ("C-x (" to start the macro and "C-x )" to finish. "C-x e" to execute, which may be given a numerical argument, to execute 20 times or whatever... How many greek letters are there anyway?) along with the search function (searching for "\" takes one simple chord and one press) to add most of the rest of the template (newlines and other such gumph).
Hopefully you can see how that could give us something like:
$\alpha$ & & & \\
$\beta$ & & & \\
...
without any trouble ( ... )
Reply
Reply
> let upper xs = (toUpper $ head xs):(tail xs) in unlines $ map (\x ->
"$\\"++x++"$ & $\\"++(upper x)++"$ & "++(upper x)++" & //") ["alpha",
"beta", "gamma", "delta"]
"$\\alpha$ & $\\Alpha$ & Alpha & //\n$\\beta$ & $\\Beta$ & Beta &
//\n$\\gamma$ & $\\Gamma$ & Gamma & //\n$\\delta$ & $\\Delta$ &
Delta & //\n"
Reply
* gds wonders how useful it'd be to have lambdabot hooks in a text editor...
gds: already has hooks :)
you can call it from vim, anyway. i do
Ah...
Might be time for my regular emacs/vim switch then, I guess...
:)
Reply
Yup - the latex suite (apt-get install vim-latexsuite in ubuntu) does it.
Reply
Lazy answer: if you know how to do it in vi, do it in vi!! (Maybe this attitude is the reason why I will never be a coder).
Honest answer: I've never bothered to learn either; though they could be useful in this sort of situation, it's one I'm seldom (never?) in. I prefer an editor like nedit where you can get going straight off without spending time learning anything. Colourful highlighting, and lets you define lovely macros and all too. Actually, maybe I could define a macro to do that in nedit. If I could be arsed.
Reply
I only had one lesson on the Greek alphabet, for which I produced this handout, but it's only just occurred to me to ask.
Reply
Reply
http://www.vim.org/tips/tip.php?tip_id=1390
Reply
Leave a comment