Skip to content

Instantly share code, notes, and snippets.

@Nircek
Created November 6, 2022 13:45
Show Gist options
  • Save Nircek/2be1d66785559056c1ea83fb965fa37a to your computer and use it in GitHub Desktop.
Save Nircek/2be1d66785559056c1ea83fb965fa37a to your computer and use it in GitHub Desktop.
% src: https://www.youtube.com/watch?v=fCzF5gDy60g
1)
\documentclass{article} % albo beamer
\usepackage[margin=1.25in]{geometry}
\usepackage{amsmath, amssymb} % do jakiejkolwiek matmy
\usepackage{graphicx} % do wstawiania obrazków
\begin{document}
\begin{center} \end{center}
\includegraphics{width=0.3\linewidth}{file}
\end{document}
2)
\documentclass[10pt]{article}
\tiny \scriptsize \footnotesize \normalsize \large \Large \LARGE \huge \Huge
switch lub {\large large}
% po więcej patrz extsizes lub anyfontsize
\textbf{bold} \textit{italic} \underline{}
% underline nie działa przy breakowaniu linii, wtedy pkg ulem i \uline \uuline i \uwave
\emph{} % akcent działający gdziekolwiek, ale ulem miesza, także trzeba \normalem albo \usepackage[normalem]{ulem}
\textrm{default roman} \textsf{sans serif} \textt{typewriter/monospace}
default justify
\begin{center} \begin{flushleft} \begin{flushright}
\\ % nowa linia
\\[\baselineskip] \\[2\baselineskip]
domyślny indent \noindent
\setlength[\parindent][1cm]
% page layout and measuremenets
3)
\[ jedna linia math \]
\begin{align} \begin{align*} % * - bez numerowania
aligh po & w każdej linii \\
linie są domyślnie numerowane chyba że \nonumber \\
będzie na końcu linii
raczej używać \( \) a nie $ $
+ - \cdot \times [x] \div
ale raczej \frac{}{} \dfrac dla dużych i \tfrac dla małych
a_1^2 = a^2_1
ale p_1^{a_1} a {p_1}^{a_1}
\left( \right) - automat
można pominąć \right.
ale
( \big( \Big( \bigg( \Bigg(
in math mode: \text{ where \( a \) and \( b \) }
greek letters \varphi
\mathbb{C} % z podwójnymi kreskami
4)
\begin{table}\caption{} % opakowanie na numerowaną tabelę
\begin{tabular}{cc} % <table> {|lc||r|}
& % <td> - trzeba wszystkie elementy precyzować, nawet puste, bo inaczej się kreski nie dorysują
\\ % <tr>
\hline
hhline pkg % precyzowanie dla każdej kolumny osobno
array pkg \newcolumntype % fixed width
booktabs % lepsze tabele
tabularx % inne kontrolowanie szerokości kolumn
colortbl % kolorowanie tabel
longtable % tabele na wiele stron
\begin{array} % tabular in math mode
ale lepiej \begin{pmatrix} z amsmath
\vdots \cdots \ddots
i \iddots z mathdots i lepsze kropki gdy różne wielkości czcionek
\multicolumn{3}{|c|}{ text }
\multirow[t/c/b]{3}{* albo 1cm}{ text } % w pierwszej i wszędzie dalej puste komórki
5)
\sin(x)
\operatorname{fun}()
\lim_{x \to \infty}
\( \displaystyle math \)
\sum
_{ \substack{ n=0 \\ n odd} }
% wyrównywanie = pod sumą z stackexchange
\int \iint \iiint
\int_{}^{}
ładniej \int \limits_{}^{}
` ` \, \: \; \quad
\mathrm{d}x
\bigg\vert_a^b % math
\big\vert_a^b % inline
\partial % sigma zamiast d
f'''(n) albo \dot{x}(t) \ddot{x}(t) ...
\vv{r}(t) % wektor, strzałka z pakietu esvect - rozciąga strzałkę, można \vect*{v}{1}, żeby nu subscript nie wchodziło
jest \vect
\langle \range % <x, y, z> dla wektorów
6)
\sqrt[n]{}
\pm % plus minus lub \mp
\{ x \in S \mid P(x) \} % \mid zastępujemy :
\subset \subseteq \supset \supseteq \subsetneq \supsetneq
\cup \cap % suma, iloczyn zbiorów
\bigcup \bigcap
\setminus % zastępstwo dla -
\emptyset \varnothing
\land \lor \lnot [szukaj tyldy]
\implies \impliedby \iff % równoważność
\forall \exists \therefore
/cdots /ldots % \ldots przy przecinkach
\geq \leq
\neq \ngtr \nless \ngeq \nleq
\approx \sim
\not \approx
\not \implies % brzydki i po to jest centernot
a \equiv b \mod{m}
\mathfrak{} % dziwna czcionka
{n \choose k} ale lepiej \binom{n}{k_1, k_2, \ldots, k_n}
{}_n C_{k} % jest też tensor z \tensor[_n]{C}{_k}
\triangleleft % i pochodne
\mathcal \mathfrak
\overset{?}{=} \underset{x \to \infty}{\longrightarrow}
7) \documentclass[a4paper]{article} ale lepiej z geometry, można też marginesy
geometry z landscape dla całości albo pdflscape z \begin{landscape}
fancyhdr \pagestyle{fancy} \fancyhead[LCR]{} \fancyfoot \thepage\ / \pageref{LastPage} % nr strony i \pageref z lastpage i wymuszenie przerwy
\pagebreak % rozszerzy przerwy między akapitami, soft
\newpage % po prostu skończy, hard
\newcommand{\commandname}{}
\renewcommand % uważać
\DeclareMathOperator*{\myop}{myop} % z gwiazdką sup i sub są wycentrowane
8)
\begin{itemize}
\item
\item[$\rightarrow$]
\begin{enumerate}
% enumitem pkg po \begin{enumerate}[label=\arabic*)] % \roman \alph i różne spacingi
amsthm
\newtheorem{thm} {Theorem}
\theoremstyle % plain, definition, remark
\newtheorem{lem}[thm] {Lemma} % share a counter
\begin{thm} \begin {lem}[]
\begin{proof}
\renewcommnad{\qedsymbol}{QED}
\newenvironment
9)
~ nbsp
\- optional myślniki
LaTeX traktuje kropki jako końce zdań, więc skrótowce trzeba .\
\hspace{1cm} \underline{\hspace{4cm}}
\vspace
\phantom{} % biały tekst, żeby alginy były lepsze
\textsc{} % small caps
\fbox{text} \boxed{math}
abc \hrulefill
\noindent \hrulefill
\dotfill
\rule{\linewidth}{0.4pt}
\title \author \date \maketitle
\section[do toc] \subsection \subsubsection \tableofcontents
% po więcej tocloft pkg
\label{sec,subsec,thm,eq} i potem Equation~\ref{eq:first}
hyperref po linki do \ref (\ref*{} bez zmian) i \hyperref[label]{text} i \href{url}{text}
\input po prostu przekleja dokument a \include oddziela strony i nie pozwala na nested
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment