Browse Source

added some examples

Martin Thoma 13 năm trước cách đây
mục cha
commit
c96f849d1b

+ 10 - 0
documents/size/Makefile

@@ -0,0 +1,10 @@
+SOURCE = size
+
+make:
+	pdflatex $(SOURCE).tex -output-format=pdf # first run for the aux file
+	makeindex $(SOURCE)                       # now the index is generated
+	pdflatex $(SOURCE).tex -output-format=pdf # pdf with index :-)
+	make clean
+
+clean:
+	rm -rf  $(TARGET) *.class *.html *.log *.aux *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg

+ 32 - 0
documents/size/size.tex

@@ -0,0 +1,32 @@
+\documentclass[a5paper]{book}
+\usepackage{amsmath}
+
+\makeindex
+
+\begin{document}
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
+nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 
+erat, 
+sed diam voluptua. At vero eos et accusam et justo duo dolores et ea 
+rebum. 
+
+\noindent \tiny tiny
+\scriptsize scriptsize
+\footnotesize footnotesize
+\small small
+\normalsize normalsize \\
+\large large
+\Large Large
+\LARGE LARGE
+\huge huge
+\Huge Huge\\
+\\
+
+\normalsize 
+\noindent
+scriptscriptstyle: $\scriptscriptstyle \lim_{n \rightarrow \infty} (1 + \frac{1}{n})^n$ \\
+scriptstyle: $\scriptstyle \lim_{n \rightarrow \infty} (1 + \frac{1}{n})^n$ \\
+textstyle: $\textstyle \lim_{n \rightarrow \infty} (1 + \frac{1}{n})^n$ \\
+displaystyle: $\displaystyle \lim_{n \rightarrow \infty} (1 + \frac{1}{n})^n$ \\
+
+\end{document}

+ 2 - 2
tikz/quadratic-function-uniform-continuity/quadratic-function-uniform-continuity.tex

@@ -11,8 +11,8 @@
   \tikz[overlay,remember picture,baseline] \coordinate [anchor=base] (#1);}
 
 \newcommand\DrawBrace[3]{%
-  \draw [decorate,decoration={brace,amplitude=5pt,mirror,raise=2pt}]
-    (#1) -- (#2) node [midway,xshift=15pt] {$\displaystyle #3$};
+  \draw [ultra thick, decorate,decoration={brace,amplitude=5pt,mirror,raise=2pt}]
+    (#1) -- (#2) node [midway,xshift=23pt] {\Huge $\displaystyle #3$};
 }
 
 \begin{document}

+ 31 - 0
tikz/tikz-sizes/Makefile

@@ -0,0 +1,31 @@
+SOURCE = tikz-sizes
+DELAY = 80
+DENSITY = 300
+WIDTH = 500
+
+make:
+	pdflatex $(SOURCE).tex -output-format=pdf
+	make clean
+
+clean:
+	rm -rf  $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
+
+gif:
+	pdfcrop $(SOURCE).pdf
+	convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
+	make clean
+
+png:
+	make
+	make svg
+	inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
+
+transparentGif:
+	convert $(SOURCE).pdf -transparent white result.gif
+	make clean
+
+svg:
+	#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
+	pdf2svg $(SOURCE).pdf $(SOURCE).svg
+	# Necessary, as pdf2svg does not always create valid svgs:
+	inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg

+ 71 - 0
tikz/tikz-sizes/tikz-sizes.tex

@@ -0,0 +1,71 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{2mm}
+
+\usepackage{amssymb,amsmath}
+\usepackage{pgfplots}
+\usepackage{tikz}
+\usetikzlibrary{arrows, positioning, calc, intersections, decorations.pathreplacing}
+
+\newcommand\tikzmark[1]{%
+  \tikz[overlay,remember picture,baseline] \coordinate [anchor=base] (#1);}
+
+\newcommand\DrawBrace[3]{%
+  \draw [ultra thick, decorate,decoration={brace,amplitude=5pt,mirror,raise=2pt}]
+    (#1) -- (#2) node [midway,xshift=23pt] {\Huge $\displaystyle #3$};
+}
+
+\begin{document}
+
+\begin{preview}
+\begin{tikzpicture}
+    \pgfplotsset{
+        right segments/.code={\pgfmathsetmacro\rightsegments{#1}},
+        right segments=3,
+        right/.style args={#1:#2}{
+            ybar interval,
+            domain=#1+((#2-#1)/\rightsegments):#2+((#2-#1)/\rightsegments),
+            samples=\rightsegments+1,
+            x filter/.code=\pgfmathparse{\pgfmathresult-((#2-#1)/\rightsegments)}
+        }
+    }
+
+    \pgfplotsset{
+        left segments/.code={\pgfmathsetmacro\leftsegments{#1}},
+        left segments=3,
+        left/.style args={#1:#2}{
+            ybar interval,
+            domain=#1:#2,
+            samples=\leftsegments+1,
+            x filter/.code=\pgfmathparse{\pgfmathresult}
+        }
+    }
+
+    \begin{axis}[
+        axis lines=middle,
+        width=15cm, height=15cm,     % size of the image
+        grid = major,
+        grid style={dashed, gray!30},
+        xmin= 0, % start the diagram at this x-coordinate
+        xmax= 3, % end   the diagram at this x-coordinate
+        ymin= 0, % start the diagram at this y-coordinate
+        ymax= 9, % end   the diagram at this y-coordinate
+        axis background/.style={fill=white},
+        ylabel=y,
+        xlabel=x,
+        tick align=outside,
+        tension=0.08,
+        legend style={at={(0.25,0.91)}, anchor=north}]
+      \addplot[domain=0:3,ultra thin, red, samples=500] {x};
+      \addplot[domain=0:3,very thin, red, samples=500] {x^2};
+      \addplot[domain=0:3,thin, red, samples=500] {x^3};
+      \addplot[domain=0:3,semithick, red, samples=500] {x^4};
+      \addplot[domain=0:3,thick, red, samples=500] {x^5};
+      \addplot[domain=0:3,very thick, red, samples=500] {e^x};
+      \addplot[domain=0:3,ultra thick, red, samples=500] {sqrt(x)};
+
+      \legend{ultra thin, very thin, thin, semithick, thick, very thick, ultra thick};
+    \end{axis} 
+\end{tikzpicture}
+\end{preview}
+\end{document}