Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new platform to compile only to latex #1339

Merged
merged 6 commits into from
Jun 21, 2020

Conversation

cserteGT3
Copy link
Contributor

As described in #1338 I would like to compile the documentation to latex only. Here's my implmentation for it.
Please let me know what you think about it.

@mortenpi mortenpi added this to the 0.25.0 milestone Jun 13, 2020
@mortenpi mortenpi linked an issue Jun 13, 2020 that may be closed by this pull request
@mortenpi mortenpi added Format: LaTeX Related to the LaTeX / PDF output Type: Enhancement labels Jun 13, 2020
Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good idea, and it can also help when debugging LaTeX builds (i.e. that you can inspect the TeX; currently we always throw away the intermediate TeX code and you have to jump through some hoops to retrieve it).

However, just the .tex file is not enough to build the PDF afterwards. The temporary build/ directory will also contain all the images, the .sty file etc. We should probably copy the whole thing over to build/?

src/Writers/LaTeXWriter.jl Show resolved Hide resolved
docs/src/man/other-formats.md Outdated Show resolved Hide resolved
docs/src/man/other-formats.md Outdated Show resolved Hide resolved
src/Writers/LaTeXWriter.jl Outdated Show resolved Hide resolved
@cserteGT3
Copy link
Contributor Author

However, just the .tex file is not enough to build the PDF afterwards. The temporary build/ directory will also contain all the images, the .sty file etc. We should probably copy the whole thing over to build/?

Agree, I forgot about the other files. Made the changes, to copy the whole source directory to the build directory. Also corrected the documentation, as you requested.

Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! @fredrikekre, any thoughts on this one?

@inkydragon
Copy link
Contributor

We should probably copy the whole thing over to build/?

If I build HTML first and then build LaTeX without PDF, Will I get a mix of HTML and LaTeX file in build/ dir?

Maybe copy the whole dir to build/latex/ ?

@cserteGT3
Copy link
Contributor Author

We should probably copy the whole thing over to build/?

If I build HTML first and then build LaTeX without PDF, Will I get a mix of HTML and LaTeX file in build/ dir?

makedocs cleans the build directory by default.

Maybe copy the whole dir to build/latex/ ?

and makedocs has a build="build" keyword to specify the build directory. I think that is sufficient.

@mortenpi
Copy link
Member

makedocs cleans the build directory by default.

That is true. However, I believe currently platform="none" will not actually honor clean = false currently? The force=true in the cp will erase the original build/?

@cserteGT3
Copy link
Contributor Author

makedocs cleans the build directory by default.

That is true. However, I believe currently platform="none" will not actually honor clean = false currently? The force=true in the cp will erase the original build/?

Yes, I think so. I'll test it later today, and report back.

@cserteGT3
Copy link
Contributor Author

I've tested the followings (on Windows and WSL Linux):

  1. makedocs(..., format = Documenter.HTML(), clean=true)
  2. makedocs(..., LaTeX(platform = "none"), clean=false)

The first step is the usual Documenter build, and after the second command nothing is deleted, and the result is a mix of HTML and LaTeX files. Though, I'm not sure why this happens.

cp(src::AbstractString, dst::AbstractString; force::Bool=false, follow_symlinks::Bool=false)

Copy the file, link, or directory from src to dst. force=true will first remove an existing dst.

If follow_symlinks=false, and src is a symbolic link, dst will be created as a symbolic link. If follow_symlinks=true and src is a symbolic link, dst will be a copy of the file or directory src refers to. Return dst.

@mortenpi
Copy link
Member

and after the second command nothing is deleted, and the result is a mix of HTML and LaTeX files.

I can confirm that, although interestingly when I run cp("foo", "bar"; force=true) on some directories, the contents of bar/ is lost. But Documenter seems to work the way we want it so 🤷‍♂️

@mortenpi mortenpi merged commit b64173c into JuliaDocs:master Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Format: LaTeX Related to the LaTeX / PDF output Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FR: compile documentation to LaTeX only
3 participants