-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
950 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/.meta.tex | ||
/schema.aux | ||
/schema.bbl | ||
/schema.blg | ||
/schema.log | ||
/schema.out | ||
/schema.pdf | ||
/schema.toc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#========================================================================= | ||
# Builders and flags: | ||
|
||
BIBTEX = bibtex | ||
PDFLATEX = pdflatex | ||
EPSTOPDF = epstopdf | ||
INKSCAPE = inkscape --without-gui | ||
|
||
RM = rm -f | ||
MV = mv | ||
|
||
|
||
#========================================================================= | ||
# Files: | ||
|
||
SRCS = schema | ||
|
||
LOGFILES = $(addsuffix .log, $(SRCS)) $(addsuffix .blg, $(SRCS)) \ | ||
$(addsuffix .out, $(SRCS)) $(addsuffix .snm, $(SRCS)) | ||
AUXFILES = $(addsuffix .aux, $(SRCS)) $(addsuffix .bbl, $(SRCS)) \ | ||
$(addsuffix .vrb, $(SRCS)) $(addsuffix .toc, $(SRCS)) \ | ||
$(addsuffix .nav, $(SRCS)) | ||
RESFILES = $(addsuffix .pdf, $(SRCS)) | ||
|
||
BIBFILES = schema.bib | ||
|
||
#========================================================================= | ||
# Maintargets: | ||
|
||
# default target | ||
all: $(RESFILES) | ||
|
||
# clean: Remove temporary files | ||
clean: | ||
$(RM) $(LOGFILES) | ||
|
||
# realclean: Remove all intermediate files | ||
realclean: | ||
$(RM) $(AUXFILES) .meta.tex $(LOGFILES) | ||
|
||
# distclean: Remove all automatically created files | ||
distclean: | ||
$(RM) $(RESFILES) $(AUXFILES) .meta.tex $(LOGFILES) $(PDFIMGS) | ||
|
||
# metafile: Create a file containing some metadata such as version and date | ||
metafile: | ||
python3 meta.py > .meta.tex | ||
|
||
# Tell make, that the main targets are not actually files, that should | ||
# considered to be build: | ||
.PHONY: all clean realclean distclean metafile | ||
|
||
|
||
#========================================================================= | ||
# Implicit rules: | ||
|
||
.SUFFIXES: | ||
.SUFFIXES: .tex .pdf .eps .svg .dot | ||
|
||
%.bbl: %.tex | ||
$(PDFLATEX) $* | ||
$(BIBTEX) $* | ||
|
||
%.pdf: %.tex | ||
while true; do \ | ||
$(PDFLATEX) $*; \ | ||
grep -s 'Rerun to get .* right' $*.log || break; \ | ||
done | ||
|
||
%.pdf: %.eps | ||
$(EPSTOPDF) $< | ||
|
||
%.eps: %.svg | ||
$(INKSCAPE) --export-eps=$@ $< | ||
|
||
%.svg: %.gv | ||
dot -Tsvg -o $@ $< | ||
|
||
|
||
#========================================================================= | ||
# Dependencies: | ||
schema.pdf: metafile schema.tex |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#! /usr/bin/python3 | ||
|
||
import datetime | ||
import os | ||
from pathlib import Path | ||
import subprocess | ||
|
||
class GitProps: | ||
"""Determine properties of the git repository. | ||
""" | ||
|
||
def __init__(self, root="."): | ||
self.root = Path(root).resolve() | ||
|
||
def _exec(self, cmd): | ||
proc = subprocess.run(cmd.split(), | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, | ||
cwd=self.root, | ||
check=True, | ||
env=dict(os.environ, LC_ALL='C'), | ||
universal_newlines=True) | ||
return proc.stdout.strip() | ||
|
||
@property | ||
def is_dirty(self): | ||
return bool(self._exec("git status --porcelain --untracked-files=no")) | ||
|
||
@property | ||
def date(self): | ||
if self.is_dirty: | ||
d = datetime.date.today() | ||
else: | ||
ts = int(self._exec("git log -1 --format=%cd --date=unix")) | ||
d = datetime.date.fromtimestamp(ts) | ||
return d.strftime("%e %B %Y").strip() | ||
|
||
@property | ||
def version(self): | ||
return self._exec("git describe --always --dirty").strip() | ||
|
||
def main(): | ||
git = GitProps() | ||
print("\\newcommand{\\schemaversion}{%s}" % git.version) | ||
print("\\newcommand{\\schemadate}{%s}" % git.date) | ||
|
||
if __name__ == "__main__": | ||
main() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
\ProvidesPackage{pidinsttitle}[2021/11/09 customized title page] | ||
\RequirePackage{graphicx} | ||
\RequirePackage{url} | ||
|
||
\renewcommand*{\@titlehead}{% | ||
\includegraphics[height=15ex]{rda-logo}% | ||
\hfill% | ||
\includegraphics[height=15ex]{pidinst-logo}% | ||
} | ||
|
||
\newcommand*{\@titlefoot}{% | ||
\hfill% | ||
\href{https://creativecommons.org/licenses/by/4.0/}{\includegraphics[height=3ex]{cc-by}}% | ||
}% | ||
\newcommand{\titlefoot}[1]{\gdef\@titlefoot{% | ||
#1% | ||
}}% | ||
|
||
\renewcommand\maketitle{% | ||
\begin{titlepage} | ||
\setcounter{page}{1}% | ||
\ifx\@titlehead\@empty \else | ||
\begin{minipage}[t]{\textwidth}% | ||
\usekomafont{titlehead}{\@titlehead\par}% | ||
\end{minipage}\par | ||
\fi | ||
\null\vfill | ||
\begin{center} | ||
{\usekomafont{title}{\huge \@title\par}}% | ||
\vskip 1em | ||
{\ifx\@subtitle\@empty\else\usekomafont{subtitle}{\@subtitle\par}\fi}% | ||
\vskip 2em | ||
{% | ||
\usekomafont{author}{% | ||
\lineskip 0.75em | ||
\begin{tabular}[t]{c} | ||
\@author | ||
\end{tabular}\par | ||
}% | ||
}% | ||
\vskip 1.5em | ||
{\usekomafont{date}{\@date \par}}% | ||
\vskip \z@ \@plus3fill | ||
{\usekomafont{publishers}{\@publishers \par}}% | ||
\vskip 3em | ||
\end{center}\par | ||
\vfill | ||
\ifx\@titlefoot\@empty \else | ||
\begin{minipage}[t]{\textwidth}% | ||
\usekomafont{titlehead}{\@titlefoot\par}% | ||
\end{minipage}\par | ||
\fi | ||
\end{titlepage} | ||
}% |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@Misc{pidinst:github, | ||
author = {RDA Persistent Identification of Instruments WG}, | ||
title = {Medadata Schema for the | ||
Persistent Identification of Scientific Instruments}, | ||
note = {Code repository}, | ||
url = {https://github.com/rdawg-pidinst/schema} | ||
} | ||
|
||
@Article{pidinst2020, | ||
author = {Stocker, Markus and Darroch, Louise and Krahl, Rolf | ||
and Habermann, Ted and Devaraju, Anusuriya and | ||
Schwardmann, Ulrich and D'Onofrio, Claudio and | ||
Häggström, Ingemar}, | ||
title = {Persistent Identification of Instruments}, | ||
journal = {Data Science Journal}, | ||
year = 2020, | ||
volume = 19, | ||
number = 1, | ||
pages = 18, | ||
doi = {10.5334/dsj-2020-018} | ||
} | ||
|
||
@Misc{datacite:schema, | ||
author = {DataCite Metadata Working Group}, | ||
title = {DataCite Metadata Schema Documentation for the | ||
Publication and Citation of Research Data and Other | ||
Research Outputs v4.4}, | ||
month = mar, | ||
year = 2021, | ||
doi = {10.14454/3W3Z-SA82} | ||
} |
Oops, something went wrong.