tag:blogger.com,1999:blog-1765650071152206388.post6413331507828677780..comments2023-05-02T13:01:58.003+01:00Comments on jevopi's little blog: Increase/Decrease Section Level with TeXShop MacrosJens v.P.http://www.blogger.com/profile/14089732885850015120noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-1765650071152206388.post-32385590378889220152011-02-20T18:52:29.615+01:002011-02-20T18:52:29.615+01:00@Jonas:
There's a tiny bug in your statement: ...@Jonas:<br />There's a tiny bug in your statement: there are three backslashes in the sed line where it must be only two:<br /><br />if this_line contains "ch:" then<br />set new_line to do shell script ¬<br />"echo " & the quoted form of this_line & ¬<br />" | sed 's/\\ch:/\\sec:/'"<br />end if<br /><br />That should work. If you change the label, you have to pay attention of updating references to it as well, of course.Jens v.P.https://www.blogger.com/profile/14089732885850015120noreply@blogger.comtag:blogger.com,1999:blog-1765650071152206388.post-76776330757640485442011-02-17T00:02:27.508+01:002011-02-17T00:02:27.508+01:00Dear Jens,
thank you for these scripts - very usef...Dear Jens,<br />thank you for these scripts - very useful!<br /><br />Just one suggestion: Whenever you downgrade or upgrade a heading (say, from Chapter to Section), the header command gets successfully converted from \chapter to \section. However, the labelprefix remains the same, i.e. "ch:". <br /><br />I have therefore tried to modify your script so that the labelprefixes are being downgraded/upgraded just like the commands are downgraded/upgraded. In other words, the change from \chapter to \section it matched by a change of the labelprefix from "ch:" to "sec:".<br /><br />However, my (naïve?) attempts with the following lines of code failed:<br /> if this_line contains "ch:" then<br /> set new_line to do shell script ¬<br /> "echo " & the quoted form of this_line & ¬<br /> " | sed 's/\\\ch:/\\\sec:/'"<br /> end if<br /><br />Would you have any ideas as to how to fix the labelprefixes?<br />Thanks!<br />JonasJonashttps://www.blogger.com/profile/08866417760337458336noreply@blogger.com