cagix / pandoc-thesis

Pandoc Thesis Template: A Template for Thesis Documents written in Markdown
MIT License
84 stars 22 forks source link

"Could not find data file templates/titlepage.tex" when running make #32

Closed genaray closed 1 year ago

genaray commented 1 year ago

Using

Error & Reproduction

I was following the Usage Example, pulled the repo, ran make docker, ran make simple or make cleanthesis. Then i was hit by the error message Could not find data file templates/titlepage.tex.

PS C:\Users\Lars\DockerProjects\pandoc-thesis> make cleanthesis
rm -rf .tmp_template_dl
git clone --quiet --single-branch --branch master --depth 100 https://github.com/derric/cleanthesis .tmp_template_dl
cd .tmp_template_dl && git checkout --quiet 63d1fdd815
cp .tmp_template_dl/cleanthesis.sty ./cleanthesis.sty
rm -rf .tmp_template_dl
docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --wrap=preserve -M cleanthesis=true -M cleanthesisbibfile=references --template=titlepage.tex --metadata-file=md/metadata.yaml -o __titlepage.filled.tex titlepage.tex
Could not find data file templates/titlepage.tex
make: *** [Makefile:196: __titlepage.filled.tex] Error 97

Additional Details

Looks like the templates folder is missing, however you mentioned that in order to generate that folder a make eisvogel or make cleanthesis is required... long story short, doesnt work since the same error is generated as the print above shows.

In addition to this problem, i also noticed that the created docker image does not run and closes instantly. Not sure if this behaviour is intended.

image

I tried several combinations of cleaning, making, pulling and setting up the repo again without any sucess. Is this a bug or is something missing in the tutorial ?

cagix commented 1 year ago

Hmmm, I don't have access to a Windows computer. Can you please try two things and post the result back here:

I suspect that something went wrong when mounting the project folder inside the container.

cagix commented 1 year ago

PS: And yes, the container will be stopped after each command. This is another issue that should be addressed in the next revision.

genaray commented 1 year ago

ls -alF

Since ls -alF is not available in windows, i actually used the standalone git bash to execute that command. Hope its the "same".

total 113
drwxr-xr-x 1 Lars 197121     0 Nov 29 15:17 ./
drwxr-xr-x 1 Lars 197121     0 Nov 29 14:45 ../
-rw-r--r-- 1 Lars 197121   198 Nov 29 14:45 .editorconfig
drwxr-xr-x 1 Lars 197121     0 Nov 29 14:45 .git/
-rw-r--r-- 1 Lars 197121   126 Nov 29 14:45 .gitattributes
-rw-r--r-- 1 Lars 197121  2602 Nov 29 14:45 .gitignore
-rw-r--r-- 1 Lars 197121   370 Nov 29 14:45 backmatter.tex
-rw-r--r-- 1 Lars 197121 24008 Nov 29 14:45 cleanthesis.sty
drwxr-xr-x 1 Lars 197121     0 Nov 29 14:45 docker/
-rw-r--r-- 1 Lars 197121 31810 Nov 29 15:08 eisvogel.tex
drwxr-xr-x 1 Lars 197121     0 Nov 29 14:45 examples/
drwxr-xr-x 1 Lars 197121     0 Nov 29 14:45 figs/
-rw-r--r-- 1 Lars 197121  1933 Nov 29 14:45 frontmatter.tex
-rw-r--r-- 1 Lars 197121   449 Nov 29 14:45 include-header.tex
-rw-r--r-- 1 Lars 197121  1074 Nov 29 14:45 LICENSE.md
-rw-r--r-- 1 Lars 197121  6765 Nov 29 14:45 Makefile
drwxr-xr-x 1 Lars 197121     0 Nov 29 14:45 md/
-rw-r--r-- 1 Lars 197121  7526 Nov 29 14:45 README.md
-rw-r--r-- 1 Lars 197121  3998 Nov 29 14:45 references.bib
-rw-r--r-- 1 Lars 197121   264 Nov 29 14:45 references.md
-rw-r--r-- 1 Lars 197121  2548 Nov 29 14:45 titlepage.tex

Interactive Mode and ls -alF

