Fix broken acronym plurals m( - add more info to Readme.md and also (#54)

* Fix broken acronym plurals m( - add more info to Readme.md and also add some Beispiel Code

* Fix broken link to pdfpages doc in README.md

Co-authored-by: sebbo <sebastian@1337lounge.de>
main
aslmx 2 years ago committed by GitHub
parent 02a8e9e455
commit db8967ee50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,3 +4,9 @@ wbh:
# Entferne die Kommentare um das erstellte PDF mit mupdf anzuzeigen # Entferne die Kommentare um das erstellte PDF mit mupdf anzuzeigen
#mupdf beispiel.pdf #mupdf beispiel.pdf
wbh_acronym:
pandoc -s --template="../wbh.tex" -o beispiel.tex --metadata-file=acronyms.yaml beispiel.md
pandoc -s --template="../wbh.tex" -o beispiel.pdf --metadata-file=acronyms.yaml beispiel.md
# Entferne die Kommentare um das erstellte PDF mit mupdf anzuzeigen
#mupdf beispiel.pdf

@ -0,0 +1,17 @@
acronym:
longest: ECTS
list:
- id: dau
short: DAU
shortplural: DAUs
long: Dümmster anzunehmender User
longplural: Dümmste anzunehmende User
- id: ects
short: ECTS
long: European Credit Transfer System
- id: ssd
short: SSD
long: Solid state Disk
- id: wbh
short: WBH
long: Wilhelm Büchner Hochschule

@ -168,4 +168,58 @@ $$ \displaystyle
De: \qty[locale = DE]{6.789}{\metre} \\ De: \qty[locale = DE]{6.789}{\metre} \\
Us: \qty[locale = US]{6.789}{\metre} Us: \qty[locale = US]{6.789}{\metre}
\end{aligned} \end{aligned}
$$ $$
# Akronyme und Zitate
## Akronyme
Das LaTeX Paket *acronyms* erlaubt das definieren von Akronymen. Das geniale an dem Paket ist, dass jede Abkürzung, oder Akronym, bei der ersten Verwendung ausgeschreiben wird. Z.b. wird aus `\ac{dau}` bei der ersten Verwendung `Dümmster anzunehmender User (DAU)` und ab der zweiten Verwendung eben nur noch `DAU` als Abkürzung.
Um die Akronyme zu definieren ist eine Datei `acronyms.yaml` notwendig, die hier auch im Beispiel Ordner liegt.
Die Datei sieht ungefähr so aus:
```
acronym:
longest: ECTS
list:
- id: dau
short: DAU
shortplural: DAUs
long: Dümmster anzunehmender User
longplural: Dümmste anzunehmende User
- id: ects
short: ECTS
long: European Credit Transfer System
- id: ssd
short: SSD
long: Solid state Disk
- id: wbh
short: WBH
long: Wilhelm Büchner Hochschule
```
Es können auch Plurale genutzt werden.
Wichtig ist, für die Spaltenbildung im Abkürzungsverzeichnis, dass die längste Abkürzung anzugeben.
Die Acronyme können dann wie folgt eingesetzt werden:
| Code | Erklärung | Ergebnis |
| -------- | ------------------- | ----------------------- |
| `\ac{dau} `| Abkürzung ausgeschrieben und kurz in Klammern | \ac{dau} |
| `\acf{dau} `| Erzwinge `\ac{dau}` | \acf{dau} |
| `\acl{dau} `| Nur Langform | \acl{dau} |
| `\acs{dau} `| Nur Kurzform | \acs{dau} |
| `\aclp{dau} `| Langform Plural | \aclp{dau} |
| `\acsp{dau}`| Kurzform Plural | \acsp{dau} |
## Zitate
Todo

@ -164,7 +164,7 @@ Eine Range kann durch `{x-y}` angegeben werden.
``` ```
Dabei unbedingt die einfachen Anführungszeichen drin lassen. Eine Range kann leider nicht angegeben Dabei unbedingt die einfachen Anführungszeichen drin lassen. Eine Range kann leider nicht angegeben
Weitere Hinweise stehen in der (Dokumentation)[https://texdoc.org/serve/pdfpages.pdf/0] des LaTeX packages `pdfpages` Weitere Hinweise stehen in der [Dokumentation](https://texdoc.org/serve/pdfpages.pdf/0) des LaTeX packages `pdfpages`
@ -204,6 +204,8 @@ acronym:
longplural: International Mobile Subscriber Identities longplural: International Mobile Subscriber Identities
``` ```
Die `acronyms.yaml` wird Pandoc mittels des Commandline Switches `--metadata-file=acronyms.yaml` bekannt gemacht. Im Beispiel [Makefile](Beispiel/Makefile) ist ein Beispiel Target `wbh_acronyms` welches die Verwendung zeigt.
Verwendung im Markdown dann mit Verwendung im Markdown dann mit
``` ```
@ -220,6 +222,7 @@ Für mehr Info über Acronyme, siehe [Dokumentation LaTeX acronym Package](https
## ToDo ## ToDo
- [ ] Codeblock mit Linenumbers - [ ] Codeblock mit Linenumbers

@ -108,12 +108,12 @@ $if(assignment.fillform)$
\begin{tikzpicture}[remember picture, overlay, x=1mm,y=1mm,% \begin{tikzpicture}[remember picture, overlay, x=1mm,y=1mm,%
mybox/.style={rectangle,minimum width=56mm, draw opacity=0.0, line width=0, minimum height=8mm, align=left,text width=56mm},% mybox/.style={rectangle,minimum width=56mm, draw opacity=0.0, line width=0, minimum height=8mm, align=left,text width=56mm},%
info/.style={mybox,draw=black,align=left}] info/.style={mybox,draw=black,align=left}]
\node at (34,-34) [info] {$student.firstname$}; \node at (34,-36) [info] {$student.firstname$};
\node at (95,-34) [info] {$student.lastname$}; \node at (95,-36) [info] {$student.lastname$};
\node at (34,-47) [info] {$student.strasse$}; \node at (34,-49) [info] {$student.strasse$};
\node at (95,-47) [info] {$student.ort$}; \node at (95,-49) [info] {$student.ort$};
\node at (34,-59) [info] {$student.matrikelnr$}; \node at (34,-61) [info] {$student.matrikelnr$};
\node at (95,-59) [info] {$studium.studiengangnr$}; \node at (95,-61) [info] {$studium.studiengangnr$};
\end{tikzpicture}}, pages=1]{$assignment.file$} \end{tikzpicture}}, pages=1]{$assignment.file$}
$if(assignment.multipage)$ % check if we need to include the rest of the document $if(assignment.multipage)$ % check if we need to include the rest of the document
\includepdf[pages=$assignment.pages$]{$assignment.file$} % Include rest of document \includepdf[pages=$assignment.pages$]{$assignment.file$} % Include rest of document
@ -574,7 +574,7 @@ $if(acronym)$
$for(acronym.list)$ $for(acronym.list)$
\acro{$it.id$}[$it.short$]{$it.long$} \acro{$it.id$}[$it.short$]{$it.long$}
$if(it.longplural)$ $if(it.longplural)$
\acro{$it.id$}[$if(it.shortplural)$$it.shortplural$$else$$it.short$$endif$]{$it.longplural$} \acroplural{$it.id$}[$if(it.shortplural)$$it.shortplural$$else$$it.short$$endif$]{$it.longplural$}
$endif$ $endif$
$endfor$ $endfor$
\end{acronym} \end{acronym}

Loading…
Cancel
Save