Advertisement
Guest User

Curly Brace Error

a guest
Dec 1st, 2013
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.32 KB | None | 0 0
  1. \documentclass{article}
  2.  
  3. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  4. % Lecture Specific Information to Fill Out
  5. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6. \newcommand{\LectureTitle}{Notas de Aula \#2}
  7. %\newcommand{\LectureDate}{\today}
  8. \newcommand{\LectureDate}{30\ de Novembro,\ 2013}
  9. \newcommand{\LectureClassName}{MAT\ D04}
  10. \newcommand{\LatexerName}{Carlos\ V.A.\ Silva}
  11. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  12.  
  13. % Change "article" to "report" to get rid of page number on title page
  14. \usepackage{amsmath,amsfonts,amsthm,amssymb}
  15. \usepackage{setspace}
  16. \usepackage{Tabbing}
  17. \usepackage{fancyhdr}
  18. \usepackage{lastpage}
  19. \usepackage{extramarks}
  20. \usepackage{chngpage}
  21. \usepackage{soul,color}
  22. \usepackage{graphicx,float,wrapfig}
  23. \usepackage{afterpage}
  24. \usepackage{abstract}
  25. \usepackage[version=3]{mhchem} % for chemical equations
  26. \usepackage{chemfig} % for drawing chemical compounds
  27. \usepackage{pgfplots} % for plotting equations
  28. \usepackage{multicol}
  29. \usepackage{tikz}
  30. \usetikzlibrary{matrix}
  31. \usetikzlibrary{decorations.pathreplacing}
  32. \tikzstyle{underbrace style}=[decorate,decoration={brace,raise=10mm,amplitude=5pt,mirror},color=black]
  33. % \tikzstyle{underbrace text style}=[font=\tiny, below, pos=.5, yshift=-3mm]
  34. %emoticons
  35. \usepackage{wasysym}
  36.  
  37.  
  38. %Code Listing
  39. \usepackage{listings}
  40. \usepackage{courier}
  41. \renewcommand{\lstlistingname}{Listagem}
  42. \lstset{
  43. basicstyle=\footnotesize\ttfamily, % Standardschrift
  44. numbers=left, % Ort der Zeilennummern
  45. numberstyle=\tiny, % Stil der Zeilennummern
  46. %stepnumber=2, % Abstand zwischen den Zeilennummern
  47. numbersep=5pt, % Abstand der Nummern zum Text
  48. tabsize=2, % Groesse von Tabs
  49. extendedchars=true, %
  50. breaklines=true, % Zeilen werden Umgebrochen
  51. keywordstyle=\color{red},
  52. frame=b,
  53. % keywordstyle=[1]\textbf, % Stil der Keywords
  54. % keywordstyle=[2]\textbf, %
  55. % keywordstyle=[3]\textbf, %
  56. % keywordstyle=[4]\textbf, \sqrt{\sqrt{}} %
  57. stringstyle=\color{white}\ttfamily, % Farbe der String
  58. showspaces=false, % Leerzeichen anzeigen ?
  59. showtabs=false, % Tabs anzeigen ?
  60. %tab=$\mid$,
  61. xleftmargin=17pt,
  62. framexleftmargin=17pt,
  63. framexrightmargin=5pt,
  64. framexbottommargin=4pt,
  65. %backgroundcolor=\color{lightgray},
  66. showstringspaces=false % Leerzeichen in Strings anzeigen ?
  67. }
  68. \lstloadlanguages{% Check Dokumentation for further languages ...
  69. %[Visual]Basic
  70. %Pascal
  71. %C
  72. %C++
  73. %XML
  74. %HTML
  75. %Java
  76. python
  77. }
  78. %\DeclareCaptionFont{blue}{\color{blue}}
  79.  
  80. %\captionsetup[lstlisting]{singlelinecheck=false, labelfont={blue}, textfont={blue}}
  81. \usepackage{caption}
  82. \DeclareCaptionFont{white}{\color{white}}
  83. \DeclareCaptionFormat{listing}{\colorbox[cmyk]{0.43, 0.35, 0.35,0.01}{\parbox{\textwidth}{\hspace{15pt}#1#2#3}}}
  84. \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white, singlelinecheck=false, margin=0pt, font={bf,footnotesize}}
  85.  
  86. %End code listing
  87.  
  88. \usepackage[brazilian]{babel}
  89. \usepackage[utf8]{inputenc}
  90. \usepackage[T1]{fontenc}
  91.  
  92. % In case you need to adjust margins:
  93. \topmargin=-0.45in
  94. \evensidemargin=0in
  95. \oddsidemargin=0in
  96. \textwidth=6.5in
  97. \textheight=9.0in
  98. \headsep=0.25in
  99.  
  100. % Setup the header and footer
  101. \pagestyle{fancy}
  102. \lhead{\LatexerName}
  103. \chead{\LectureClassName: \LectureTitle}
  104. \rhead{\LectureDate}
  105. \lfoot{\lastxmark}
  106. \cfoot{}
  107. \rfoot{Page\ \thepage\ of\ \pageref{LastPage}}
  108. \renewcommand\headrulewidth{0.4pt}
  109. \renewcommand\footrulewidth{0.4pt}
  110.  
  111. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  112. % Some tools
  113. \newcommand{\enterTopicHeader}[1]{\nobreak\extramarks{#1}{#1 continua na próxima página\ldots}\nobreak
  114. \nobreak\extramarks{#1 (continued)}{#1 continua na próxima página\ldots}\nobreak}
  115. \newcommand{\exitTopicHeader}[1]{\nobreak\extramarks{#1 (continued)}{#1 continua na próxima página\ldots}\nobreak
  116. \nobreak\extramarks{#1}{}\nobreak}
  117.  
  118. \newlength{\labelLength}
  119. \newcommand{\labelAnswer}[2]
  120. {\settowidth{\labelLength}{#1}
  121. \addtolength{\labelLength}{0.25in}
  122. \changetext{}{-\labelLength}{}{}{}
  123. \noindent\fbox{\begin{minipage}[c]{\columnwidth}#2\end{minipage}}
  124. \marginpar{\fbox{#1}}
  125.  
  126. % We put the blank space above in order to make sure this
  127. % \marginpar gets correctly placed.
  128. \changetext{}{+\labelLength}{}{}{}}
  129.  
  130. \setcounter{secnumdepth}{0}
  131. \newcommand{\TopicName}{}
  132. \newcounter{TopicCounter}
  133. \newenvironment{Topic}[1][Problem \arabic{TopicCounter}]
  134. {\stepcounter{TopicCounter}
  135. \renewcommand{\TopicName}{#1}
  136. \section{\TopicName}
  137. \enterTopicHeader{\TopicName}}
  138. {\exitTopicHeader{\TopicName}}
  139.  
  140. \setcounter{secnumdepth}{0}
  141. \newcommand{\ExampleSectionName}{}
  142. \newcounter{ExampleSectionCounter}[TopicCounter]
  143. \newenvironment{ExampleSection}[1][Example \arabic{ExampleSectionCounter}]
  144. {\stepcounter{ExampleSectionCounter}
  145. \renewcommand{\ExampleSectionName}{#1}
  146. \section{\ExampleSectionName}
  147. \enterTopicHeader{\ExampleSectionName}}
  148. {\exitTopicHeader{\ExampleSectionName}}
  149.  
  150. \setcounter{secnumdepth}{0}
  151. \newcounter{ExampleBoxCounter}[TopicCounter]
  152. \newcommand{\examplebox}[1]
  153. {
  154. % We put this space here to make sure we're disconnected from the previous
  155. % passage
  156. \stepcounter{ExampleBoxCounter}
  157. \noindent\fbox{\begin{minipage}[c]{\columnwidth}#1\end{minipage}}\enterTopicHeader{\ExampleSectionName}\exitTopicHeader{\ExampleSectionName}\marginpar{\fbox{\#\arabic{ExampleBoxCounter}}}
  158. % We put the blank space above in order to make sure this
  159. % \marginpar gets correctly placed.
  160. \vskip10pt
  161. }
  162.  
  163. \renewcommand{\contentsname}{{\normalsize Topics Covered}}
  164. \renewcommand{\abstractname}{\LectureTitle\ Summary}
  165. \renewcommand{\absnamepos}{flushleft}
  166.  
  167. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  168.  
  169. \begin{document}
  170. \begin{spacing}{1.1}
  171. \newpage
  172.  
  173. \begin{tikzpicture}[%
  174. >=stealth,
  175. shorten >=2pt,
  176. thick
  177. ]
  178. \matrix (block) [%
  179. matrix of nodes,
  180. nodes={%
  181. draw,
  182. anchor=center,
  183. minimum width=2em,
  184. minimum height=1em
  185. }
  186. ] {%
  187. 1 & 2 & \node[fill=gray!99]{8}; & \node[fill=gray!50]{3}; & 4 & 6 & 9\\
  188. };
  189. %\node[fill=gray!50]{1};
  190. \path[->] (block-1-4.north) edge [bend right=30] (block-1-3.north)
  191. (block-1-3.south) edge [bend right=30] (block-1-4.south);
  192. \draw (block-1-1.west) node[left=0.005cm,scale=0.9] {A:};
  193. \draw (block-1-2.south) node[below=0.1cm] {$\longleftarrow$};
  194. \draw (block-1-2.south) node[left=0.2cm,below=0.4cm,scale=0.6] {Ordenado};
  195. \draw (block-1-1.north) node[above=0.1cm,scale=0.7] {0};
  196. \draw (block-1-2.north) node[above=0.1cm,scale=0.7] {1};
  197. \draw (block-1-3.north) node[above=0.1cm,scale=0.7] {i=2};
  198. \draw (block-1-4.north) node[above=0.05cm,scale=0.7] {j=3};
  199. \draw (block-1-5.north) node[above=0.1cm,scale=0.7] {4};
  200. \draw (block-1-6.north) node[above=0.1cm,scale=0.7] {5};
  201. \draw (block-1-7.north) node[above=0.1cm,scale=0.7] {6};
  202. \draw (block-1-2.south east) node[right=0.25cm,below=1.9cm] {$\longrightarrow$};
  203. \draw [thin] (block-1-2.south east) +(0,-2) -- +(0,+2);
  204. \draw (block-1-2.south east) node[right=0.25cm,below=2.1cm] {Fronteira};
  205. \draw [underbrace style] (block-1-1.south west) -- (block-1-2.south east) node [left=0.8cm,below=1.05cm] {$A_{esquerdo}$};
  206. \draw [underbrace style] (block-1-2.south east) -- (block-1-7.south east) node [left=1.8cm,below=1.05cm] {$A_{direito}$};
  207.  
  208. \end{tikzpicture}
  209. \end{spacing}
  210. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement