\documentclass[11pt]{article}
\usepackage{a4wide,czech}

\usepackage{array}
\usepackage{latexsym}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

\newcommand{\handout}[4]{
  \noindent
  \begin{center}
  \framebox{
    \vbox{
      \hbox to 5.78in { {\bf NOPT048: Optimaliza�n� metody - LS 2012}
        \hfill Ji�� Sgall }
      \vspace{2mm}
      \hbox to 5.78in { {\Large \hfill #1  \hfill} }
      \vspace{2mm}
      \hbox to 5.78in { {#2 \hfill\em #4} }
%      \vspace{1mm}
      \hbox to 5.78in { {Posledn� zm�na: #3\hfill} }
    }
  }
  \end{center}
  \vspace*{2mm}
}

\newcommand{\lecture}[5]{\handout{#2}{#3, #1. p�edn�ka}{#4}{Zapsal: #5}}


\newtheorem{veta}{V�ta}
\newtheorem{pozorovani}[veta]{Pozorov�n�}
\newtheorem{lemma}[veta]{Lemma}
\theoremstyle{definition}
\newtheorem{definice}[veta]{Definice}
\newtheorem{priklad}{P��klad}

\renewcommand{\labelenumi}{(\roman{enumi})}

\newcommand{\NN}{{\mathbb{N}}}
\newcommand{\ZZ}{{\mathbb{Z}}}
\newcommand{\RR}{{\mathbb{R}}}
\newcommand{\bfb}{{\bf{b}}}
\newcommand{\bfc}{{\bf{c}}}
\newcommand{\bfx}{{\bf{x}}}
\newcommand{\bfy}{{\bf{y}}}
\newcommand{\bfz}{{\bf{z}}}

%\DeclareMathOperator{\af}{Aff}
%\DeclareMathOperator{\conv}{conv}
%\DeclareMathOperator{\lh}{span}
%\DeclareMathOperator{\rank}{rank}

\newcommand{\set}[1]{\ensuremath{\{#1\}}}
\newcommand{\setcond}[2]{\set{#1 \mid #2}}
\newcommand{\bigset}[1]{\ensuremath{\left\{#1 \right\}}}
\newcommand{\bigsetcond}[2]{\bigset{#1 \: \left| \: #2 \right.}}

\newenvironment{matice}[1]{
\left(\begin{array}{*{#1}{c}}
}{
\end{array}\right)
}

\newenvironment{bmatice}[2][1]{
\left(\begin{array}{*{#2}{c}|*{#1}{c}}
}{
\end{array}\right)
}

\newenvironment{LP}[3][1]{
\begin{array}{r@{\quad}l} 
\textrm{#2} & \: \displaystyle #3
\\[5pt]
\textrm{za podm�nek}&
\begin{array}[t]{*{#1}{>{\displaystyle}rc}r@{\quad}l} 
}{
\end{array}
\end{array}
}

\newenvironment{LPpro}[4][1]{
\begin{array}{r@{\quad}l} 
\textrm{#2} & \: \displaystyle #3
\\[5pt]
\textrm{pro} & \: \displaystyle #4
\\[5pt]
\textrm{za podm�nek}&
\begin{array}[t]{*{#1}{>{\displaystyle}rc}r@{\qquad}l}
}{
\end{array}
\end{array}
}

\newenvironment{LPmax}[2][1]{\begin{LP}[#1]{maximalizuj}{#2}}{\end{LP}}
\newenvironment{LPmin}[2][1]{\begin{LP}[#1]{minimalizuj}{#2}}{\end{LP}}

\newenvironment{LPmaxpro}[3][1]{\begin{LPpro}[#1]{maximalizuj}{#2}{#3}}{\end{LPpro}}
\newenvironment{LPminpro}[3][1]{\begin{LPpro}[#1]{minimalizuj}{#2}{#3}}{\end{LPpro}}

% pouziti:
% \begin{LPmax}{ucelovafce}
% podminky psane jako
% leva str. & operator & prava str. [& podminka]
% \end{LPmax}
%
% \begin{LPmaxpro}{ucelovafce}{podminka na promenne}
% podminky psane jako
% leva str. & operator & prava str. [& podminka]
% \end{LPmaxpro}
%
% varianta se sloupci: 
% \begin{LPmax}[i]{ucelovafce}
% podminky psane jako
% i-krat (leva str. & operator) & prava str. [& podminka]
% napr. pro i=3
% x_1 &+& x_2&+& x_3 &=& b
% \end{LPmax}
%
