org article; add glossaries and some snippets

This commit is contained in:
2022-04-18 15:21:48 +02:00
parent 3db70c17be
commit 163772942a
8 changed files with 288 additions and 107 deletions

View File

@@ -56,7 +56,9 @@
\\mkern-4mu%
\\raisebox{#5\\ht2}{\\usebox2}%
}" t) ;; http://tex.stackexchange.com/questions/27591/extending-the-faktor-package/27735#27735"
(add-to-list 'org-latex-default-packages-alist '("thinspace,thinqspace,squaren,Gray" "SIunits" nil) t)
(add-to-list 'org-latex-default-packages-alist '("thinspace,thinqspace,squaren,Gray" "SIunits" t) t)
(add-to-list 'org-latex-default-packages-alist '("" "dsfont" t) t)
(add-to-list 'org-latex-default-packages-alist '("" "MnSymbol" t) t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\field}[1]{\\ensuremath{\\mathds{#1}}}" t) ;; \field{X} defined with mathds
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fA}{\\field{A}}" t) ;; \fA Affine field A
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fC}{\\field{C}}" t) ;; \fC Complex field C
@@ -75,7 +77,7 @@
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fdg}{\\;|\\;}" t) ;; \fdg 'für die gilt'
(add-to-list 'org-latex-default-packages-alist "\\newcommand*{\\qed}{\\hfill\\ensuremath{\\blacksquare}}" t) ;; \qed Q.E.D. quod erat demonstrandum "what was to be shown" -> "which was to be demonstrated"
(add-to-list 'org-latex-default-packages-alist "\\newcommand*\\euler{\\mathrm{e}}" t) ;; \euler e
(add-to-list 'org-latex-default-packages-alist '("" "xspace" nil) t) ;; for \deg
(add-to-list 'org-latex-default-packages-alist '("" "xspace" t) t) ;; for \deg
(add-to-list 'org-latex-default-packages-alist "\\renewcommand{\\deg}{\\ensuremath{^{\\circ}}\\xspace}" t) ;; for text \deg ° degree
(add-to-list 'org-latex-default-packages-alist "\\newcommand\\degC{{\\,^{\\circ}\\mathrm{C}}}" t) ;; \degC °C
(add-to-list 'org-latex-default-packages-alist "\\newcommand\\sins{{\\mathrm{s}}}" t) ;; \sins short sin: s
@@ -102,13 +104,18 @@
(add-to-list 'org-latex-default-packages-alist "\\newcommand*{\\dt}[1]{\\overset{\\mbox{\\large\\bfseries .}}{#1}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand*{\\ddt}[1]{\\overset{\\mbox{\\large\\bfseries .\\hspace{-0.1ex}.}}{#1}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand*{\\Eval}[3]{{\\left.#1\\phantom{\\Big|}\\!\\!\\right\\rvert_{#2}^{#3}}}" t)
(add-to-list 'org-latex-default-packages-alist '("" "accents" nil) t) ;; tensors
(add-to-list 'org-latex-default-packages-alist '("" "ushort" nil) t)
(add-to-list 'org-latex-default-packages-alist '("" "accents" t) t) ;; tensors
(add-to-list 'org-latex-default-packages-alist '("" "ushort" t) t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensor}[1]{\\ensuremath{{\\boldsymbol{#1}}}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensorI}[1]{\\ensuremath{\\ushort{{\\boldsymbol{#1}}}}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensorII}[1]{\\ensuremath{\\ushortd{{\\boldsymbol{#1}}}}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensorIII}[1]{\\ensuremath{\\underaccent{3}{\\underaccent{\\tilde}{{\\boldsymbol{#1}}}}}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensorIV}[1]{\\ensuremath{\\underaccent{4}{\\underaccent{\\tilde}{{\\boldsymbol{#1}}}}}}" t)
(add-to-list 'org-latex-default-packages-alist '("" "tikz" t) t)
(add-to-list 'org-latex-default-packages-alist '("" "pgfplots" t) t)
(add-to-list 'org-latex-default-packages-alist "\\usepgflibrary{shapes.geometric}" t)
(add-to-list 'org-latex-default-packages-alist "\\usepgfplotslibrary{patchplots}" t)
(add-to-list 'org-latex-default-packages-alist "\\usetikzlibrary{arrows,backgrounds,calc,decorations.pathmorphing,mindmap,pgfplotsclickable,positioning,shadows,shadows.blur,shapes.multipart,tikzmark}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensori}[1]{
\\tikz[baseline, anchor=base,inner sep=0pt]{
\\node{\\ensuremath{\\phantom{#1\\vphantom{\\overrightharpoon{b}}}}};
@@ -139,8 +146,65 @@
;; also added to `my-org-article-latex-default-packages-alist'
;; convert table #+name: glossary to \newglossaryentry to latex_header_extra
;; overwrite org-ref-glossary.el function `org-ref-glossary-before-parsing'
;; ** exporting with a glossary table
(defun my-org-article-ref-glossary-before-parsing (_backend)
"Function to preprocess a glossary table on export.
This assumes a table like
#+name: glossary
| label | name | description |
|-------+-------+---------------|
| tree | Tree | A woody plant |
| shrub | Shrub | A woody bush |
is in the org-buffer, and will add the relevant latex_header
items if there is. The table is deleted in a copy of the buffer
before the export, so you can put it where you want. The column
names are arbitrary, but three columns are expected, and the
hline is expected.
This is intended to be run in `org-export-before-parsing-hook'."
(let* (begin
end
(entries (save-excursion
(catch 'found
(org-element-map
(org-element-parse-buffer)
'table
(lambda (el)
(when (and (org-element-property :name el)
(stringp (org-element-property :name el))
(string= "glossary" (org-element-property :name el)))
(setq begin (org-element-property :begin el)
end (org-element-property :end el))
(goto-char (org-element-property :contents-begin el))
(throw 'found
(nthcdr 2 (org-babel-read-table))))))))))
;; Delete the table
(when entries
(setf (buffer-substring begin end) "")
(goto-char (point-min))
(cl-loop
for (label name description . rest) in entries
do
(cond
;; idea for a general approach
;; ((= (length rest) 1) ;; only a 4th column (type) is specified
;; (insert (format "#+latex_header_extra: \\newglossaryentry{%s}{name=%s,description={{%s}},type=%s}\n"
;; label name description (car rest))))
;; ((= (length rest) 2) ;; a 4th (type) and 5th column (symbol) is specified
;; (insert (format "#+latex_header_extra: \\newglossaryentry{%s}{name=%s,description={{%s}},type=%s,symbol=%s}\n"
;; label name description (car rest) (cadr rest))))
((= (length rest) 1) ;; if a 4th column (symbol) is specified
(insert (format "#+latex_header_extra: \\newglossaryentry{%s}{name=%s,description={{%s}},type=%s,symbol=%s}\n"
label name description (if (string-empty-p (car rest)) "main" "symbols") (car rest))))
(t
(insert (format "#+latex_header_extra: \\newglossaryentry{%s}{name=%s,description={{%s}}} %% rest: %s %s\n"
label name description rest (length rest)))))))))
(add-hook 'org-export-before-parsing-hook
'org-ref-glossary-before-parsing)
'my-org-article-ref-glossary-before-parsing)
;; convert table #+name: acronyms to \newacronym to latex_header_extra
(add-hook 'org-export-before-parsing-hook
'org-ref-acronyms-before-parsing)
@@ -315,7 +379,7 @@ Currently only one i.e. A.x is possible."
;; %\\renewcommand{\\thesection}{\\Alph{section}} % will be A.x but points to 1.x
;; %\\renewcommand{\\thesubsection}{A\\arabic{subsection}}
;; %\\renewcommand{\\thetable}{A\\arabic{table}}
"\\end{mtchideinmaintoc}")))))
"\\end{mtchideinmaintoc}\n")))))
(add-to-list 'org-export-filter-headline-functions
'my-org-article-latex-appendix)
@@ -328,6 +392,7 @@ Currently only one i.e. A.x is possible."
(defvar my-org-article-latex-header)
(defvar my-org-article-latex-header-extra)
(defvar my-org-article-latex-document-type)
(defvar my-org-article-latex-header-biblatex)
(defvar my-org-article-latex-opening)
(defvar my-org-article-latex-closing)
(defvar my-org-article-latex-draft)
@@ -363,6 +428,7 @@ Currently only one i.e. A.x is possible."
(:latex-compiler "LATEX_COMPILER" nil my-org-article-latex-compiler t)
;; custom
(:article-document-type "DOCUMENT_TYPE" nil my-org-article-latex-document-type t)
(:article-biblatex "BIBLATEX" nil my-org-article-latex-header-biblatex t)
(:article-closing "CLOSING" nil my-org-article-latex-closing newline)
(:article-opening "OPENING" nil my-org-article-latex-opening newline)
(:article-draft nil "draft" my-org-article-latex-draft t) ;; toogle (nil/t) to activate draft visuals, see :draft in `my-org-article-latex-template-plist'
@@ -392,7 +458,7 @@ Currently only one i.e. A.x is possible."
:group 'my-org-export-article
:type '(string :tag "LaTeX class"))
(defvar my-org-article-latex-header-biblatex
(defcustom my-org-article-latex-header-biblatex
"
%\\usepackage[fixlanguage]{babelbib} % Mehrsprachige Literaturliste, nicht mit biblatex
%\\selectbiblanguage{german}
@@ -416,7 +482,6 @@ Currently only one i.e. A.x is possible."
% Erst Nachname, dann Vorname
\\DeclareNameAlias{default}{family-given}
% Autorennamen in Kapitälchen
\\renewcommand*{\\mkbibnamelast}[1]{\\textsc{#1}}
@@ -552,10 +617,12 @@ Currently only one i.e. A.x is possible."
\\usebibmacro{labeltitle}%
\\setunit*{\\addspace}}%
\\usebibmacro{date+extrayear}}
\\addbibresource{references.bib}
"
"Used in `my-org-article-latex-template-plist'
points to references.bib")
"The default LaTeX biblatex setup."
:group 'my-org-export-article
:type '(string :tag "LaTeX class"))
(defvar my-org-article-latex-template-plist
(list
@@ -571,8 +638,6 @@ points to references.bib")
:ruby-en ""
:ruby-ja "\\usepackage[CJK,overlap]{ruby} % support for FURIGANA - japanese"
;;; REFERENCES
:biblatex-en my-org-article-latex-header-biblatex
:biblatex-de-rott ""
:csquotes-en "\\usepackage[autostyle]{csquotes}"
:csquotes-de "\\usepackage[autostyle,german=quotes]{csquotes}"
;;; APPENDIX
@@ -600,6 +665,7 @@ replacements.")
;; %titlepage: first page, cover page (invoking \maketitle)
;; %draft: display a block at the end of a line, which is too long (bad line break)
;; dvipsnames: colors
;; listof=entryprefix: to have e.g. Fig. in front of every to entry
"\
[
paper=a4,
@@ -611,6 +677,7 @@ replacements.")
captions=tableheading,
version=first,
bibliography=totoc,
listof=totoc,
dvipsnames,
]"
"The default LaTeX class options.
@@ -623,9 +690,12 @@ Replaces <<...>> with values defined in
(add-to-list 'org-latex-classes
;; (numbered-section . unnumbered-section)
'("koma-article" "\\documentclass{scrartcl}"
("\\cleardoublepage\\section{%s}\\thispagestyle{plain}" . "\\def\\my_org_article_section{%s}\\cleardoublepage\\section*{\\my_org_article_section}\\phantomsection\\addcontentsline{toc}{section}{\\my_org_article_section}\\thispagestyle{plain}")
("\\subsection{%s}" . "\\def\\my_org_article_subsection{%s}\\subsection*{\\my_org_article_subsection}\\phantomsection\\addcontentsline{toc}{subsection}{\\my_org_article_subsection}")
("\\subsubsection{%s}" . "\\def\\my_org_article_subsubsection{%s}\\subsubsection*{\\my_org_article_subsubsection}\\phantomsection\\addcontentsline{toc}{subsubsection}{\\my_org_article_subsubsection}")
("\\cleardoublepage\\sectionheader\\section{%s}\\thispagestyle{plain}" .
"\\def\\mysectionname{%s}\\cleardoublepage\\phantomsection\\addcontentsline{toc}{section}{\\mysectionname}\\section*{\\mysectionname}\\thispagestyle{plain}")
("\\subsection{%s}" .
"\\def\\mysubsectionname{%s}\\phantomsection\\addcontentsline{toc}{subsection}{\\mysubsectionname}\\subsection*{\\mysubsectionname}")
("\\subsubsection{%s}" .
"\\def\\mysubsubsectionname{%s}\\phantomsection\\addcontentsline{toc}{subsubsection}{\\mysubsubsectionname}\\subsubsection*{\\mysubsubsectionname}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
@@ -637,7 +707,6 @@ Replaces <<...>> with values defined in
%<<fontspec>>
%<<lstlistingname>>
\\def\\nameappendix{Appendix}
%<<biblatex>>
%<<csquotes>>
%<<siunitx>>
" "Inserted after `my-org-article-latex-default-packages-alist'.")
@@ -961,53 +1030,6 @@ Replaces <<...>> with values defined in
\\end{mtchideinmaintoc}
}
%%%
%%% INDEX
%%%
\\usepackage{imakeidx}
%\\usepackage{splitidx}
\\newcommand{\\Index}[1]{#1\\index{#1}}
% Formatiere Seitennummern im Index:
\\newcommand{\\indexpageno}[1]{%
{\\bfseries\\hyperpage{#1}}%
}
\\makeindex
%\\makeindex[%
%name=persons,
%title=Index of names,
%columns=3
%]
\\usepackage{idxlayout} % avoid LaTeX bug 3126 (\twocolumn interfering with \topskip)
\\usepackage{ragged2e} % avoid the automatic loading of the ragged2e package failure
%\\index[persons]{Einstein, Albert}
\\indexsetup{%
level=\\section*,
toclevel=section,
noclearpage,
%firstpagestyle=plain, % disabled when the package fancyhdr is loaded
%headers={\\indexname}{\\indexname} % Dont use these keys if you use fancyhdr
}
%save as <filename>.mst:
%headings_flag 1
%heading_prefix \"{\\\\bf ---~\"
%heading_suffix \"~---}\"
%delim_0 \"\\\\dotfill\\\\indexpageno{\"
%delim_1 \"\\\\dotfill\\\\indexpageno{\"
%delim_2 \"\\\\dotfill\\\\indexpageno{\"
%delim_t \"}\"
%delim_n \"}, \\\\indexpageno{\"
%delim_r \"} -- \\\\indexpageno{\"
%suffix_2p \"}f.{\"
%suffix_3p \"}ff.{\"
%symhead_negative \"Symbole\"
%symhead_positive \"Symbole\"
%numhead_negative \"Zahlen\"
%numhead_positive \"Zahlen\"
%quote '+'
%line_max 255
%%%
%%% FIGURES
@@ -1565,25 +1587,6 @@ Text like <<...>>> will be replaced according to
"\\fancyfoot[C]{--~\\thepage~--}"
;; "%\\fancyfoot[RO] {\\thepage}"
"}"
;; ""
;; "% must be set between an header and text, direct before the first paragraph, and must be compiled at least twice"
"\\newcommand{\\sectionheader}{%"
" \\thispagestyle{plain}%"
" \\begin{tikzpicture}[remember picture, overlay]%"
" \\node[shift={(0 cm,-2.8cm)}] at (current page.north west){%"
" \\begin{tikzpicture}[remember picture, overlay]%"
" \\node[shift={(2.8,0)},right] {\\TITLE\\ -- \\SUBTITLE};%"
" \\end{tikzpicture}%"
" };%"
" \\node[shift={(0 cm,-2.8cm)}] at (current page.north east){%"
" \\begin{tikzpicture}[remember picture, overlay]%"
" \\node[shift={(-2.8,0)},left] {\\AUTHOR};%"
" \\end{tikzpicture}%"
" };%"
;; " % Draw a page border"
;; " % \\draw (current page.north west) rectangle (current page.south east);%"
" \\end{tikzpicture}%"
"}"
;;; Lists
;; ("" "enumerate" nil) ;; already loaded?
"\\renewcommand{\\labelitemi}{--}" ;; 1st level dash instead of dot
@@ -1620,9 +1623,9 @@ Text like <<...>>> will be replaced according to
;;; - Figures
("" "svg" nil) ;; uses Inkscape
;;; - Tikz
("" "tikz" nil)
("" "tikz" t)
("" "gnuplot-lua-tikz" nil)
("" "pgfplots" nil) ;; ,pgfmath ;; for \\begin{axis} !needs by tikz (backgrounds)
("" "pgfplots" t) ;; ,pgfmath ;; for \\begin{axis} !needs by tikz (backgrounds)
"\\usepgflibrary{shapes.geometric}"
"\\usepgfplotslibrary{patchplots}"
"\\usetikzlibrary{"
@@ -1771,9 +1774,34 @@ Text like <<...>>> will be replaced according to
;; " %morekeywords={*,...},
;; " %deletekeywords={...},
"}"
;;; Glossaries
("\n automake=immediate,\n acronym,\n nonumberlist,\n nogroupskip,\n section=section,\n"
"glossaries" nil)
;;; Index
;; define an index with \index{text}
;; or if another index is specified \index[otherindex]{text}
("" "imakeidx" nil)
;; %\renewcommand{\indexname}{Stichwortverzeichnis}
("totoc" "idxlayout" nil) ;; % avoid LaTeX bug 3126 (\twocolumn interfering with \topskip)
"\\indexsetup{"
" level=\\section*," ;; \section* is default for article class
" toclevel=section,"
;;" noclearpage,"
;;" othercode=\\addcontentsline{toc}{section}{\\indexname}" ;; toclevel and or makeindex option intoc does not seem to work. solved; 'problem' was idxlayout and not setting option totoc
"}"
"\\makeindex[intoc]"
;; "\\makeindex[intoc,name=name,title={Index of names}]" ;; having another index
;; %firstpagestyle=plain, % disabled when the package fancyhdr is loaded
;; %headers={\indexname}{\indexname} % Dont use these keys if you use fancyhdr
;;; Glossaries (with acronym)
"\\usepackage["
" automake=immediate,"
" acronym,"
;; " nonumberlist,"
" nogroupskip,"
" nopostdot,"
" section=section,"
" translate=true,"
" toc,"
;; " savewrites,"
"]{glossaries}"
;; automake, % will run makeindex to create .gls, .acr files,
;; (? automake or automake=true will execute at the end of the document, for lualatex we need it before the command \makeglossaries, for this using automake=immediate (https://tex.stackexchange.com/a/468877))
;; to create .glo and .acn with latexmk see latexmkrc file
@@ -1789,9 +1817,32 @@ Text like <<...>>> will be replaced according to
;; %makeindex,
;; %xindy={language=german-duden,codepage=utf8} % mit makeglossaries.exe ?
;; %hyperfirst=false, %
;; % define an entry \\newglossary[⟨log-ext⟩]{⟨name⟩}{⟨in-ext⟩}{⟨out-ext⟩}{⟨title⟩}[⟨counter⟩]
"\\renewcommand*{\\glspostdescription}{}" ;; remove the dot at the end of every entry
;; % define a new glossary type \newglossary[⟨log-ext⟩]{⟨name⟩}{⟨in-ext⟩}{⟨out-ext⟩}{⟨title⟩}[⟨counter⟩]
;; "\\newglossary[slg]{symbolslist}{syi}{syg}{List of Symbols}"
"\\newglossary[los.glg]{symbols}{los.gls}{los.glo}{List of Symbols}" ;; define a \glssymbolsgroupname. if this glossary should be considered an acronym, then add the label to glossaries option acronymlist, like aronymlist={main,symbols} or use \DeclareAcronymList{<list>} to add or use \SetAcronymLists{<list>} to replace
;; "\\glsaddkey{unit}{\\glsentrytext{\\glslabel}}{\\glsentryunit}{\\GLsentryunit}{\\glsunit}{\\Glsunit}{\\GLSunit}" ;; now a unit can be defined inside \newglossaryentry. But for list of symbols we use the symbol key.
"\\newglossarystyle{mysymbols}{
\\setlength\\LTleft{0pt}
\\setglossarystyle{long3colheader}
\\renewenvironment{theglossary}
%{\\begin{longtable}{lp{2cm}p{\\glsdescwidth}}}
{\\begin{longtable}{@{}lll@{}}}
{\\end{longtable}}
% \\renewcommand*{\\glossaryheader}{
% % \\textbf{Symbol} & \\textbf{Unit} & \\textbf{Name}\\\\
% % \\midrule[1pt]
% % \\addlinespace[2ex]
% \\endhead
% % \\bottomrule[1pt]
% \\endfoot
% }
\\renewcommand*{\\glossaryheader}{}
\\renewcommand*{\\glossentry}[2]{%
% first column could be also \\textbf{\\glsentryitem{##1}\\glstarget{##1}{\\glossentryname{##1}}}
\\glossentryname{##1} & \\glossentrysymbol{##1} & \\glossentrydesc{##1} \\tabularnewline}%
}"
"\\makeglossaries%"
;; "\\makenoidxglossaries%" ;; using \printnoidxglosssaries
;;; Glyphs & More
"\\DeclareUnicodeCharacter{2009}{\\,}" ;; convert unicode to latex command, thin-space
("" "eurosym" t)
@@ -1848,7 +1899,7 @@ Text like <<...>>> will be replaced according to
" \\raisebox{#5\\ht2}{\\usebox2}%"
"}"
;; units
("thinspace,thinqspace,squaren,Gray" "SIunits" nil) ;; cannot be used together with amssymb
("thinspace,thinqspace,squaren,Gray" "SIunits" t) ;; cannot be used together with amssymb
;; thinspace,
;; thinqspace, % use of \, (thin math space) as spacing
;; %mediumqspace, % use of \: (medium math space) as spacing
@@ -1858,8 +1909,8 @@ Text like <<...>>> will be replaced according to
;; %textstyle,
;; ("" "siunitx" nil) ;; runs in: ! TeX capacity exceeded, sorry [input stack size=5000].
;;"\\DeclareSIUnit{\\EUR}{\\text{\\euro}}"
("" "dsfont" nil) ;; use \mathds{A} alternative zu mathbb
("" "MnSymbol" nil) ;; incompatible with the amssymb and amsfonts, automatically loads the amsmath and textcomp. used for tensors
("" "dsfont" t) ;; use \mathds{A} alternative zu mathbb
("" "MnSymbol" t) ;; incompatible with the amssymb and amsfonts, automatically loads the amsmath and textcomp. used for tensors
;; symbols using dsfont MnSymbol
"\\newcommand{\\field}[1]{\\ensuremath{\\mathds{#1}}}" ;; \field{X} defined with mathds
"\\newcommand{\\fA}{\\field{A}}" ;; \fA Affine field A
@@ -1879,7 +1930,7 @@ Text like <<...>>> will be replaced according to
"\\newcommand{\\fdg}{\\;|\\;}" ;; \fdg 'für die gilt'
"\\newcommand*{\\qed}{\\hfill\\ensuremath{\\blacksquare}}" ;; \qed Q.E.D. quod erat demonstrandum "what was to be shown" -> "which was to be demonstrated"
"\\newcommand*\\euler{\\mathrm{e}}" ;; \euler e
("" "xspace" nil) ;; for \deg
("" "xspace" t) ;; for \deg
"\\renewcommand{\\deg}{\\ensuremath{^{\\circ}}\\xspace}" ;; for text \deg ° degree
"\\newcommand\\degC{{\\,^{\\circ}\\mathrm{C}}}" ;; \degC °C
"\\newcommand\\sins{{\\mathrm{s}}}" ;; \sins short sin: s
@@ -1911,8 +1962,8 @@ Text like <<...>>> will be replaced according to
"\\newcommand*{\\ddt}[1]{\\overset{\\mbox{\\large\\bfseries .\\hspace{-0.1ex}.}}{#1}}"
"\\newcommand*{\\Eval}[3]{{\\left.#1\\phantom{\\Big|}\\!\\!\\right\\rvert_{#2}^{#3}}}"
;; tensors
("" "accents" nil)
("" "ushort" nil)
("" "accents" t)
("" "ushort" t)
;; ("" "ulem" nil) ;; % not for math mode, too much space below with uuline; for tensor
;; under-line version
"\\newcommand{\\tensor}[1]{\\ensuremath{{\\boldsymbol{#1}}}}"
@@ -1926,7 +1977,7 @@ Text like <<...>>> will be replaced according to
;; "%\\newcommand{\\tensorII}[1]{\\ensuremath{\\uuline{\\bm{#1}}}}"
;; "%\\newcommand{\\tensorIII}[1]{\\ensuremath{\\underaccent{3}{\\underaccent{\\tilde}{\\bm{#1}}}}}"
;; "%\\newcommand{\\tensorIV}[1]{\\ensuremath{\\underaccent{4}{\\underaccent{\\tilde}{\\bm{#1}}}}}"
;; arrow version needs MnSymbol
;; arrow version needs MnSymbol and tikz
"\\newcommand{\\tensori}[1]{
\\tikz[baseline, anchor=base,inner sep=0pt]{
\\node{\\ensuremath{\\phantom{#1\\vphantom{\\overrightharpoon{b}}}}};
@@ -2161,7 +2212,9 @@ Uses also `my-org-article-latex-template-value' with
;; Possibly limit depth for headline numbering.
(let ((sec-num (plist-get info :section-numbers)))
(when (integerp sec-num)
(format "\\setcounter{secnumdepth}{%d}\n" sec-num)))
(format "\\setcounter{secnumdepth}{%d}\n" sec-num)))
;; biblatex
(format "%s" (plist-get info :article-biblatex))
;; Author.
(let ((author (and (plist-get info :with-author)
(let ((auth (plist-get info :author)))
@@ -2191,7 +2244,10 @@ Uses also `my-org-article-latex-template-value' with
(and (stringp template)
(format-spec template spec)))
;; custom variables
(let* ((language (plist-get info :language))
(let* ((title (car (plist-get info :title)))
(subtitle (car (plist-get info :subtitle)))
(author (car (plist-get info :author)))
(language (plist-get info :language))
(document-type (if (string=
(plist-get info :article-document-type)
my-org-article-latex-document-type)
@@ -2200,6 +2256,7 @@ Uses also `my-org-article-latex-template-value' with
;; en version
(t my-org-article-latex-document-type))
(plist-get info :article-document-type)))
;; use document-type
(titlename (cond ((string= "de" language)
(concat "Thema der " document-type))
;; en version
@@ -2211,9 +2268,13 @@ Uses also `my-org-article-latex-template-value' with
(cond ((string= "de" language) "Kurzzusammenfassung")
;; en version
(t "Description"))))
(concat (format "\\def\\mytitlename{%s}\n" titlename)
(format "\\def\\mykeywordname{%s}\n" keywordname)
(format "\\def\\mydescriptionname{%s}\n" descriptionname)))
(concat
(format "\\def\\mytitle{%s}\n" title)
(format "\\def\\mysubtitle{%s}\n" subtitle)
(format "\\def\\myauthor{%s}\n" author)
(format "\\def\\mytitlename{%s}\n" titlename)
(format "\\def\\mykeywordname{%s}\n" keywordname)
(format "\\def\\mydescriptionname{%s}\n" descriptionname)))
;; Document start.
"\\begin{document}\n\n"
;; Title command.

View File

@@ -309,8 +309,10 @@ Version 2016-07-13"
(;; Note that the built-in `describe-function' includes both functions
;; and macros. `helpful-function' is functions only, so we provide
;; `helpful-callable' as a drop-in replacement to include `helpful-macro'.
("C-h f" . helpful-callable)
("C-h v" . helpful-variable)
("C-h f" . describe-function)
;; ("C-h f" . helpful-callable)
("C-h v" . describe-variable)
;; ("C-h v" . helpful-variable)
("C-h k" . helpful-key)
;; Lookup the current symbol at point. C-c C-d is a common keybinding
;; for this in lisp modes.

View File

@@ -1,6 +1,6 @@
# -*- mode: snippet -*-
# name: Article
# group: templates
# group: Article Templates
# key: ?article
# --
#+TITLE: ${1:Title}
@@ -24,6 +24,7 @@
:VISIBILITY: folded
:END:
#+LATEX: \clearpage\thispagestyle{empty}
# uses keyword document_type
#+BEGIN_abstract
*{{{author}}}*
@@ -48,15 +49,14 @@
#+LATEX: \thispagestyle{plain}
# List of Figures (# `#+TOC: figures' is not working)
#+LATEX: \phantomsection\addcontentsline{toc}{section}{\listfigurename}\listoffigures
#+LATEX: \listoffigures
#+LATEX: \thispagestyle{plain}
# List of Tables
#+LATEX: \phantomsection\addcontentsline{toc}{section}{\listtablename}
#+TOC: tables
#+LATEX: \thispagestyle{plain}
# List of Listings
#+LATEX: \phantomsection\addcontentsline{toc}{section}{\lstlistlistingname}
#+TOC: listings
#+LATEX: \thispagestyle{plain}
@@ -117,3 +117,6 @@ $0
:UNNUMBERED: nil
:END:
# ! UNNUMBERED: nil !
* Index :ignore:
[[printindex:]]

View File

@@ -0,0 +1,29 @@
# -*- mode: snippet -*-
# name: Article Glossaries
# group: Article Templates
# key: ?article-gls
# --
* Glossary, Acronym and List of Symbols :ignore:
#+name: glossary
| label | name | description | unit |
|-------+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------|
| tree | Tree | A woody plant | |
| shrub | Shrub | A woody bush | |
| api-g | API | An Application Programming Interface (API) is a particular set of rules and specifications that a software program can follow to access and make use of the services and resources provided by another particular software program that implements that API | |
| w | \(w\) | Width | mm |
| A | \(A\) | Area | mm^{2} |
| L | \(L\) | Length | mm |
| f | \(f\) | Eigen frequency | Hz |
#+name: acronyms
| label | abbreviation | full form |
|-------+--------------+-----------------------------------|
| mimo | | multiple-input multiple output |
| qos | QoS | quality-of-service |
| bb | BB | branch and bound |
| api | API | Application Programming Interface |
#+LATEX: \printglossary\thispagestyle{plain}
#+LATEX: \printglossary[type=\acronymtype,title=Abkürzungsverzeichnis]\thispagestyle{plain}
#+LATEX: \printglossary[type=symbols,style=mysymbols,title=Symbolverzeichnis]\thispagestyle{plain}
#+LATEX: \glsaddallunused

View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: Article Image svg
# group: Article Templates
# key: ?article-img-svg
# --
#+NAME: fig-svg
#+CAPTION[Caption in ToC]: Caption at place
#+ATTR_ORG: :width 100
#+ATTR_LATEX: :width 0.1\textwidth
[[./path.svg]]

View File

@@ -0,0 +1,43 @@
# -*- mode: snippet -*-
# name: Article Image Tikz
# group: Article Templates
# key: ?article-img-tpl
# --
#+HEADER: :file (tpl-file "test-tikz")
#+HEADER: :results (tpl-results)
#+BEGIN_src latex :exports results :wrap figure
\begin{tikzpicture}
\begin{axis}[
width=12.5cm,
height=5cm,
title={},
enlarge x limits=false,
enlarge y limits=false,
scale only axis,
ymajorgrids,
grid style={gray!30},
axis lines=left,
xticklabel style={/pgf/number format/.cd,fixed,fixed zerofill,precision=1},
%xticklabel style={rotate=90,anchor=near xticklabel, /pgf/number format/1000 sep={}},
xlabel={$x$ label},
xlabel style ={yshift=-0.5cm},
%xtick={0,1,...,3},
xmin=0,
xmax=3,
ymin=0,
ymax=10,
ylabel={$y$ label},
%yticklabel style={/pgf/number format/.cd,fixed,fixed zerofill,precision=2},
%ytick={-1,0,...,3.5},
]
\addplot[red, thick, mark=x] table[x index=0, y index=1] {data.dat}; \label{tpl:y1}
\addplot[blue, thick, mark=x] table[x index=0, y index=2] {data.dat}; \label{tpl:y2}
\end{axis}
\end{tikzpicture}
#+END_src
#+ATTR_LATEX: :options [H] :caption \caption[Caption in ToC]{Caption at place with ref to \(y_{1}\) \ref{tpl:y1} and \(y_{2}\) \ref{tpl:y2}}
#+RESULTS:
#+begin_figure
[[file:test-tikz.svg]]
#+end_figure

View File

@@ -0,0 +1,18 @@
# -*- mode: snippet -*-
# name: Article List of Symbols
# group: Article Templates
# key: ?article-los-old
# --
* List of Symbols
:PROPERTIES:
:CUSTOM_ID: sec-list-of-symbols
:UNNUMBERED: t
:TITLE: Symbols
:END:
#+ATTR_LATEX: :center nil :align @{}lll@{}
| \(A\) | mm^{2} | Area |
| \(L\) | mm | Length |
| \(f\) | Hz | Eigen frequency |
| \(J\) | | {{{textsc(Jacobi)}}}an determinant |
| \(m\ti{ges}\) | kg | Total mass |
| \(m_{ik}\ho{eff}\) | kg | Effective mass |

View File

@@ -0,0 +1,15 @@
# -*- mode: snippet -*-
# name: Article Table
# group: Article Templates
# key: ?article-tbl
# --
#+NAME: tbl-name
#+CAPTION[Caption in ToC]: Caption at place
#+ATTR_LATEX: :booktabs t :align rcl :placement [H]
|--------+--------+--------|
| right | center | left |
|--------+--------+--------|
| A1 | A2 | A2 |
| B1.1 | B2.1 | B3.1 |
| C1.1.1 | C2.1.1 | C3.1.1 |
|--------+--------+--------|