mailr28150 - /trunk/docs/latex/find_replicate_titles.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on December 15, 2015 - 12:01:
Author: bugman
Date: Tue Dec 15 12:01:21 2015
New Revision: 28150

URL: http://svn.gna.org/viewcvs/relax?rev=28150&view=rev
Log:
The replicate title finding script now processes short titles as well.

This shows that the Frame_order.html file will be conflicting and overwritten.


Modified:
    trunk/docs/latex/find_replicate_titles.py

Modified: trunk/docs/latex/find_replicate_titles.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/docs/latex/find_replicate_titles.py?rev=28150&r1=28149&r2=28150&view=diff
==============================================================================
--- trunk/docs/latex/find_replicate_titles.py   (original)
+++ trunk/docs/latex/find_replicate_titles.py   Tue Dec 15 12:01:21 2015
@@ -67,7 +67,7 @@
                 # Loop over the file contents.
                 for line in lines:
                     # Skip everything that is not a chapter or section.
-                    if not (search("\\\\chapter{", line) or 
search("\\\\section{", line) or search("\\\\subsection{", line)):
+                    if not (search("\\\\chapter", line) or 
search("\\\\section", line) or search("\\\\subsection", line)):
                         continue
 
                     # Strip off the newline character.
@@ -77,8 +77,13 @@
                     if search(' \\\\label', line):
                         line = line[:line.index(' \label')]
 
-                    # Extract the title string by finding the first '{' and 
chop off the final '}'.
-                    title = line[line.index('{')+1:-1]
+                    # Extract the short title string, if it exists.
+                    if '[' in line:
+                        title = line[line.index('[')+1:line.index(']')]
+
+                    # Extract the full title string by finding the first '{' 
and chop off the final '}'.
+                    else:
+                        title = line[line.index('{')+1:-1]
 
                     # Is the title new?
                     if not title in self.titles:




Related Messages


Powered by MHonArc, Updated Tue Dec 15 12:20:13 2015