Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
lo2
Posts: 15 Joined: Wed Oct 21, 2009 6:31 pm
Post
by lo2 » Mon Sep 03, 2012 7:28 pm
I am trying to build the following:
Code: Select all
\documentclass[danish]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{geometry}
\usepackage{babel}
\usepackage{ae}
\usepackage{fancyhdr}
\usepackage[pdftex]{graphicx}
\geometry{verbose,letterpaper,bmargin=2cm,tmargin=2cm}
\pagestyle{fancy}
\title{Blækregning}
\author{Name - bnc776}
\fancyhead[LE,RO]{side \thepage $\ $/ \pageref{LastPage} -- \LaTeX}
\chead{}
\lhead{Name}
\begin{document}
\newcommand{\vetar}[4]{\left ( \begin{array}{cc} #1 & #3 \\ #2 & #4 \end{array} \right ) }
\newcommand{\vecar}[2]{\left ( \begin{array}{c} #1 \\ #2 \end{array} \right ) }
\newcommand{\vedar}[3]{\left ( \begin{array}{c} #1 \\ #2 \\ #3 \end{array} \right ) }
\section{Lynopgave}
\tableofcontents{}
\subsection{1.1}
Vi har de to flg. grafer, for funktionerne:
\[
f_1(x)=\frac{x^2-7}{x+\sqrt{7}} \vspace(12 pt) \mathrm{og} \vspace(12 pt) f_2(x)=\frac{x^2-7}{x+2.645751311}
\]
\end{document}
The errors I get are these:
Code: Select all
Missing number, treated as zero f_1(x)=\frac{x^2-7}{x+\sqrt{7}} \vspace(
Illegal unit of measure (pt inserted) f_1(x)=\frac{x^2-7}{x+\sqrt{7}} \vspace(
Missing number, treated as zero ...rt{7}} \vspace(12 pt) \mathrm{og} \vspace(
Illegal unit of measure (pt inserted) ...rt{7}} \vspace(12 pt) \mathrm{og} \vspace(
\fancyhead's `E' option without twoside option is useless on input line 13. \fancyhead's `E' option without twoside option is useless
Reference `LastPage' on page 1 undefined on input line 27.
There were undefined references.
Last edited by
localghost on Mon Sep 03, 2012 8:03 pm, edited 2 times in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.
cgnieder
Site Moderator
Posts: 2000 Joined: Sat Apr 16, 2011 7:27 pm
Post
by cgnieder » Mon Sep 03, 2012 7:36 pm
\vspace
's argument is no different than most other arguments: it's enclosed by braces:
This won't give you the result you're hoping for, though. You might want to use one of amsmath's aligning environments together with its command
\intertext
:
Code: Select all
\documentclass[danish]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{geometry}
\usepackage{babel}
\usepackage{amsmath}
\begin{document}
\begin{align*}
f_1(x) &= \frac{x^2-7}{x+\sqrt{7}}
\intertext{og} \\
f_2(x) &= \frac{x^2-7}{x+2.645751311}
\end{align*}
\end{document}
Regards
lo2
Posts: 15 Joined: Wed Oct 21, 2009 6:31 pm
Post
by lo2 » Mon Sep 03, 2012 8:23 pm
cgnieder wrote: \vspace
's argument is no different than most other arguments: it's enclosed by braces:
This won't give you the result you're hoping for, though. You might want to use one of amsmath's aligning environments together with its command
\intertext
:
Code: Select all
\documentclass[danish]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{geometry}
\usepackage{babel}
\usepackage{amsmath}
\begin{document}
\begin{align*}
f_1(x) &= \frac{x^2-7}{x+\sqrt{7}}
\intertext{og} \\
f_2(x) &= \frac{x^2-7}{x+2.645751311}
\end{align*}
\end{document}
Regards
Ok so this structure cannot be obtained by using the \[ and \] method??
cgnieder
Site Moderator
Posts: 2000 Joined: Sat Apr 16, 2011 7:27 pm
Post
by cgnieder » Mon Sep 03, 2012 9:10 pm
Well, one you do some hacking but that would not be what
\[
and
\]
are meant for.
It is generally advised and agreed by many LaTeX users that every document doing serious maths should use amsmath.
There are some good manuals about mathmode and amsmath's features:
mathmode - generally about math mode
amsmath - the amsmath manual
mathtools - the mathtools manual; mathtools offers some improvements on amsmath (and of course loads it itself!)
Regards