Essential LaTeX: Just What's Needed
This is mainly for any of the people I have class with, but maybe it will help others too.
- Template:
\documentclass{article}
\addtolength{\oddsidemargin}{-.875in}
\addtolength{\evensidemargin}{-.875in}
\addtolength{\textwidth}{1.75in}
\addtolength{\topmargin}{-.875in}
\addtolength{\textheight}{1.75in}
\begin{document}
.......
\end{document}With the exception of the
\endline these need to be the first lines of your document. The\addtolengthlines manipulate the document's margins (which, default, are massive) to be something more appealing (~1"), in my opinion. - Beginning:
By default latex indents so, in order to bring stuff as far left as possible we'll use\noindentand conversely\indent. Also, latex doesn't read the newlines in the .tex file, you must specify a 'return' with\\. So, an example header would look like:.......
\noindent
Stew Dent \\
\#123456789 \\
5/5/2010 \\
CS251-S10 \\
6.3: 1, 4, 5cd, 9ab, 12abcd \\
........Also, should it come to it, if you need to force a page break then you can use \newpage.
- Common Connectives:
I'll only list out the common connectives we've used so far. Now, in order for these to be used they need to be surrounded on either end by dollar signs '$'. So, in order to get A ∨ B the corresponding latex code would look like:$ A \vee B $.LaTeX Translation - \vee
- \wedge
- \rightarrow
- \neg
- \not
- \equiv
- ∨ - Disjunction
- ∧ - Conjunction
- → - Implies
- ¬ - Not
- / - "Does not" (something like '\not =' would produce a '≠')
- ≡ - Equivalent
- Tables:
This is a pretty substantial part to doing formal proofs. First, an example:......
\begin{tabular}{ r@{. }l r }
\hline
\multicolumn{3}{|c|}{ $ \hspace{2.5cm} A \rightarrow \neg False \hspace{2.5cm} $ } \\
\hline
1 & $ A $ & [P] \\
2 & $ \indent\indent \neg \neg False $ & [P] \\
3 & $ \indent\indent False $ & [2, DN] \\
4 & $ \neg False $ & [2,3, IP] \\
* & QED & [1,4, CP] \\
\end{tabular}Notice:
\hlinecreates a horizontal line and\multicolumn.... produces a section that spans multiple columns to create headers, etc. In the example the table is formatted much like a formal logic proof:A → ¬F
------------------
1. A [P]
2. ¬ ¬F [P]
3. .............
*. QED [1,4, CP] - Finalizing:
Alright, now that you've got your assignment.tex file we can 'compile' and convert it to something more standard, like a PDF file. I'm assuming you've got latex installed on your respective system so simply run latex assignment.tex in order to have the file converted into a DVI file, then run:$ dvipdf assignment.dvi assignment.pdf
- Log in to post comments