I want to define some variable for my IPE template, such as the title, affiliation and author etc. The code is listed below. However when I compile it using pdflatex, it does not show the result what the \def variable should be. When I remove the \makeatletter and \makeatother, it issued a error message "! Use of \@ doesn't match its definition."
Any solutions ?
\documentclass{article}
\usepackage{color}
\makeatletter
\def\title#1{\def\@title{#1}} % Title
\def\displaytitle#1{\def\@displaytitle{#1}} % Display Title
\def\displayauthor#1{\def\@displayauthor{#1}} % Display author
\def\displayaffiliation#1{\def\@displayaffiliation{#1}} % Display affiliation
\makeatother
\title{This is a presentation}%
\displayauthor{Liu Benyuan}%
\displayaffiliation{The Automatic Target Recognition (ATR) Laboratory}%
\displaytitle{Compressive Sensing via Block Sparse Bayesian Learning : Theory and Applications}%
\begin{document}
\begin{minipage}{736pt}
\vspace*{.5em}
\begin{minipage}{650pt}\Large
\textcolor{red}{
{\bf \@displayauthor{}}~~$\cdot$~~{\bf \@displayaffiliation{}}~\hfill$\cdot$\hfill~{\bf NUDT}} \\
\textcolor{blue}{
\bf \@displaytitle{}\hfill \today{}}
\end{minipage}
\hspace*{8em}
\vspace*{.5em}
\end{minipage}
\end{document}
\makeatletterbefore the minipage: You could also simply use command names without @. E.g. instead of\def\@displayaffiliation{#1}do\def\displayaffiliationcontent{#1}. – Ulrike Fischer Jun 26 '13 at 07:34