diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1968a69 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Ignore macOS specific files +.DS_Store +.AppleDouble +.LSOverride +._* +.fseventsd +.Spotlight-V100 + +# Ignore all existing snippets of the Texpad creators +Bold.snippet +Description.snippet +Displaymath.snippet +Enumerate.snippet +Equation.snippet +Verbatim.snippet +Typewriter.snippet +Tabular.snippet +Quotation.snippet +Itemize.snippet +Italic.snippet +Floating Table.snippet +Preamble.snippet +Matrix.snippet +Figure.snippet diff --git a/2FiguresIn1.snippet b/2FiguresIn1.snippet new file mode 100644 index 0000000..84d35a8 --- /dev/null +++ b/2FiguresIn1.snippet @@ -0,0 +1,21 @@ +% A snippet to insert a floating figure that consists of more than one figure +% Needs \usepackage{graphicx} +% and \usepackage{subcaption} +group = Floating +insert at cursor = +\begin{figure}[hbt] + \centering + \begin{subfigure}[b]{0.49\textwidth} + \includegraphics[width=\textwidth]{} + \caption{} + \label{subfigure:} + \end{subfigure} + ~ % add some space between the images: ~, \hfill, \quad, \qquad, , ... + \begin{subfigure}[b]{0.49\textwidth} + \includegraphics[width=\textwidth]{} + \caption{} + \label{subfigure:} + \end{subfigure} + \caption{} + \label{figure:} +\end{figure} diff --git a/2FiguresSideBySide.snippet b/2FiguresSideBySide.snippet new file mode 100644 index 0000000..b035aad --- /dev/null +++ b/2FiguresSideBySide.snippet @@ -0,0 +1,20 @@ +% Displays 2 figures side by side with separate labels and captions +% Needs \usepackage{graphicx} +ctrl key = w +group = Floating +insert at cursor = +\begin{figure}[hbt] +\centering +\begin{minipage}{0.49\textwidth} + \centering + \includegraphics[scale=0.2]{images/} + \caption{} + \label{figure:} +\end{minipage} +\begin{minipage}{0.49\textwidth} + \centering + \includegraphics[scale=0.2]{images/} + \caption{} + \label{figure:} +\end{minipage} +\end{figure} diff --git a/BibLaTeX-Article.snippet b/BibLaTeX-Article.snippet new file mode 100644 index 0000000..d96a9c5 --- /dev/null +++ b/BibLaTeX-Article.snippet @@ -0,0 +1,11 @@ +% BibLaTeX - Article in a journal +ctrl key = +group = BibLaTeX +insert at cursor = +@article{, +author = {}, +title = {}, +journaltitle = {}, +year = {} +% more options available +} diff --git a/BibLaTeX-ArticleInConferenceProceeding.snippet b/BibLaTeX-ArticleInConferenceProceeding.snippet new file mode 100644 index 0000000..c94bac5 --- /dev/null +++ b/BibLaTeX-ArticleInConferenceProceeding.snippet @@ -0,0 +1,10 @@ +% BibLaTeX - Article in a conference proceeding +ctrl key = +group = BibLaTeX +insert at cursor = +@InProceedings{, +author = {}, +title = {}, +booktitle = {} +% more options available +} diff --git a/BibLaTeX-Book.snippet b/BibLaTeX-Book.snippet new file mode 100644 index 0000000..35fcb6c --- /dev/null +++ b/BibLaTeX-Book.snippet @@ -0,0 +1,10 @@ +% BibLaTeX - Book +ctrl key = +group = BibLaTeX +insert at cursor = +@book{, +author = {}, +title = {}, +year = {} +% more options available +} diff --git a/BibLaTeX-Misc.snippet b/BibLaTeX-Misc.snippet new file mode 100644 index 0000000..bbb123d --- /dev/null +++ b/BibLaTeX-Misc.snippet @@ -0,0 +1,10 @@ +% BibLaTeX - Misc +ctrl key = +group = BibLaTeX +insert at cursor = +@misc{, +author = {}, +title = {}, +year = {} +% more options available +} \ No newline at end of file diff --git a/BibLaTeX-Multi-Volume-Book.snippet b/BibLaTeX-Multi-Volume-Book.snippet new file mode 100644 index 0000000..f266d3c --- /dev/null +++ b/BibLaTeX-Multi-Volume-Book.snippet @@ -0,0 +1,10 @@ +% BibLaTeX - MV book +ctrl key = +group = BibLaTeX +insert at cursor = +@mvbook{, +author = {}, +title = {}, +year = {} +% more options available +} diff --git a/BibLaTeX-OnlineResource.snippet b/BibLaTeX-OnlineResource.snippet new file mode 100644 index 0000000..a90e9ef --- /dev/null +++ b/BibLaTeX-OnlineResource.snippet @@ -0,0 +1,11 @@ +% BibLaTeX - Online resource +ctrl key = +group = BibLaTeX +insert at cursor = +@online{, +author = {}, +title = {}, +year = {}, +url = {} +% more options available +} \ No newline at end of file diff --git a/BibLaTeX-PartOfABook.snippet b/BibLaTeX-PartOfABook.snippet new file mode 100644 index 0000000..d6f05c3 --- /dev/null +++ b/BibLaTeX-PartOfABook.snippet @@ -0,0 +1,11 @@ +% BibLaTeX - Part of a book +ctrl key = +group = BibLaTeX +insert at cursor = +@inbook{, +author = {}, +title = {}, +booktitle = {}, +year = {} +% more options available +} diff --git a/BibLaTeX-Report.snippet b/BibLaTeX-Report.snippet new file mode 100644 index 0000000..3f5712d --- /dev/null +++ b/BibLaTeX-Report.snippet @@ -0,0 +1,12 @@ +% BibLaTeX - Report +ctrl key = +group = BibLaTeX +insert at cursor = +@report{, +author = {}, +title = {}, +type = {}, +institution = {}, +year = {} +% more options available +} \ No newline at end of file diff --git a/BibLaTeX-TechnicalDocumentation.snippet b/BibLaTeX-TechnicalDocumentation.snippet new file mode 100644 index 0000000..39ae5a6 --- /dev/null +++ b/BibLaTeX-TechnicalDocumentation.snippet @@ -0,0 +1,10 @@ +% BibLaTeX - Technical manual +ctrl key = +group = BibLaTeX +insert at cursor = +@manual{, +author = {}, +title = {}, +year = {} +% more options available +} \ No newline at end of file diff --git a/BibLaTeX-Thesis.snippet b/BibLaTeX-Thesis.snippet new file mode 100644 index 0000000..70c9df9 --- /dev/null +++ b/BibLaTeX-Thesis.snippet @@ -0,0 +1,12 @@ +% BibLaTeX - Thesis +ctrl key = +group = BibLaTeX +insert at cursor = +@thesis{, +author = {}, +title = {}, +type = {}, +institution = {}, +year = {} +% more options available +} \ No newline at end of file diff --git a/Enquote.snippet b/Enquote.snippet new file mode 100644 index 0000000..93b6203 --- /dev/null +++ b/Enquote.snippet @@ -0,0 +1,5 @@ +% Quotes a text +% Needs \usepackage[autostyle=true,german=quotes]{csquotes} +ctrl key = n +group = Inline +insert at cursor = \enquote{} \ No newline at end of file diff --git a/IncludeFile.snippet b/IncludeFile.snippet new file mode 100644 index 0000000..2df72ae --- /dev/null +++ b/IncludeFile.snippet @@ -0,0 +1,5 @@ +% Include is basically like \input{} with \clearpage before and after \input{}. It's faster than \input{}, but can't be nested, can't appear in preamble and forces page breaks around the included text. +ctrl key = j +group = Other +insert at cursor = +\include{} diff --git a/IncludePDF.snippet b/IncludePDF.snippet new file mode 100644 index 0000000..922159b --- /dev/null +++ b/IncludePDF.snippet @@ -0,0 +1,6 @@ +% Include a PDF file +% Needs \usepackage{pdfpages} +ctrl key = s +group = Other +insert at cursor = +\includepdf[pages=-]{} diff --git a/InputFile.snippet b/InputFile.snippet new file mode 100644 index 0000000..2b21a85 --- /dev/null +++ b/InputFile.snippet @@ -0,0 +1,5 @@ +% Imports commands from another TeX file into the target file. It's equivalent to typing all commands from the other TeX file right into the target file. +ctrl key = k +group = Other +insert at cursor = +\input{} diff --git a/ListingBlock.snippet b/ListingBlock.snippet new file mode 100644 index 0000000..778efeb --- /dev/null +++ b/ListingBlock.snippet @@ -0,0 +1,9 @@ +% Include source code in a block environment within latex +% Needs \usepackage{listings} +% See also \lstloadlanguages and \lstset +ctrl key = c +group = Environment +insert at cursor = +\begin{lstlisting} + +\end{lstlisting} diff --git a/ListingInline.snippet b/ListingInline.snippet new file mode 100644 index 0000000..c3a6121 --- /dev/null +++ b/ListingInline.snippet @@ -0,0 +1,7 @@ +% Include source code inline +% Needs \usepackage{listings} +% See also \lstloadlanguages and \lstset +ctrl key = o +group = Inline +insert at cursor = +\lstinline[columns=fixed]{} diff --git a/ListingInputFile.snippet b/ListingInputFile.snippet new file mode 100644 index 0000000..6d97021 --- /dev/null +++ b/ListingInputFile.snippet @@ -0,0 +1,6 @@ +% Include source code from a file +% Needs \usepackage{listings} +% See also \lstloadlanguages and \lstset +ctrl key = h +group = Environment +insert at cursor = \lstinputlisting{} diff --git a/MathmodeInline.snippet b/MathmodeInline.snippet new file mode 100644 index 0000000..9b408a1 --- /dev/null +++ b/MathmodeInline.snippet @@ -0,0 +1,4 @@ +% Inline math mode +ctrl key = r +group = Inline +insert at cursor = $$ diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..9f2a485 --- /dev/null +++ b/Readme.md @@ -0,0 +1,22 @@ +# Texpad snippets + +Starting with version 1.5, Texpad makes it easy to insert regularly used blocks of text into your document. Texpad ships only a small number of helpful snippets and misses some I often use. Feel free to contribute and extend my small collection. + +## Required packages +Some of the snippets require the usage of additonal packages in LaTeX: +| Snippet | Package | +| ------------- |:-------------:| +| 2FiguresSideBySide | \usepackage{graphicx} | +| 2FiguresIn1 | \usepackage{graphicx} and \usepackage{subcaption} | +| IncludePDF | \usepackage{pdfpages} | +| ListingInline | \usepackage{listings} | +| ListingInputFile | \usepackage{listings} | +| ListingBlock | \usepackage{listings} | +| Url | \usepackage{hyperref} | +| Enquote | \usepackage[autostyle=true,german=quotes]{csquotes} | + +# Installation +Copy the snippets to `~/Library/Application Support/Texpad/Snippets`. + +# License ![CC BY-SA 4.0](https://i.creativecommons.org/l/by-sa/4.0/80x15.png) +The snippets are release under the [CC BY-SA 4.0 license](http://creativecommons.org/licenses/by-sa/4.0/). See the [license text](https://creativecommons.org/licenses/by-sa/4.0/legalcode) file for additional details. diff --git a/Url.snippet b/Url.snippet new file mode 100644 index 0000000..13534cc --- /dev/null +++ b/Url.snippet @@ -0,0 +1,5 @@ +% Transform a url as text into a clickable text (link) in pdf +% Needs \usepackage{hyperref} +ctrl key = u +group = Inline +insert at cursor = \url{}