Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [definition]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
3 answers
62 views

How to define a LaTeX shorthand for nested indentation "contexts"

I am looking for a convenient way to code nestable "contexts" whose extents are displayed through indentation. Each context consists of a sequence of "statements" (i.e. lines) and/...
user avatar
  • 771
0 votes
1 answer
54 views

Why is this \def failing?

This is just a small snippet, for debugging: \documentclass[12pt]{article} \usepackage{amsmath} \def\block#1{\begin{array}{ll}\ &{#1}\end{array}} \def\sub#1#2{\text{#1}:\\\block{#2}} \begin{...
user avatar
  • 771
2 votes
2 answers
225 views

Defining a new command, the output of which depends on an internal parameter

Maybe someone can tell me how to define a new command in \LaTeX, which can take one mandatory value and another optional value (parameter) as input. In this case, depending on the value of the ...
user avatar
  • 97
0 votes
0 answers
14 views

List of Definitions derived from \begin{definitions}

I have a bunch of definitions in my document, which I created using the following structure: \begin{definition}[Term X] \label{def:term-x} What a great term \end{definition} Now, I want to show a ...
user avatar
2 votes
2 answers
53 views

Generate command definitions that take arguments

I want to define a command \NewSmartOp such that: \NewSmartOp \MYOP \myop would produce the following code (or anything equivalent): \makeatletter \def\MYOP{\@ifstar\MYOP@star\MYOP@nostar} \def\...
user avatar
  • 216
2 votes
1 answer
204 views

Why double curly brackets in `\long\def\bold#1{{\bf#1}}`

I'm reading The TeXbook by Knuth. Page 205 has If you actually want a control sequence to allow arguments with \par tokens, you can define it to be a “long” macro by saying ‘\long’ just before ‘\def’. ...
user avatar
  • 449
0 votes
2 answers
62 views

Constructing \definition in latex

Does there exist \begin{definition} in latex? And how can I construct one? Is everything derived from \newtheorem command.
user avatar
  • 103
0 votes
0 answers
27 views

Enumerating theorems and examples

I have an issue when writing an article. The process of enumerating definitions, algorithms, figures and sections are ok, but when I enumerate theorems and examples, they follow in order as if they ...
user avatar
0 votes
2 answers
199 views

How to adapt \crefrangelabelformat to subexample formatting?

I would like to be able to redefine something which is supposed to be defined in the preamble. In this example and in relation to this question : Cross-referencing: more sublevels, and presets, I want ...
user avatar
0 votes
0 answers
44 views

! Missing \endcsname inserted . Problem with \def

