Tag Info

New answers tagged

2

without evidence to the contrary, \hip appears to be a "fragile" command. adding \protect before a fragile command in a "moving argument" (the argument to a command like \paragraph that can potentially also be used somewhere else, such as in the toc) will avoid the problem. so here, \protect\hip. more information on this situation can be found with the ...


0

I resolved this query by a bit of search on the forum. Using package, \usepackage{titletoc} with command, \newcommand\MiniToC{% \setcounter{tocdepth}{2} \startcontents \printcontents{}{1}{\section*{\contentsname}\vskip-3.5ex\hrulefill\vskip1ex} \vskip-0.5ex\noindent\hrulefill \setcounter{tocdepth}{0} } \setcounter{tocdepth}{0} helps me ...


3

The easiest way seems to be etoc by your fellow user [tag:jfbu] here, just using the \localtableofcontents where appropiate \documentclass{article} \usepackage{etoc} \usepackage{blindtext} \begin{document} \tableofcontents \clearpage \section{One} \localtableofcontents \subsection{First} \blindtext \clearpage \section{Two} \localtableofcontents ...


1

I managed to find the answer. The class i am using is \documentclass{abntex2} which is based on the \documentclass{memoir} class the fix for the chapter space was to combine the metric \beforechapskip with the redefinition of the command \chapterheadstart that somehow got lost inside the abntex2 package. ...


0

The issue was solved by using \protect, as suggested by @barbarabeeton. If she posts an answer I'll be happy to remove this and accept hers :) \paragraph*{\protect\hip{} Following...} On @qzx's answer and @cfr's & @Werner's comments: I didn't add a preamble because mine's way too big, and I thought it wasn't an issue with it. It might be ...


2

A quick trial, but I have to think about the numbering \documentclass{book} \usepackage{etoolbox} \let\latexchapter\chapter \let\latexsection\section \newcommand{\OneLevelDeeper}{% \let\chapter\section \let\section\subsection } \begin{document} \tableofcontents \chapter{First} \section{Section} \subsection{Subsection} \OneLevelDeeper ...


2

Define an auxiliary counter and use it for temporary storage of the section number. Then use \inputreset{file} for inputting a file where you want to reset the equation number. However, you'll have big problems as soon as you try loading hyperref. \newcounter{storedsection} \newcommand{\inputreset}[1]{% \setcounter{storedsection}{\value{section}}% ...


2

This uses a temporary counter to store the section counter value before the first \input is used. In addition, the \input command is changed to \refstepcounter a input counter, which then resets the section counter in turn. Edit Automated storing of the section counter value for first \input. Some drawback: Each time if \input is used the section counter ...


1

this is a way \documentclass[10pt]{report} \usepackage{lipsum} \usepackage{fancyhdr} \fancyhf{} \lhead{\nouppercase{\textsl{\bfseries{\leftmark}}}} \rhead{\nouppercase{\textsl{\bfseries{\rightmark}}}} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{0.1mm} \pagestyle{fancy} \usepackage{xpatch} ...


3

The \part macro from report.cls always has a \thispagestyle{plain} in its setup, so redefining the plain style with a header rule of thickness 0.1mm will show such one. \fancyhf{} does only clear the individual fields of the header and footers, but not the header or footer rules. To clear this, I added \renewcommand{\headrulewidth}{0pt} to the partpagestyle ...


3

You didn't give the documentclass you are using. So I will let loose my guess that it is book. Here the default space above is defined by \vspace*{50\p@}. This can be patched as in this code: \documentclass{book} \usepackage{blindtext,showframe} %% just for demo \usepackage{xpatch} \makeatletter ...


0

Apologies for the long hiatus... deadlines and travel delayed my being able to close out this question & project... I did try the MWE posted by @touhami, and it did work very well. Had I been starting from scratch building the volumes and chapters &c. and/or if this were likely to be a common sort of project that occurred regularly and needed to be ...


1

You probably don't want the rule before the first section, nor when a section starts at the top of a page. The following code accomplishes this. \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{titlesec} \usepackage{lipsum} \titleformat{\section} {\sectionrule\Large\bfseries} {\thesection} {1em} {} % this ...


3

