17. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
todonotes: Todo notes within your document
The todonotes package lets you mark items that you need to completeâŠ
This note was created with todo[inline].
Mark missing figures: missingfigure[fig-
width=6cm,
figheight=4cm]
Missing
figure
Lots of optionsâŠcolour combos: blue!20!white
18. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
todonotes: Todo notes within your document
The todonotes package lets you mark items that you need to completeâŠ
This note was created with todo[inline].
Mark missing figures: missingfigure[fig-
width=6cm,
figheight=4cm]
Missing
figure
Lots of optionsâŠcolour combos: blue!20!white
Load with obeyFinal to remove all notes when passing final to your class.
28. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
Often want to edit a macro in an external package or class
regexpatch provides advanced functionality to do so
Some useful patches for the BioMed Centralâs bmcart.cls:
Contains: defdoi@base{http://dx.doi.org/}
29. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
Often want to edit a macro in an external package or class
regexpatch provides advanced functionality to do so
Some useful patches for the BioMed Centralâs bmcart.cls:
Contains: defdoi@base{http://dx.doi.org/}
patchcmd{doi@base}{http://dx.doi.org}
{https://doi.org}{}{}
31. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
appto{ figure@ setting s}{%
i f @ f i g u r e s t a r
captionsetup { . . . ,
s i n g l e l i n e c h e c k=f a l s e , j u s t i f i c a t i o n=RaggedRight}
f i%
}
def bmcart@hyperref@settings{%
. . .
@ifundefined { hy@title }{}{ p d f s t r i n g d e f
@pdftitle { hy@title }}
}
32. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Patching other packages or classes
appto{ figure@ setting s}{%
i f @ f i g u r e s t a r
captionsetup { . . . ,
s i n g l e l i n e c h e c k=f a l s e , j u s t i f i c a t i o n=RaggedRight}
f i%
}
def bmcart@hyperref@settings{%
. . .
@ifundefined { hy@title }{}{ p d f s t r i n g d e f
@pdftitle { hy@title }}
}
regexpatchcmd { bmcart@hyperref@settings }
{.* @title .*}{}{}{}
34. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
There are typesetting instructions and instructions with other effects
def is like a simpler version of newcommand*, in TEX and not LATEX
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
35. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
There are typesetting instructions and instructions with other effects
def is like a simpler version of newcommand*, in TEX and not LATEX
expandafter is a macro that influences the expansion of macros
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
36. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
There are typesetting instructions and instructions with other effects
def is like a simpler version of newcommand*, in TEX and not LATEX
expandafter is a macro that influences the expansion of macros
defxx{ABC}; replacement text and expansion of xx is ABC
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
47. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
48. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
Common use case: calling a macro with the result of another
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
49. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
Common use case: calling a macro with the result of another
defxx[#1]{...} defyy{[ABC]}
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
50. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
Common use case: calling a macro with the result of another
defxx[#1]{...} defyy{[ABC]}
xxyy fails; expandafterxxyy works
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
51. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
Common use case: calling a macro with the result of another
defxx[#1]{...} defyy{[ABC]}
xxyy fails; expandafterxxyy works
defzz{yy}. expandafterxxzz fails, since expansion only occurs
once
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
52. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
tokene is placed back in front of the generated tokens and processing
continues
expandafter reverses expansion, not execution
Common use case: calling a macro with the result of another
defxx[#1]{...} defyy{[ABC]}
xxyy fails; expandafterxxyy works
defzz{yy}. expandafterxxzz fails, since expansion only occurs
once
Solved using edeftemp{noexpandxxzz}
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
56. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
57. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
ex4 is executed, saving b and expanding c
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
58. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
ex4 is executed, saving b and expanding c
All saved tokens ex2· a · b are reinserted in front of the replacement of
c
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
59. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
ex4 is executed, saving b and expanding c
All saved tokens ex2· a · b are reinserted in front of the replacement of
c
Now ex2 s executed, saving a and expanding b
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
60. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
ex4 is executed, saving b and expanding c
All saved tokens ex2· a · b are reinserted in front of the replacement of
c
Now ex2 s executed, saving a and expanding b
a is reinserted and then expanded
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
61. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
Multiple expandafters: ex1ex1ex1aex4bc
ex1 is executed, saving ex2.
ex3 is executed, saving a
Saved token list: ex2· a
ex4 is executed, saving b and expanding c
All saved tokens ex2· a · b are reinserted in front of the replacement of
c
Now ex2 s executed, saving a and expanding b
a is reinserted and then expanded
Execution continues with the replacement text of a
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
62. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
Reverse expansion of 4 tokens: 7 expandafters, token a, 3
expandafters, token b, expandafter, token c, token d
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
63. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: expandafter
Reverse expansion of 4 tokens: 7 expandafters, token a, 3
expandafters, token b, expandafter, token c, token d
For n tokens, the ith token must be preceded by 2nâi â1 expandafters
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1, pp. 57â61,
1988.
66. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: csnameâŠendcsname
csnameâendcsname are TEX primatives used to define and call macros
def can only used letters
Can do: expandafterdefcsname $&3endcsname{Hi!}
A. Hendrickson, âThe joy of csnameâŠendcsnameâ, TUGboat, vol. 33, no. 2,
pp. 219â224, 2012.
67. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: csnameâŠendcsname
csnameâendcsname are TEX primatives used to define and call macros
def can only used letters
Can do: expandafterdefcsname $&3endcsname{Hi!}
Then csname $&3endcsname produces âHi!â
A. Hendrickson, âThe joy of csnameâŠendcsnameâ, TUGboat, vol. 33, no. 2,
pp. 219â224, 2012.
68. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
Δ-TEX programming: csnameâŠendcsname
csnameâendcsname are TEX primatives used to define and call macros
def can only used letters
Can do: expandafterdefcsname $&3endcsname{Hi!}
Then csname $&3endcsname produces âHi!â
Can expand commands within this and use for building dynamic macros
A. Hendrickson, âThe joy of csnameâŠendcsnameâ, TUGboat, vol. 33, no. 2,
pp. 219â224, 2012.
80. Lab meetingâ
technical
talk
Coby Viner
Engines
Packages
Microtypography
Siunitx
Todonotes
Conditionals
Patching &
Programming
Patching
Programming
Programming
Programming
Overleaf
Compilation
Upcoming
References
S. Kottwitz. (2015), Example: a diagram of tex engines,
http://www.texample.net/tikz/examples/smart-bubbles/.
H. T. ThĂ nh, âMicro-typographic extensions of pdfTEX in practiceâ,
TUGboat, vol. 25, no. 1, pp. 35â38, 2004.
S. Khirevich. (2018), Tips on writing a thesis in latex,
http://www.khirevich.com/latex/microtype/.
S. v. Bechtolsheim, âA tutorial on expandafterâ, TUGboat, vol. 9, no. 1,
pp. 57â61, 1988.
A. Hendrickson, âThe joy of csnameâŠendcsnameâ, TUGboat, vol. 33, no. 2,
pp. 219â224, 2012.
J. Wright, âsiunitx: a comprehensive (SI) units packageâ, TUGboat, vol. 32,
no. 1, pp. 95â98, 2011.