Re: [MiKTeX] Ask for help : Package titlesec affects the settings of tocloft
MiKTeX source code moved to GitHub
Brought to you by:
csc
From: Vladimir Y. <yum...@ma...> - 2014-04-14 20:12:36
|
Sorry, \makeatletter and \makeatother brackets Mon, 14 Apr 2014 17:52:53 +0900 от Jilong Yin <yin...@gm...>: >Hello, everyone. > > I am facing a problem when formatting my report edited by Latex. > >I wanto to do the following two formatting > >1. to supress the line break after chapter title, for example > Chapter 1 Exercise A > to replace the default one > Chapter 1 > Exercise A > >2. to append "Appendix x........#"' to TOC, replacing default "x........#" > > >I use package titlesec to do format 1 and use package tocloft to do format >2. >But I found the two package affect each other. >I can not get the two format at the same time. > >Anyone can help me some, thanks in advance. > >The following is the my minimal example. > > > >\documentclass[a4paper,openany]{book} > >\usepackage{tocloft} > >\usepackage{titlesec} > >\usepackage{nonumonpart} %dont display page number on part cover page > >%to append "Appendix x........#"' to TOC, replacing default "x........#" >\renewcommand{\partname}{Appendix} >\makeatletter >\@addtoreset{chapter}{part} >\makeatother >\newlength\mylen >\renewcommand\thepart{\Roman{part}} >\renewcommand\cftpartpresnum{\Large Appendix~} >\settowidth\mylen{\bfseries\cftpartpresnum\cftpartaftersnum} >\addtolength\cftpartnumwidth{\mylen} > > >%to supress the line break after chapter title >\titleformat{\chapter}% reformat chapter headings > [hang]% like section, with number on same line > {\Huge\bfseries}% formatting applied to whole > {\thechapter}% Chapter number > {0.5em}% space between # and title > {}% formatting applied just to title > % > >\begin{document} > > \pagenumbering{roman} > \tableofcontents > >\pagenumbering{arabic} >\part{My homework1} > \chapter{Exercise A} > I am exercise A. > \chapter{Exercise B} > I am exercise B. > >\part{My homework2} > \chapter{Exercise A} > I am exercise A. > \chapter{Exercise B} > I am exercise B. > >\end{document} >------------------------------------------------------------------------------ >Learn Graph Databases - Download FREE O'Reilly Book >"Graph Databases" is the definitive new guide to graph databases and their >applications. Written by three acclaimed leaders in the field, >this first edition is now available. Download your free book today! >http://p.sf.net/sfu/NeoTech >_______________________________________________ >MiKTeX-Users mailing list >MiK...@li... >https://lists.sourceforge.net/lists/listinfo/miktex-users |