2011-01-29 47 views
18

只是好奇,如果有人知道如何定製使用latexpdf目標時的獅身人面像輸出?我已經看到很多html輸出的自定義東西,但似乎找不到任何自定義PDF輸出的例子。sphinx自定義的latexpdf輸出?

具體來說,我有興趣定製標題頁,頁眉,頁腳,並可能在內容前添加前幾頁的內容。

有沒有人看到過這種定製的任何例子,或者幾乎所有人在生成pdf時都使用「stock」獅身人面像輸出?謝謝!

回答

20

是的,我認爲更好或更清晰的乳膠造型文件會很好, 一些例子。

這是一個關於使用軟件包的sphinx郵件列表的問題。

sphinx在一個名爲sphinxmanual.cls或 sphinxhowto.cls的文件中有它自己的latex文檔類,如果我沒記錯的話,它將報告documentclass作爲基礎使用。 則有2樣式文件,這些文件包,這是這些文件的內容 被稱爲當你寫\ usepackage {mylatexstilefile}

關於產品使用的乳膠包裝上 http://groups.google.com/group/sphinx-dev/browse_thread/thread/890dab5e53fff004

這裏是我的conf的.py。

preamb_old = ur''' 
    %\documentclass{memoir} 
    \makeatletter 
    \fancypagestyle{normal}{ 
    \fancyhf{} 
    \fancyfoot[LE,RO]{{\[email protected]\thepage}} 
    \fancyfoot[LO]{{\[email protected]\nouppercase{\rightmark}}} 
    \fancyfoot[RE]{{\[email protected]\nouppercase{\leftmark}}} 
    \fancyhead[LE,RO]{{\[email protected] \@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,你乳膠序言。

檢出sphinx文檔中的latex_elements和latex_additional_files作爲 的一個起點。

+0

對不起,格式化報錯了,它看起來確實在預覽! – cognacc 2011-01-31 20:15:03