sphinx定制的Latexpdf输出? [英] sphinx customization of latexpdf output?

查看:304
本文介绍了sphinx定制的Latexpdf输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是好奇是否有人知道在使用latexpdf目标时如何自定义sphinx输出?我见过很多用于html输出的自定义内容,但似乎找不到任何自定义pdf输出的示例.

Just curious if anyone knows how to customize the sphinx output when using the latexpdf target? I've seen lots of custom stuff for html output, but cant seem to find any example of custom pdf output.

具体来说,我想对标题页,页眉,页脚进行自定义,并可能在内容之前添加几页首页.

Specifically, I'd be interested in customizing the title page, headers, footers, and possibly adding a few pages of front matter before the contents.

有没有人看到过这种定制的任何示例,或者人们在生成pdf时几乎只使用普通"的狮身人面像输出吗?谢谢!

Has anyone seen any examples of this kind of customization, or do people pretty much just use the "stock" sphinx output when generating pdfs? Thanks!

推荐答案

是的,我认为更好或更清晰的乳胶样式文档会很好,并且 一些例子.

Yes i think better or clearer documentation for latex styling would be nice and some examples.

这是狮身人面像邮件列表上的一个问题,该问题与使用软件包有关.

Here is a question on the sphinx mailing list, which is about about using packages.

sphinx在名为sphinxmanual.cls的文件中具有自己的乳胶文档类,或者 sphinxhowto.cls,如果我没有记错的话,它是用作基础的报告文档类. 然后有2个样式文件,它们是包,这是那些文件的内容 编写\ usepackage {mylatexstilefile}

sphinx has its own latex documentclass in a file called sphinxmanual.cls or sphinxhowto.cls, if i remember correctly its a report documentclass that is used as base. then there is 2 style files, which are the packages, it is those files contents that are called on when you write \usepackage{mylatexstilefile}

有关使用乳胶包装的问题 http://groups.google.com/group/sphinx-dev/browse_thread /thread/890dab5e53fff004

Question about using latex packages http://groups.google.com/group/sphinx-dev/browse_thread/thread/890dab5e53fff004

这是我的conf.py.

Here is my conf.py.

preamb_old = ur'''
  %\documentclass{memoir}
  \makeatletter
  \fancypagestyle{normal}{
    \fancyhf{}
    \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
    \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}}
    \fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}}
    \fancyhead[LE,RO]{{\py@HeaderFamily \@title}} % here's the change
    \renewcommand{\headrulewidth}{0.4pt}
    \renewcommand{\footrulewidth}{0.4pt}
  }
  \makeatother
  %\color {blue}
  %\normalcolor {dark blue}
  \pagecolor [RGB]{255, 247, 226}
  \definecolor{VerbatimColor}{rgb}{0.95,0.85,0.65}
  \definecolor{VerbatimBorderColor}{rgb}{0.5,0.95,0.1}
'''

f = open('graph/static/latexstyling.tex', 'r+')
PREAMBLE = f.read();


latex_elements = {
   'papersize':'a4paper',
   'pointsize':'11pt',
   'classoptions': ',openany',
   'babel': '\\usepackage[english]{babel}',
   'preamble': PREAMBLE

}

我不再使用preamble_old,但这是直接在其中进行更改的示例 conf.py,转到您的乳胶序言中.

i don't use preamble_old anymore, but it is an example of changes directly in conf.py, to your latex preamble.

在sphinx文档中检出latex_elements和latex_additional_files为 一个起点.

Check out latex_elements and latex_additional_files in the sphinx docs as a starting point.

这篇关于sphinx定制的Latexpdf输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