-
Notifications
You must be signed in to change notification settings - Fork 1
/
Testfilelatex.tex
177 lines (148 loc) · 4.25 KB
/
Testfilelatex.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
\documentclass[]{scrartcl}
\usepackage[left=25mm,right=25mm,top=30mm,bottom=30mm,head=24pt]{geometry}
%\usepackage{environ} % for conditional text
%\usepackage{etoolbox} % for conditional text
%\usepackage{xcolor}
%\usepackage{grffile} % image support (like graphicx)
\usepackage{float} % for positioning figures
%\usepackage{longtable}
\usepackage{supertabular}
\usepackage{booktabs} % booktabs table sytles
\usepackage{makecell} % additional table features + \Xhline
\usepackage{ragged2e}
%\usepackage{etoolbox} % supports conditional tests
\KOMAoption{parskip}{full} % change default spacing between paragraphs
\hyphenpenalty=500
\tolerance=2000
\emergencystretch=10pt
\KOMAoption{fontsize}{10pt}
\usepackage{fontspec}
\usepackage{lmodern} % Latin Modern Font with lots of glyphs
%\setmainfont{} % any serif font on the system (times roman)
%\setsansfont{} % any sans-serif font on the system ()
%\setmonofont{} % any monospace font on the system ()
\usepackage{microtype}
\raggedright
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
% Moved
\usepackage{hyperref} % Clickable links with \ref{} and \href{}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=cyan,
pdfpagemode=FullScreen,
}
\usepackage{grffile} % image support (like graphicx). Usage: \includegraphics{path/to/file}
% Define \thickhline, a variant of \hline
\newcommand{\thickhline}{\Xhline{0.3ex}} % requires package makecell
\begin{document}
\section{Tables}
Online \LaTeX table generator: \href{https://www.tablesgenerator.com/}{https://www.tablesgenerator.com/}.
\subsection{Simple Table, Centered Table, Left-Justified Data}
\begin{table}[h!]
\centering
\begin{tabular}{ll}
column 1 & column 2 \\
\hline
celery & apples \\
milk & peanut butter
\end{tabular}
\caption{Table centered, data left}\label{tab:center-left}
\end{table}
\subsection{Simple Table, Booktabs Style}
%\usepackage{booktabs} % goes in the main .tex file preamble, not here
\begin{table}[h!]
\centering
\begin{tabular}{@{}ll@{}}
\toprule
column 1 & column 2 \\
\hline
celery & apples \\
milk & peanut butter
\end{tabular}
\caption{Table centered, data left}\label{tab:booktabs}
\end{table}
\subsection{Simple Table, Centered Table, Centered Data}
\begin{table}[h!]
\centering
\begin{tabular}{cc}
column 1 & column 2 \\
\hline
celery & apples \\
milk & peanut butter
\end{tabular}
\caption{Table centered, data centered}\label{tab:center-center}
\end{table}
\subsection{Simple Table, Float Left, Left Data}
\begin{table}[h!]
\begin{tabular}{ll}
column 1 & column 2 \\
\hline
celery & apples \\
milk & peanut butter
\end{tabular}
\caption{Table left, data left}\label{tab:left-left}
\end{table}
\subsection{Wrap Text in Cells}
\begin{table}[h!]
\centering
\begin{tabular}{lp{.8\textwidth}}
column 1 & column 2 \\
\hline
celery & Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \\
milk & peanut butter
\end{tabular}
\caption{Wrapped text}\label{tab:wrapped-text}
\end{table}
\subsection{Unnumbered Table Without Caption}
\begin{center}
\begin{tabular}{ll}
column 1 & column 2 \\
\hline
celery & apples \\
milk & peanut butter
\end{tabular}
\end{center}
\subsection{Extra Horizontal Padding}
\begin{table}[h!]
\centering
\setlength{\tabcolsep}{3.5em}
\begin{tabular}{ll}
column 1 & column 2 \\
\hline
celery & apples \\
milk & peanut butter
\end{tabular}
\caption{Increase horizontal cell padding}\label{tab:horiz-padding}
\end{table}
\subsection{Extra Vertical Spacing}
\begin{table}[h!]
\renewcommand{\arraystretch}{1.5}
\centering
\begin{tabular}{ll}
column 1 & column 2 \\
\hline
celery & apples \\
milk & peanut butter
\end{tabular}
\caption{Extra line spacing}\label{tab:line-spacing}
\end{table}
\subsection{Table with Cell Borders}
\begin{table}[h!]
\renewcommand{\arraystretch}{1.2}
\centering
\begin{tabular}{|l|l|}
\hline
Column 1 & Column 2 \\
\hline
celery & apples \\
\hline
milk & peanut butter \\
\hline
\end{tabular}
\caption{Table with cell borders}\label{tab:all-borders}
\end{table}
\end{document}