Skip to main content

Questions tagged [programming]

{programming} is about how (La)TeX can be used as a programming language.

5 votes
2 answers
223 views

I currently have the following code to recursively split and access a sequence according to a list of separators: %% -------------------------------- PREAMBLE -------------------------------- %% \...
Vincent's user avatar
  • 6,225
3 votes
1 answer
75 views

Consider the following code: \documentclass[10pt]{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\split}{m m}{ \seq_set_split:Nnn \l_tmpa_seq{#2}{#1} \seq_map_indexed_function:...
Vincent's user avatar
  • 6,225
2 votes
2 answers
173 views

I want to save the value from some command (e.g. from \title) in an external text file, having cleaned it up from TeX's syntax beforehand. I decided to do it with the help of regular expressions on \...
sergiokapone's user avatar
  • 5,972
9 votes
6 answers
553 views

How can I index into an array of "strings" (text to be typeset) in Latex? If I were to write something in Python, it might look like this: dow = [ "Sunday", "Monday", ...
dedded's user avatar
  • 2,872
9 votes
4 answers
754 views

In LaTeX3, token lists collapse spaces. Is there a way to avoid that and call a function on all tokens, without collapsing spaces. For example, I would like the following function to display the ...
Vincent's user avatar
  • 6,225
6 votes
1 answer
202 views

Consider that I have a command that produces a Tikz node: % First parameter: node name % Second parameter: node width % Third parameter: node height \newcommand{\makenode}[3]{ \node (#1) [draw, ...
Vincent's user avatar
  • 6,225
5 votes
1 answer
217 views

I'm developing a LaTeX class for typesetting theses at the University of Trento, aiming to streamline every aspect of the thesis formatting process. One feature I want to implement is allowing ...
Emanuele Nardi's user avatar
0 votes
1 answer
75 views

Consider this wrapper as an example: \prg_new_conditional:Nnn \check_engine:n{p,T,F,TF}{ \tl_trim_spaces_apply:nN{#1}\__check_engine:n } \cs_new:Npn \__check_engine:n #1{ \bool_lazy_any:nTF{ ...
Vincent's user avatar
  • 6,225
1 vote
0 answers
114 views

I reused the code provided as an answer here (I tried to make it a new conditional) \prg_new_conditional:Npnn \if_font_exist:nnnn #1#2#3#4{p,T,F,TF}{ \group_begin: \tl_if_empty:nF{#1}{\...
Vincent's user avatar
  • 6,225
2 votes
1 answer
139 views

Is there any input for which, once processed with tl_trim_spaces could lead to tl_if_blank being true AND tl_if_empty being false?
Vincent's user avatar
  • 6,225
1 vote
2 answers
240 views

Note [cfr]: the code below does NOT work. Please follow the link for amended code which does. I do not know how to edit this question without changing its meaning and its author has not updated it in ...
Vincent's user avatar
  • 6,225
2 votes
2 answers
129 views

In LaTeX3 am wondering what \token_if_expandable:N(TF) actually test? The documentation says: Tests if the ⟨token⟩ is expandable. This test returns ⟨false⟩ for an undefined token. but I am guessing ...
Vincent's user avatar
  • 6,225
0 votes
2 answers
137 views

I have read tens of pages on expansion, and for whatever reason, I am still missing a clear understanding. To help me understand, I would like to focus on a specific example. Consider the following ...
Vincent's user avatar
  • 6,225
5 votes
4 answers
432 views

When using XeTeX or LuaTex and fontspec, one can use \IfFontExistsTF{font name}{yes code}{no code}. What would be the best way to test if a font exists/can be loaded when fontspec is not available (...
Vincent's user avatar
  • 6,225
1 vote
1 answer
151 views

I am wondering how to create efficient expandable functions in LaTeX3: \check_if_dim:n \check_if_skip:n \check_if_muskip:n that would check if an argument can be parsed as a dimension, a skip or a ...
Vincent's user avatar
  • 6,225

15 30 50 per page
1
2 3 4 5
45