• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Collecting Code LaTeX 2013
 

Collecting Code LaTeX 2013

on

  • 901 views

 

Statistics

Views

Total Views
901
Views on SlideShare
901
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Collecting Code LaTeX 2013 Collecting Code LaTeX 2013 Document Transcript

    • CollectingCodeLaTeXJune 12Berisi kumpulan kode latex yang dapat digunakan dalam pembuatanbuku, paper, article, jurnal, poster, dan presentasi menggunakanbeamer. Selain itu, didalam juga diberikan alternatif dalampembuatan presentasi seperti pdfscreen , prosper dan komascript.For AdvancedUsers
    • BAB 1ARTICLE1. Ar cle_1.tex%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Large Colored Title Ar cle% LaTeX Template% Version 1.1 (25/11/12)%% This template has been downloaded from:% h p://www.LaTeXTemplates.com%% Original author:% Frits Wenneker (h p://www.howtotex.com)%% License:% CC BY-NC-SA 3.0 (h p://crea vecommons.org/licenses/by-nc-sa/3.0/)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%----------------------------------------------------------------------------------------% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS%----------------------------------------------------------------------------------------documentclass[DIV=calc, paper=a4, fontsize=11pt, twocolumn]{scrartcl} % A4 paperand 11pt font sizeusepackage{lipsum} % Used for inser ng dummy Lorem ipsum text into the templateusepackage[english]{babel} % English language/hyphena onusepackage[protrusion=true,expansion=true]{microtype} % Be er typographyusepackage{amsmath,amsfonts,amsthm} % Math packagesusepackage[svgnames]{xcolor} % Enabling colors by their svgnamesusepackage[hang, small,labelfont=bf,up,tex ont=it,up]{cap on} % Custom cap onsunder/above floats in tables or figuresusepackage{booktabs} % Horizontal rules in tablesusepackage{fix-cm} % Custom font sizes - used for the ini al le er in the documentusepackage{sectsty} % Enables custom sec on tlesallsec onsfont{usefont{OT1}{phv}{b}{n}} % Change the font of all sec on commandsusepackage{fancyhdr} % Needed to define custom headers/footerspagestyle{fancy} % Enables the custom headers/footersusepackage{lastpage} % Used to determine the number of pages in the document (for "PageX of Total")% Headers - all currently emptylhead{}chead{}rhead{}
    • % Footerslfoot{}cfoot{}rfoot{footnotesize Page thepage of pageref{LastPage}} % "Page 1 of 2"renewcommand{headrulewidth}{0.0pt} % No header rulerenewcommand{footrulewidth}{0.4pt} % Thin footer ruleusepackage{le rine} % Package to accentuate the first le er of the textnewcommand{ini al}[1]{ % Defines the command and style for the first le erle rine[lines=3,lhang=0.3,nindent=0em]{color{DarkGoldenrod}{textsf{#1}}}{}}%----------------------------------------------------------------------------------------% TITLE SECTION%----------------------------------------------------------------------------------------usepackage{ tling} % Allows custom tle configura onnewcommand{HorRule}{color{DarkGoldenrod} rule{linewidth}{1pt}} % Defines the goldhorizontal rule around the tlepre tle{vspace{-30pt} begin{flushle } HorRule fontsize{50}{50} usefont{OT1}{phv}{b}{n}color{DarkRed} selec ont} % Horizontal rule before the tle tle{Ar cle Title} % Your ar cle tlepos tle{parend{flushle }vskip 0.5em} % Whitespace under the tlepreauthor{begin{flushle }large lineskip 0.5em usefont{OT1}{phv}{b}{sl}color{DarkRed}} % Author font configura onauthor{John Smith, } % Your namepostauthor{footnotesize usefont{OT1}{phv}{m}{sl} color{Black} % Configura on for theins tu on nameUniversity of California % Your ins tu onparend{flushle }HorRule} % Horizontal rule a er the tledate{} % Add a date here if you would like one to appear underneath the tle block%----------------------------------------------------------------------------------------begin{document}make tle % Print the tlethispagestyle{fancy} % Enabling the custom headers/footers for the first page
    • %----------------------------------------------------------------------------------------% ABSTRACT%----------------------------------------------------------------------------------------% The first character should be within ini al{}ini al{H}textbf{ere is some sample text to show the ini al in the introductory paragraph ofthis template ar cle. The color and lineheight of the ini al can be modified in the preambleof this document.}%----------------------------------------------------------------------------------------% ARTICLE CONTENTS%----------------------------------------------------------------------------------------sec on*{Sec on 1}lipsum[1-3] % Dummy textbegin{align}A =begin{bmatrix}A_{11} & A_{21} A_{21} & A_{22}end{bmatrix}end{align}lipsum[4] % Dummy text%------------------------------------------------subsec on*{Subsec on 1}lipsum[5] % Dummy textbegin{itemize}item First item in a listitem Second item in a listitem Third item in a listend{itemize}lipsum[6] % Dummy text%------------------------------------------------subsec on*{Subsec on 2}lipsum[7] % Dummy textbegin{table}cap on{Random table}centeringbegin{tabular}{llr}
    • toprulemul column{2}{c}{Name} cmidrule(r){1-2}First name & Last Name & Grade midruleJohn & Doe & $7.5$ Richard & Miles & $2$ bo omruleend{tabular}end{table}%------------------------------------------------sec on*{Sec on 2}lipsum[8] % Dummy textbegin{descrip on}item[First] This is the first itemitem[Last] This is the last itemend{descrip on}lipsum[9] % Dummy text%----------------------------------------------------------------------------------------% REFERENCE LIST%----------------------------------------------------------------------------------------begin{thebibliography}{99} % Bibliography - this is inten onally simple in this templatebibitem[Figueredo and Wolf, 2009]{Figueredo:2009dg}Figueredo, A.~J. and Wolf, P. S.~A. (2009).newblock Assorta ve pairing and life history strategy - a cross-culturalstudy.newblock {em Human Nature}, 20:317--330.end{thebibliography}%----------------------------------------------------------------------------------------end{document}2. Ar cle_2.tex%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Journal Ar cle% LaTeX Template% Version 1.2 (15/5/13)%% This template has been downloaded from:% h p://www.LaTeXTemplates.com
    • %% Original author:% Frits Wenneker (h p://www.howtotex.com)%% License:% CC BY-NC-SA 3.0 (h p://crea vecommons.org/licenses/by-nc-sa/3.0/)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%----------------------------------------------------------------------------------------% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS%----------------------------------------------------------------------------------------documentclass[twoside]{ar cle}usepackage{lipsum} % Package to generate dummy text throughout this templateusepackage[sc]{mathpazo} % Use the Pala no fontusepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphslinespread{1.05} % Line spacing - Pala no needs more space between linesusepackage{microtype} % Slightly tweak font spacing for aesthe csusepackage[hmarginra o=1:1,top=32mm,columnsep=20pt]{geometry} % Documentmarginsusepackage{mul col} % Used for the two-column layout of the documentusepackage[hang, small,labelfont=bf,up,tex ont=it,up]{cap on} % Custom cap onsunder/above floats in tables or figuresusepackage{booktabs} % Horizontal rules in tablesusepackage{float} % Required for tables and figures in the mul -column environment - theyneed to be placed in specific loca ons with the [H] (e.g. begin{table}[H])usepackage{hyperref} % For hyperlinks in the PDFusepackage{le rine} % The le rine is the first enlarged le er at the beginning of the textusepackage{paralist} % Used for the compac tem environment which makes bullet pointswith less space between themusepackage{abstract} % Allows abstract customiza onrenewcommand{abstractnamefont}{normalfontbfseries} % Set the "Abstract" text toboldrenewcommand{abstrac ex ont}{normalfontsmallitshape} % Set the abstract itself tosmall italic textusepackage{ tlesec} % Allows customiza on of tlesrenewcommandthesec on{Roman{sec on}} tleformat{sec on}[block]{largescshapecentering}{thesec on.}{1em}{} % Change thelook of the sec on tlesusepackage{fancyhdr} % Headers and footerspagestyle{fancy} % All pages have headers and footersfancyhead{} % Blank out the default headerfancyfoot{} % Blank out the default footer
    • fancyhead[C]{Running tle $bullet$ November 2012 $bullet$ Vol. XXI, No. 1} % Customheader textfancyfoot[RO,LE]{thepage} % Custom footer text%----------------------------------------------------------------------------------------% TITLE SECTION%---------------------------------------------------------------------------------------- tle{vspace{-15mm}fontsize{24pt}{10pt}selec onttextbf{Ar cle Title}} % Ar cle tleauthor{largetextsc{John Smith}thanks{A thank you or further informa on}[2mm] % Your namenormalsize University of California % Your ins tu onnormalsize href{mailto:john@smith.com}{john@smith.com} % Your email addressvspace{-5mm}}date{}%----------------------------------------------------------------------------------------begin{document}make tle % Insert tlethispagestyle{fancy} % All pages have headers and footers%----------------------------------------------------------------------------------------% ABSTRACT%----------------------------------------------------------------------------------------begin{abstract}noindent lipsum[1] % Dummy abstract textend{abstract}%----------------------------------------------------------------------------------------% ARTICLE CONTENTS%----------------------------------------------------------------------------------------begin{mul cols}{2} % Two-column layout throughout the main ar cle textsec on{Introduc on}le rine[nindent=0em,lines=3]{L} orem ipsum dolor sit amet, consectetur adipiscing elit.lipsum[2-3] % Dummy text%------------------------------------------------sec on{Methods}
    • Maecenas sed ultricies felis. Sed imperdiet dictum arcu a egestas.begin{compac tem}item Donec dolor arcu, rutrum id moles e in, viverra sed diamitem Curabitur feugiatitem turpis sed auctor facilisisitem arcu eros accumsan lorem, at posuere mi diam sit amet tortoritem Fusce fermentum, mi sit amet euismod rutrumitem sem lorem moles e diam, iaculis aliquet sapien tortor non nisiitem Pellentesque bibendum pre um aliquetend{compac tem}lipsum[4] % Dummy text%------------------------------------------------sec on{Results}begin{table}[H]cap on{Example table}centeringbegin{tabular}{llr}toprulemul column{2}{c}{Name} cmidrule(r){1-2}First name & Last Name & Grade midruleJohn & Doe & $7.5$ Richard & Miles & $2$ bo omruleend{tabular}end{table}lipsum[5] % Dummy textbegin{equa on}label{eq:emc}e = mc^2end{equa on}lipsum[6] % Dummy text%------------------------------------------------sec on{Discussion}lipsum[7-8] % Dummy text%----------------------------------------------------------------------------------------% REFERENCE LIST%----------------------------------------------------------------------------------------
    • begin{thebibliography}{99} % Bibliography - this is inten onally simple in this templatebibitem[Figueredo and Wolf, 2009]{Figueredo:2009dg}Figueredo, A.~J. and Wolf, P. S.~A. (2009).newblock Assorta ve pairing and life history strategy - a cross-culturalstudy.newblock {em Human Nature}, 20:317--330.end{thebibliography}%----------------------------------------------------------------------------------------end{mul cols}end{document}3. Ar cle_3.tex%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Stylish Ar cle% LaTeX Template% Version 1.0 (31/1/13)%% This template has been downloaded from:% h p://www.LaTeXTemplates.com%% Original author:% Mathias Legrand (legrand.mathias@gmail.com)%% License:% CC BY-NC-SA 3.0 (h p://crea vecommons.org/licenses/by-nc-sa/3.0/)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%----------------------------------------------------------------------------------------% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS%----------------------------------------------------------------------------------------documentclass[fleqn,10pt]{SelfArx} % Document font size and equa ons flushed lesetlength{columnsep}{0.55cm} % Distance between the two columns of textsetlength{ oxrule}{0.75pt} % Width of the border around the abstractdefinecolor{color1}{RGB}{0,0,90} % Color of the ar cle tle and sec onsdefinecolor{color2}{RGB}{0,20,20} % Color of the boxes behind the abstract and headingsnewlength{tocsep}setlengthtocsep{1.5pc} % Sets the indenta on of the sec ons in the table of contentssetcounter{tocdepth}{3} % Show only three levels in the table of contents sec on: sec ons,subsec ons and subsubsec ons
    • usepackage{lipsum} % Required to insert dummy text%----------------------------------------------------------------------------------------% ARTICLE INFORMATION%----------------------------------------------------------------------------------------JournalInfo{Journal, Vol. XXI, No. 1, 1-5, 2013} % Journal informa onArchive{Addi onal note} % Addi onal notes (e.g. copyright, DOI, review/research ar cle)PaperTitle{Ar cle Title} % Ar cle tleAuthors{John Smithtextsuperscript{1}*, James Smithtextsuperscript{2}} % Authorsaffilia on{textsuperscript{1}tex t{Department of Biology, University of Examples, London,United Kingdom}} % Author affilia onaffilia on{textsuperscript{2}tex t{Department of Chemistry, University of Examples,London, United Kingdom}} % Author affilia onaffilia on{*textbf{Corresponding author}: john@smith.com} % Corresponding authorKeywords{Keyword1 --- Keyword2 --- Keyword3} % Keywords - if you dont want any simplyremove all the text between the curly bracketsnewcommand{keywordname}{Keywords} % Defines the keywords heading name%----------------------------------------------------------------------------------------% ABSTRACT%----------------------------------------------------------------------------------------Abstract{lipsum[1]~}%----------------------------------------------------------------------------------------begin{document}flushbo om % Makes all text pages the same heightmake tle % Print the tle and abstract boxtableofcontents % Print the contents sec onthispagestyle{empty} % Removes page numbering from the first page%----------------------------------------------------------------------------------------% ARTICLE CONTENTS%----------------------------------------------------------------------------------------sec on*{Introduc on} % The sec on*{} command stops sec on numberingaddcontentsline{toc}{sec on}{hspace*{-tocsep}Introduc on} % Adds this sec on to thetable of contents with nega ve horizontal space equal to the indent for the numberedsec onslipsum[1-3] % Dummy text
    • %------------------------------------------------sec on{Methods}begin{figure*}[ht]centering % Using begin{figure*} makes the figure take up the en rewidth of the pageincludegraphics[width=linewidth]{view}cap on{Wide Picture}label{fig:view}end{figure*}lipsum[4] % Dummy textbegin{equa on}cos^3 theta =frac{1}{4}costheta+frac{3}{4}cos 3thetalabel{eq:refname2}end{equa on}lipsum[5] % Dummy textbegin{enumerate}[noitemsep] % [noitemsep] removes whitespace between the items for acompact lookitem First item in a listitem Second item in a listitem Third item in a listend{enumerate}subsec on{Subsec on}lipsum[6] % Dummy textparagraph{Paragraph} lipsum[7] % Dummy textparagraph{Paragraph} lipsum[8] % Dummy textsubsec on{Subsec on}lipsum[9] % Dummy textbegin{figure}[ht]centeringincludegraphics[width=linewidth]{results}cap on{In-text Picture}label{fig:results}end{figure}Reference to Figure ref{fig:results}.%------------------------------------------------sec on{Results and Discussion}
    • lipsum[10] % Dummy textsubsec on{Subsec on}lipsum[11] % Dummy textbegin{table}[hbt]cap on{Table of Grades}centeringbegin{tabular}{llr}toprulemul column{2}{c}{Name} cmidrule(r){1-2}First name & Last Name & Grade midruleJohn & Doe & $7.5$ Richard & Miles & $2$ bo omruleend{tabular}label{tab:label}end{table}subsubsec on{Subsubsec on}lipsum[12] % Dummy textbegin{descrip on}item[Word] Defini onitem[Concept] Explana onitem[Idea] Textend{descrip on}subsubsec on{Subsubsec on}lipsum[13] % Dummy textbegin{itemize}[noitemsep] % [noitemsep] removes whitespace between the items for acompact lookitem First item in a listitem Second item in a listitem Third item in a listend{itemize}subsubsec on{Subsubsec on}lipsum[14] % Dummy textsubsec on{Subsec on}lipsum[15-23] % Dummy text
    • %------------------------------------------------sec on*{Acknowledgments} % The sec on*{} command stops sec on numberingaddcontentsline{toc}{sec on}{hspace*{-tocsep}Acknowledgments} % Adds this sec on tothe table of contents with nega ve horizontal space equal to the indent for the numberedsec onsSo long and thanks for all the fish cite{Figueredo:2009dg}.%----------------------------------------------------------------------------------------% REFERENCE LIST%----------------------------------------------------------------------------------------bibliographystyle{unsrt}bibliography{sample}%----------------------------------------------------------------------------------------end{document}
    • BAB 2ASSIGNMENNT1. Assignment_1.tex%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Structured General Purpose Assignment% LaTeX Template%% This template has been downloaded from:% h p://www.latextemplates.com%% Original author:% Ted Pavlic (h p://www.tedpavlic.com)%% Note:% The lipsum[#] commands throughout this template generate dummy text% to fill the template out. These commands should all be removed when% wri ng assignment content.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%----------------------------------------------------------------------------------------% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS%----------------------------------------------------------------------------------------documentclass{ar cle}usepackage{fancyhdr} % Required for custom headersusepackage{lastpage} % Required to determine the last page for the footerusepackage{extramarks} % Required for headers and footersusepackage{graphicx} % Required to insert imagesusepackage{lipsum} % Used for inser ng dummy Lorem ipsum text into the template% Marginstopmargin=-0.45inevensidemargin=0inoddsidemargin=0intextwidth=6.5intextheight=9.0inheadsep=0.25inlinespread{1.1} % Line spacing% Set up the header and footerpagestyle{fancy}lhead{hmwkAuthorName} % Top le headerchead{hmwkClass (hmwkClassInstructor hmwkClassTime): hmwkTitle} % Top center headerrhead{firstxmark} % Top right headerlfoot{lastxmark} % Bo om le footercfoot{} % Bo om center footer
    • rfoot{Page thepage of pageref{LastPage}} % Bo om right footerrenewcommandheadrulewidth{0.4pt} % Size of the header rulerenewcommandfootrulewidth{0.4pt} % Size of the footer rulesetlengthparindent{0pt} % Removes all indenta on from paragraphs%----------------------------------------------------------------------------------------% DOCUMENT STRUCTURE COMMANDS% Skip this unless you know what youre doing%----------------------------------------------------------------------------------------% Header and footer for when a page split occurs within a problem environmentnewcommand{enterProblemHeader}[1]{nobreakextramarks{#1}{#1 con nued on next pageldots}nobreaknobreakextramarks{#1 (con nued)}{#1 con nued on next pageldots}nobreak}% Header and footer for when a page split occurs between problem environmentsnewcommand{exitProblemHeader}[1]{nobreakextramarks{#1 (con nued)}{#1 con nued on next pageldots}nobreaknobreakextramarks{#1}{}nobreak}setcounter{secnumdepth}{0} % Removes default sec on numbersnewcounter{homeworkProblemCounter} % Creates a counter to keep track of the number ofproblemsnewcommand{homeworkProblemName}{}newenvironment{homeworkProblem}[1][Problem arabic{homeworkProblemCounter}]{ % Makes anew environment called homeworkProblem which takes 1 argument (custom name) but the defaultis "Problem #"stepcounter{homeworkProblemCounter} % Increase counter for number of problemsrenewcommand{homeworkProblemName}{#1} % Assign homeworkProblemName the name ofthe problemsec on{homeworkProblemName} % Make a sec on in the document with the custom problemcountenterProblemHeader{homeworkProblemName} % Header and footer within the environment}{exitProblemHeader{homeworkProblemName} % Header and footer a er the environment}newcommand{problemAnswer}[1]{ % Defines the problem answer command with the content asthe only argumentnoindentframebox[columnwidth][c]{begin{minipage}{0.98columnwidth}#1end{minipage}} %Makes the box around the problem answer and puts the content inside}newcommand{homeworkSec onName}{}newenvironment{homeworkSec on}[1]{ % New environment for sec ons within homeworkproblems, takes 1 argument - the name of the sec on
    • renewcommand{homeworkSec onName}{#1} % Assign homeworkSec onName to the name ofthe sec on from the environment argumentsubsec on{homeworkSec onName} % Make a subsec on with the custom name of the subsec onenterProblemHeader{homeworkProblemName [homeworkSec onName]} % Header and footerwithin the environment}{enterProblemHeader{homeworkProblemName} % Header and footer a er the environment}%----------------------------------------------------------------------------------------% NAME AND CLASS SECTION%----------------------------------------------------------------------------------------newcommand{hmwkTitle}{Assignment #1} % Assignment tlenewcommand{hmwkDueDate}{Monday, January 1, 2012} % Due datenewcommand{hmwkClass}{BIO 101} % Course/classnewcommand{hmwkClassTime}{10:30am} % Class/lecture menewcommand{hmwkClassInstructor}{Jones} % Teacher/lecturernewcommand{hmwkAuthorName}{John Smith} % Your name%----------------------------------------------------------------------------------------% TITLE PAGE%---------------------------------------------------------------------------------------- tle{vspace{2in}textmd{textbf{hmwkClass: hmwkTitle}}normalsizevspace{0.1in}small{Due on hmwkDueDate}vspace{0.1in}large{tex t{hmwkClassInstructor hmwkClassTime}}vspace{3in}}author{textbf{hmwkAuthorName}}date{} % Insert date here if you want it to appear below your name%----------------------------------------------------------------------------------------begin{document}make tle%----------------------------------------------------------------------------------------% TABLE OF CONTENTS%----------------------------------------------------------------------------------------%setcounter{tocdepth}{1} % Uncomment this line if you dont want subsec ons listed in the ToCnewpagetableofcontentsnewpage
    • %----------------------------------------------------------------------------------------% PROBLEM 1%----------------------------------------------------------------------------------------% To have just one problem per page, simply put a clearpage a er each problembegin{homeworkProblem}lipsum[1]vspace{10pt} % Ques onproblemAnswer{ % Answerbegin{center}includegraphics[width=0.75columnwidth]{example_figure} % Example imageend{center}lipsum[2]}end{homeworkProblem}%----------------------------------------------------------------------------------------% PROBLEM 2%----------------------------------------------------------------------------------------begin{homeworkProblem}[Exercise #arabic{homeworkProblemCounter}] % Custom sec on tlelipsum[3] % Ques on%--------------------------------------------begin{homeworkSec on}{(a)} % Sec on within problemlipsum[4]vspace{10pt} % Ques onproblemAnswer{ % Answerlipsum[5]}end{homeworkSec on}%--------------------------------------------begin{homeworkSec on}{(b)} % Sec on within problemproblemAnswer{ % Answerlipsum[6]}end{homeworkSec on}%--------------------------------------------end{homeworkProblem}%----------------------------------------------------------------------------------------% PROBLEM 3%----------------------------------------------------------------------------------------
    • begin{homeworkProblem}[Prob. Roman{homeworkProblemCounter}] % Roman numerals%--------------------------------------------begin{homeworkSec on}{homeworkProblemName:~(a)} % Using the problem name elsewhereproblemAnswer{ % Answerlipsum[7]}end{homeworkSec on}%--------------------------------------------begin{homeworkSec on}{homeworkProblemName:~(b)}lipsum[8]vspace{10pt} % Ques onproblemAnswer{ % Answerlipsum[9]}end{homeworkSec on}%--------------------------------------------end{homeworkProblem}%----------------------------------------------------------------------------------------% PROBLEM 4%----------------------------------------------------------------------------------------begin{homeworkProblem}[Prob. Roman{homeworkProblemCounter}] % Roman numeralsproblemAnswer{ % Answerlipsum[10]}end{homeworkProblem}%----------------------------------------------------------------------------------------end{document}2. Assignment_2.tex%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Programming/Coding Assignment% LaTeX Template%% This template has been downloaded from:% h p://www.latextemplates.com%% Original author:% Ted Pavlic (h p://www.tedpavlic.com)%% Note:
    • % The lipsum[#] commands throughout this template generate dummy text% to fill the template out. These commands should all be removed when% wri ng assignment content.%% This template uses a Perl script as an example snippet of code, most other% languages are also usable. Configure them in the "CODE INCLUSION% CONFIGURATION" sec on.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%----------------------------------------------------------------------------------------% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS%----------------------------------------------------------------------------------------documentclass{ar cle}usepackage{fancyhdr} % Required for custom headersusepackage{lastpage} % Required to determine the last page for the footerusepackage{extramarks} % Required for headers and footersusepackage[usenames,dvipsnames]{color} % Required for custom colorsusepackage{graphicx} % Required to insert imagesusepackage{lis ngs} % Required for inser on of codeusepackage{courier} % Required for the courier fontusepackage{lipsum} % Used for inser ng dummy Lorem ipsum text into the template% Marginstopmargin=-0.45inevensidemargin=0inoddsidemargin=0intextwidth=6.5intextheight=9.0inheadsep=0.25inlinespread{1.1} % Line spacing% Set up the header and footerpagestyle{fancy}lhead{hmwkAuthorName} % Top le headerchead{hmwkClass (hmwkClassInstructor hmwkClassTime): hmwkTitle} % Top centerheadrhead{firstxmark} % Top right headerlfoot{lastxmark} % Bo om le footercfoot{} % Bo om center footerrfoot{Page thepage of protectpageref{LastPage}} % Bo om right footerrenewcommandheadrulewidth{0.4pt} % Size of the header rulerenewcommandfootrulewidth{0.4pt} % Size of the footer rulesetlengthparindent{0pt} % Removes all indenta on from paragraphs%----------------------------------------------------------------------------------------% CODE INCLUSION CONFIGURATION
    • %----------------------------------------------------------------------------------------definecolor{MyDarkGreen}{rgb}{0.0,0.4,0.0} % This is the color used for commentslstloadlanguages{Perl} % Load Perl syntax for lis ngs, for a list of other languages supportedsee: p:// p.tex.ac.uk/tex-archive/macros/latex/contrib/lis ngs/lis ngs.pdflstset{language=Perl, % Use Perl in this exampleframe=single, % Single frame around codebasicstyle=small amily, % Use small true type fontkeywordstyle=[1]color{Blue}bf, % Perl func ons bold and bluekeywordstyle=[2]color{Purple}, % Perl func on arguments purplekeywordstyle=[3]color{Blue}underbar, % Custom func ons underlined and blueiden fierstyle=, % Nothing special about iden fierscommentstyle=usefont{T1}{pcr}{m}{sl}color{MyDarkGreen}small, % Comments smalldark green courier fontstringstyle=color{Purple}, % Strings are purpleshowstringspaces=false, % Dont put marks in string spacestabsize=5, % 5 spaces per tab%% Put standard Perl func ons not included in the default language heremorekeywords={rand},%% Put Perl func on parameters heremorekeywords=[2]{on, off, interp},%% Put user defined func ons heremorekeywords=[3]{test},%morecomment=[l][color{Blue}]{...}, % Line con nua on (...) like blue commentnumbers=le , % Line numbers on lefirstnumber=1, % Line numbers start with line 1numberstyle= nycolor{Blue}, % Line numbers are blue and smallstepnumber=5 % Line numbers go in steps of 5}% Creates a new command to include a perl script, the first parameter is the filename of thescript (without .pl), the second parameter is the cap onnewcommand{perlscript}[2]{begin{itemize}item[]ls nputlis ng[cap on=#2,label=#1]{#1.pl}end{itemize}}%----------------------------------------------------------------------------------------% DOCUMENT STRUCTURE COMMANDS% Skip this unless you know what youre doing%----------------------------------------------------------------------------------------% Header and footer for when a page split occurs within a problem environmentnewcommand{enterProblemHeader}[1]{nobreakextramarks{#1}{#1 con nued on next pageldots}nobreaknobreakextramarks{#1 (con nued)}{#1 con nued on next pageldots}nobreak
    • }% Header and footer for when a page split occurs between problem environmentsnewcommand{exitProblemHeader}[1]{nobreakextramarks{#1 (con nued)}{#1 con nued on next pageldots}nobreaknobreakextramarks{#1}{}nobreak}setcounter{secnumdepth}{0} % Removes default sec on numbersnewcounter{homeworkProblemCounter} % Creates a counter to keep track of the numberof problemsnewcommand{homeworkProblemName}{}newenvironment{homeworkProblem}[1][Problem arabic{homeworkProblemCounter}]{ %Makes a new environment called homeworkProblem which takes 1 argument (custom name)but the default is "Problem #"stepcounter{homeworkProblemCounter} % Increase counter for number of problemsrenewcommand{homeworkProblemName}{#1} % Assign homeworkProblemName thename of the problemsec on{homeworkProblemName} % Make a sec on in the document with the customproblem countenterProblemHeader{homeworkProblemName} % Header and footer within theenvironment}{exitProblemHeader{homeworkProblemName} % Header and footer a er the environment}newcommand{problemAnswer}[1]{ % Defines the problem answer command with thecontent as the only argumentnoindentframebox[columnwidth][c]{begin{minipage}{0.98columnwidth}#1end{minipage}} % Makes the box around the problem answer and puts the content inside}newcommand{homeworkSec onName}{}newenvironment{homeworkSec on}[1]{ % New environment for sec ons within homeworkproblems, takes 1 argument - the name of the sec onrenewcommand{homeworkSec onName}{#1} % Assign homeworkSec onName to thename of the sec on from the environment argumentsubsec on{homeworkSec onName} % Make a subsec on with the custom name of thesubsec onenterProblemHeader{homeworkProblemName [homeworkSec onName]} % Header andfooter within the environment}{enterProblemHeader{homeworkProblemName} % Header and footer a er theenvironment}%----------------------------------------------------------------------------------------% NAME AND CLASS SECTION%----------------------------------------------------------------------------------------
    • newcommand{hmwkTitle}{Assignment #1} % Assignment tlenewcommand{hmwkDueDate}{Monday, January 1, 2012} % Due datenewcommand{hmwkClass}{COMPSCI 101} % Course/classnewcommand{hmwkClassTime}{10:30am} % Class/lecture menewcommand{hmwkClassInstructor}{Jones} % Teacher/lecturernewcommand{hmwkAuthorName}{John Smith} % Your name%----------------------------------------------------------------------------------------% TITLE PAGE%---------------------------------------------------------------------------------------- tle{vspace{2in}textmd{textbf{hmwkClass: hmwkTitle}}normalsizevspace{0.1in}small{Due on hmwkDueDate}vspace{0.1in}large{tex t{hmwkClassInstructor hmwkClassTime}}vspace{3in}}author{textbf{hmwkAuthorName}}date{} % Insert date here if you want it to appear below your name%----------------------------------------------------------------------------------------begin{document}make tle%----------------------------------------------------------------------------------------% TABLE OF CONTENTS%----------------------------------------------------------------------------------------%setcounter{tocdepth}{1} % Uncomment this line if you dont want subsec ons listed in theToCnewpagetableofcontentsnewpage%----------------------------------------------------------------------------------------% PROBLEM 1%----------------------------------------------------------------------------------------% To have just one problem per page, simply put a clearpage a er each problembegin{homeworkProblem}Lis ng ref{homework_example} shows a Perl script.perlscript{homework_example}{Sample Perl Script With Highligh ng}lipsum[1]
    • end{homeworkProblem}%----------------------------------------------------------------------------------------% PROBLEM 2%----------------------------------------------------------------------------------------begin{homeworkProblem}lipsum[2]problemAnswer{begin{center}includegraphics[width=0.75columnwidth]{example_figure} % Example imageend{center}lipsum[3-5]}end{homeworkProblem}%----------------------------------------------------------------------------------------end{document}3. Assignment_3.tex%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Short Sec oned Assignment% LaTeX Template% Version 1.0 (5/5/12)%% This template has been downloaded from:% h p://www.LaTeXTemplates.com%% Original author:% Frits Wenneker (h p://www.howtotex.com)%% License:% CC BY-NC-SA 3.0 (h p://crea vecommons.org/licenses/by-nc-sa/3.0/)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%----------------------------------------------------------------------------------------% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS%----------------------------------------------------------------------------------------documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font sizeusepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphsusepackage{fourier} % Use the Adobe Utopia font for the document - comment this line toreturn to the LaTeX defaultusepackage[english]{babel} % English language/hyphena onusepackage{amsmath,amsfonts,amsthm} % Math packages
    • usepackage{lipsum} % Used for inser ng dummy Lorem ipsum text into the templateusepackage{sectsty} % Allows customizing sec on commandsallsec onsfont{centering normalfontscshape} % Make all sec ons centered, the defaultfont and small capsusepackage{fancyhdr} % Custom headers and footerspagestyle{fancyplain} % Makes all pages in the document conform to the custom headersand footersfancyhead{} % No page header - if you want one, create it in the same way as the footersbelowfancyfoot[L]{} % Empty le footerfancyfoot[C]{} % Empty center footerfancyfoot[R]{thepage} % Page numbering for right footerrenewcommand{headrulewidth}{0pt} % Remove header underlinesrenewcommand{footrulewidth}{0pt} % Remove footer underlinessetlength{headheight}{13.6pt} % Customize the height of the headernumberwithin{equa on}{sec on} % Number equa ons within sec ons (i.e. 1.1, 1.2, 2.1, 2.2instead of 1, 2, 3, 4)numberwithin{figure}{sec on} % Number figures within sec ons (i.e. 1.1, 1.2, 2.1, 2.2instead of 1, 2, 3, 4)numberwithin{table}{sec on} % Number tables within sec ons (i.e. 1.1, 1.2, 2.1, 2.2 insteadof 1, 2, 3, 4)setlengthparindent{0pt} % Removes all indenta on from paragraphs - comment this linefor an assignment with lots of text%----------------------------------------------------------------------------------------% TITLE SECTION%----------------------------------------------------------------------------------------newcommand{horrule}[1]{rule{linewidth}{#1}} % Create horizontal rule command with 1argument of height tle{normalfont normalsizetextsc{university, school or department name} [25pt] % Your university, school and/ordepartment name(s)horrule{0.5pt} [0.4cm] % Thin top horizontal rulehuge Assignment Title % The assignment tlehorrule{2pt} [0.5cm] % Thick bo om horizontal rule}author{John Smith} % Your namedate{normalsizetoday} % Todays date or a custom datebegin{document}
    • make tle % Print the tle%----------------------------------------------------------------------------------------% PROBLEM 1%----------------------------------------------------------------------------------------sec on{Problem tle}lipsum[2] % Dummy textbegin{align}begin{split}(x+y)^3 &= (x+y)^2(x+y)&=(x^2+2xy+y^2)(x+y)&=(x^3+2x^2y+xy^2) + (x^2y+2xy^2+y^3)&=x^3+3x^2y+3xy^2+y^3end{split}end{align}Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. E amultricies nisi vel augue. Curabitur ullamcorper ultricies%------------------------------------------------subsec on{Heading on level 2 (subsec on)}Lorem ipsum dolor sit amet, consectetuer adipiscing elit.begin{align}A =begin{bmatrix}A_{11} & A_{21} A_{21} & A_{22}end{bmatrix}end{align}Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque pena bus et magnisdis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesqueeu, pre um quis, sem.%------------------------------------------------subsubsec on{Heading on level 3 (subsubsec on)}lipsum[3] % Dummy textparagraph{Heading on level 4 (paragraph)}lipsum[6] % Dummy text%----------------------------------------------------------------------------------------% PROBLEM 2%----------------------------------------------------------------------------------------
    • sec on{Lists}%------------------------------------------------subsec on{Example of list (3*itemize)}begin{itemize}item First item in a listbegin{itemize}item First item in a listbegin{itemize}item First item in a listitem Second item in a listend{itemize}item Second item in a listend{itemize}item Second item in a listend{itemize}%------------------------------------------------subsec on{Example of list (enumerate)}begin{enumerate}item First item in a listitem Second item in a listitem Third item in a listend{enumerate}%----------------------------------------------------------------------------------------end{document}