total 96
drwxrwxrwx 1 root root  4096 Nov 29 14:17 ./
drwxr-xr-x 1 root root  4096 Nov 29 14:18 ../
-rwxrwxrwx 1 root root   198 Nov 29 13:45 .editorconfig*
drwxrwxrwx 1 root root  4096 Nov 29 13:45 .git/
-rwxrwxrwx 1 root root   126 Nov 29 13:45 .gitattributes*
-rwxrwxrwx 1 root root  2602 Nov 29 13:45 .gitignore*
-rwxrwxrwx 1 root root  1074 Nov 29 13:45 LICENSE.md*
-rwxrwxrwx 1 root root  6765 Nov 29 13:45 Makefile*
-rwxrwxrwx 1 root root  7526 Nov 29 13:45 README.md*
-rwxrwxrwx 1 root root   370 Nov 29 13:45 backmatter.tex*
-rwxrwxrwx 1 root root 24008 Nov 29 13:45 cleanthesis.sty*
drwxrwxrwx 1 root root  4096 Nov 29 13:45 docker/
-rwxrwxrwx 1 root root 31810 Nov 29 14:08 eisvogel.tex*
drwxrwxrwx 1 root root  4096 Nov 29 13:45 examples/
drwxrwxrwx 1 root root  4096 Nov 29 13:45 figs/
-rwxrwxrwx 1 root root  1933 Nov 29 13:45 frontmatter.tex*
-rwxrwxrwx 1 root root   449 Nov 29 13:45 include-header.tex*
drwxrwxrwx 1 root root  4096 Nov 29 13:45 md/
-rwxrwxrwx 1 root root  3998 Nov 29 13:45 references.bib*
-rwxrwxrwx 1 root root   264 Nov 29 13:45 references.md*
-rwxrwxrwx 1 root root  2548 Nov 29 13:45 titlepage.tex*
cagix commented 1 year ago

okay, mounting seems to work.

could you please try a pandoc -v at the container prompt?

genaray commented 1 year ago

okay, mounting seems to work.

could you please try a pandoc -v at the container prompt?

Done :

pandocthesis@4a8b3f102581:/pandoc$ pandoc -v
pandoc 2.11.4
Compiled with pandoc-types 1.22, texmath 0.12.1, skylighting 0.10.2,
citeproc 0.3.0.5, ipynb 0.1.0.1
User data directory: /home/pandocthesis/.local/share/pandoc or /home/pandocthesis/.pandoc
Copyright (C) 2006-2021 John MacFarlane. Web:  https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
cagix commented 1 year ago

ok, this ist the good old version ;) ...

then let's try to add a --data-dir=. --resource-path=. to pandoc. so at the container prompt please run pandoc --data-dir=. --resource-path=. --wrap=preserve -M cleanthesis=true -M cleanthesisbibfile=references --template=titlepage.tex --metadata-file=md/metadata.yaml -o __titlepage.filled.tex titlepage.tex.

genaray commented 1 year ago

Also done ( no output however ) ^^ should i now run it again to test if it works ? Or is there more setup to be done ?

Update, still the same error message

cagix commented 1 year ago

Can you please check if you can access the contents of titlepage.tex in the container shell (less titlepage.tex)?

cagix commented 1 year ago

Also done ( no output however ) ^^ should i now run it again to test if it works ? Or is there more setup to be done ?

Update, still the same error message

Actually, there is no setup necessary at all. However, for some reason Pandoc is refusing to find the template.

cagix commented 1 year ago

You could try two other things: The path inside the container is /pandoc/, isn't it? Then you could check --data-dir=/pandoc/ instead of --data-dir=.. Also, instead of --template=titlepage.tex you could try --template=/pandoc/titlepage.tex.

Edit: I.e.

genaray commented 1 year ago

Unfortunately this has'nt worked either :/ and the titlepage.tex is acessable.

