6:11 AM
@samcarter_looks_forward_TUG'21 you're welcome :)
I'm however not sure how LuaTeX treats line endings, so the pattern might not match if the line contains only \bea.

7:03 AM
Is there a way(/package) that includes the name of label in the caption of a figure? As an alternative to showkeys/showlabels.

@Flow you want a third package to do the same again? most people wonder why there are two:-)

@DavidCarlisle It is my understanding that showkeys/showlabel just show the label name "next" to the label. I want it to appear as prefix or postfix to text of the caption.
So showkeys and showlabel try to avoid changing the layout of the document. I don't care, as I build multiple versions of the document (with annotations, without, etc.) anyway. Hence inline remarks/comments/annotations are fine

@Flow well in both cases the idea is that as far as possible you want the draft document to have the same line and page breaks as the final one so you don't want printing the label to disturb the main text. Also specifically for caption you have the issue that the \label command might be anywheer in the caption or anywheer after the caption.

With my limited knowledge about latex internals, I wonder if what I ask for if even possible, given that \caption has to appear before \label
Therefore, I imagine, that when \caption is expanded (or whatever the latex lingo is), the \label name will not yet be available
Right, I usually put the \label after the \caption, not in the caption (hope that doesn't make any difference)

@Flow if you want the label printed "somewhere" you can go much simpler and do \let\zzlabel\label \def\label#1{\mbox{\detokenize{#1}}\zzlabel{#1}}
@Flow in is actually better than after in some edge cases.

7:14 AM
@DavidCarlisle thanks, will give it a try
though, it would be really nice if the label name would appear as part of the caption :)

@Flow well with the above do \caption{\label{abc} This is my caption} and it will.

Ahh, right, but then I have to change my habit of putting the label after the caption (which I very much like from an aesthetic point of view)

@Flow too bad, as I say putting it after can affect the spacing anyway so maybe changing habits is good
@Flow in an ideal world it would be more like \caption[label=zzz]{my caption} and you could control things more easily, you could of course define such a syntax locally

@DavidCarlisle what about the space between the closing curly brace and the first letter of the caption
ahh would be great, such a thing could even include the feature I envision

@Flow you can use whatever formatting you want perhaps use \ignorespaces at the end of the \label definition, or make the label be in red or in parens or whatever

7:24 AM
Ahh, no, I was just wondering, all that "label in caption beside" if there are any consequences of
\caption{\label{abc} This is my caption}
vs
\caption{This is my caption\label{abc}}
The latter one is what en.wikibooks.org/wiki/LaTeX/… shows

@Flow the \label syntax predates the internet, actually it probably predates the notion of hypertext (I'd have to check) it worked well for generating a number but it is a real pain for hyperref or anything that wants a reference to link back to an anchor as \label makes it hard to put an anchor in the right place: hyperref goes through some contortions to guess where to put an anhor so \ref{abc} jumps to somewhere reasonable that isn't just random place where the user wrote \label
@Flow no in the standard definition at least, latex will ignore the space token introduced by the first form

@DavidCarlisle you do not happen to have an idea how a \RenewDocumentCommand of \catpion wouild look like so that \caption[label=foo]{This is a caption} expands to \caption{This is a caption\label{foo}} and \caption{This is another caption} expands to \caption{this is another caption}? :)
whereas the expanded \caption is the "original" \caption

