I am using Sphinx to create documentation for my Python project in Windows. I need to generate PDF documentation. I found many explanation how to do this in Linux, but no good explanation how to do this in Windows. As far as i understand I need to create Latex format with Sphinx, and than use Texworks to convert Latex to PDF. Can someone provide step by step explanation how can I do this, assuming I created documentation in Latex format and installed Texworks?
Install MiKTeX (< 200mb)
wget -nv -N http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable-2.9.4757.exe
7z.exe x -y miktex-portable-2.9.4757.exe -o"miktex"
Add the bin directory to your path
SET Path=%Path%;%CD%\miktex\miktex\bin
Run Sphinx's "make.bat" to generate the .tex file.
SET SPHINXOPTS=-W -E
make.bat latex
Invoke MiKTeX's pdflatex:
cd build/latex
pdflatex.exe YOUR_PROJECT_NAME.tex
The resultant PDF will be in your build/latex directory
Install the full tex live distribution, it will install latex, PDF backends and texworks. Yes it is much, yes, it will dl and install for a fat hour depending on your pipe. But it will be sub gig total, and harddisks are large nowadays.
From what I see, Texworks is just a simple LaTeX editor with some build functionality and latex syntax highlighting. It is not really needed for just compiling (you could use notepad)
Then it should be a matter of simply putting the tex live binary directory i the path and doing
pdflatex <yourlatexdocument.tex>
on the cmdline, at least that is what I do with the latex output of our own documentation generating tool
As you have figured out: use Sphinx to generate LaTeX source, and then run it through a LaTex compiler to produce your PDF.
Instead of troubling yourself with installing LaTeX (which can be daunting) and getting an editor set up, I suggest that you use one of the on-line LaTeX services. You then only have to create a project in ShareLaTeX or Overleaf, for example (which are in the process of merging), upload the contents of the Sphinx build\latex directory, compile on-line, and download the finished PDF.
This works reasonably well, but since the output targets are very different (HTML vs a formal document), you may have to fiddle with the reST to get things the way you like it.
Related
When I run Sphinx on my machine it installs for example
developers/integration.rst into developers/integration.html
but on readthedocs it installs it in
developers/integration/index.html
This makes the use of relative links in any raw commands fail.
Is there a way to force my machine install to use the same directory structure as readthedocs? Or other solutions?
That's basically the difference between the Standalone HTML Builder and the Directory HTML Builder. You can change the builder with the sphinx-builder option of the read-the-doc configuration file, or change your build option on the command line by specifying it with -b.
I want to build a Markdown to PDF converter running on Heroku using Pandoc and LaTeX that I can send markdown to and it will return a PDF. On my local machine this worked fine without any problem. I am using Pandoc 2.7.3 and pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019).
Now I wanted to host this on heroku, but I just get errors for missing files when I run the pandoc command because the versions are old or don't match.
What is the easiest way to get this to run?
Heroku obviously has some limitations on the slug size (500mb), so a full tex install is not possible. It would need to be a smaller subset.
There are Buildpacks for pandoc and TeX Live, but espacially the TeX Live buildpacks seem to be outdated and is not compatible with the pandoc one if you try to run the latest version. The Apt package seems also to maintain only an older version. Is a docker image maybe the answer? https://devcenter.heroku.com/articles/container-registry-and-runtime
I am not necessarily searching for installation instructions, but rather in which way you would handle that. I am a web developer, not a dev ops, so i am really lost in this LaTeX install mess.
I am using pandoc to generate some slides for reveal.js. Now, when I edit the markdown file, I have to manually regenerate the HTML and then manually reload it in my browser to see the changes.
Is there a way to automate this task?
Update
I ended up creating a Python package for this: Markdownreveal.
You can install it with:
pip install markdownreveal
And start working with your presentations with:
markdownreveal my_presentation.md
You can customize the style, generate ZIPs or PDFs, upload to GitHub pages... For more information, have a look at the full project's documentation.
Old answer
Well, there is no way to configure pandoc to do that. But you can always create a script.
I made a script called pandoc-watch that watches the markdown file and, on modification (when you save your changes), it will automatically regenerate the HTML for reveal.js and it will be reloaded in your browser, using reveal.js's local server.
Note:
Made for GNU/Linux OSs.
Requires: bash, curl, npm, grunt, inotifywait.
Usage: pandoc-watch markdown_slides.md.
It is only meant for reveal.js output!
The first time is run it will download reveal.js and all the required node.js packages, so it may take some time. All the downloaded files are kept in ~/.pandoc-watch, in case you want to clean everything.
I have written the following code. When I run this file graph.dot file is generated
rather than graph.jpg.
I can't understand why so. Does any body have any idea?
My code is as:
require 'rgl/adjacency'
require 'rgl/dot'
dg=RGL::DirectedAdjacencyGraph[1,2,2,3,2,4,4,5,6,4,1,6]
dg.write_to_graphic_file('jpg')
RGL uses dot files as an intermediary format to produce image formats, it doesn't produce them itself. That is why you are seeing a graph.dot file.
If you have a dot binary available (part of the GraphViz package), rgl will invoke it to produce a graph.jpg file.
You can download the GraphViz package at the project homepage, or use homebrew (if you're on a mac) to install it with brew install graphviz.
I was wondering if the following is possible.
I have a BASH script that I want to make available for some people but I wanted them to only have to "install" the program and not messing around with terminal, so I thought a .deb would be cool.
So what would the "install" do?
Simple. I want to move the script and an icon to a folder (any folder, but I was wondering some hidden folder in Home) and then run a script that creates a launcher in the Applications menu for the first script. It seems there isn't much to it, but for what I've searched, there doesn't seem to be a lot of info...
How can I accomplish this?
By the way, I'm using Ubuntu 11.04.
Basically (install and) run dh-make to set up the debian/ directory, edit the generated files (mainly remove the many you do not need, and fill in a package description and any dependencies in debian/control), then debuild-us -uc -b.
You may also have to set up a simple Makefile for debian/rules to call; it probably only needs an install target to copy the binary to $(DESTDIR)/usr/bin.
Binaries install into /usr/bin and you should not try to override that. The way to have a menu is to add a .desktop file.
Once you have a good .deb you will need to set up a repo for distributing it. The simplest solution is probably to set up a launchpad.net account and create a personal PPA there.
It's not hard to find more information on these topics, but of course, you need to know what to look for. The canonical documentation is the Debian New Maintainer's Guide.
Found this video on youtube that explains IN FULL the process of creating a *.deb for a script or program and even mentions how to do it for a C program.
Full guide in how to build simple *.deb package
Has one bug, btw, that the author, during the making of the *.deb, didn't notice. The path in the *.desktop file for the EXEC parameter is wrong in the example.