Tag Info

Hot answers tagged

3

Each counter has a fellow macro called \the..., say counter foo will have \thefoo. This \the... macro does by default the output of the counter value with arabic numbers. \thefoo is used also for the label as it is written to the .aux file. If format (i), is requested, this has to be written into the .aux file and it's to be used in \thefoo. So ...


3

As you are doing inside an environment you need to define \counterIDX "globally" by using \gdef: \documentclass{memoir} \usepackage{totcount} \newenvironment{passagequestions}{% This does not work \gdef\counterIDX{passagecounterX}% \newtotcounter{c\counterIDX}% \total{c\counterIDX}% }{% } \begin{document} ...


2

\label write \theX of the last counter X, so update this accordingly: \documentclass{article} \newcounter{foo} \renewcommand{\thefoo}{(\roman{foo})} \newcommand{\rfoo}{\refstepcounter{foo}\thefoo} \begin{document} \begin{tabular}{r|l} \hline \rfoo\label{f1} & First line \\ \rfoo\label{f2} & Second line \\ \hline \end{tabular} The first ...


2

Aligning the label left is easy with align=left from enumitem package. The special item can be set with \item[4bis], but this is only a strategy, if this does not occur very often. If the features of the enumerate package are requested, change to \usepackage[shortlabels]{enumitem} here. If the label should be wider, just say labelwidth=40pt, for example, ...


2

Yes, it is. With the help of counters (which are a key concept in (La)TeX): \documentclass{article} \parindent0em \newcounter{DoanCount} \setcounter{DoanCount}{1} \newcommand{\DoanString}[1]{% \stepcounter{DoanCount}% #10\theDoanCount0 } \begin{document} \DoanString{M-ERF}\\ \DoanString{M-AUSW} \end{document}


1

I suppose, the question environment has a counter named question, if this is different, change the name. It's possible to prepend code before \section is started either with \pretocmd (etoolbox) or \xpretocmd (xpatch) commands. The later works in more sophisticated cases, but xpatch calls etoolbox anyway. \documentclass{scrartcl} ...


1

There is a good reason: the only way LaTeX has for saving values during a run for using them during the next one is via some auxiliary file. The totcount package uses the standard .aux file, which is a very reasonable choice, as this file is always written (unless \nofiles has been declared) and read in at the start (and at the end, for making a comparison ...


1

There are many ways for numerical calculations inside \foreach loop. Here are two possibilities, one use count, the other evaluate : \documentclass[preview, border=7mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[line width=1pt,line cap=round,x=.5cm,y=.5cm] % axes \draw [<->,thick] (0,0) -- (10,0); % tick ...


1

One very clean solution is to make the list format use the two command \multilistdelim and \finallistdelim at the appropriate places \renewbibmacro*{list:plain}{% \ifnumgreater{\value{listcount}}{\value{liststart}} {\ifboolexpr{ test {\ifnumless{\value{listcount}}{\value{liststop}}} or test \ifmoreitems } ...


1

Here is an informal solution to your question: Mark the beginning and end of the passagequestions environment with a \label Recall these \labels as \refs in the start of the passagequestions environment. You'll have to make sure that counter stepping survives the environment it's called in. While this is naturally the case, redefinition of the stepped ...


1

Edit See the better version at the end. Similar to Werner, but I am using fake labels, which can break as soon as hyperref is used. \documentclass{article} \usepackage{refcount} \newcounter{passage}% \newcounter{question} \newenvironment{question}{\refstepcounter{question}}{} \makeatletter \newenvironment{passagequestions}{% ...



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