From: Sih Iok-J. <iok...@co...> - 2011-05-31 03:32:06
|
Dear All, python-doctuils Version: 0.7-2 I would like to use rst2latex to generate *.tex file , and show the section name on the right top of result PDF file. So, I use the fancyhdr Latex package to accomplish my goal. But the result PDF file doesn't show the section name on the right top. Only show "TABLE OF CONTENT" string at the right top. the default tex file that rst2latex generated seem like doest't add section info for Latex fancyhdr packages Is there any advise for my question ? the following is my docutils.conf and docutils.tex (Latex stylesheet) docutils.conf ----------------- [latex2e writer] documentclass: article documentoptions: 12pt,a4paper,dvipdfmx output-encoding: utf-8 stylesheet: docutils.tex docutils.tex ------------- \usepackage[top=2.54cm, bottom=2.54cm, left=2.54cm, right=2.54cm]{geometry} \usepackage{fancyhdr} \usepackage{fncychap} \pagestyle{fancy} \renewcommand{\sectionmark}[1]{\markboth{}{\thesection. \ #1}} \fancyhead[LO,L]{\leftmark} \fancyhead[RO,R]{\rightmark} \fancyfoot[CO,C]{\thepage} My PDF generate step ---------------------- rst2latex foo.rst foo.tex latex foo.tex latex foo.tex dvipdfmx foo.dvi Regards, Sih, Io̍k-Jîn |
From: Guenter M. <mi...@us...> - 2011-06-01 07:11:18
|
On 2011-05-31, Sih Iok-Jin wrote: > I would like to use rst2latex to generate *.tex file , and show the > section name on the right top of result PDF file. > So, I use the fancyhdr Latex package to accomplish my goal. > But the result PDF file doesn't show the section name on the right top. By default, headings are only automatically updated when a new numbered section starts. Hence, there can be several reasons: a) You do not use numbered headings b) You do not use "latex numbering" Fix for b): > docutils.conf > ----------------- > [latex2e writer] > documentclass: article > documentoptions: 12pt,a4paper,dvipdfmx > output-encoding: utf-8 > stylesheet: docutils.tex # section numbering by LaTeX instead of Docutils: sectnum-xform: False or command line arg: --no-section-numbering Otherwise, you would need to update the headers via raw latex... (see the fancyhdr documentation). Günter |