Skip to main content

Questions tagged [macros]

{macros} is for questions specifically concerning TeX's macro processor. Note that, because TeX uses macros ubiquitously, most questions about code that uses macros are not looking for information about how macros work, and so are not appropriate for this tag.

0 votes
2 answers
17 views

I defined a Tikz macro and I want to use it so the item of an inline itemize is passed as its argument. So far, my solution is this: \documentclass{article} \usepackage[inline]{enumitem} \usepackage{...
mathbekunkus's user avatar
  • 1,389
0 votes
1 answer
57 views

With the help of AI I created the following: \documentclass{article} \usepackage[margin=1cm]{geometry} \usepackage{tikz} \usetikzlibrary{positioning} % Define colors extracted from the image \...
Nick B's user avatar
  • 1,233
3 votes
3 answers
107 views

This is my first time using of xint.sty; therefore, I have a few questions: (1) Is \NewDocumentCommand{\sn}{m}{ subsn(expr, var1=value1; var2=#1) } ​​the correct way to define a macro with a mandatory ...
cis's user avatar
  • 13.5k
1 vote
2 answers
34 views

The Goal: I am building a chemistry database package (chemdata.sty) where chemical equations and properties are generated from a CSV file (via Python) and stored as control sequences using etoolbox's \...
Le Ngoc's user avatar
  • 53
2 votes
1 answer
44 views

I wrote a macro \exo{} that automatically numbers the exercises in a worksheet or in an assessment (the option allows you to choose and display the grading rubric). It was corrected by @egreg here: ...
AndréC's user avatar
  • 27k
11 votes
5 answers
857 views

I want to create a command \isthisprime{<number>} where it decides whether <number> is or is not prime, and if it is, it also returns the order of the prime (eg, 2 is the first, 3 is the ...
legogubben's user avatar
1 vote
0 answers
50 views

I am tasked with a very specific book design and have done this until now with Scribus but want to switch to LaTeX and try to get it done to learn it. The design of the booklet is very specific, as it ...
chibisuketyan's user avatar
4 votes
3 answers
603 views

I have a (far from ideal) collection of macros that I \include in the preambles of my documents. It's very useful in giving my documents uniform semantic representation. For example, contravariant ...
Steven Thomas Hatton's user avatar
3 votes
0 answers
60 views

I would like to create a user copy of the \if@partsw flag something like this \documentclass{article} \newif\ifPart \AtBeginDocument{\makeatletter \if@partsw \Parttrue \else \Partfalse \...
Ethan Duckworth's user avatar
1 vote
0 answers
57 views

The following code works if I use \DTLread to read csv under name data, then save it as dbtex-3 using \DTLwrite, and finally read the .dbtex file under the name datafromdbtex. Then I can use it for ...
Krantz's user avatar
  • 169
2 votes
1 answer
68 views

Note: I attempted to mod the code in my OP by integrating Mr. Carlisle suggestions in the comments below. My implementation must be wrong because the render still results in the screenshot below. I am ...
Oregon Math Tutor's user avatar
5 votes
7 answers
366 views

I'm trying to define commands inside a pgffor \foreach loop, where the command-names depend both on the a macroparameter and the loop parameters. However, I get "First argument of '\...
kaba's user avatar
  • 705
2 votes
2 answers
101 views

Suppose I have a document containing text and mathematical formulas. From a certain point onward, I would like everything written before that point not to be displayed in the compiled document, ...
Sebastiano's user avatar
  • 68.8k
0 votes
2 answers
64 views

The following code works until \DTLwrite. So, I am unable to get the \action to work. I understand there might be other ways of accomplishing this. My reason for using this approach is to speed up ...
Krantz's user avatar
  • 169
2 votes
1 answer
57 views

I am trying to implement a counter (boxlevel) that automatically tracks and displays the nesting depth of my boxes. I attempted to achieve this by redefining the standard tcolorbox environment to ...
user avatar

15 30 50 per page
1
2 3 4 5
572