I am trying to compile and OLD LaTex file from my PhD thesis, using PDFLatex. However, now it does not compile anymore. It keep me giving this error. Below I give a MWE: \documentclass[12pt,...
user avatar
1 vote
1 answer
64 views

Declare math operator

I'm trying to create a command with which to write \declaremathoperator{ABC} to get \def\ABC{\operatorname{ABC}} I tried to implement it like \def\declaremathoperator#1 { \def\csname #1\endcsname{\...
user avatar
2 votes
1 answer
74 views

new, renew, provide and declare commands naming conventions

When defining new macros (or more general/abstract: resources), we have to consider the case of the macro already being defined. xparse handles this (imho) quite nicely, by using the four prefixes \...
user avatar
1 vote
1 answer
44 views

Huge set definition in latex

I am trying to write a set definition like the picture below in latex: How can I make such a clean set definition?
user avatar
1 vote
1 answer
60 views

Writing (nested) argument specifier to aux file

This is a follow-up to this question: where I explained that I want to write some definitions into an aux file and use hooks to achieve this. Refer to this question for context why I want to do the ...
user avatar
0 votes
0 answers
24 views

How to add a code in `\tcolorboxenvironment{definition}` to change the color of "Definition" black to red?

I want to change the color of "Definition" from black to red. For example, the "Definition 8.2.8 (stochastic processes)" is black. But I want to replace it by red color. My code ...
user avatar
  • 185
2 votes
1 answer
45 views

On Stacking Asterisks to Form Chapter Dividers with Stackengine

This question is an extension of the earlier post Best Way to Produce This Chapter Divider Image Consider the code: \documentclass{book} \usepackage{stackengine} \usepackage{graphicx} \def\asterisks{\...
user avatar
  • 4,979
0 votes
2 answers
79 views

Best Way to Produce This Chapter Divider Image

I am currently working on a document into which I hope to incorporate this chapter divider: QUESTION: Does LaTeX have an ornament that resembles this triangular group of asterisks, or must it be ...
user avatar
  • 4,979
4 votes
1 answer
695 views

How is TeX syntactically organised?

I'm just starting out on TeX, and I wanted to find a directory or table of how TeX is arranged in syntax. I can make educated guesses, but I figured I'd be better self taught if I understood how ...
user avatar
  • 159
1 vote
0 answers
48 views

Save environment declared with \NewDocumentEnvironment to redefine it

I have some environment declared with \NewDocumentEnvironment, lets call it oldenv which I want to redefine in another package, to tweak it a little bit. However, in the redefinition I want to make ...
user avatar
0 votes
4 answers
93 views

Define global function within \begingroup ... \endgroup

I have a command that accepts optional arguments as key-value pairs, handled by the l3keys package. I use \begingroup and \endgroup to \keys_set:nn the keys in order to process set options only for ...
user avatar
0 votes
0 answers
31 views

Chapter with image and format section

I would like to get chapters with image, section with dot line under and left box cover, def with shadow box and upper + lower straight lines for every proof as in the picture. Could you please help ...
user avatar
1 vote
1 answer
36 views

MetaPost vardef: how to declare a variable of type 'expr'?

I want to make a macro swap: vardef swap(expr a, b) = save tmp; expr tmp; tmp := a; a := b; b := tmp; enddef; But there is an error when compilating: ! A statement can't begin with `expr'. I ...
user avatar
  • 515
1 vote
0 answers
37 views

Continued minipage geometry

I need to motivate certain definition, and to do that I used minipage environment for the motivation part. However when the length of the motivation is more the section doesn't continue to next page ...
user avatar
  • 619
4 votes
4 answers
246 views

Same command with two different argument-separators

I have the following code \makeatletter \def\ip#1{\@ip#1\relax} \def\@ip#1|#2\relax{\langle#1|#2\rangle} \makeatother When in the document one finds $\ip{2|3}$ he gets something like <2|3>. ...
user avatar
3 votes
1 answer
152 views

How can I achieve this theorem style (a very common one)?

Consider: How can I achieve this style for definitions, theorems, ...? I only know the standard or "plain" style (bold for header, italics for body) for theorem-like environments.
user avatar
  • 243
0 votes
1 answer
20 views

Why do nameref package zap the ending dot in \label and how to avoid this zap locally?

So, I'm hacking something related to nameref and during the hacking, I find on the beginning of page 3 of the nameref manual on my computer (dated 2016/05/21) that We redefine \label so that it also ...
user avatar
0 votes
0 answers
80 views

Different between \def and \long\def and where to use [duplicate]

Please excuse if my question is silly.... May I know what's the difference between \def and \long\def and where to use \long\def Thanks....
user avatar
  • 10.9k
1 vote
0 answers
65 views

What is the equivalent PreTeXt equivalent of \def in Latex? [closed]

I am using Latex to write my course syllabi and I want to switch to PreTeXt does anyone know what is the equivalent of \def in PreTeXt? For example, in my syllabi I use the following: \def\officehours{...
user avatar
3 votes
1 answer
66 views

\def allowing multiple formats

For example, I want to define this \def\normal(#1,#2){\mathcal N\left( #1, #2 \right)} which makes it convenient to write a normal distribution (e.g., \normal(0,1) gives N(0,1)). However, I have been ...
user avatar
3 votes
1 answer
58 views

Newly-Defined Scaled Bullet Point Not Being Scaled When Invoking New Definition

Consider the code \documentclass{book} \usepackage{xcolor} \usepackage{scalefnt} \usepackage{amssymb} \newcommand{\m}{\textcolor{blue}{{\scalefont{1.00}{\maltese}}}} \newcommand{\M}{\textcolor{blue}{...
user avatar
  • 4,979
1 vote
1 answer
29 views

math mode print as normal mode when a command is fragile

i have created a macro, when the command in math mode print in bold, if it is outside math it should print in color \def\mathtest{\ifmmode ***math mode***\else\textcolor{red}{***text mode***}\fi} ...
user avatar
  • 1,774
0 votes
1 answer
84 views

Definition function in LaTeX Tcolorboxed Poster

I'd like to create a \newtcbtheorem[number within=subsection]{definition}{Definition}{...} like this: "Title of the definition" and "Statement of the definition" must be manually ...
user avatar
  • 795
3 votes
1 answer
188 views

\let and \def differentiation in D. Knuth's commentary (plain TeX)

In the The TeX Book, in apendix B, I read \def\obeyspaces{\catcode`\ =\active} {\obeyspaces\global\let =\space} {% \catcode`\^^M=\active % these lines must end with ‘%’ \gdef\obeylines{\catcode`\^^M=\...
user avatar
1 vote
3 answers
96 views

LaTeX3 - Test string equality + Star version

I'm looking for some good advice on switching from (La)TeX to LaTeX3 Here is the first questions corresponding to the toy code below. What is a good way to manage an optional argument with LaTeX3? ...
user avatar
  • 11.4k
0 votes
0 answers
39 views

Definition starting at A.1 (Appendix)

I'm trying to get the definition ("definição" in portuguese) to start at A.1 instead of 1. The problem is that I have several appendices and every time I add an appendix, the definition ...
user avatar
1 vote
0 answers
39 views

Determining the RGB Definitions of Modified Colors in LaTeX [duplicate]

After defining certain colors and modifying them as the following code indicates, I then would like to determine the equivalent RGB definitions of the modified colors. For example, \documentclass{...
user avatar
  • 4,979
1 vote
4 answers
144 views

Failing with TeX expansion

I'm trying to achieve a (seemingly simple) thing. I'd like to define a custom command \Symbol that receives a single parameter and prints that parameter. In addition, I'd like to have another series ...
user avatar
  • 175
4 votes
2 answers
86 views

\NewDocumentCommand without xparse

I noticed that I can use \NewDocumentCommand without loading xparse. Why is that? How universal is that? And where can I read more about this? (My search terms always pointed to xparse.) \...
user avatar
  • 3,335
0 votes
1 answer
104 views

Adjust the code to get TikTok symbol

This question it is related to this. Considering the link of my answer where there are the conditions to have the tiktok symbol https://github.com/liweitianux/resume/blob/master/fontawesome5/...
user avatar
  • 46.2k
0 votes
1 answer
37 views

Read out (and edit) data from a table with def, xdef, let etc. (by using a pgf-loop and pgfplotstable)

If I read out from a table with \def, say \pgfplotstablegetelem{\row}{No}\of{\mytable} \def\No{\pgfplotsretval} it becomes wrong. By using \xdef \pgfplotstablegetelem{\row}{No}\of{\mytable} \xdef\No{\...
user avatar
  • 6,217
5 votes
4 answers
106 views

Store the expanded version of a macro into another macro in the plain format

I wrote the following macro that prints a range of numbers separated by commas: \newcount\tmpnum \def\range#1#2#3{\tmpnum=#2 \loop\the\tmpnum\advance\tmpnum by #1 \ifnum\tmpnum<#3,\...
user avatar
  • 2,499
1 vote
0 answers
10 views

Error when citing definitions [duplicate]

I'm looking to cite the source of a definition, but there seems to be a bug. An example of something I'm looking to type: \begin{definition}[\cite[Definition 1.4.2]{Hilbert10}] content \end{...
user avatar
  • 41
3 votes
1 answer
48 views

Non letter name in command definition

I'd like to define similar commands one with underscore the other — without. However such an approach throws me an error \def\Fix#1{\mathrm{Fix}(#1)} \def\Fix_#1#2{\mathrm{Fix}_{\,#1}(#2)} I tried to ...
user avatar
  • 1,785
1 vote
2 answers
58 views

Add optional parameter to def

So I was looking for a way to do something in latex, and I ran across the following MWE: \documentclass{article} \def\foo{1} \def\bar#1 #2{% \expandafter\def\expandafter\foo\expandafter{\foo {}#1}...
user avatar
1 vote
0 answers
60 views

Missing { inserted: \DeclarePairedDelimiterX

The following code \documentclass{scrartcl} \usepackage{mathtools} \DeclarePairedDelimiterX\innerp[2]{\left(}{\right)}{#1 \delimsize\vert \mathopen{}#2} \DeclarePairedDelimiterX{\dualp}[2]{\langle}{\...
user avatar
  • 607
0 votes
1 answer
35 views

Restating a part of the definition

I am repeating a single definition several times, and I use restatable to do so. But I want the first occurrence of a definition to contain a qualification which is not repeated in the next ...
user avatar
  • 908
1 vote
1 answer
39 views

I want to retrieve the first and second elements from one argument of \def

\documentclass[border=1cm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[help lines](0,0)grid(3,3); \def\line_segment#1; { \draw(#1[0],#1[1])-...
user avatar
3 votes
1 answer
37 views

The definition in my recompiled pdf is not working like I want

I have a hard time with the definition display. See below, to notice that the Definition A. n supposed to read Definition. An expression... How do I this: "supposed to read Definition. An ...
user avatar
  • 33
1 vote
1 answer
41 views

Specifying macro definitions via command line arguments to make4ht

I want to learn if there is a way to make make4ht pass some macro definitions to the LaTeX engine during compilation time. Let me explain what I am talking about with pdflatex as an example first. I ...
user avatar
  • 2,897
3 votes
1 answer
123 views

Redefine \choose as \binom

I did not know that I should be using \binom instead of \choose (and I ignored all the warnings). Now, instead of manually changing it at all places where I used \choose, I think there should be a way ...
user avatar