Andrea,

I could not get the size changed easily without post processing.  The 
easiest way to get it to be the correct size coming out of sphinx is to 
give it as in input that is already the correct size.  Also be aware that 
if rendering on windows, if the input image has alpha channel data (eg a 
.png file) all the text on the page may show up in bold.  You can avoid 
this issue if you use a .jpg or a image editor that will remove that data.

As for the position, I approached it by creating my own sty file and then 
including that.  So in you preamble you would need to add
\usepackage{my_sty_file}

Then create an sty file, eg my_sty_file.sty.  This needs to get copied to 
your build/latex dir.  It will redefine what commands you want to modify.  
For example, if you wanted remove the logo from the front page, you would 
redefine \maketitle.  The default is defined as:
\renewcommand{\maketitle}{%
  \begin{titlepage}%
    \let\footnotesize\small
    \let\footnoterule\relax
    \rule{\textwidth}{1pt}%
    \ifsphinxpdfoutput
      \begingroup
      % These \defs are required to deal with multi-line authors; it
      % changes \\ to ', ' (comma-space), making it pass muster for
      % generating document info in the PDF file.
      \def\\{, }
      \def\and{and }
      \pdfinfo{
        /Author (\@author)
        /Title (\@title)
      }
      \endgroup
    \fi
    \begin{flushright}%
      \sphinxlogo%
      {\rm\Huge\py@HeaderFamily \@title \par}%
      {\em\LARGE\py@HeaderFamily \py@release\releaseinfo \par}
      \vfill
      {\LARGE\py@HeaderFamily
        \begin{tabular}[t]{c}
          \@author
        \end{tabular}
        \par}
      \vfill\vfill
      {\large
       \@date \par
       \vfill
       \py@authoraddress \par
      }%
    \end{flushright}%\par
    \@thanks
  \end{titlepage}%
  \cleardoublepage%
  \setcounter{footnote}{0}%
  \let\thanks\relax\let\maketitle\relax
  %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
}

You can see in the above the \sphinxlogo% command.  If you don't want to 
logo on the front page/center, then you can comment it out or move it to a 
better location.

If you wanted it in the headers/footers, you could modify the header/footer 
definitions, for example:
\fancypagestyle{plain}{
    \fancyhead[L]{\sphinxlogo}
}
\fancypagestyle{normal}{
    \fancyhead[L]{\sphinxlogo}
}
\fancyhead{}
\fancyfoot{}
If the above were placed in your sty file, then it would put the logo in 
the upper left corner of the header (one page output, you need to modify it 
if you are using a 2 page layout).

I am convinced that getting sphinx to work correctly is about 80% learning 
LaTeX, then figuring out how to change the LaTeX command to make things 
work the way I want.  This is difficult because you need to figure out all 
of the styles the Sphinx applies by default and which rst commands map to 
which LaTeX commands.  I think the documentation about how to modify the 
PDF output is lacking, it has taken me a week or 2 of a lot of searching 
online to figure out to make documents look the way I want them.  I've 
found on more then one occasion people just post process the .tex file then 
convert it to a PDF because it is easier than trying to figure out how to 
make Sphinx do what they want.  Here is one example: 
https://github.com/jmcnamara/XlsxWriter/blob/master/dev/release/modify_latex.pl 
.  I've seen other places where they do the same thing to get tables 
centered since they default to left align.

Hope the above helps.

--Peter

On Thursday, May 12, 2016 at 5:17:50 PM UTC-7, Andrea Cassioli wrote:
>
> Hi @gsavix,
>
> actually I do not think it helps. The pdf logo is specified in the conf.py 
> passing the file name. But I cannot see how to change the image size and 
> position...
>
> On Monday, 9 May 2016 16:53:33 UTC+2, Andrea Cassioli wrote:
>>
>> Hi,
>> I am trying (with no success) to find out how to change the size and the 
>> alignment of the logo we pass via the `html_logo` option. Any suggestions?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to