Running `make cleanthesis´ outside of the container results in the same error message stated in the issue... and running it inside the container results in :

root@7b867d8835c1:/pandoc# make cleanthesis
docker run --rm -v /pandoc:/pandoc pandoc-thesis pandoc --wrap=preserve -M cleanthesis=true -M cleanthesisbibfile=references --template=titlepage.tex --metadata-file=md/metadata.yaml -o __titlepage.filled.tex titlepage.tex
make: docker: No such file or directory
make: *** [Makefile:196: __titlepage.filled.tex] Error **127**

Also i just saw that the command still states : --template=titlepage.tex, while it actually should have been updated to /pandoc/titlepage.tex since it was modified during your command.

I ran all your commands on the same repo... or should i probably clone it again to provide a clean state ?

cagix commented 1 year ago

I ran all your commands on the same repo... or should i probably clone it again to provide a clean state ?

Ah, sorry. Please start the container (i.e. docker run --rm -it -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc --entrypoint "bash", in your Windows shell), and then at the container prompt (inside the container) please run these two tests, i.e.

Just copy&paste the respective commands (do not type them). Do not use make inside the container, as this would try to use a container inside the container :)

Edit: added "pwd" to be clear on the working dir inside the container Edit: You could probably just try pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex and/or pandoc --template=/pandoc/titlepage.tex titlepage.tex, since we just need to figure as to why Pandoc fails to find the template ...

genaray commented 1 year ago
root@e21411b6424e:/pandoc# pwd
/pandoc
root@e21411b6424e:/pandoc# pandoc --data-dir=/pandoc/ --wrap=preserve -M cleanthesis=true -M cleanthesisbibfile=references --template=titlepage.tex --metadata-file=md/metadata.yaml -o __titlepage.filled.tex titlepage.tex
root@e21411b6424e:/pandoc# pandoc --wrap=preserve -M cleanthesis=true -M cleanthesisbibfile=references --template=/pandoc/titlepage.tex --metadata-file=md/metadata.yaml -o __titlepage.filled.tex titlepage.tex

However make cleanthesis still throws the exact same error ( outside the container shell ). So lets try those other two commands...

root@e21411b6424e:/pandoc# pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex
[WARNING] This document format requires a nonempty <title> element.
  Defaulting to 'titlepage' as the title.
  To specify a title, use 'title' in metadata or --metadata title="...".

%------------------------------------- Custom Title Page ---------------------------
\renewcommand{\maketitle}{
\thispagestyle{empty}

\parindent=0pt
\begin{center}
    \Large
    \textsc{
        Fachhochschule Bielefeld\\
        Fachbereich Campus Minden\\
        \vspace{\baselineskip}\noindent
        Studiengang Informatik
    }
\end{center}

\vspace{20mm}
\hrule
\vspace{5mm}

\begin{center}
    \LARGE
    \textbf{\textsc{  }}
\end{center}

\vspace{5mm}
\hrule
\vspace{10mm}

\vfill

\vspace{\baselineskip}\noindent
\large
\begin{tabular}{lp{\textwidth}}
    vorgelegt von: & \texttt{}\\
    Matrikelnummer: & \texttt{} \\
    &\\[12pt]
    Abgabe am: & \texttt{}\\
    &\\[24pt]
    Erstprüfer/in: & \texttt{}\\
    Zweitprüfer/in: & \texttt{}
\end{tabular}
}
%------------------------------------- Custom Title Page ---------------------------

%------------------------------------- Custom Title (Back) Page --------------------
\newcommand\customtitlebackpage{
\thispagestyle{empty}
\hfill
\vfill
\textbf{} () \\
\textit{} \\
 \\[12pt]
Erstprüfer/in:  \\
Zweitprüfer/in:
}
%------------------------------------- Custom Title (Back) Page --------------------

%------------------------------------- Patch Eisvogel's frontmatter ----------------
%% Eisvogel template uses `\frontmatter` directly *after* `\maketitle`, thus there is
%% a `\doubleclearpage` after the titlepage, which prevents our title-back-page to be
%% positioned on the backside of the titlepage ...
%% (Pandocs default template uses `\frontmatter` *before* `\maketitle`)
%------------------------------------- Patch Eisvogel's frontmatter ----------------

%------------------------------------- Workaround for CleanStyle -------------------
%% cleanthesis.sty *will* check the bibfile, even if `configurebiblatex=false` ...
%% So we need to set it appropriately using our metadata variable "cleanthesisbibfile"
%------------------------------------- Workaround for CleanStyle -------------------

root@e21411b6424e:/pandoc# pandoc --template=/pandoc/titlepage.tex titlepage.tex
[WARNING] This document format requires a nonempty <title> element.
  Defaulting to 'titlepage' as the title.
  To specify a title, use 'title' in metadata or --metadata title="...".

%------------------------------------- Custom Title Page ---------------------------
\renewcommand{\maketitle}{
\thispagestyle{empty}

\parindent=0pt
\begin{center}
    \Large
    \textsc{
        Fachhochschule Bielefeld\\
        Fachbereich Campus Minden\\
        \vspace{\baselineskip}\noindent
        Studiengang Informatik
    }
\end{center}

\vspace{20mm}
\hrule
\vspace{5mm}

\begin{center}
    \LARGE
    \textbf{\textsc{  }}
\end{center}

\vspace{5mm}
\hrule
\vspace{10mm}

\vfill

\vspace{\baselineskip}\noindent
\large
\begin{tabular}{lp{\textwidth}}
    vorgelegt von: & \texttt{}\\
    Matrikelnummer: & \texttt{} \\
    &\\[12pt]
    Abgabe am: & \texttt{}\\
    &\\[24pt]
    Erstprüfer/in: & \texttt{}\\
    Zweitprüfer/in: & \texttt{}
\end{tabular}
}
%------------------------------------- Custom Title Page ---------------------------

%------------------------------------- Custom Title (Back) Page --------------------
\newcommand\customtitlebackpage{
\thispagestyle{empty}
\hfill
\vfill
\textbf{} () \\
\textit{} \\
 \\[12pt]
Erstprüfer/in:  \\
Zweitprüfer/in:
}
%------------------------------------- Custom Title (Back) Page --------------------

%------------------------------------- Patch Eisvogel's frontmatter ----------------
%% Eisvogel template uses `\frontmatter` directly *after* `\maketitle`, thus there is
%% a `\doubleclearpage` after the titlepage, which prevents our title-back-page to be
%% positioned on the backside of the titlepage ...
%% (Pandocs default template uses `\frontmatter` *before* `\maketitle`)
%------------------------------------- Patch Eisvogel's frontmatter ----------------

%------------------------------------- Workaround for CleanStyle -------------------
%% cleanthesis.sty *will* check the bibfile, even if `configurebiblatex=false` ...
%% So we need to set it appropriately using our metadata variable "cleanthesisbibfile"
%------------------------------------- Workaround for CleanStyle -------------------

When we run make cleanthesis again, the error message slighty differs this time :

PS C:\Users\Lars\DockerProjects\pandoc-thesis> make cleanthesis
docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --wrap=preserve -M cleanthesis=true -M cleanthesisbibfile=references --template=frontmatter.tex --metadata-file=md/metadata.yaml -o __frontmatter.filled.tex frontmatter.tex
Could not find data file templates/frontmatter.tex
make: *** [Makefile:196: __frontmatter.filled.tex] Error 97

templates/frontmatter.tex instead of templates/titlepage.tex

cagix commented 1 year ago

ok, let's see:

  1. we are indeed on /pandoc/ inside the container
  2. adding --data-dir=/pandoc/ to Pandoc seems to resolve the issue

so, a quick (and mostly dirty) workaround should be: change line 58 in the makefile from AUX_OPTS = --wrap=preserve to AUX_OPTS = --wrap=preserve --data-dir=/pandoc/. afterwards a make cleanthesis from the Windows prompt should work.


When we run make cleanthesis again, the error message slighty differs this time :

yeah, since we created (filled) the first file manually inside the container, Pandoc complaines about the next template, since the data-dir option is still not in the makefile ...

genaray commented 1 year ago

ok, let's see:

  1. we are indeed on /pandoc/ inside the container
  2. adding --data-dir=/pandoc/ to Pandoc seems to resolve the issue

so, a quick (and mostly dirty) workaround should be: change line 58 in the makefile from AUX_OPTS = --wrap=preserve to AUX_OPTS = --wrap=preserve --data-dir=/pandoc/. afterwards a make cleanthesis from the Windows prompt should work.

When we run make cleanthesis again, the error message slighty differs this time :

yeah, since we created (filled) the first file manually inside the container, Pandoc complaines about the next template, since the data-dir option is still not in the makefile ...

That did not worked either :/

PS C:\Users\Lars\DockerProjects\pandoc-thesis> make cleanthesis
docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --wrap=preserve --data-dir=/pandoc/ -M cleanthesis=true -M cleanthesisbibfile=references --template=frontmatter.tex --metadata-file=md/metadata.yaml -o __frontmatter.filled.tex frontmatter.tex
Could not find data file templates/frontmatter.tex
make: *** [Makefile:196: __frontmatter.filled.tex] Error 97
cagix commented 1 year ago

🤔 so, which of the two command lines in https://github.com/cagix/pandoc-thesis/issues/32#issuecomment-1330885307 did produce the posted output?

genaray commented 1 year ago

🤔 so, which of the two command lines in #32 (comment) did produce the posted output?

Do you mean the large one ? Or the error output ? The large one contains both outputs of: pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex and pandoc --template=/pandoc/titlepage.tex titlepage.tex. The later command is a bit hidden in the messy output.

The error output was however generated by make cleanthesis.

cagix commented 1 year ago

so, in the container shell pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex works (produces the text you posted above).

what happens, if you try docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex at the Windows shell?

cagix commented 1 year ago

🤔 so, which of the two command lines in #32 (comment) did produce the posted output?

Do you mean the large one ? Or the error output ? The large one contains both outputs of: pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex and pandoc --template=/pandoc/titlepage.tex titlepage.tex. The later command is a bit hidden in the messy output.

ah, now i can see it. well, with either --data-dir=/pandoc/ or --template=/pandoc/titlepage.tex it works inside the container. this is promising :)

so, now let's see, if we can reproduce this from the outside (i.e. from the Windows prompt):

this is sort of the same as before but from inside the container.

genaray commented 1 year ago

so, in the container shell pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex works (produces the text you posted above).

what happens, if you try docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex at the Windows shell?

This actually produces this output :

PS C:\Users\Lars\DockerProjects\pandoc-thesis> docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex
[WARNING] This document format requires a nonempty <title> element.
  Defaulting to 'titlepage' as the title.
  To specify a title, use 'title' in metadata or --metadata title="...".

%------------------------------------- Custom Title Page ---------------------------
\renewcommand{\maketitle}{
\thispagestyle{empty}

\parindent=0pt
\begin{center}
    \Large
    \textsc{
        Fachhochschule Bielefeld\\
        Fachbereich Campus Minden\\
        \vspace{\baselineskip}\noindent
        Studiengang Informatik
    }
\end{center}

\vspace{20mm}
\hrule
\vspace{5mm}

\begin{center}
    \LARGE
    \textbf{\textsc{  }}
\end{center}

\vspace{5mm}
\hrule
\vspace{10mm}

\vfill

\vspace{\baselineskip}\noindent
\large
\begin{tabular}{lp{\textwidth}}
    vorgelegt von: & \texttt{}\\
    Matrikelnummer: & \texttt{} \\
    &\\[12pt]
    Abgabe am: & \texttt{}\\
    &\\[24pt]
    Erstprüfer/in: & \texttt{}\\
    Zweitprüfer/in: & \texttt{}
\end{tabular}
}
%------------------------------------- Custom Title Page ---------------------------

%------------------------------------- Custom Title (Back) Page --------------------
\newcommand\customtitlebackpage{
\thispagestyle{empty}
\hfill
\vfill
\textbf{} () \\
\textit{} \\
 \\[12pt]
Erstprüfer/in:  \\
Zweitprüfer/in:
}
%------------------------------------- Custom Title (Back) Page --------------------

%------------------------------------- Patch Eisvogel's frontmatter ----------------
%% Eisvogel template uses `\frontmatter` directly *after* `\maketitle`, thus there is
%% a `\doubleclearpage` after the titlepage, which prevents our title-back-page to be
%% positioned on the backside of the titlepage ...
%% (Pandocs default template uses `\frontmatter` *before* `\maketitle`)
%------------------------------------- Patch Eisvogel's frontmatter ----------------

%------------------------------------- Workaround for CleanStyle -------------------
%% cleanthesis.sty *will* check the bibfile, even if `configurebiblatex=false` ...
%% So we need to set it appropriately using our metadata variable "cleanthesisbibfile"
%------------------------------------- Workaround for CleanStyle -------------------

The command : docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex produces...

PS C:\Users\Lars\DockerProjects\pandoc-thesis> docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex
[WARNING] This document format requires a nonempty <title> element.
  Defaulting to 'titlepage' as the title.
  To specify a title, use 'title' in metadata or --metadata title="...".

%------------------------------------- Custom Title Page ---------------------------
\renewcommand{\maketitle}{
\thispagestyle{empty}

\parindent=0pt
\begin{center}
    \Large
    \textsc{
        Fachhochschule Bielefeld\\
        Fachbereich Campus Minden\\
        \vspace{\baselineskip}\noindent
        Studiengang Informatik
    }
\end{center}

\vspace{20mm}
\hrule
\vspace{5mm}

\begin{center}
    \LARGE
    \textbf{\textsc{  }}
\end{center}

\vspace{5mm}
\hrule
\vspace{10mm}

\vfill

\vspace{\baselineskip}\noindent
\large
\begin{tabular}{lp{\textwidth}}
    vorgelegt von: & \texttt{}\\
    Matrikelnummer: & \texttt{} \\
    &\\[12pt]
    Abgabe am: & \texttt{}\\
    &\\[24pt]
    Erstprüfer/in: & \texttt{}\\
    Zweitprüfer/in: & \texttt{}
\end{tabular}
}
%------------------------------------- Custom Title Page ---------------------------

%------------------------------------- Custom Title (Back) Page --------------------
\newcommand\customtitlebackpage{
\thispagestyle{empty}
\hfill
\vfill
\textbf{} () \\
\textit{} \\
 \\[12pt]
Erstprüfer/in:  \\
Zweitprüfer/in:
}
%------------------------------------- Custom Title (Back) Page --------------------

%------------------------------------- Patch Eisvogel's frontmatter ----------------
%% Eisvogel template uses `\frontmatter` directly *after* `\maketitle`, thus there is
%% a `\doubleclearpage` after the titlepage, which prevents our title-back-page to be
%% positioned on the backside of the titlepage ...
%% (Pandocs default template uses `\frontmatter` *before* `\maketitle`)
%------------------------------------- Patch Eisvogel's frontmatter ----------------

%------------------------------------- Workaround for CleanStyle -------------------
%% cleanthesis.sty *will* check the bibfile, even if `configurebiblatex=false` ...
%% So we need to set it appropriately using our metadata variable "cleanthesisbibfile"
%------------------------------------- Workaround for CleanStyle -------------------

And docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --template=/pandoc/titlepage.tex titlepage.tex produces :

PS C:\Users\Lars\DockerProjects\pandoc-thesis> docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --template=/pandoc/titlepage.tex titlepage.tex
[WARNING] This document format requires a nonempty <title> element.
  Defaulting to 'titlepage' as the title.
  To specify a title, use 'title' in metadata or --metadata title="...".

%------------------------------------- Custom Title Page ---------------------------
\renewcommand{\maketitle}{
\thispagestyle{empty}

\parindent=0pt
\begin{center}
    \Large
    \textsc{
        Fachhochschule Bielefeld\\
        Fachbereich Campus Minden\\
        \vspace{\baselineskip}\noindent
        Studiengang Informatik
    }
\end{center}

\vspace{20mm}
\hrule
\vspace{5mm}

\begin{center}
    \LARGE
    \textbf{\textsc{  }}
\end{center}

\vspace{5mm}
\hrule
\vspace{10mm}

\vfill

\vspace{\baselineskip}\noindent
\large
\begin{tabular}{lp{\textwidth}}
    vorgelegt von: & \texttt{}\\
    Matrikelnummer: & \texttt{} \\
    &\\[12pt]
    Abgabe am: & \texttt{}\\
    &\\[24pt]
    Erstprüfer/in: & \texttt{}\\
    Zweitprüfer/in: & \texttt{}
\end{tabular}
}
%------------------------------------- Custom Title Page ---------------------------

%------------------------------------- Custom Title (Back) Page --------------------
\newcommand\customtitlebackpage{
\thispagestyle{empty}
\hfill
\vfill
\textbf{} () \\
\textit{} \\
 \\[12pt]
Erstprüfer/in:  \\
Zweitprüfer/in:
}
%------------------------------------- Custom Title (Back) Page --------------------

%------------------------------------- Patch Eisvogel's frontmatter ----------------
%% Eisvogel template uses `\frontmatter` directly *after* `\maketitle`, thus there is
%% a `\doubleclearpage` after the titlepage, which prevents our title-back-page to be
%% positioned on the backside of the titlepage ...
%% (Pandocs default template uses `\frontmatter` *before* `\maketitle`)
%------------------------------------- Patch Eisvogel's frontmatter ----------------

%------------------------------------- Workaround for CleanStyle -------------------
%% cleanthesis.sty *will* check the bibfile, even if `configurebiblatex=false` ...
%% So we need to set it appropriately using our metadata variable "cleanthesisbibfile"
%------------------------------------- Workaround for CleanStyle -------------------

The error however stays make cleanthesis :

PS C:\Users\Lars\DockerProjects\pandoc-thesis> make cleanthesis
docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --wrap=preserve --data-dir=/pandoc/ -M cleanthesis=true -M cleanthesisbibfile=references --template=frontmatter.tex --metadata-file=md/metadata.yaml -o __frontmatter.filled.tex frontmatter.tex
Could not find data file templates/frontmatter.tex
make: *** [Makefile:196: __frontmatter.filled.tex] Error 97
cagix commented 1 year ago

so, we've established, that pandoc can find the templates when being called directly from within the running container as well as from "the outside", i.e. when we use the "docker run".

but when we use it with some more options, then it somehow fails? strange.

what happens, if you (temporarily) replace line 196 in the makefile $(PANDOC) $(AUX_OPTS) --template=$< --metadata-file=$(META) -o $@ $< with docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex and run make cleanthesis? this should produce the same output as above (plus some errors, but ignore those for the moment).

genaray commented 1 year ago

so, we've established, that pandoc can find the templates when being called directly from within the running container as well as from "the outside", i.e. when we use the "docker run".

  • inside: pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex: check
  • docker run: docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex: check

but when we use it with some more options, then it somehow fails? strange.

what happens, if you (temporarily) replace line 196 in the makefile $(PANDOC) $(AUX_OPTS) --template=$< --metadata-file=$(META) -o $@ $< with docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex and run make cleanthesis? this should produce the same output as above (plus some errors, but ignore those for the moment).

Running docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex with $(PANDOC) $(AUX_OPTS) --template=$< --metadata-file=$(META) -o $@ $< results in :

PS C:\Users\Lars\DockerProjects\pandoc-thesis> docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex
[WARNING] This document format requires a nonempty <title> element.
  Defaulting to 'titlepage' as the title.
  To specify a title, use 'title' in metadata or --metadata title="...".

%------------------------------------- Custom Title Page ---------------------------
\renewcommand{\maketitle}{
\thispagestyle{empty}

\parindent=0pt
\begin{center}
    \Large
    \textsc{
        Fachhochschule Bielefeld\\
        Fachbereich Campus Minden\\
        \vspace{\baselineskip}\noindent
        Studiengang Informatik
    }
\end{center}

\vspace{20mm}
\hrule
\vspace{5mm}

\begin{center}
    \LARGE
    \textbf{\textsc{  }}
\end{center}

\vspace{5mm}
\hrule
\vspace{10mm}

\vfill

\vspace{\baselineskip}\noindent
\large
\begin{tabular}{lp{\textwidth}}
    vorgelegt von: & \texttt{}\\
    Matrikelnummer: & \texttt{} \\
    &\\[12pt]
    Abgabe am: & \texttt{}\\
    &\\[24pt]
    Erstprüfer/in: & \texttt{}\\
    Zweitprüfer/in: & \texttt{}
\end{tabular}
}
%------------------------------------- Custom Title Page ---------------------------

%------------------------------------- Custom Title (Back) Page --------------------
\newcommand\customtitlebackpage{
\thispagestyle{empty}
\hfill
\vfill
\textbf{} () \\
\textit{} \\
 \\[12pt]
Erstprüfer/in:  \\
Zweitprüfer/in:
}
%------------------------------------- Custom Title (Back) Page --------------------

%------------------------------------- Patch Eisvogel's frontmatter ----------------
%% Eisvogel template uses `\frontmatter` directly *after* `\maketitle`, thus there is
%% a `\doubleclearpage` after the titlepage, which prevents our title-back-page to be
%% positioned on the backside of the titlepage ...
%% (Pandocs default template uses `\frontmatter` *before* `\maketitle`)
%------------------------------------- Patch Eisvogel's frontmatter ----------------

%------------------------------------- Workaround for CleanStyle -------------------
%% cleanthesis.sty *will* check the bibfile, even if `configurebiblatex=false` ...
%% So we need to set it appropriately using our metadata variable "cleanthesisbibfile"
%------------------------------------- Workaround for CleanStyle -------------------

However make cleanthesis still throws this :

PS C:\Users\Lars\DockerProjects\pandoc-thesis> make cleanthesis
docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --wrap=preserve --data-dir=/pandoc/ -M cleanthesis=true -M cleanthesisbibfile=references --template=frontmatter.tex --metadata-file=md/metadata.yaml -o __frontmatter.filled.tex frontmatter.tex
Could not find data file templates/frontmatter.tex
make: *** [Makefile:196: __frontmatter.filled.tex] Error 97

:/

genaray commented 1 year ago

Alright im gonna try something different now... i will just install docker on my WLS2 Ubuntu, pull that project and see if it works fine there xD

Edit : This worked flawless on WLS2, guess i will just continue working there.

cagix commented 1 year ago

Running docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex with $(PANDOC) $(AUX_OPTS) --template=$< --metadata-file=$(META) -o $@ $< results in :

PS C:\Users\Lars\DockerProjects\pandoc-thesis> docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex
[WARNING] This document format requires a nonempty <title> element.
  Defaulting to 'titlepage' as the title.
  To specify a title, use 'title' in metadata or --metadata title="...".

Hmmm. Have you actually replaced line 196 in the makefile with docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex and run make cleanthesis again?

From your log it would seem to me that you used docker run --rm -v /c/Users/Lars/DockerProjects/pandoc-thesis:/pandoc pandoc-thesis pandoc --data-dir=/pandoc/ --template=titlepage.tex titlepage.tex directly at the prompt?

My intention was to check if Make is a problem on your machine or the amount of arguments to the docker command.

cagix commented 1 year ago

Alright im gonna try something different now... i will just install docker on my WLS2 Ubuntu, pull that project and see if it works fine there xD

Edit : This worked flawless on WLS2, guess i will just continue working there.

I am glad to hear that! Unfortunately I don't use Windows and can't test this myself. But I've heard from other people that Windows and Docker don't necessarily work well together.

Can you please summarise briefly what you did to make it work? I thought WSL was active from the beginning? Then I could include this in the readme for future Windows users :) Thank you!

Am I correct in assuming that this ticket does not require any further action and can be closed for the time being?

genaray commented 1 year ago

Alright im gonna try something different now... i will just install docker on my WLS2 Ubuntu, pull that project and see if it works fine there xD Edit : This worked flawless on WLS2, guess i will just continue working there.

I am glad to hear that! Unfortunately I don't use Windows and can't test this myself. But I've heard from other people that Windows and Docker don't necessarily work well together.

Can you please summarise briefly what you did to make it work? I thought WSL was active from the beginning? Then I could include this in the readme for future Windows users :) Thank you!

Am I correct in assuming that this ticket does not require any further action and can be closed for the time being?

Well my "solution" was to ditch windows and use the windows linux subsystems for building this project instead ^^

Solution / Workaround