Re: libreoffice-document met handgeschreven inhoudsopgave en sectionering

Wybo Dekker <wybodekker-qWit8jRvyhVmR6Xm/[email protected]>
Newsgroups gmane.comp.tex.dutch
Message-ID <[email protected]>
On 07/23/2011 10:12 PM, Koen Wybo wrote:
> Kent er iemand een oplossing / script om deze handmatige sectionering om
> te zetten naar mooie LaTeX? 

Die sectionering is niet zo moeilijk; al je vim gebruikt vervang je
eerst alle 6-cijfer-combinaties door \subparagraph, dan alle
5-cijfer-combinaties door \paragraph, enzovoort tot je tenslotte alle
2-cijfer combinaties door \section vervangen hebt:

:%s/^ *\(\d\+\.\)\{6} *\(.*\)/\\subparagraph{\2}/
:%s/^ *\(\d\+\.\)\{5} *\(.*\)/\\paragraph{\2}/
:%s/^ *\(\d\+\.\)\{4} *\(.*\)/\\subsubsection{\2}/
:%s/^ *\(\d\+\.\)\{3} *\(.*\)/\\subsection{\2}/
:%s/^ *\(\d\+\.\)\{2} *\(.*\)/\\section{\2}/

Desnoods kun je ook de chapters nog zo vervangen, maar dan kom je ook de
1., 2. en zo van itemize lists tegen, dus geef een c-optie mee (confirm)
zodat je telkens een y of een n moet typen om de conversie wel of niet
uit te voeren:

:%s/^ *\(\d\+\.\)\{1} *\(.*\)/\\chapter{\2}/c

Maar er zijn maar 13 chapters, dus je bent waarschijnlijk sneller klaar
als je die even opzoekt en het met de hand doet. Dito voor de \part's
-- 
Wybo
_______________________________________________
TeX-NL mailing list
[email protected]
http://www.ntg.nl/cgi-bin/mailman/listinfo/tex-nl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.