It's easy with titlesec: \documentclass{article}% http://ctan.org/pkg/amsproc \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fourier} \usepackage{titlesec} \titleformat{\section}{\vbox{\rule{\linewidth}{0.8pt}}\bigskip\LARGE\bfseries}{\thesection}{1em}{} \begin{document} \begin{equation} v = \sqrt{2gl(\cos\phi_0 - \cos \phi)} ...


4

What you're discovering is that the Computer Modern font family doesn't feature a bold/smallcaps weight/shape combination. To restore the "normal" weight for the smallcaps string, you need to preface it with an \mdseries directive. \documentclass{article} \newcommand*{\matlab}{\textsc{matlab}} \newcommand*{\altmatlab}{{\mdseries\matlab}} % note the double ...


1

After spending half a day digging through the sources, I think I may have discovered the cause of this problem. All LaTeX \section commands contain the macro \refstepcounter, which is responsible for updating section counters. It is redefined by cleveref to store additional information about the current section in \cref@currentlabel. This information is ...


2

Temporarily change \chapter into \section: \documentclass{book} \usepackage{algorithm} \begin{document} \chapter{A chapter} \begingroup \renewcommand{\listalgorithmname}{Algorithmenverzeichnis} \let\chapter\section \listofalgorithms \endgroup \begin{algorithm} \caption{An algorithm} \end{algorithm} \end{document} The grouping above limits the ...


2

All LaTeX counters automatically define a counter format routine, named \the..., e.g. if the counter is named foo, than there is \thefoo. This defaults to \arabic{foo}, i.e. arabic numbers, unless a driver counter was given too. \renewcommand{\thesubsection}{\arabic{section}\roman{subsection}} will use the arabic format of section and the roman format ...


4

