In a master thesis, I need to refer to a model described elsewhere, from a section title, like  \section{Analysis of model X}    One way of referring to a model is to create a new counter, and then write  \section{Analysis of \cref{grandmodelofeverything}}   But now hyperref will complain because of invalid token, and it does not look good in the TOC either, especially since the titles of the sections the describe the models are more descriptive than  \section{Model 1}   They are currently like  \section{Adding the effect from Y processes}   Do I need to invent semi-descriptive long names like "The model by Authors with this modification" or can I live with these quirks?
122992
I need to refer to a model described elsewhere, from a section title, like  \section{Analysis of model X}    One way of referring to a model is to create a new counter, and then write  \section{Analysis of \cref{grandmodelofeverything}}   But now hyperref will complain because of invalid token, and it does not look good in the TOC either, especially since the titles of the sections the describe the models are more descriptive than  \section{Model 1}   They are currently like  \section{Adding the effect from Y processes}   Do I need to invent semi-descriptive long names like "The model by Authors with this modification" or can I live with these quirks?
48726
If I use  \usepackage[colorlinks]{hyperref}   I get colored links for \cite (not good for printing or even viewing) but table of content looks fine.  If I use  \usepackage[colorlinks=false]{hyperref}   I get \cite  links in black with a colored frame (this looks very good) but the table of content looks strange with extra long boxes.  What are my other options? Can you have two styles in different parts of a document?   How do you make the page numbers in TOC to be the links instead of the section headers?
10794
The editor asked me to use the following format.      Reference   1. Author, blah blah   Instead of      Reference   [1] Author, blah blah ...   Even though in the main text, [1] style has been used.   For example,        Smith [1] has proposed ...      Reference   1. Smith,      This is what I want.   Could you please advise how I can do the above?  Thanks in advance.
66786
I can't seem to get the reference within my {refsection}.  \documentclass[a4paper]{article}  \newcommand{\myparagraph}[1]{\paragraph{#1}\mbox{}\\}  \usepackage[     backend=bibtex,     isbn=false,     url=false,     doi=false,     eprint=false, ]{biblatex}  %Point to the bibliography db \addbibresource{mybib.bib}  \begin{document}  \include{myparagraph}  \end{document}   My paragraph file  \myparagraph{\fullcite{dante1320}} \begin{refsection}  \cite{manzoni1827}  \printbibliography[heading=subbibliography] \end{refsection}   I get the first citation (dante1320) right, but the second prints as [manzoni1827]. I don't get any error when I run Bibtex concerning the missing reference. But I got it when I run Latex: LaTeX Warning: Citation 'manzoni1827' on page 2 undefined on input line 5.
44988
I am having some issues with the hyperref package. I would like to create a Introduction chapter without a number so I use \chapter*{Introduction} and \addcontentsline{toc}{chapter}{Introduction} because I want it in the table of contents (see example).  But then the link in my PDF viewer gets it wrong and also the automatically created header is no longer correct (see picture). The table of contents shows the right page number (p.1) but the link is also wrong.   What is my mistake here?  \documentclass{scrbook}  \usepackage{hyperref} \usepackage{blindtext} \usepackage{glossaries}   \makeglossaries  \newacronym{eg}{e.g.}{% for example }   \begin{document}   \frontmatter  % abstract before the table of contents \chapter*{Abstract} \addcontentsline{toc}{chapter}{Abstract} \blindtext  \tableofcontents  % chapter with acronyms \cleardoublepage \phantomsection  \printglossary[type=\acronymtype] \addcontentsline{toc}{chapter}{Glossary}  \cleardoublepage \mainmatter   \phantomsection % \chapter{Introduction} % with this everything is correct but I don't want the number \chapter*{Introduction} \addcontentsline{toc}{chapter}{Introduction}  \blindtext  \pagebreak  \blindtext  % first chapter \chapter{Chapter1}  \gls{eg} \blindtext  \pagebreak  \blindtext   \end{document}
74800
I'm using the backref package within the hyperref package:  \usepackage[backref]{hyperref}   I get the following result:  Philip Hall. On representatives of subsets. Journal of the LMS, 10, 1935. 3.2, 4.1   where 3.2 and 4.1 are hyperlinks to sections in which this bibliographic entry is referenced. Is it possible to get pages instead of sections?
47494
I'm getting stumped about how to generate the ToC for this book. I'm about to give up and just do it by hand. The author wants to include a lot of structural information that isn't present in the actual text, and none of the numbers "roll over" as they're want to do in ConTeXt.  This is the desired effect:    Narrator 1...      FIRST PART: PART SUBTITLE  1). First Poem // First Poem (Spanish title) . . . . . . . . . . . . . . . . .    1     Author of Poem (b. XXXX d. XXYY)  2). Second Poem // Poema Secunda . . . . . . . . . . . . . . . . . . . . . . .    3     Author of Poem    Narrator 2...  3). Third Poem // Third Poem . . . . . . . . . . . . . . . . . . . . . . . . .    5     Author      SECOND PART: Part 2  4). Fourth Poem // Fourth Poem . . . . . . . . . . . . . . . . . . . . . . . .    7     Author    Narrator 3...   The problems I have essentially boil down to these:   There is this weird "narrator" concept that doesn't seem to contain or be contained by the part/poem structure. A new part doesn't imply a new "narrator" and a new "narrator" doesn't imply a new part. I need to aggrandize each title with the title in translation and the author, and I want to typeset them nicely. I need poems to continue counting up across parts.   I see basically three approaches:   Make each poem a chapter and customize the appearance with \setuphead[chapter][....]. Then use \writebetweenlist[chapter] to add the Narrator and author information. Make a new list with \definelist[poem] and \definecombinedlist[content][part,poem]; continue using \writebetweenlist[poem] to insert the author and Narrator. This feels like the most conceptually valid option, but I think I'll still need a lot of customization. Forget all about ConTeXt and switch to plain TeX, use eplain's writetocentry system. Make it look right and forget maintainability.
61857
Basically, here's my MWE, and I need to include "Chapter" before every section title in the ToC (without changing anything else).      \documentclass[12pt]{article} \usepackage[utf8]{inputenc}  \usepackage[english]{babel} \usepackage[titles]{tocloft} \usepackage{titlesec} \usepackage{titletoc}  \addto\captionsenglish{ \renewcommand*\contentsname{\centerline{TABLE OF CONTENTS}}}  %\renewcommand{\thesection}{CHAPTER} %\renewcommand{\cftsecpresnum}{Chapter \thesection} \titleformat{\section}[display]% {\null\vskip1em\sffamily\bfseries\filcenter}{Chapter \thesection}{0em}{}[] \titlespacing*{\section}{0em}{1em}{1em}  \titlecontents{section} [1.5em] % ie, 1.5em (chapter) + 2.3em {} {\contentslabel{1em}} {\hspace*{-1.5em}} {\titlerule*[0.5pc]{.}\contentspage}  \begin{document} \newpage \tableofcontents \newpage  \section{Section One} \section{Section Two} Content \end{document}   The commented out code is what I've already tried. The first one just changes the number to "CHAPTER" and doesn't move the text in the ToC (so it just overlays on top of the name of the section), and if I include "\thesection" after "CHAPTER" it creates an infinite loop definition error. The second one causes no differences, and the code still compiles.  Thanks!
67256
The following MWE produces a PDF whose TOC has two entries: “Foo” and “Bar” with correct page numbers. So far, so good. However, upon clicking on the link to “Bar”, I am taken to the page for “Foo” instead.  \documentclass{report} \usepackage{hyperref} \newcommand*\backmatter{\setcounter{chapter}{0}}  \begin{document} \tableofcontents \chapter{Foo} \backmatter \chapter{Bar} \end{document}   (Produced with pdflatex, run twice.)  This MWE is whittled down from a (much!) more complex document but the above does seem to reproduce the error reliably.  Re-setting the chapter count seems to confuse hyperref, even though the page references are still accurate. Notice that in my real document, \backmatter does other things, including setting the numbering style to alphabetical so there’s no chance of confusion even though both chapters are ostensibly labelled as “Chapter 1”.  How do I fix this? Is this a bug? Are there workarounds?
21186
I once read about an option for hyperref that automatically takes the info provided via the standard \author and \title, and puts it into the pdfinfo. Now I want to implement it in my template and can't find it anywhere in the hyperref manual nor anywhere else.  Did I dream about this or can someone help me out here?  (A similar, but more general question: )
3341
I'd like to modify the names used to typeset some of my document elements. For example, the caption of figure floats should change from "Figure" to "Fig.", and my \tableofcontents sectioning heading shouldn't read "Contents", but "Table of Contents". How can I do that?  \documentclass{article} % \usepackage[english]{babel} \begin{document} \tableofcontents \section{foo} \begin{figure}[h] \centering \rule{1cm}{1cm}% placeholder for graphic \caption{A figure} \end{figure} \end{document}
122131
I need a section which isn’t really a part, nor a chapter. So I was trying to define a new command, \subpart, based on the \part command, but with its own numbering and which would look like this, in the middle of a new blank page:     SUBPART ONE      Name of the subpart   However, when I try to do so, there always are errors showing up…  My approach, based on the code from I-dont-remember-where on the web:  \makeatletter \def\@subpart[#1]{%     \ifnum \c@secnumdepth &gt;\m@ne       \refstepcounter{subpart}%       \addcontentsline{toc}{subpart}{\thepart\hspace{1em}#1}%     \else       \addcontentsline{toc}{subpart}{#1}%     \fi     {\parindent \z@ %\raggedright                    % Commented \raggedright      \interlinepenalty \@M      \normalfont      \ifnum \c@secnumdepth &gt;\m@ne        \Large\bfseries\hfil\partname~\thepart\hfil   %  added \hfil … \hfil for centering        \par\nobreak      \fi      \huge \bfseries %      \markboth{}{}\par}%     \nobreak     \vskip 3ex     \@afterheading} \makeatother   I really should learn to use LaTeX correctly…   Thank you for your help, Sebastian
90082
I was using titletoc until I realized that it has some incompatibilities with hyperref. The thing is, that titletoc can do the same thing in a easier way, less one.  \titlecontents*{subsection}[5.4em] {\small} {\thecontentslabel~ } {} {} [.~\textbullet\ ] [.]   this part does the subsection as a paragraph (with section number and without page number). I have realized that the problem is the pseudo-code used by tocloft for the entries in the TOC  {\cftXfont {\cftXpresnum SNUM\cftXaftersnum\hfil} \cftXaftersnumb TITLE}% {\cftXleader}{\cftXpagefont PAGE}\cftXafterpnum\par   I mean, the last command \par make impossible to leave two subsection entries in the same textline. Any idea? Another interesting solution is with etoolbox, some examples with that package are awesome, but it's not on my hands.  This is a MWE:  \documentclass{book}  \usepackage{titletoc} \titlecontents*{subsection}[5.4em]{\small} {\thecontentslabel~ }{}{}[.~\textbullet\ ][.]  \begin{document}  \tableofcontents  \chapter{Test Chapter 1} \section{Test Section 1.1} \subsection{First Test Subsection} \subsection{Second Test Subsection} \subsection{Third Test Subsection} \subsection{Fourth Test Subsection} \section{Test Section 1.2} \subsection{First Test Subsection} \subsection{Second Test Subsection}  \chapter{Test Chapter 2} \section{Test Section 2.1} \subsection{First Test Subsection} \subsection{Second Test Subsection} \subsection{Third Test Subsection} \subsection{Fourth Test Subsection} \section{Test Section 2.2} \subsection{First Test Subsection} \subsection{Second Test Subsection}  \end{document}
31
\documentclass{article} \usepackage{algorithm}  \begin{document} \setcounter{section}{54} \section{A section with no label} \begin{algorithm} \label{myalg} \caption{An algorithm with the label `myalg'.} \end{algorithm} Reference to myalg: \ref{myalg}. \end{document}   With this code, the reference givens 55 (the section number); if I move the label after the caption command, I get the correct reference (1).  Why should this be the case? I find it confusing: when thinking about an algorithm as an environment, you expect to be able to label it right after you began it. At the very least I would expect some kind of error or "??" to appear, rather than the previous environment or reference-able entity being used.
56091
I have the following code:  \usepackage{hyperref} \newtheorem{thm}{Theorem}  \begin{thm} \label{mythm}    \begin{enumerate}       \item     \end{enumerate} \end{thm}  \ref{mythm}   The ref prints the right number. However, when I click on it, it will lead me to a wrong page (basically, to the beginning of the document).  pdflatex also has some warning.  If I add $ $ between \begin{thm} and \begin{enumerate}, the problem disappears, but now, the enumeration starts a new line.  Is there any way to fix this?
36105
I have a problem with cleveref. Apparently, it does not work with mdframed.  \documentclass[12pt,a4paper]{book} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage[left=2.50cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry} \usepackage{xcolor} % Definition of colors \definecolor{toc_heading}{RGB}{0 51 89} \definecolor{toc}{RGB}{0 119 138} \definecolor{section}{RGB}{0 113 187} \definecolor{subsection}{RGB}{0 115 207} \definecolor{headline}{RGB}{77 112 139} \definecolor{citecolor}{RGB}{0 124 48}  \usepackage{amsthm}  \usepackage[framemethod=TikZ]{mdframed} \mdfsetup{skipbelow=3ex} \newtheorem{dummy}{dummy}[chapter]   \newmdtheoremenv [%  hidealllines=true, leftline=true,  linewidth = 2pt,  linecolor=section,  leftmargin = 0,rightmargin = 0,%  skipabove=\dimexpr\parskip+10pt\relax,  innertopmargin = 0,splittopskip =3ex,  innerrightmargin=2ex,splitbottomskip=3ex,innerbottommargin=2ex,  ntheorem = false ,backgroundcolor=section!20% ]{theorem}[dummy]{Theorem} \usepackage{hyperref} \usepackage{cleveref} \crefname{theorem}{theorem}{theorems} \begin{document} \chapter{Chapter 1} \begin{theorem}\label{thm:1}    bla \end{theorem}  This is \cref{thm:1}.  \end{document}   This code produces: This is ?? 1.1.   Has anyone encountered a similar problem?
73111
In my macro file, I have certain theorem environments defined, for example.  \newtheorem{theorem}{Theorem} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary}  \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition}   Again, these lines are in my macros.sty file of shortcuts.  In the past, I have changed the numbering of theorem, etc... by using \numberwithin. I have recently learned that I can instead edit the \newtheorem line. For example, if I want results numbered according to section I can use  \newtheorem{theorem}{Theorem}[section]   My question now is about future situations when I have two documents, which both use the same macros.sty file, but in one document I want to number results by section and in the other document I want to number results by something else, say chapter.  How can I accomplish this without creating two different .sty files?   EDIT: I think I should add that I am looking for a way to do this without going back to \numberwithin. The reason for this is because \numberwithin doesn't seem to work well with the thmtools package.