Tartalomjegyzék

TODO: float barrier

Important $\LaTeX$ tricks

Files

LaTeX_symbols.pdf1978 days460.37 KB
magyar.ldf1270 days245.14 KB

LaTeX Symbols

Left-right

\updownarrow with certain length (source)

\newcommand{\xdownarrow}[1]{%
    {\left\downarrow\vbox to #1{}\right.\kern-\nulldelimiterspace}
}

$\downarrow \big\downarrow \Big\updownarrow \bigg\downarrow \Bigg\downarrow \xdownarrow{2cm}$
$ \downarrow \big\downarrow \Big\updownarrow \bigg\downarrow \Bigg\downarrow $

hyperref

\usepackage[
    hyperfootnotes=false,
    colorlinks=true,
    linkcolor=blue,
    urlcolor=blue,
    citecolor=blue,
    anchorcolor=blue,
    pagebackref=false,
    unicode=true]{hyperref}

Spacing, layout

Geometry

emergencystrech

Ha túlságosan a margón kívülre lógnak az el nem választott szavak (forrás):

\sloppy % vagy
\emergencystretch 3em

Keep two paragraphs on the same page

Source:

\begin{samepage}
 This is the first paragraph. This is the first paragraph.
 This is the first paragraph. This is the first paragraph.

 \nopagebreak

 This the second. This the second. This the second.
 This the second. This the second. This the second.
 This the second. This the second.
\end{samepage}

Itemize spacing, layout, bullet

\usepackage{enumitem,enumerate}
\begin{itemize}[label={Step \arabic*.},ref=Step \arabic*,noitemsep,topsep=1pt,leftmargin=0.7cm] % noitemsep != itemsep=0pt
    \renewcommand\labelitemi{$\triangleright$}
    \item observed state vector $\hat x(t)$,
    \item artificial output $y_p(t)$,
    \item designed control input $v(t)$.
\end{itemize}

Widetext

Download widetext.sty from the GitHub.

\documentclass[twocolumn]{article}
\usepackage{mwe}
\usepackage{widetext}

\begin{document}
\blindtext
\begin{widetext}
    \blindtext
    \[
        E = mc^2.
    \]
    \blindtext
\end{widetext}
\blindtext
\end{document}

Equation spacing

In order the decrease the space below and above equations, use

\makeatletter
\g@addto@macro\normalsize{%
    \setlength\abovedisplayskip{4pt}
    \setlength\belowdisplayskip{4pt}
    \setlength\abovedisplayshortskip{4pt}
    \setlength\belowdisplayshortskip{4pt}
}
\makeatother

Float equations left and set indent

\documentclass[fleqn,...]{article}
% or
\usepackage[fleqn]{amsmath}
\setlength{\mathindent}{0pt}
PDF Ornament - fancy rulers between text

Stitch equations and paragraph

In order to stitch two paragraphs or equations with paragraphs, etc..., one can use the gather environment as follows: (source)
\begin{gather}
u_{i,t} = u_{i,t-1} + v_t \\
u_{i,t-1} = u_{i,t-2} + v_{t-1} \\
\Delta u_{it} = u_{i,t} - u_{i,t-1} = u_{i,t-1} + v_t - u_{i,t-1} =
v_t
\end{gather}

In order to make page breaks inside a display environment, use \displaybreak.

Line separator

source:
\documentclass{article}
\usepackage{graphicx,lipsum}% http://ctan.org/pkg/{graphicx,lipsum}
\newcommand{\PRLsep}{\noindent\makebox[\linewidth]{\resizebox{0.3333\linewidth}{1pt}{$\bullet$}}\bigskip}
\begin{document}
\lipsum[1]

\PRLsep

\lipsum[2]
\end{document}

Marginal comments

\documentclass{article}
\usepackage{setspace}
\setstretch{1.5}
\usepackage[status=draft,layout=margin]{fixme}

\fxsetup{marginface=\singlespacing}

\usepackage{lipsum}

\begin{document}
  \fxnote{
    Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi.
    Morbi auctor lorem non justo.  Nam lacus libero, pretium at, lobortis
    vitae, ultricies et, tellus.}
  \lipsum[1]
\end{document}

Fonts

Font size

standard font size
command 10pt 11pt 12pt
\tiny 5pt 6pt 6pt
\scriptsize 7pt 8pt 8pt
\footnotesize 8pt 9pt 10pt
\small 9pt 10pt 11pt
\normalsize 10pt 11pt 12pt
\large 12pt 12pt 14pt
\Large 14pt 14pt 17pt
\LARGE 17pt 17pt 20pt
\huge 20pt 20pt 25pt
\Huge 25pt 25pt 25pt

See also: LaTeX font size

Warnings

Messages like the following (source)

! pdfTeX warning (ext4): destination with the same identifier (name{equation.1.7.7.30}) has been already used, duplicate ignored
appear, when you have made something like
\begin{eqnarray}a=b\nonumber\end{eqnarray}
The error disappears, if you use instead this form:
\begin{eqnarray*}a=b\end{eqnarray*}
Beware that the shown line number is often completely different from the erroneous line. Possible solution: Place the amsmath package before the hyperref package.

Figure caption -- minipage

\begin{minipage}{0.39\textwidth}
    \includegraphics[width=\textwidth]{fig/PS/logicalthm_proof.pdf}
    \captionsetup{type=figure}
    \caption{Some figure}
\end{minipage}