Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #40 from skyfrk/feature/add_vscode_snippets
Browse files Browse the repository at this point in the history
Add VSCode snippets
  • Loading branch information
skyfrk authored Aug 22, 2019
2 parents f6057fd + 69a7cd4 commit 2e0ed18
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@
],
"latex-workshop.synctex.afterBuild.enabled": true,
"latex-workshop.intellisense.package.enabled": true,
"latex-workshop.chktex.enabled": true
"latex-workshop.chktex.enabled": true,
"editor.tabCompletion": "onlySnippets"
}
193 changes: 193 additions & 0 deletions .vscode/udhbwvst.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"udhbwvst class setup": {
"prefix": "udhbwvst",
"body": [
"\\documentclass[%",
"\tauto-generate\t= ${1|true,false|},\t% Generates all required pages around the text.",
"\tdebug\t\t\t= ${2|false,true|},\t% Loads packages lipsum and blindtext and displays hyperref-links.",
"\tprint-ndn\t\t= ${3|true,false|},\t% Prints the non-disclosure notice.",
"\tprint-loa\t\t= ${4|true,false|},\t% Prints the list of acronyms.",
"\tprint-lof\t\t= ${5|true,false|},\t% Prints the list of figures.",
"\tprint-lot\t\t= ${6|true,false|},\t% Prints the list of tables.",
"\tprint-lol\t\t= ${7|true,false|},\t% Prints the list of code listings.",
"\tbib-file\t\t= {${8:literature.bib}},\t% Path to the bibliography file.",
"\tplantuml\t\t= ${9|false,true|}\t% Loads the plantuml package.",
"]{udhbwvst}"
],
"scope": "tex,latex",
"description": "Sets up the udhbwvst documentclass."
},
"Command: \\dhbwSetup": {
"prefix": "\\dhbwSetup",
"body": [
"\\dhbwSetup{%",
"\tauthor\t\t\t= {${1:Vorname Nachname}},",
"\tfaculty\t\t\t= {${2|Wirtschaft,Sozialwesen|}},",
"\tfield of study\t= {${3|Wirtschaftsinformatik,BWL-Bank,BWL-Controlling & Consulting,BWL-Digital Business Management,BWL-Industrie,BWL-International Business,BWL-Mittelständische Wirtschaft,BWL-Technical Management,RSW-Steuern und Prüfungswesen,RSW-Wirtschaftsprüfung,Soziale Arbeit - Bildung und Beruf,Soziale Arbeit - Jugend-\\, Familien- und Sozialhilfe,Soziale Arbeit - Netzwerk- und Sozialraumarbeit,Soziale Arbeit im Gesundheitswesen,Soziale Arbeit - Menschen mit Behinderung,Soziale Arbeit - Psychische Gesundheit und Sucht,Sozialwirtschaft|}},",
"\tacademic year\t= {${4:2017}},",
"\tcourse\t\t\t= {${5|A,B,C,D|}},",
"\ttitle\t\t\t= {${6:Titel der Arbeit}},",
"\tsubtitle\t\t= {${7:Untertitel der Arbeit}},",
"\ttext type\t\t= {${8|Projektarbeit 1,Projektarbeit 2,Bachelorarbeit|}},",
"\tcompany name\t= {${9:Eine GmbH}},",
"\tcompany logo\t= {${10:./assets/logo.png}},",
"\tlecturer\t\t= {${11:Prof. Dr. Vorname Nachname}},",
"\tlocation\t\t= {${12:Villingen-Schwenningen}},",
"\tdate\t\t\t= {${13:\\today}},",
"\tlongest acronym\t= {${14:xD}},",
"\tacronyms\t\t= {%",
"\t\t% Define your acronyms with \\acro{short form}{long form} here.",
"\t\t% You have to manually sort them by alphabet.",
"\t}",
"}"
],
"scope": "tex,latex",
"description": "Sets up the \\dhbwSetup command with all possible fields."
},
"Command \\footcite": {
"prefix": "\\footcite",
"body": [
"\\footcite[${2:Vgl.}][$3]{${1:bibEntryId}}"
],
"scope": "tex,latex",
"description": "Create a citation with a footnote."
},
"Command \\dfootcite": {
"prefix": "\\dfootcite",
"body": [
"\\dfootcite${2:[]}{${1:bibEntryId}}{$TM_SELECTED_TEXT$3}"
],
"scope": "tex,latex",
"description": "Create a direct citation with a footnote."
},
"Command \\ifootcite": {
"prefix": "\\ifootcite",
"body": [
"\\ifootcite${2:[]}{${1:bibEntryId}}"
],
"scope": "tex,latex",
"description": "Create a indirect citation with a footnote."
},
"Command \\icite": {
"prefix": "\\icite",
"body": [
"\\icite${2:[]}{${1:bibEntryId}}"
],
"scope": "tex,latex",
"description": "Create a citation without a footnote."
},
"dhbwfigure environment": {
"prefix": "dhbwfigure",
"body": [
"\\begin{dhbwfigure}{%",
"\tcaption\t= $1,",
"\tlabel\t= fig:$2,",
"\tsource\t= $3,",
"\tfloat\t= ${4:ht}",
"}",
"\t$TM_SELECTED_TEXT$0",
"\\end{dhbwfigure}"
],
"scope": "tex,latex",
"description": "Sets up a dhbwfigure environment with all possible fields."
},
"Command \\dhbwFigure": {
"prefix": "\\dhbwFigure",
"body": [
"\\dhbwFigure{%",
"\tcaption\t= $1,",
"\tlabel\t= fig:$2,",
"\tpath\t= $3,",
"\tsource\t= $4,",
"\twidth\t= ${5:\\textwidth},",
"\tfloat\t= ${6:ht}",
"}"
],
"scope": "tex,latex",
"description": "Sets up the \\dhbwFigure command with all possible fields."
},
"Command \\dhbwWrapfigure": {
"prefix": "\\dhbwWrapfigure",
"body": [
"\\dhbwWrapfigure{%",
"\tcaption\t\t= $1,",
"\tlabel\t\t= fig:$2,",
"\tpath\t\t= $3,",
"\tsource\t\t= $4,",
"\tplacement\t= ${5|R,L,r,l|},",
"\twidth\t\t= ${6:{0.45\\textwidth}},",
"\timage width\t= ${7:{0.4\\textwidth}}",
"}"
],
"scope": "tex,latex",
"description": "Sets up the \\dhbwWrapfigure command with all possible fields."
},
"dhbwtable environment": {
"prefix": "dhbwtable",
"body": [
"\\begin{dhbwtable}{%",
"\tcaption\t= $1,",
"\tlabel\t= tab:$2,",
"\tsource\t= $3,",
"\tfloat\t= ${4:ht}",
"}",
"\t$TM_SELECTED_TEXT$0",
"\\end{dhbwtable}"
],
"scope": "tex,latex",
"description": "Sets up the dhbwtable environment with all possible fields."
},
"code environment": {
"prefix": "code",
"body": [
"\\begin{code}{caption=$1,label=lst:$2,language=${3:javascript}}{$4}",
"$TM_SELECTED_TEXT$0",
"\\end{code}"
],
"scope": "tex,latex",
"description": "Sets up the code environment with all possible fields."
},
"protected code environment": {
"prefix": "codeprotected",
"body": [
"\\begin{minipage}[c]{\\textwidth}",
"\\begin{code}{caption=$1,label=lst:$2,language=${3:javascript}}{$4}",
"$TM_SELECTED_TEXT$0",
"\\end{code}",
"\\end{minipage}"
],
"scope": "tex,latex",
"description": "Sets up the code environment with all possible fields and wraps it inside a minipage environment to make sure that the subcaption and the code listings stick together."
},
"bib entry online": {
"prefix": "@online",
"body": [
"@online{$1,",
"\tauthor\t\t= {$2},",
"\ttitle\t\t= {$3},",
"\tshorttitle\t= {$4},",
"\turl\t\t\t= {$5},",
"\turldate\t\t= {${6:${7:0000}-${8:00}-${9:00}}},",
"\tdate\t\t= {${10:${11:0000}-${12:00}-${13:00}}}",
"}"
],
"scope": "tex,latex,bibtex",
"description": "Adds a bibliography entry of type @online."
},
"bib entry book": {
"prefix": "@book",
"body": [
"@book{$1,",
"\tauthor\t\t= {$2},",
"\ttitle\t\t= {$3},",
"\tshorttitle\t= {$4},",
"\tyear\t\t= {${5:0000}},",
"\tedition\t\t= {${6:3}},",
"\tpublisher\t= {$7},",
"\tlocation\t= {$8}",
"}"
],
"scope": "tex,latex,bibtex",
"description": "Adds a bibliography entry of type @book."
}
}
3 changes: 2 additions & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ Copy all files inside the `src` folder to your working directory. As long as you
### Optional setup

