Issue with Documenter's pdf output - pictures not found

documenter
#1

I’m using Documenter.jl to create documentation for a non-julia project. Creating the website works fine, but I can’t make a pdf with the docker image. If I understand correctly, LaTeXWriter misses the pictures.
Julia error message:

julia> include("makepdf.jl")
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
[ Info: RenderDocument: rendering document.
[ Info: LaTeXWriter: rendering PDF.
[ Info: LaTeXWriter: using docker to compile tex.
┌ Error: LaTeXWriter: failed to compile tex with docker. Logs and partial output can be found in C:\Users\cstamas\AppData\Local\Temp\jl_321C.tmp.
│   exception =
│    failed process: Process(`docker exec -u zeptodoctor latex-container bash -c 'mkdir /home/zeptodoctor/build
│    cd /home/zeptodoctor/build
│    cp -r /mnt/. .
│    latexmk -f -interaction=nonstopmode -view=none -lualatex -shell-escape URSZTAKI.tex
│    '`, ProcessExited(12)) [12]
└ @ Documenter.Writers.LaTeXWriter C:\Users\cstamas\.julia\packages\Documenter\8vUAI\src\Writers\LaTeXWriter.jl:166

One error from the LaTeXWriter.stderr file:

Latexmk: Missing input file: 'ursztaki_segedprogramok.png' from line
  'LaTeX Warning: File `ursztaki_segedprogramok.png' not found on input line 533.'

Documenter.jl versions: Documenter v0.22.2, DocumenterLaTeX v0.2.0, DocumenterMarkdown v0.2.0

I don’t know where to start debugging. Could you please point me where the error is? I happily provide more informations/log files/etc.

Edit1: makepdf.jl

using Documenter
using DocumenterLaTeX

makedocs(sitename = "URSZTAKI",
        format = LaTeX(platform = "docker"),
        pages = ["Home" => "index.md",
                "Guidelines" => "guidelines.md",
                "Információk" => ["Hírek, információk" => "hírek.md",
                                "Hasznos linkek - UR" => "hasznos_linkek.md"],
                "Releasek" => "releases.md",
                "Külső programok" => ["URSZTAKI Mathematica" => "kulso_programok/mathematica.md" ,
                                        "URSZTAKI segédprogramok" => "ursztaki_segedprogramok/URSZTAKI_helpers.md",
                                        "RoboProg" => "kulso_programok/RoboProg.md"],
                "Telepítési instrukciók" => ["Támogatott robotok" => "instrukciok/tamogatott_robotok.md",
                                                "URSZTAKI telepítés" => "instrukciok/telepites/URSZTAKI_telepites.md",
                                                "URSZTAKI telepítés URCappel" => "instrukciok/URSZTAKI_telepites_urcap.md",
                                                "Node-Red telepítés" => "instrukciok/node-red_telepites/Node-Red_telepites.md",
                                                "URSZTAKI Node-Red Dashboard" => "instrukciok/URSZTAKI-NR-dashboard.md"],
                "URSZTAKI dokumentáció" => ["URSZTAKI leírás" => "dokumentaciok/URSZTAKI_leírás.md",
                                                "URCap leírás" => "dokumentaciok/URCap.md",
                                                #"Taskok jegyzéke" => "dokumentaciok/taskjegyzek.md",
                                                "Node-Red flow leírás" => "dokumentaciok/Node-Red_flow_leiras.md",
                                                "Regiszterek" => "dokumentaciok/regiszterek.md",
                                                "Task fejlesztés guide" => "dokumentaciok/task_fejlesztes.md",
                                                "URSZTAKI-Erőszenzorok" => "dokumentaciok/URSZTAKI-eroszenzorok.md",
                                                "Hibakódok" => "dokumentaciok/hibakodok.md",
                                                "RTDE" => "dokumentaciok/RTDE.md"]
                ]
        )

(Edit2: to clarify, the website build is perfectly fine, every image is in it’s place.)

#2

Is this a public repository? Where in the source did you put the picture?

#3

It’s a private (svn) repository. I’ll try and create an MWE and report back.

#4

Created a repo for the MWE:
https://github.com/cserteGT3/Documentertest

#5

Thank you! However, I don’t seem to get any errors, this is what I did:

git clone https://github.com/cserteGT3/Documentertest
cd Documentertest
julia --project docs/makepdf.jl

and the output PDF has images.

#6

Do you have any idea why is the difference?
I’m on windows 10 with a fresh install of docker (first time using it).

#7

From the logs, LaTeX seems to be unhappy with paths like

\includegraphics{guides\Lena.png}

since it considers \Lena a LaTeX command.

1 Like
#8

Ah, good catch. So looks like Documenter should output / on Windows too, assuming tex can handle that.

#9

Ahh, I missed that. Than you for pointing out! I’ll open an issue on GitHub.

\ is one of the reasons why I hate windows.

#10

Can you try

pkg> add Documenter#fe/filepath-windows-tex

and see if that branch fixes it, see https://github.com/JuliaDocs/Documenter.jl/pull/999.

2 Likes
#11

AFAICT using the / for all OSs is the way to go, eg

1 Like
#12

The issue is still there. What I’ve done (from Git Bash):

$ git clone https://github.com/cserteGT3/Documentertest.git
Cloning into 'Documentertest'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 23 (delta 4), reused 19 (delta 2), pack-reused 0
Unpacking objects: 100% (23/23), done.

$ cd Documenter
bash: cd: Documenter: No such file or directory

$ cd Documentertest/

$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.0 (2019-01-21)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.1) pkg> activate .

(Documentertest) pkg> add Documenter#fe/filepath-windows-tex
  Updating registry at `C:\Users\cstamas\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Updating git-repo `https://github.com/JuliaDocs/Documenter.jl.git`
 Resolving package versions...
  Updating `C:\Users\cstamas\Documents\GIT\Documentertest\Project.toml`
  [e30172f5] ~ Documenter v0.22.2 ⇒ v0.22.2 #fe/filepath-windows-tex (https://github.com/JuliaDocs/Documenter.jl.git)
  Updating `C:\Users\cstamas\Documents\GIT\Documentertest\Manifest.toml`
  [e30172f5] ~ Documenter v0.22.2 ⇒ v0.22.2 #fe/filepath-windows-tex (https://github.com/JuliaDocs/Documenter.jl.git)

(Documentertest) pkg> st
    Status `C:\Users\cstamas\Documents\GIT\Documentertest\Project.toml`
  [e30172f5] ~ Documenter v0.22.2 ⇒ v0.22.2 #fe/filepath-windows-tex (https://github.com/JuliaDocs/Documenter.jl.git)
  [cd674d7a]   DocumenterLaTeX v0.2.0
    Status `C:\Users\cstamas\Documents\GIT\Documentertest\Manifest.toml`
  [e30172f5] ~ Documenter v0.22.2 ⇒ v0.22.2 #fe/filepath-windows-tex (https://github.com/JuliaDocs/Documenter.jl.git)

julia> include("docs\\makepdf.jl")
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
[ Info: RenderDocument: rendering document.
[ Info: LaTeXWriter: rendering PDF.
[ Info: LaTeXWriter: using docker to compile tex.
┌ Error: LaTeXWriter: failed to compile tex with docker. Logs and partial output can be found in C:\Users\cstamas\AppData\Local\Temp\jl_37D8.tmp.
│   exception =
│    failed process: Process(`docker exec -u zeptodoctor latex-container bash -c 'mkdir /home/zeptodoctor/build
│    cd /home/zeptodoctor/build
│    cp -r /mnt/. .
│    latexmk -f -interaction=nonstopmode -view=none -lualatex -shell-escape Issuetest.tex
│    '`, ProcessExited(12)) [12]
└ @ Documenter.Writers.LaTeXWriter C:\Users\cstamas\.julia\packages\Documenter\o7pky\src\Writers\LaTeXWriter.jl:166

julia>

One line from the .tex file:

\includegraphics{infos\old\Lena.png}

Edit: should I comment on the issue from now, or we stay here?

#13

Hmm okay. Lets take the discussion to https://github.com/JuliaDocs/Documenter.jl/pull/999.

#14

Again thank you for the quick fix!

But I still have an error message. After updating to the fixed release I get:

C:\Users\cstamas\Documents\GIT\Documentertest>julia --project --color=yes docs\makepdf.jl
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
[ Info: RenderDocument: rendering document.
[ Info: LaTeXWriter: rendering PDF.
[ Info: LaTeXWriter: using docker to compile tex.
┌ Error: LaTeXWriter: failed to compile tex with docker. Logs and partial output can be found in C:\Users\cstamas\AppData\Local\Temp\jl_46CD.tmp.
│   exception = failed process: Process(`docker cp latex-container:/home/zeptodoctor/build/. .`, ProcessExited(1)) [1]
└ @ Documenter.Writers.LaTeXWriter C:\Users\cstamas\.julia\packages\Documenter\G5Sup\src\Writers\LaTeXWriter.jl:166

The log folder:

C:\Users\cstamas\AppData\Local\Temp\jl_46CD.tmp>dir
 Volume in drive C has no label.
 Volume Serial Number is 3841-5075

 Directory of C:\Users\cstamas\AppData\Local\Temp\jl_46CD.tmp

2019-04-12  12:58    <DIR>          .
2019-04-12  12:58    <DIR>          ..
2019-04-12  12:58                 0 custom.sty
2019-04-12  12:58             1,449 documenter.sty
2019-04-12  12:58    <DIR>          guides
2019-04-12  12:58    <DIR>          infos
2019-04-12  12:58             2,593 Issuetest.aux
2019-04-12  12:58            21,393 Issuetest.fdb_latexmk
2019-04-12  12:58            20,416 Issuetest.fls
2019-04-12  12:58            69,411 Issuetest.log
2019-04-12  12:58             1,317 Issuetest.out
2019-04-12  12:58         2,994,661 Issuetest.pdf
2019-04-12  12:58             4,048 Issuetest.tex
2019-04-12  12:58               907 Issuetest.toc
2019-04-12  12:58                 0 LaTeXWriter.stdout
2019-04-12  12:58           473,831 Lena.png
              12 File(s)      3,590,026 bytes
               4 Dir(s)  164,416,876,544 bytes free

LaTeXWriter.stdout is empty, and neither or the other files contain an error message or something.
I’m not even sure, that there was any error, as the pdf looks good to me (but I don’t know how it should look).
Any idea for this issue?

#15

Not sure, but based on the exception that is thrown it looks like the compilation step worked fine, but the “copying back to host” step failed. Not sure why that would happen though. I can try on a Windows machine later and see if I can reproduce.

2 Likes
#16

I tested on another windows PC and the result was the same (error at the copying back step).
Then I thought that maybe using --verbose for piperun() would tell the issue, so what I did:

git clone https://github.com/cserteGT3/Documentertest
cd Documentertest
julia --project --color=yes docs/makepdf.jl --verbose

And it works, the issuetest.pdf is in the build directory and I didn’t get any error.
The last few lines from the console:

/Lato-Bold.ttf></usr/share/fonts/truetype/lato/Lato-Regular.ttf>
Output written on Issuetest.pdf (26 pages, 2994660 bytes).
Transcript written on Issuetest.log.
Latexmk: Log file says output to 'Issuetest.pdf'
Latexmk: All targets (Issuetest.pdf) are up-to-date
latex-container