Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I accustomed myself to define my own little macros for any mathematical expression I use frequently. For example, I have a macro for the expected value of a random variable:

\providecommand{\ev}[1]{\mathbb{E} \left[#1 \right]}

This has proven to be incredibly useful for several reasons:

  1. I have less to write.
  2. My document source is uncluttered.
  3. I can focus on the semantics instead of the typesetting.

In non-math mode, this is the default: I specify what I want (e.g. a subsection), not how it should look like (e.g. large and bold, with letters capitalized). Even in math mode, there are certain commands (e.g. \frac) which come with semantics attached to them. Another advantage I can think of is that it is easier to adjust documents to different tastes: Some people may be used to the \mathbb{E}, others to a bold or even a normal E for denoting an expected value. Having macros that carry semantics would allow to quickly change the notation.

With all this in mind, it seems quite surprising that I wasn't able to find a package which provides me with such commands. Am I just looking in the wrong places or is there a good reason for not doing what I try to?

share|improve this question
3  
To search package you can use CTAN. For example you can search by topic: CTAN keyword. If I understand you question correct you are looking for packages like commath or mathcmd. –  Marco Daniel Dec 16 '11 at 20:08
    
Check out the vector and easyvector packages that both provide semantics for representing vectors. –  Lev Bishop Dec 17 '11 at 6:05
add comment

3 Answers

up vote 9 down vote accepted

What about cool (COntent Oriented LaTeX)? Examples here.

share|improve this answer
    
Obviously there are still lots of things to add, but this gives an excellent start. Thanks! –  blubb Dec 17 '11 at 5:55
add comment

Of course, replacing frequently used letter/character sequences with LaTeX macros -- especially if these sequences embody stylistic and aesthetic choices that may be subject to a global change (say, because of a journal's house style) -- is a great habit to have when writing TeX/LaTeX documents. You observe:

it seems quite surprising that I wasn't able to find a package which provides me with such commands.

I suspect that your own set of useful and handy macros, which obviously depend importantly on the field you are in, and the stylistic preferences that are embedded in these macros, are likely to be so tailored to your needs and work habits that they might not be of much use to anyone else. Conversely, if some others wrote a package that collected their favorite abbreviations and incorporated their preferences, the resulting package might not be of much use outside of a very small circle of persons.

That said, if you have undergraduate and/or graduate students who are learning to use TeX and Friends, you might do them a huge favor by giving them your collection of macros as a template, that they can adapt and expand. :-)

I guess it would also be a good idea for writers of LaTeX Guides for Beginners if they stressed the importance of developing good work habits -- and if they pointed out that one of these good work habits is to come up with a set of macros that will save a lot of time down the road. :-)

share|improve this answer
add comment

Take the section command. This is a nice semantic command. We all understand what is expected of it. So why are there several packages which redefine what the command does and how it looks? Because people want their section commands to look different. Mathematical formalism is subject to the same pressures.

What would you expect this putative package to do except define a bunch of shortcuts? If that's all it's doing then it is useless. What's the point of having a shortcut you have to look up in a manual rather than one you wrote yourself?

share|improve this answer
    
I'd expect that package to establish a shared language among people. An example: I just spent half an hour replacing every occurance of a \Var \left[X \right] macro someone else wrote with my own \var{X}. If a package existed that standardized the syntactic ground, I could have saved that work. –  blubb Dec 17 '11 at 5:58
    
What could have saved you that work is standards among your coauthors, presumably. If you all wanted to use similar notation, then a package that contained all your macros would make sense. However, notational conventions (and how people want to translate them into macros) isn't universal enough for a package on CTAN to seem worthwhile. By all means write one and submit it. I don't expect many people would use it. –  Seamus Dec 17 '11 at 12:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.