Tag Info

Hot answers tagged

8

Here is as far as I got. \documentclass{article} \usepackage[a4paper]{geometry} \usepackage{pdfpages} %\usepackage{tikz} \usepackage{everypage} \AddEverypageHook{\ifnum\value{page}>50 \errmessage{Too many pages}\errorstopmode\fi} \renewcommand{\contentsname}{My combined file} \setlength\parindent{0pt} \begin{document} ...


6

Use the (newly created) pagectrl package: \documentclass{article} \usepackage[range=2-3, report-as=error]{pagectrl} \usepackage{mwe} \begin{document} \lipsum[1-40] \end{document} Note that issuing a fatal error will cause TeX to halt, but this error will not be thrown until \end{document}. I will be uploading this to CTAN later tonight. Until it's ...


5

Tell LaTeX to reset the equation number whenever section or subsection is stepped: \documentclass{article} \usepackage{chngcntr} \counterwithin*{equation}{section} \counterwithin*{equation}{subsection} \begin{document} \section{One} \begin{equation} 2+2=3.99 \end{equation} \begin{equation} \pi^2=9.86 \end{equation} \section{Two} \begin{equation} ...


4

Here's a minimal example; the package enumitem is loaded just to have an application of \alph, the important code you have to add is \usepackage{etoolbox} \makeatletter % patch \abj@num@i@iso \patchcmd\abj@num@i@iso{^^^^0627}{^^^^0623}{}{} \makeatother Maybe some other macros where ا appears should be changed in a similar way (let us know). I use ...


4

The command \stepcounter is a fragile command, meaning it can lead to errors when put inside of a moving argument. Arguments to \section are moving arguments, since LaTeX will also puts the section name (the argument) in the table of contents and elsewhere. You need to "protect" \stepcounter to make sure it doesn't cause issues as a fragile command. We can ...


3

Don't use \stepcounter in the argument of \subsection. Even if preceding it with \protect in order to avoid the error, this will have adverse effect when \tableofcontents is used. The following example shows it clearly (I used \section, but it's exactly the same with \subsection, provided it goes in the table of contents). \documentclass{article} ...


3

Use the package option counter-within=section in order to get a reset of the question counter each time a section starts (See chapter 8 of the exsheets documentation) \documentclass{article} \usepackage[counter-within=section]{exsheets} \begin{document} \section{One} \begin{question} This is question number 1 in section 1. \end{question} ...


3

I am not entirely sure I understand everything you are trying to do but maybe this will help: \documentclass{article} \usepackage{enumitem} \begin{document} \begin{enumerate}[label=(\alph*), ref=\alph*] \item Thing 1\label{first} \item Thing 2 \item Thing 3 \item Thing 4 \end{enumerate} As I have said before: \begin{itemize} ...


3

You have to do nothing particular: \newtheorem{theorem}[table]{Theorem} will do. \documentclass{book} \usepackage{amsmath} \usepackage{amsthm} \usepackage{cleveref} \newtheorem{theorem}[table]{Theorem} \begin{document} \chapter{My content} \begin{theorem}\label{A} \end{theorem} \begin{table} \caption{A dummy table}\label{B} \end{table} ...


3

The question's not terribly clear, but I think you want something like: \documentclass[parskip=false]{scrbook} \usepackage{eledmac,savesym,fontspec} \setmainfont{texgyrepagella-regular.otf} \newfontfamily\greekfont{GFS Porson} \usepackage{polyglossia} \setmainlanguage[babelshorthands = true]{german} \setotherlanguage{greek} \usepackage{teubner} ...


2

You can do this: \newcommand*\abcRoman[1]{\csname abc\Roman{#1}\endcsname} ... \abcRoman{myabc} \stepcounter{myabc} Well, I suspect that this may not be what you really need, however, that depends on knowing what you want to use your code for. As egreg suggests, if you can use lowercase roman numerals for your macros, you can get on the safer side: ...


2

Simply use: \newtheorem{test}{Theorem} \renewcommand\thetest{\Roman{test}} Defining a new theorem environment test defines a new counter test. The optional argument, such as you used, says the ‘test’ environment shares the counter of another theorem-like environment.


2

The amsmath alignment environments pass over the material twice. In the measurement pass, the conditional \ifmeasuring@ is set to true, otherwise it's false. I have made some amendments to the code. For instance you have two wrong % after +1; also your settings of the counters were sometimes local sometimes global, which is wrong. There are \@namedef and ...


1

As I wrote in a comment I would use different approach in general. So, even though your own anwer is working, I add this solution for completeness: \documentclass[twoside,twocolumn,letterpaper,11pt]{book} \usepackage[T1]{fontenc} \usepackage{ebgaramond} \usepackage{lipsum} \usepackage{fixltx2e} \usepackage[usenames,dvipsnames,svgnames,table]{xcolor} ...


1

The resetting of the chapter counter after a new part (= year) confuses the hyperlink settings from hyperref in some cases unless the option hypertexnames=false is used. This 'solution' uses an automatic setup of month names in loop, but it's not suited of course in this form for a productive run with content between the month chapters ...


1

This could be achieved with the mutally assignment of associated counters (package assoccnt. Each time Theorem is increased, the table counter should be increased as well and vice versa, the lemma environment uses the Theorem counter, so this will be increased too. The usage of this continous counting should prevent floating tables, as those might ...



Only top voted, non community-wiki answers of a minimum length are eligible