Delete **Contents:** in index of pdf generated with python-spihnx - latex

I have a project created with python-sphinx and I use latexpdf to compile the final pdf.
In the final pdf created, in the index it is visible a Contents: string that I would like to delete.
The only way I found by now is to compile only the latex, open the .tex file, look for the string and delete that from there.
Then compile the pdf via latex make all-pdf.
Is there a way to specify that?

My assumption is that you have **Contents** as part of the normal .rst markup and use it as a header before the table of contents (ToC), which is fine in your html.
For LaTeX, however, one ToC is assembled (if there are multiple) and used as the one and only ToC at the beginning of the document. ToCs are not displayed inline. That's why your ToC is displayed before your **Contents** markup.
To just fix this issue you can use Spinx's .. only:: directive:
.. only:: html
**Contents**
Alternatively and to do things the proper way, you can use the :caption: option of the toctree directive:
.. toctree::
:caption: Contents
your-content
here

Related

Customize doxygen output for PDF LATEX

Problem:
Cannot customize the Doxygen output for LATEX to hide the page content. DoxgentLayout.xml gives you the ability to show or hide pages for HTML. looking for something equivalent
Why:
I need to remove/hide the pages type. The reason is because I use the modules type to create a tree hierarchy of the detailed design document which is a md file with the classes associated with the design. I use grouping to group the md file and classes together. The reason I have to hide the pages type in doxygen is because as soon as you put \ingroup at the top the .md file the content after that line will not show up this results in a series of blank pages so I just hide them because the content is within the module. So DoxgenLayout.xml will allow me to hide the pages for HTML but I don't have an equivalent for LATEX.
What I have tried:
I tried modifying the refman.tex file after it was generated. When I run make for the LATEX output it always fails. So I don't know if LATEX realizes that the file changed and fails its build or I am doing something wrong.
I tried using the LATEX_HEADER file but same result. I think this was intended to change the style of your PDF more so then what content is shown
at the top of my md files I do this:
\defgroup g_SystemService SystemService Library
\defgroup g_ICP-SCP ICP-SCP
\ingroup g_SystemService g_ICP-SCP
# ICP-SCP System
This system provides...
The PDF output results in this:
HTML output I can hide this by just modifying the DoxygenLayout.xml file to say:
<navindex>
<tab type="pages" visible="no" title="" intro=""/>
refman.tex generation (what I want to is remove these chapters from generation):
...
%--- Begin generated contents ---
% want to remove these pages
\chapter{Base\+Data\+Model}
\label{md_architecture_Common_datamodels_BaseDataModel}
\Hypertarget{md_architecture_Common_datamodels_BaseDataModel}
\input{md_architecture_Common_datamodels_BaseDataModel}
\chapter{Commands}
\label{md_architecture_SystemService_ICP_Commands}
\Hypertarget{md_architecture_SystemService_ICP_Commands}
\input{md_architecture_SystemService_ICP_Commands}
\chapter{I\+C\+P-\/\+S\+CP}
\label{md_architecture_SystemService_ICP_ICP-SCP}
\Hypertarget{md_architecture_SystemService_ICP_ICP-SCP}
\input{md_architecture_SystemService_ICP_ICP-SCP}
\chapter{I\+C\+P-\/\+S\+C\+P\+Manager}
\label{md_architecture_SystemService_ICP_ICP-SCPManager}
\Hypertarget{md_architecture_SystemService_ICP_ICP-SCPManager}
\input{md_architecture_SystemService_ICP_ICP-SCPManager}
\chapter{I\+C\+P\+Comm}
\label{md_architecture_SystemService_ICP_ICPComm}
\Hypertarget{md_architecture_SystemService_ICP_ICPComm}
\input{md_architecture_SystemService_ICP_ICPComm}
\chapter{Unit\+Tests}
\label{md_architecture_SystemService_ICP_UnitTests}
\Hypertarget{md_architecture_SystemService_ICP_UnitTests}
\input{md_architecture_SystemService_ICP_UnitTests}
% end of removing pages
\chapter{Todo List}
\label{todo}
...
Doxygen Version: 1.8.17

knitr/rmarkdown/Latex: How to cross-reference figures and tables in 2 different pdf files?