Use expl3 (loaded by xparse): \documentclass[11pt,oneside,a4paper]{article} \usepackage{titlesec} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\sectionfamily}{mm} { \fennell_section_family:nn { #1 } { #2 } } \cs_new_protected:Npn \fennell_section_family:nn #1 #2 { \tl_clear:N \l_fennell_section_font_tl \tl_clear:N ...


6

There must be two \expandafter statements. The first to generate the command sequence and then for the \titleformat to expand in the internal setup (I've not looked into the package, however) \documentclass[11pt,oneside,a4paper]{article} \usepackage{titlesec} \newcommand{\sectionfamily}[2]{% \expandafter\titleformat\expandafter{\csname ...


3

Change the value (here 4 cm) to your needs. \documentclass{scrreprt} \renewcommand*{\chapterformat}{% \mbox{\chapappifchapterprefix{\nobreakspace}\thechapter\autodot \IfUsePrefixLine{}{\hspace{4cm}}}% } \begin{document} \chapter{Canh chua} \end{document} This may seem complicated, and we can just as well make this more simple and still see the very ...


7

You need some \protection. BTW, that complicated \newcommand can be simplified. \documentclass{article} \usepackage{graphicx} \newcommand{\icon}[1]{\includegraphics[height=12pt]{#1}} \begin{document} \section{Some section here} \subsection{Sentinel \protect\icon{example-image-a}} \end{document} If you don't want to \protect at many instances, you have ...


1

This is some code from beamerbasesection.sty, with some annotations There is no distinction between \section and \section* regarding the stepping of the section counter, contrary to the standard classes like article. As such, the section counter is increased even by a \section* command. Is this a bug? No, I think, it's easier to do so for bookkeeping all ...


7

Add the following definition for sections and alike \renewcommand*\othersectionlevelsformat[3]{% \llap{#3\autodot\enskip}% } and change the definition of \chapterformat to \renewcommand*{\chapterformat}{% {\fontsize{20}{30}\scshape\chapappifchapterprefix{}}% \fontsize{120}{30}\selectfont\rlap{\thechapter\autodot}% } MWE: \documentclass[ ...


1

Try this Edited \documentclass[]{aiaa-tc} \makeatletter \renewcommand\thesubsection {\thesection.\@Alph\c@subsection} \renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection} \makeatother \begin{document} \section{Introduction} \subsection{First} \subsection{Second} \section{Conclusion} \subsection{First} \subsection{Second} ...


0

The fix is to delete the \adjuststc command. You also need to fix the typo \section{Anhang} not section{Anhang} as @Christian Hupfer said. In your MWE there is nothing that needs to be adjusted, so I guess \adjuststc is causing a problem, not fixing a problem that doesn't exist. You need to run LaTeX more than once to get the right output. If your LaTeX ...


2

When you say, \newtheorem{theorem}{Theorem}[section] the theorem is numbered within section. Since you want it to be numbered within subsection make it \newtheorem{theorem}{Theorem}[subsection] as already commented by egreg. Further, when you write \newtheorem{corollary}[theorem]{Corollary} The corollary and theorem share the same counter i.e., ...


2

Use ##1 instead of #1. However, the explicit option is very rarely needed. Better is like below: the last argument to \titleformat can end with a macro taking one argument, which will be fed the title. \documentclass{book} \usepackage{xcolor} \usepackage{titlesec} \newcommand{\mycustomchapter}{% \titleformat{\chapter} {\normalfont\Huge\color{blue}} ...


5

The IEEEtran.cls you've downloaded is a modified version of the one you can find on CTAN. And it is clearly buggy... It contains the lines \def\@seccntformat#1{\hb@xt@ 1.4em{\csname the#1dis\endcsname\hss\relax}} \def\@seccntformatinl#1{\hb@xt@ 1.1em{\csname the#1dis\endcsname\hss\relax}} \def\@seccntformatch#1{\csname the#1dis\endcsname\hskip 1em\relax} ...


5

It makes no sense, but journal editors sometimes have weird ideas. How is a reader supposed to understand what “section 2” refers to? Well, ask that journal editor. \documentclass{article} \makeatletter % \@seccntformat is the command that adds the number to section titles % we make it a no-op \renewcommand{\@seccntformat}[1]{} \makeatother ...


5

Referencing by name/title Without section numbers, it does not make much sense to refer sections by number. There are alternatives: Package nameref, which provides \nameref. Package titleref, which provides \titleref. Both can be used to reference the section by name (= title). Example: \documentclass{article} \usepackage[english]{babel} ...


1

My apologies, this is a shameless self-promotion by me! This is a simple style I created for my thesis. It's not the style OP wanted, but may be the OP or someone will like this too. \usepackage{titlesec} \titleformat{name=\chapter}[display] {\chapterfont\bfseries\huge} {\raisedrule[0.175em]{1pt}\Large\filleft\textsc{ \chaptertitlename} \Huge\thechapter} ...


1

This can be done with titlesec. Here is a sample. \documentclass{book} \usepackage{titlesec} \titleformat{\chapter}[display] {\normalfont\Large\bfseries}{\MakeUppercase{\chaptertitlename}\ \thechapter}{10pt}{\titlerule[1pt]\vskip12pt\Large\filcenter\MakeUppercase} \titleformat{name=\chapter,numberless}[display] ...


2

If there is no important reason for using fancyhdr with beamer, I'd suggest to declare headers and footers with footline and headline beamertemplates which is the beamer's way. Following code shows an starting point. %%%%%%%%%%%%%%%%%%%%%% % Class and packages % %%%%%%%%%%%%%%%%%%%%%% \documentclass[12pt]{beamer} \usetheme{default} \usepackage{lipsum} ...


0

EDIT: As @Johannes_B pointed out, def is an inappropriate command for general use. The other answer still works. Another way to do this is to put the command \def\thesection{\alph{section}} in the preamble, where alph can be susbtituted for arabic, roman etc as detailed in the other answer. See: http://wiki.lyx.org/FAQ/Numbering#sec-numbering


2

This does most, but not quite all, of what you want. I hesitate to hack KOMA Script's code for the table of contents. Hence, this does not remove the page number from the ToC entry of parts. As far as I've understood them, it implements all the other desiderata stated in the question. Insofar as is possible, I've used KOMA's facilities to implement your ...


0

This is the code I tried from Tarun's answer: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % LyX 2.1.0 created this file. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[twoside,ngerman,fontsize=10pt]{scrreprt} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage[a4paper]{geometry} \geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm} ...


2

There are two parts to answering the question. First of all, to include only one of the chapters and not the others, the best way is to use the \includeonly command. Put the separate chapters in separate files and include them in the main file with the \include command. \begin{document} \include{chapter01} %chapter01.tex \include{chapter02} ...


3

It's necessary to use \protect or to robustify the command. However, other problems might appear, if hyperref is used, since pdftex will complete about invalid strings in bookmarks then. In this case, use \texorpdfstring as shown in the second version. \documentclass{article} \usepackage{amsmath} \usepackage[english]{babel} \usepackage{hyperref} % Not ...


0

No need of sectsty with scrartcl. Use \addtokomafont{disposition}{\normalfont\scshape} Code: \documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size %\usepackage{sectsty} % Allows customizing section commands %\allsectionsfont{\normalfont\scshape} % Make all sections centered, the default font and small caps ...


2

The spacing before and after a longtable are configured by the registers \LTpre and \LTpost. Both are set to \bigskipamount by default. The following example sets \LTpre, the space before` to zero: \documentclass[12pt,a4paper]{scrartcl} \usepackage{longtable} \begin{document} \section*{Practical experiences} \setlength{\LTpre}{0pt} ...


0

I did the following and it worked for me: \pagestyle{fancy} \renewcommand{\chaptername}{} \fancyhf{} \fancyhead[RE,LO]{\textit{\nouppercase{\leftmark}}} \fancyhead[LE,RO]{\textbf\thepage} \fancypagestyle{newfancy}{ %define new style for TOC. Use this 'newfancy' page style just before the command for generating TOC: \renewcommand{\chaptername}{} \fancyhf{} ...


3

Assuming that you use article class, you can do this: \documentclass{article} \makeatletter \def\@part[#1]#2{% \ifnum \c@secnumdepth >\m@ne \refstepcounter{part}% \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% \else \addcontentsline{toc}{part}{#1}% \fi {\parindent \z@ \raggedright \interlinepenalty \@M ...


1

To format \section* use the numberless setting in the extended syntax for the first argument: \documentclass{article} \usepackage[explicit]{titlesec} \titleformat{name=\section,numberless}[block]{\bf}{label}{1em}{#1}[trailer] \begin{document} \section*{Foo} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ...


2

The full error message of the question shows several clues: Runaway argument? {\contentsline {chapter}{\num ! File ended while scanning use of \@writefile. <inserted text> \par l.70 \begin{document} \@writefile is usually called in the .aux file to move an entry for the table of contents from the .aux file to the .toc file. According to ...


2

Here is my way: Edit: Almost complete We use \evolume and \evolume to reset page numbering etoc package for table of contents titletoc package for list of figures and tables \documentclass[12pt,letterpaper,twoside,final,openright]{book} \usepackage{titletoc} \usepackage{etoc} %--------------------------------------- \usepackage{lipsum,mwe} ...


3

You can rely on the LaTeX definitions contained within \section to distinguish between the optional argument and/or whether you used a starred version. From my point of view, you should tap into \@sect (non-starred) or \@ssect (starred): \documentclass{article} \pagestyle{empty} \usepackage{etoolbox} \usepackage[inline,draft,nomargin]{fixme} ...


5

Surely you have declared your lemma numbering to be within section numbering, that is, something like \newtheorem{lem}{Lemma}[section] In fact, the following MWE \documentclass{article} \newtheorem{lem}{Lemma}[section] \begin{document} \begin{lem} Hello \end{lem} \end{document} produces Instead, you have to define it to not follow any existing ...


4

Here's a slightly cleaner version but it still leaves a good deal to be desired... \documentclass[12pt,a4paper]{article} \usepackage{geometry} \usepackage{xcolor} \usepackage{amsmath} \usepackage[some]{background} \usepackage{titlesec,afterpage} \definecolor{titlepagecolor}{cmyk}{1,.60,0,.40} \backgroundsetup{ scale=1, angle=0, opacity=.9, ...


1

The solution from @cfr is great, but since I was working on this, I'll post an alternate solution; it is based on: Rotate text in Thumbindex using thumbs package ... with the trick that I'm using \vadjust (How to switch between horizontal and vertical modes?) to get rid of that "Entered in horizontal mode" (Note that it is manually tuned in respect to ...



Top 50 recent answers are included