瀏覽代碼

example how to typeset pixel

Martin Thoma 10 年之前
父節點
當前提交
523913c372
共有 3 個文件被更改,包括 29 次插入0 次删除
  1. 7 0
      documents/siunitx-pixel/Makefile
  2. 6 0
      documents/siunitx-pixel/README.md
  3. 16 0
      documents/siunitx-pixel/siunitx-pixel.tex

+ 7 - 0
documents/siunitx-pixel/Makefile

@@ -0,0 +1,7 @@
+SOURCE = siunitx-pixel
+make:
+	pdflatex $(SOURCE).tex -output-format=pdf
+	make clean
+
+clean:
+	rm -rf  $(TARGET) *.class *.html *.log *.aux *.out

+ 6 - 0
documents/siunitx-pixel/README.md

@@ -0,0 +1,6 @@
+Read the [manual](ftp://ftp.tex.ac.uk/tex-archive/macros/latex/exptl/siunitx/siunitx.pdf)
+for more information how `siunitx` works.
+
+Material
+--------
+* [Why use a package to typeset units?](http://tex.stackexchange.com/q/107818/5645)

+ 16 - 0
documents/siunitx-pixel/siunitx-pixel.tex

@@ -0,0 +1,16 @@
+\documentclass[a4paper,9pt]{scrartcl}
+\usepackage{amssymb, amsmath} % needed for math
+\usepackage[utf8]{inputenc} % this is needed for umlauts
+\usepackage[ngerman]{babel} % this is needed for umlauts
+\usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf
+\usepackage[margin=2.5cm]{geometry} %layout
+\usepackage{hyperref}   % links im text
+\usepackage[binary-units = true]{siunitx} % this package is for units!
+
+\DeclareSIUnit\px{px}
+
+\begin{document}
+My display has a resolution of $\SI{1366}{\px} \times \si{768}{\px}$.
+
+The speed of a modem is $\SI[per-mode=symbol]{57.6}{\kilo\bit\per\second}$
+\end{document}