I'm trying to write a scientific article and the associated supplementary materials entirely in RStudio with rmarkdown.
It seems clear that book down is the way to go to cross-reference between files (https://stackoverflow.com/a/38884378/576684), but I also would like to be able to reference figures produced in one pdf in the other pdf.
Although my latex has got quite rusty with time, I imagine it could be achieved as follows:
compile the article tex and SuppMat tex a first time using rmarkdown::render()
compile these tex files from the command line in order to keep the corresponding .aux file with their references (missing references won't be resolved at this time)
recompile the 2 tex files from the command line another time where all references should now be resolved
Is it a reasonable way to do it? am I overlooking something simpler?
In any case, it requires:
a different numbering of figures in each pdf file (covered by https://stackoverflow.com/a/51337664/576684)
to prevent rmarkdown from trashing the .aux files (it seems that pandoc doesn't allow this, hence the need to create the aux file using standalone latex)
to tell latex to use the additional .aux file if it is found (probably using header-includes: in the YAML header). how can I achieve that?
Thank you very much for your help!
It turns out that the xr package is one way to go: https://texblog.org/2016/08/23/adding-references-from-an-external-file/
so this works from R:
rmarkdown::render("myarticle_ms.Rmd",
bookdown::pdf_book(base_format=rticles::plos_article),
clean=FALSE)
rmarkdown::render("myarticle_SM.Rmd",
bookdown::pdf_book(base_format=rticles::plos_article),
clean=FALSE)
tinytex::pdflatex("myarticle_ms.tex", clean=FALSE)
tinytex::pdflatex("myarticle_SM.tex", clean=FALSE)
tinytex::pdflatex("myarticle_ms.tex")
tinytex::pdflatex("myarticle_SM.tex")
with the following in the YAML header of myarticle_ms.Rmd (and the corresponding one the SuppMat file header):
header-includes:
\usepackage{xr} \externaldocument{myarticle_SM}
Hope it makes life easier for a few others :)

adding latex packages to doxygen can not work

I want to add some graphics to my doxygen generated output. For that I need to add some more packages:
\usepackage{tikz}
\usepackage{tikz-timing}
\usetikzlibrary{mindmap}
\usetikzlibrary{arrows,shadows}
The first two lines can be added to the Doxyfile with
EXTRA_PACKAGES = {tikz} \
{tikz-qtree}
But the 2 other ones are not.
Is there a chance to add a .tex file into the generated output files before pdflatex starts?
Adding
LATEX_EXTRA_STYLESHEET = packages.tex
will not work. It used my file but the output is broken. Seems that the packages are loaded at the wrong place or time.
The third thing i tried was writing a header file with
doxygen -w latex ....
This works and changing the header.tex file is ok, but this ends up in always in generating the header, patching the header, run doxygen again with own header. This is very stupid!
Any idea?
The EXTRA_PACKAGES option is equivalent to the \usepackage tag in Latex. This of course doesn't work for the \usetikzlibrary tags.
You can add your modified Latex header using the tag LATEX_HEADER in the Doxyfile, e.g.:
LATEX_HEADER = ./templates/latex/YourCustomHeader.tex
Then Doxygen pulls this Latex header file when generating the documentation. In this file you can add the used packages and libraries.
By the way: The custom stylesheet isn't used before you run the make.bat script, so it is sufficient if you copy the modified 'doxygen.sty' file to the output folder after Doxygen generated the Latex files, but before you run the 'make.bat' script to generate the PDF file. I do this by a script which first calls doxygen then copies the necessary files to the output folder and finally calls the 'make.bat' script...

How to cancel the \hypersetup in 0rg-mode of Emacs

Org-mode is a power editor. I use it to write scientific notes and produce them into tex/PDF files.
When I produce .org file into .tex or .pdf file, some codes are generated automatically by org-mode, such as:
\hypersetup{
pdfkeywords={},
pdfsubject={},
pdfcreator={Emacs Org-mode version 7.8.11}}
Those codes make some information occupied the first page of PDF file, that is useless for me.
How to prevent those codes from appearing on the tex-file produced and its PDF?
I use this in my init file:
(setq org-latex-with-hyperref nil)
Then you have to put your own hyper setup in where you want it.

How to add a (large) code appendix in LaTeX / LyX?

I'd like to add a code appendix to my LyX document. There are a few options I already considered, but they all have their problems.
I know a bit about listings, but one problem with those is that, if I copy & paste my code into them, I lose all enters/newlines. Since the code is too large to correct by hand, I was wondering if there is an alternative.
In LyX there is the possibility of inserting child documents, but that seems to be only for .tex files. Would have been ideal if I could just insert my .java file as a child document.
I could print the code to PDF, but it will include margins that mess up the final document, since the PDF is placed on the left margin of the final document and then there is the margin of the PDF. Also, this PDF always contains the entire code and white areas where not the entire page has been filled.
Does anyone have good alternative?
The listings package found here
http://www.ctan.org/tex-archive/macros/latex/contrib/listings/
allows the include of external source code files (look into the reference for \lstinputlisting).
EDIT: here you find some samples how to use it:
http://en.wikibooks.org/wiki/LaTeX/Packages/Listings
If you need to copy-paste code to LyX listing box then use Edit -> Paste Special -> Seletion or Ctrl+Alt+V.
For what it's worth, at least the 2.0 versions of LyX have the ability to include listings as child documents. Insert, File, Child Document, and choose from the dropdown box "Program Listing". This uses the listings package and lets you keep your source in its own file.
If listings doesn't support your language, you can always use something like highlight or source-highlight to generate a latex snippet of syntax-highlighted code that you can add as a child document of type "Input"
Yes, if you copy&paste code into the LyX listings box, you lose all newlines, but you can preprocess your code (insert an extra newline below each line):
$ cat foo.java | sed -e 's/$/\n/' > bar.java
Then you can copy&paste the new file bar.java and everything will be ok.

Resources