@Flow I might but not now, and I'd use a different command name to be honest as otherwise you have to work out how to regain the original optional argument to caption, and if you do redefine and want it to work well you'd have to cordinate with other packages that redefine caption, so float, caption, longtable, ...... whereas defining \zzcaption such that whatever the definition of \caption, \zzcaption[label=fff]{gggg} is \caption{gggg\label{fff} is trivial.

Fair point

8:06 AM
\documentclass[]{article}

\usepackage{expkv-def}

\makeatletter
\ekvdefinekeys{mycaption}
{
dataT label = \mycaption@label
,data  short = \mycaption@short
}
\newcommand\mycaption@short@aux[2]
{\captionORIG[{#2}]{#1\mycaption@label\label}}
\AtBeginDocument
{%
\NewCommandCopy\captionORIG\caption
\RenewDocumentCommand\caption{O{} m}
{%
\begingroup
\ekvset{mycaption}{#1}%
\mycaption@short
{\mycaption@short@aux{#2}}%
{\captionORIG{#2\mycaption@label\label}}%
@Flow ^^^ this does what you want.

@Skillmon thanks, will give it a try

@Flow of course other key=value implementations than expkv could be used as well (but the data and dataT handlers ease the process a bit here).
@Flow it should work with the caption package, hyperref, etc., but since longtable redefines \caption locally it doesn't work with longtable.

@Skillmon That would be another argument to go with @DavidCarlisle suggestion of using a different command name for this feature. Not sure what the latex idiom for that whould be, or if there is one. Maybe \Caption, or \xcaption?

@Flow well, the LaTeX2e idiom would not use uppercase, as that is intended as a programmers interface, not as document level. So \xcaption, or \zzcaption, or \mycaption, etc.
\documentclass[]{article}

\usepackage{expkv-def}

\makeatletter
\ekvdefinekeys{mycaption}
{
dataT label = \mycaption@label
,data  short = \mycaption@short
}
\newcommand\mycaption@short@aux[2]
{\caption[{#2}]{#1\mycaption@label\label}}
\NewDocumentCommand \mycaption { O{} m }
{%
\begingroup
\ekvset{mycaption}{#1}%
\mycaption@short
{\mycaption@short@aux{#2}}%
{\caption{#2\mycaption@label\label}}%
\endgroup
}%

\usepackage[]{graphicx}

\begin{document}
Oh, the code misses a \makeatother after the definition in both cases.

8:29 AM
@Skillmon surely everyone uses the one true kv system?

8:45 AM
to rule them all? :)

@Rmano Thanks!

@UlrikeFischer I suspect the user is you with a sockpuppet account generating excuses to advertise para hooks.

@DavidCarlisle I would never write \def\a !

@UlrikeFischer because accents in tabbing have such a brilliant interface and you don't want to break that?

8:55 AM
@DavidCarlisle no, because I never know which accent I would break with redefining \a, \b, \c and I'm to lazy to look it up first.

@DavidCarlisle Hans ...

@chsk there is a list here tex.stackexchange.com/questions/60491/… maybe \pdftracingfont? But for sure @DavidCarlisle knows how to make the tracing box list...

@JosephWright get ze Flammenwerfer?

@Skillmon Er, 'remove all the accent commands'

@Rmano \show\tracingall (latex-dev has more \tracing... commands than latex:-)

9:00 AM
@JosephWright Nice! Maybe it's worth adding \mF, now that those things are more common vvvvvvv

9:12 AM
@Rmano Is it really 350 F, as in 350 000 000 000 nF?!

@Rmano Thanks, I'll check it out!

@yo' Yes. Although I am starting to question where the capacitor ends and the battery starts...

@Rmano that probably depends on max current and internal resistance.
Also, capacitors in general don't mind undervoltage, which is not quite the case for batteries (even modern ones)

@yo' yes, that's true. That guy there can store 1000 Coulombs --- you need a lot of patience to charge it. It seems a current /dev/null when you first check it... ;-)

10:01 AM
@Rmano I'd have said if there is a electro-chemical reaction it's a battery, else it's a capacitor? :)

@Skillmon ...but with elkos (electrolytic capacitors --- as supercapacitors are) the thing is a bit blurred... But yes, that was a bit tongue-in-check --- that guys is a capacitor. A fun one. I hope nobody got the polarities wrongs...

10:27 AM
@Rmano I heard with the big ones the boom isn't as spectacular as with smaller elkos (but I haven't tried myself, yet).

1 hour later…
11:54 AM
Hi, I haven't used chat here before.
For some reason, using TexStudio 3.0.1 with TexLive 2017 on my Mac, cleaning my document (including manually deleting all generated files in my project folder) and rebuilding it does not regenerate my list of Acronyms correctly.
The acronym list has a bunch of entries that linger in spite of the fact that I removed ALL associated \gls{} commands from my document.
The only thing I can think of that is causing this is that there is a WIP file generated somewhere in a different folder.
@Rmano That's a whopping big capacitor, I wouldn't put my tongue across those terminals.

12:56 PM
@gone have you re-ru makeindex, or make glossaries or whatever to regenerate the list?

@DavidCarlisle: makeglossaries is part of the build. I have \makeglossaries but no makeindex. What do you mean?

@gone makeglossaries is just makeindex or xindy configured to use glsfiles so . if you are running makeglossaries ad it is not building the list there should be an error in its log file with the error. Otherwise better to make a small example that does not work and post it as a question on the main site not here in chat

@DavidCarlisle: It is running and generating the gls files and both the 'acronym' and 'glossary' pages in my document. /usr/local/texlive/2017/.../makeglossaries is a perl script that seems to use makeindex. The strange thing is that the glossary is always right, but the acronym page contains acronyms that I used earlier (for testing actually) and they do not disappear until I comment out their definition in my glossary.tex file

@gone well perhaps you have used some command to include all acronyms, or they are in some auxiliary file. But without concrete code one can only guess.

According to makeglossaries --help it uses the target document's folder to store all files. Yet, even after deleting all the generated files, these entries remain.
Not all acronyms are listed, only the ones I used earlier.

1:13 PM
@gone the main question and answer site works better for questions than chat. make an example that shows the problem. It is impossible to guess what you have done wrong just given fragments of information.

@gone use grep to find all files with traces of such an acronym. And then start to think why such a file could matter.

@UlrikeFischer: yes, I am about to do that.
Report.tex

... (various packages)

%\usepackage[acronym]{glossaries}
\usepackage[nonumberlist,acronym]{glossaries} %% nonumberlist also turns off 'see' .
%\usepackage{glossaries-extra}
%\usepackage{glossaries-prefix}

%% Set flag to include Glossary in the ToC
%\glstoctrue
\makeglossaries
%% Load the file containing the glossary terms.
% Set acronyms such that on first use, the whole phrase is shown along with the acronym.
%\setacronymstyle{long-short}

\begin{document}

@gone sorry but this completly unusable. How should we know what you do in all this include files or if the (various packages) contains something that could interfere? Move everything to some test folder and then strip that down to something that can be actually tested.

@gone as Ulrike says but also post it as a question on the main site not in chat. chat is OK for quick questions but really isn't good for code examples

Ok, I think I've worked it out, maybe...
The ones that are showing up are those which I used \newglossaryentry{tcpip}{type=\acronymtype, .... } to define.
I need some of my acronyms to reference the glossary, and \newacronym does not allow me to specify first use and the other fields.
Yea, I understand your point. I'm no expert in latex, and my document is not only complex (reusing a template from others in my lab) but it is also very long (40+ pages).

1:30 PM
@gone your example doesn't need to be long or to use multi-file \include you can have all the needed terms in a single paragraph document. makeglossaries doesn't care about the document structure.
@gone if you are using the desktop view of this chat look at the starred comments on the right 8th one down: "it is such.....

@gone you don't need to be an expert to strip a document down, you only need some time. Copy everything in some other folder and then start to remove things one by one.

I think I've understood what the problem is; the way I'm defining some of my acronyms differs from the default, and the pattern is that the default ones work fine but the others don't. I'll set-up a test document here to confirm that's the problem, and then I'll post the question to the main forum.

@DavidCarlisle Seen the template question? A long standing bug ...

1:46 PM
@JosephWright will look
@JosephWright er.. I'm sure it was working when Frank and I last looked at it?

2:00 PM
@JosephWright doesn't the code simply miss \AssignTemplateKeys?

@DavidCarlisle, @UlrikeFischer: I've worked out the problem, though I don't understand why it's occurring. Whenever I use the see key, the acronym gets added regardless of whether I've actually used it or not. I'll post a question about this.

2:19 PM
@UlrikeFischer There's that too
@UlrikeFischer, @DavidCarlisle github.com/latex3/latex3/commit/…
@DavidCarlisle Yes, this would be my fault
@DavidCarlisle I'm not sure we've ever actually tested restricted templates!
@UlrikeFischer I've mentioned that in my answer

2:38 PM
@JosephWright I didn't consider the validity of my statement:-)

@JosephWright people use xtemplate?

any winedt users around? How do you run xelatex?
@Espen first check it works, save the code in this answer to file.tex then on the commandline type xelatex file and you will have file.pdf That is all you have to do, if your editor is making it more complicated than that then it is not helping. — David Carlisle 8 mins ago
@Skillmon Not people, users. Much worse.

I have posted my question with a snippet that demonstrates the problem: tex.stackexchange.com/questions/595968/…
@DavidCarlisle, @UlrikeFischer thanks for your input.

@gone thanks

2 hours later…
4:50 PM
@JosephWright I can resave xetex tests. I get an error
C:\texlive\2021\bin\win32\runscript.tlu:935: ...exlive/2021/texmf-dist/scripts/l3build/l3build-check.lua:1010: attempt to concatenate a nil value (field 'expectation')

I was wondering if there is ever any hope of getting a new expandable primitive, call it \pointer, that would alleviate the need to place macro arguments in a \def to be use for comparisons?

@StevenB.Segletes \pdfstrcmp added last century?

Usage: \def\comparitor{xyz}\newcommand\z[1]{\ifx\pointer#1\comparitor T\else F\fi}
@DavidCarlisle I'll have a look...I so enjoyed living in the last century. This could be a bit wrenching

@StevenB.Segletes \def\z#1{\ifnum\pdfstrcmp{#1}{xyz}=0 yes\else no\fi}

@DavidCarlisle And it's expandable? Wow, I really was living in the last century. Where is that? etoolbox?

4:54 PM
@StevenB.Segletes pdftex primitive also xetex primitive under name \strcmp and can be faked in Lua for luatex

@DavidCarlisle Even better!! (eyes popping)
@DavidCarlisle I see the catch...for package writers, one has to handle all the engine cases.

@StevenB.Segletes pdftexcmds package provides a comon name as does expl3

@DavidCarlisle Thank you.

@UlrikeFischer That's odd - I've tested locally didn't see it. I'll try some tests now it's in TL

@JosephWright hm, it works on a test in graphics-def. So what is my problem?

5:03 PM
@UlrikeFischer What repo are you trying with?

@JosephWright pdfresources. I just wanted to remake the checkbox test, because of the color switches.
@JosephWright l3build save -exetex checkbox
@JosephWright I remade also a few luatex tests, and that worked fine.
@JosephWright oh the luatex tests were all log based, a pdf based test fails too.

@UlrikeFischer Right, yes: I think it might be @MarcelKrüger's change

Anyone know how to install bib2gls on Macos?

@gone it should automatically be included in a full texlive installation

I wish. I'm using 2017, and it's not part of it.

5:17 PM
@gone It was released mid 2017, maybe your last update is older than that

yea. Let me see if I can update.

5:33 PM
@JosephWright @UlrikeFischer Fixed in l3build main.

@MarcelKrüger and what is an "expectation"?

6:17 PM
@UlrikeFischer See l3build manual 3.2 (.lve files are expectiation files for .log). It is another LaTeX file which is expected to produce the same tlg as the test file.

@MarcelKrüger aha, perhaps at some time, when @DavidCarlisle doesn't look, I should read the documentation ...

@UlrikeFischer but when is such a time

@JosephWright with @MarcelKrüger's fix it works again. I could save my tests.

6:38 PM
Excel has a text search function FIND which finds a string in a cell and returns a number corresponding to the position of the first character of the string. It throws an error (rather than 0) when the string is not found, which means you can't use it in a conditional statement without first trapping the error. Weird design choice?

@AlanMunn not weirder than using excel :)

@samcarter_looks_forward_TUG'21 Yes, well Excel has its uses sometimes. :)

I upgraded to MacTex 2021. However, my document no longer compiles and returns the error: Extra \endgroup. \begin{document}.
In the meantime, COTO actually answered my question and his solution works perfect.
So, now I need to fix this new bug. lol

@gone using catoptions or menukeys tex.stackexchange.com/questions/565937/… ?

@DavidCarlisle: catoptions is not mentioned in any of my project files. However, the Document.log file does have 2 references to is:
./Document.log:(/usr/local/texlive/2021/texmf-dist/tex/latex/catoptions/catoptions.sty
./Document.log:Package: catoptions 2014/08/29 v0.2.7h Securing catcodes and parsing options (A
no reference to menukeys

6:57 PM
@gone menukeys is only a problem as it loads catoptions (by the same author) catoptions cuts across large parts or latex internals and it finally broke. If you search this site you can probably find patches but not using it is probably a good idea

@DavidCarlisle: I'm not using either of them explicitly, but maybe one of the packages I am using has a reference to it. I don't know.

@DavidCarlisle menukeys is fine now, after @Skillmon took over.
@gone xwatermark?

@UlrikeFischer: Yes, I'm using xwatermark.

@gone drop it.

But I need it. Is there an alternative?

7:05 PM
@gone see the comments here tex.stackexchange.com/q/594943/2388

@UlrikeFischer: Cheers. That post is exactly what I'm getting. I'll read on and see what I can do.

7:47 PM
@UlrikeFischer: Thanks. I managed to recreate what I had using eso-pic, however I needed to use an image rather than text.

@gone why? eso-pic handles text fine.

Previously, I had the word "DRAFT" at 45 degrees in red with a low opacity centered on every page. From the examples I found, the only satisfactory result used an image. It will do for now, but I'll look into it later.
Unfortunately I'm not really a power LaTeX user.

8:49 PM
@UlrikeFischer Phew