* If you're using VS Code as text editor you can take advantage of the already configured `.vscode/settings.json` which compiles using `latexmk` (part of TeX Live and MiKTeX) and if you don't want to use `latexmk` there is a another recipe using just `lualatex` and `biber`.
* If you're using VS Code you can take advantage of the already configured `.vscode/settings.json` which compiles using `latexmk` (part of TeX Live and MiKTeX) and if you don't want to use `latexmk` there is a another recipe using just `lualatex` and `biber`.
* If you're using VS Code you can take advantage of many predefined snippets (`.vscode/udhbwvst.code-snippets`).
* If you are using [git](https://git-scm.com/) you can use the provided `.gitignore` file.

## Compiling to PDF
Expand Down
22 changes: 22 additions & 0 deletions docs/writing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Documentation and general tips and tricks on how to wirte an academic text assig
- [Firstname lastname combinations](#firstname-lastname-combinations)
- [Author is just one word](#author-is-just-one-word)
- [More than one author](#more-than-one-author)
- [VSCode snippets](#vscode-snippets)

## The udhbwvst class

Expand Down Expand Up @@ -608,3 +609,24 @@ You can use the keyword `and others` if there are to many authors:
...
}
```

## VSCode snippets

There are a few [VSCode snippets](https://code.visualstudio.com/docs/editor/userdefinedsnippets) predefined in `.vscode/udhbwvst.code-snippets` you can take advantage of:

| Prefix | Description |
| ----------------- | ------------------------------------------------------------------------------ |
| `udhbwvst` | Setup the `udhbwvst` class. |
| `\dhbwSetup` | Snippet for the [\dhbwSetup](#required-dhbwsetup-command) command. |
| `\footcite` | Snippet for the [\footcite](#cite-with-footnote) command. |
| `\dfootcite` | Snippet for the [\dfootcite](#cite-direct-with-footnote) command. |
| `\ifootcite` | Snippet for the [\ifootcite](#cite-indirect-with-footnote) command. |
| `\icite` | Snippet for the [\icite](#cite-indirect-without-footnote) command. |
| `dhbwfigure` | Snippet for the [dhbwfigure](#the-dhbwfigure-environment) environment. |
| `\dhbwFigure` | Snippet for the [\dhbwFigure](#the-dhbwfigure-command) command. |
| `\dhbwWrapfigure` | Snippet for the [\dhbwWrapfigure](#the-dhbwwrapfigure-command) command. |
| `dhbwtable` | Snippet for the [dhbwtable](#tables) environment. |
| `code` | Snippet for the [code](#code-listing) environment. |
| `codeprotected` | Snippet for the [code](#code-listing) environment but wrapped in a `minipage`. |
| `@online` | Snippet for an [@online](#add-entry-of-type-online) bibliography entry. |
| `@book` | Snippet for an [@book](#add-entry-of-type-book) bibliography entry. |

0 comments on commit 2e0ed18

Please sign in to comment.