New answers tagged

0 votes

Command and counter for chemical equations

You can replace equation with a different counter for reactions. \documentclass{article} \usepackage{amsmath} \usepackage[version=4]{mhchem} \makeatletter \newcounter{reaction} %\counterwithin*{...
  • 1.0m
0 votes

Command and counter for chemical equations

I'd state your problem counts of two parts. First, the counter, which is solved by adding to the preamble: \newcounter{reactionCount} Next, the command delimiting the reaction. \newcommand{\reaction}[...
2 votes
Accepted

Fancy Header Custom Counter References

You have to do this with the marks mechanism. The easiest is if you make a macro for starting a verse (this also is less typing) and set the mark in that macro. Here is a start. EDIT: Cleanup the ...
3 votes
Accepted

Adding a letter to a counter

You can declare \renewcomand\thethm{N\arabic{thm}} if you are using a thm counter.
4 votes

How to have unique ID for each row in normative tables?

The following defines the special environment directives, that takes an optional argument (key=value with the keys start and max, with start specifying the first directives index and max defining the ...
  • 49.7k
3 votes
Accepted

How to have unique ID for each row in normative tables?

Here's a solution that works by defining a new column type -- called x below -- that takes a prefix label -- say, S -- as its argument and displays the normative number as <prefix label><...
  • 448k
2 votes

How to have unique ID for each row in normative tables?

\documentclass{article} \usepackage{tabularray} \newcounter{tablecounter} \setcounter{tablecounter}{1} \newcommand{\mynum}{S\ref{specifications-directives}-\stepcounter{tablecounter}\thetablecounter} \...
  • 1,567
0 votes
Accepted

Continuous subsection

I applied custom styles due to indentation and custom numbering. Also, I found a hack to remove the last punctuation, which by default follows a theorem number. Below is the outcome \documentclass{...
  • 3,022
4 votes

Start footnote counter at 1

The footmisc package provides the option perpage natively -- no need to load the perpage package. The footmisc package also lets you define your own preferred sequence of symbols to be used as ...
  • 448k
2 votes
Accepted

Start footnote counter at 1

This use case is described in the perpage package manual on the first page: \MakePerPage[2]{footnote} will start footnote numbers with 2 on each page (the optional argument defaults to 1). 2 might be ...
  • 31.5k
0 votes
Accepted

Custom numbering of cbtheorem

The simplest way is to use \tcolorboxenvironment. \documentclass{article} \usepackage{amsmath} \usepackage{amsthm} \usepackage[many]{tcolorbox} % Equations and theorems style \counterwithin*{equation}...
  • 1.0m
1 vote
Accepted

Error when feeding the name of a counter from one macro into another

You need to remove the braces. \documentclass{article} \newcommand{\getmaxoftwocounters}[2]{% \ifnum\value{#1}<\value{#2}% #2% \else #1% \fi } \begin{document} \newcounter{...
  • 1.0m
1 vote

When LaTeX expand or not expand the macro in various auxiliary files and how to include a user-defined counter in the chapter name?

I think your question about the "exact point" at which LaTeX stops expanding the macro when it is written to these various auxiliary files is hard to answer. When writing tokens to external ...
  • 24.4k
2 votes
Accepted

Why the reference is not correct when involving the new counter?

It's really unclear what you're trying to achieve. A solution for getting correct anchors is to link the counter to another one. \documentclass{book} \usepackage{lipsum} \usepackage{marginnote} \...
  • 1.0m
-1 votes

Is there something like \renewcounter or \providecounter?

I use a counter in some tikz pictures, and since I prefer to put them in separate files .tikz, I would also find a \renewcounter useful. I concur this should not be used to try and provide local ...

Top 50 recent answers are included