TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on my CV, and am trying to format job/education listings to look something like follows:

Company or University (Location)
Job title or degree received
Some description of what I did there.

I'm putting enough of these in that I'd like to define an environment to handle the formatting so I don't have to hard-code it (and/or have to re-do every single one individually when I change my mind!). I.e. I'd like to be able to do something like

\institution{Company or University}
\position{Job title or degree received}
\description{Some description of what I did there.}

And have it output the above. I kind of blindly tried to define new commands for \institution, \location, \position, etc. using e.g.


and then create a new environment that does the formatting in the "after environment" code, like so:


I put both of these inside a \makeatletter...\makeatother block, and my document compiles fine with this in the preamble. But as soon as I try to actually use this environment, e.g. insert

\institution{Someplace I worked}

somewhere in the document body, I get an error that says

Missing control sequence inserted: <inserted text> 

when it reads the \institution{Someplace I worked} line and a second that says

Undefined control sequence: <recently read> \@institution

when it reads the \end{job} line.

So, clearly my naive approach doesn't work - any better ways to go about this?

share|improve this question

closed as too localized by Marco Daniel, Joseph Wright Aug 11 '12 at 9:10

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

\gdef{\@institution}{#1} is a syntax error you can not put braces around the command being defined with the primitive def syntax. \gdef\@institution{#1}} – David Carlisle Aug 10 '12 at 18:54
Also, there is no need to define those commands as global. It might be a better idea to define local commands in the "begin" portion of \newenvironment – mrf Aug 10 '12 at 21:49
Ah! Thanks, @david-carlisle - the syntax error was the culprit. It worked once I fixed that. – Jennifer L Aug 10 '12 at 22:44
@JenniferL Is it OK for you if we close this question since it seems that you have fixed the issue? – percusse Aug 10 '12 at 23:01
Yes - I was just about to update the question with the solution, but it's fine to close it. Thanks for the help! – Jennifer L Aug 10 '12 at 23:09

Here's a couple of ideas- one is using a \newcommand, and one uses a \newenvironment; perhaps you can tweak them as you see fit




% as a command
\newcommand{\job}[4]{% 1: company, 2: location, 3: title, 4: description
    \bfseries{#1 (#2)}\\

% or perhaps an environment
\newenvironment{myjob}[3]{% 1: company, 2: location, 3: title
    \bfseries{#1 (#2)}\\


\job{Company or University}%
    {Job title or degree received}%
    {Some description of what I did there.}

\begin{myjob}{Another institution}%
    {Somewhere else}%
    {Another thing}%
    Long description of stuff| could be anything
        \item discovered
        \item a 
        \item few
        \item important
        \item things

share|improve this answer

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