listings sample
TRANSCRIPT
-
8/2/2019 Listings Sample
1/7
Pruebas del paquete listings
1 \begin{displaymath}
2 \oint_{S}\vec{E}\cdot d\vec{S}=\frac{q}{\
epsilon_{0}}
3 \end{displaymath}
S
E dS=q
0
1 \begin{trivlist}
2 \item\input{\jobname.exa}
3 \end{trivlist}
Let H be a Hilbert space, C be a closed
bounded convex subset ofH, T a nonex-
pansive self map of C. Suppose that asn , an,k 0 for each k, and n =
k=0(an,k+1 an,k)
+ 0. Then foreach x in C, Anx =
k=0an,kT
kx con-
verges weakly to a fixed point ofT .
The numbered equation
uttu+u5+u |u|p2 = 0 inR3[0,[
(1)
is automatically numbered as equation 2.
Let $H$ be a Hilbert space, $C$ be a closed bounde
a nonexpansive self map of $C$. Suppose that as $n
$a_{n,k}\rightarrow0$ for each $k$, and $\gamma_{na_{n,k+1}-a_{n,k}\right) {+}\rightarrow0$. Then
$A_{n}x=\sum_{k=0}{\infty}a_{n,k}T{k}x$ converge
$T$ .
The numbered equation
\begin{equation}
u_{tt}-\Delta u+u{5}+u\left| u\right| {p-2}=0\
{3}\times\left[ 0,\infty\right[ \label{eqn1}%
\end{equation}
is automatically numbered as equation \ref{eqn1}.
1 Let $H$ be a Hilbert space, $C$ be a
closed bounded convex subset of $H$,
$T$
2 a nonexpansive self map of $C$. Supposethat as $n\rightarrow\infty$,
3 $a_{n,k}\rightarrow0$ for each $k$, and
$\gamma_{n}=\sum_{k=0}{\infty}\left
(
4 a_{n,k+1}-a_{n,k}\right) {+}\rightarrow
0$. Then for each $x$ in $C$,
5 $A_{n}x=\sum_{k=0}{\infty}a_{n,k}T{k}x$
converges weakly to a fixed pointof
6 $T$ .
7
8 The numbered equation
9 \begin{equation}
10 u_{tt}-\Delta u+u{5}+u\left| u\right|
{p-2}=0\text{ in }\mathbf{R}%
11 {3}\times\left[ 0,\infty\right[ \label{eqn1} %
12 \end{equation}
13 is automatically numbered as equation \ref{eqn1}.
Let H be a Hilbert space, C be a closedbounded convex subset ofH, T a nonex-
pansive self map of C. Suppose that as
n , an,k 0 for each k, and n =
k=0(an,k+1 an,k)
+ 0. Then foreach x in C, Anx =
k=0an,kT
kx con-
verges weakly to a fixed point ofT .
The numbered equation
uttu+u5+u |u|p2 = 0 inR3[0,[
(2)
is automatically numbered as equation 2.
1
-
8/2/2019 Listings Sample
2/7
1 \begin{equation}
2 \forall x \in \mathbf{R}:
3 \qquad x{2} \geq 0
4 \end{equation}
x R : x2 0 (3)
1 \begin{displaymath}
2 x{2} \geq 0\qquad
3 \textrm{para todo }x\in\mathbb{R}
4 \end{displaymath}
x2 0 para todo x R
Codigo de este archivo
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage[latin1]{inputenc}
\usepackage[normalbf,normalem]{ulem}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{amsbsy}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{times}
\usepackage[activeacute,spanish]{babel}
\usepackage{color}
\usepackage{verbatim}
\usepackage{listings}
\definecolor{gray97}{gray}{.97}
\definecolor{gray85}{gray}{.95}
\definecolor{gray75}{gray}{.75}
\definecolor{gray45}{gray}{.45}
\definecolor{yellow57}{rgb}{1.00,1.00,0.84}
\lstset{ frame=Ltb,
framerule=0pt,aboveskip=0.5cm,
framextopmargin=3pt,
framexbottommargin=3pt,
framexleftmargin=0.4cm,
framesep=0pt,
2
-
8/2/2019 Listings Sample
3/7
rulesep=.4pt,
backgroundcolor=\color{gray97},
rulesepcolor=\color{black},
%
stringstyle=\ttfamily,
showstringspaces = false,
basicstyle=\small\ttfamily,
commentstyle=\color{gray45},
keywordstyle=\bfseries,
%
numbers=left,
numbersep=15pt,
numberstyle=\tiny,
numberfirstline = false,
breaklines=true,
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% minimizar fragmentado de listados
\lstnewenvironment{listing}[1][]
{\lstset{#1}\pagebreak[0]}{\pagebreak[0]}
\lstdefinestyle{consola}
{basicstyle=\scriptsize\bf\ttfamily,
backgroundcolor=\color{blue57},
}
\lstdefinestyle{L}
{language=TeX,}
% y en la derecha la composicion.
%
% \begin{example}
% \Large Esto es grande
% \end{example}
%
% Esta parte procede de verbaim.sty de FMi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\newwrite\solution@stream
\openout\solution@stream=\jobname.solutions
\newcounter{problem}\newcommand*{\problemname}{Problem}
\newcommand{\problem}[1]{%
\refstepcounter{problem}%
\problemname\theproblem:\enskip#1\par
3
-
8/2/2019 Listings Sample
4/7
}
\newcommand{\solution}[1]{%
\protected@write\solution@stream{}{%
\protect\print@solution{\theproblem}{#1}%
}%
}
\newcommand*{\printsolutions}{%
\closeout\solution@stream
\makeatletter
\InputIfFileExists{\jobname.solutions}{}{}%
\makeatother
}
\newcommand*{\solutionname}{Solution}
\newcommand{\print@solution}[2]{%
\solutionname#1:\enskip#2\par
}
%\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\makeatletter
%\def\ThisFile{\yorname}%\let\OldInput\input
%\renewcommand{\input}[1]{%
% \renewcommand{\ThisFile}{#1}%
% \OldInput{#1}%
%}
\newwrite\ejercicio@out
\newenvironment{ejercicio}%
{\begingroup% Lets Keep the Changes Local
\@bsphack
\immediate\openout \ejercicio@out \jobname.exa
\let\do\@makeother\dospecials\catcode\M\active
\def\verbatim@processline{%
\immediate\write\ejercicio@out{\the\verbatim@line}}%\verbatim@start}%
{\immediate\closeout\ejercicio@out\@esphack\endgroup%
%
% Y aqui lo que se ha anadido
%
4
-
8/2/2019 Listings Sample
5/7
\par\small\addvspace{3ex plus 1ex}\vskip -\parskip
\noindent
\makebox[0.45\linewidth][l]{%
\begin{minipage}[t]{0.45\linewidth}
\vspace*{-2ex}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.4ex minus 0.2ex}
\begin{trivlist}
\item\input{\jobname.exa}
\end{trivlist}
\end{minipage}}%
\hfill%
\makebox[0.5\linewidth][l]{%
\begin{minipage}[t]{0.50\linewidth}
\vspace*{-1ex}
\verbatiminput{\jobname.exa}
\end{minipage}}
\par\addvspace{3ex plus 1ex}\vskip -\parskip
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newwrite\example@out
\newenvironment{example}%
{\begingroup% Lets Keep the Changes Local
\@bsphack
\immediate\openout \example@out \jobname.exa\let\do\@makeother\dospecials\catcode\M\active
\def\verbatim@processline{%
\immediate\write\example@out{\the\verbatim@line}}%
\verbatim@start}%
{\immediate\closeout\example@out\@esphack\endgroup%
\makeatother
%% Y aqui lo que se ha anadido
%
\par\small\addvspace{3ex plus 1ex}\vskip -\parskip
\noindent
\makebox[0.5\linewidth][l]{%
\hspace*{+2ex}
\setlength{\parindent}{0pt}\setlength{\parskip}{1ex plus 0.4ex minus 0.7ex}
\begin{minipage}[t]{0.50\linewidth}
% \vspace*{-1ex}
\vspace*{-2ex}
5
-
8/2/2019 Listings Sample
6/7
\lstinputlisting[style=L, basicstyle=\scriptsize\bf\ttfamily,
backgroundcolor=\color{yellow57},]{\jobname.exa}
%\verbatiminput{\jobname.exa}
\end{minipage}}
\hfill
\hspace{10pt}%
\makebox[0.45\linewidth][l]{%
\begin{minipage}[t]{0.45\linewidth}
\vspace*{-2ex}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.4ex minus 0.7ex}
\begin{trivlist}
\item\input{\jobname.exa}
\end{trivlist}
\end{minipage}}%
\par\addvspace{3ex plus 1ex}\vskip -\parskip
}
\begin{document}
Pruebas del paquete listings
\begin{example}
$$\oint_{S}\vec{E}\cdot d\vec{S}=\frac{q}{\epsilon_{0}} $$
\end{example}
\begin{lstlisting}[style=L]\begin{trivlist}
\item\input{\jobname.exa}
\end{trivlist}
\end{lstlisting}
\begin{ejercicio}
Let $H$ be a Hilbert space, $C$ be a closed bounded convex subset of $H$,
a nonexpansive self map of $C$. Suppose that as $n\rightarrow\infty$,
$a_{n,k}\rightarrow0$ for each $k$, and $\gamma_{n}=\sum_{k=0}{\infty}\le
a_{n,k+1}-a_{n,k}\right) {+}\rightarrow0$. Then for each $x$ in $C$,
$A_{n}x=\sum_{k=0}{\infty}a_{n,k}T{k}x$ converges weakly to a fixed poin
$T$ .
The numbered equation\begin{equation}
u_{tt}-\Delta u+u{5}+u\left| u\right| {p-2}=0\text{ in }\mathbf{R}%
{3}\times\left[ 0,\infty\right[ \label{eqn1}%
\end{equation}
is automatically numbered as equation \ref{eqn1}.
6
-
8/2/2019 Listings Sample
7/7
\end{ejercicio}
\begin{example}
Let $H$ be a Hilbert space, $C$ be a closed bounded convex subset of $H$,
a nonexpansive self map of $C$. Suppose that as $n\rightarrow\infty$,
$a_{n,k}\rightarrow0$ for each $k$, and $\gamma_{n}=\sum_{k=0}{\infty}\le
a_{n,k+1}-a_{n,k}\right) {+}\rightarrow0$. Then for each $x$ in $C$,
$A_{n}x=\sum_{k=0}{\infty}a_{n,k}T{k}x$ converges weakly to a fixed poin
$T$ .
The numbered equation
\begin{equation}
u_{tt}-\Delta u+u{5}+u\left| u\right| {p-2}=0\text{ in }\mathbf{R}%
{3}\times\left[ 0,\infty\right[ \label{eqn1}%
\end{equation}
is automatically numbered as equation \ref{eqn1}.
\end{example}
\begin{example}
\begin{equation}
\forall x \in \mathbf{R}:
\qquad x{2} \geq 0
\end{equation}
\end{example}
\begin{example}
\begin{displaymath}
x{2} \geq 0\qquad
\textrm{para todo }x\in\mathbb{R}
\end{displaymath}\end{example}
7