« first day (5145 days earlier)      last day (43 days later) » 

03:43
Thanks everyone.
 
2 hours later…
cfr
cfr
06:13
@samcarter yes, though it's the amazing ones which get their stories out to the press, I guess. the less successful pigeons keep quiet about it ....
D G
D G
Only the default logo shown even if I change to otherlogo. What is wrong?
\ProvidesClass{myclass}[2024/12/01 v 1.00 class for fun]
\def\@logo{mydefaultlogo}
\DeclareOption{logo}{\def\@logo{#1}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass[twoside,12pt]{article}


\RequirePackage{graphicx}

% use \includegraphics{\@logo} here
\endinput


% user will use as follows
%\documentclass[logo=otherlogo]{myclass}
 
1 hour later…
07:23
@DG You can't pass key-value options using this approach. But you could check the kvoptions or xkeyval packages. Or create an expl3 class.
cfr
cfr
@DG @JasperHabicht you don't need to create an expl3 class. the kernel now provides a 2e interface for processing common types of key-value options when loading classes and packages. see clsguide for details. but you can't do it with the \DeclareOption syntax. you need to use the commands provided for key-values.
@cfr Ah, right! It seems that I directly jumped to expl3 in my coding history =D
cfr
cfr
@JasperHabicht you don't have to make an expl3 class even to use expl3 in your class. you can always say \ExplSyntaxOn.
but the main point is, you don't have to use expl3 syntax at all.
@cfr You are right. I almost always use \keys_define, just because I also use it with local key-val settings. Therefore, I found it more reasonable to also use this for class or package options.
cfr
cfr
@JasperHabicht yes, I do the same. I'm too lazy to learn an additional setup.
07:38
@cfr That's exaclty it! =)
So, @DG ignore what I said above and check the answer on the main site instead =)
D G
D G
07:53
ok thanks.
cfr
cfr
08:24
is it expected that .fontspec files may result in different results depending on whether the file system is case sensitive? it seems Baskervaldx.fontspec is not found on a case-sensitive fs, but is on a case-insensitive one, if the file is actually called baskervaldx.fontspec. or can anybody confirm this is the reason?
4
A: Baskervaldx doesn’t allow certain glyphs

cfrBaskervaldx.sty is designed for 8-bit engines and should not be used with Unicode engines. However, the package provides baskervaldx.fontspec, which you can use, if you wish, with Unicode engines. For example, the following will load the .fontspec configuration provided by baskervaldx: \document...

 
3 hours later…
10:55
@PauloCereda ohh
11:27
Just seen on main meta: a spammer uses spam as one of the tags for their post. Very appropriate!
 
2 hours later…
cfr
cfr
13:48
@samcarter fancy having to get all those bears to line up like that ...
14:32
@cfr I'd use a tikz matrix and tikzbears :D
 
3 hours later…
17:49
@cfr -- but when all lined up in one place, doesn't that empty their original locations?
 
1 hour later…
19:00
Why does not one want to answer my bountied question? 😊
1
Q: Coloured headings in margins

GausslerIn my CV design, I like to put some sections in the margins in order to make better use of the space. Currently, I’m using a solution based on tcolorbox, but I would like to get rid of the reliance on that package and do it all “manually” instead. My issue is related to headings inside the margin...

19:11
@Gaussler there is an answer posted
@DavidCarlisle It doesn’t answer the question. It’s a long comment (though a useful one)
@Gaussler oh that's not clear, it looks like it ought to answer it although i didn't check, your main issue seems to be that you want the dark red rule to be 7cm long so you can simply use \begin{minipage}{7cm} instead of \begin{minipage}{\linewidth} (and move it back a cm)
@PauloCereda duck (removed) how will we get dinner now?
@DavidCarlisle oh no
19:54
@Gaussler There is now an answer (actually two answers ... one of which uses the l3draw package)
@DavidCarlisle I have a can of pineapples ... we could just eat pizza
@DavidCarlisle I stole your tick ;-(
@cfr the additional setup is just a slower version of \keys_define:nn anyway :) (since it uses ltcmd-argument grabbing)
@JasperHabicht I'd neither recommend kvoptions nor xkeyval anymore. Both are unmaintained and have their limitations. Only very few key=value option parsers are viable, imhbo (that's "in my humble biased opinion), nowadays and those are ltkeys (the thing in the Kernel), expkv-opt, and scrbase (KOMA script) (the last one of these also only partially). These are the only once I'm aware of using the new raw lists, and afaik only ltcmd and expkv-opt support parsing future options.
@Skillmon I also checked both and saw that the last updates are from 2022 or so ... =/
@Skillmon I'd personally use l3keys I guess, since most of the time, I run into an issue which I can solve best with expl3, so why not use this in general ...
@JasperHabicht I should've said "unmaintained or at least don't get new features"
But thanks for pointing to the other possibilities!
20:08
@JasperHabicht that's ltkeys.
@JasperHabicht l3keys and ltkeys use the same implementation, only a few different front facing macros/names. And l3keys doesn't support package/class options, that support is part of ltkeys.
Hi everyone! Apologies for interrupting the discussion with another topic, but I couldn’t help noticing the OP of this question is here in this chatroom
@Skillmon Well, yes. But you can \keys_define:nn and then use \ProcessKeyOptions with these keys, can't you?
@JasperHabicht exactly, because they are the same system underneath the hood.
@EmanueleNardi no harm done. But you'll get her attention easier by directly pinging @UlrikeFischer
@Skillmon Yes this is what I meant: I would prefer the expl3 implementation, because it is easier for me to just think in one "mode"
@JasperHabicht which is totally fine and valid. And for customers I'd use it over expkv-opt myself (though I'm the author of expkv-opt), because of the bus factor of the latter. For my own stuff or in answers here I tend to use expkv-opt or show both solutions.
@JasperHabicht took a quick glance, both were just minimal changes to get the handling of the \@unusedoptionlist right with the updated kernel behaviour. So my point stands: Bug fixes but no development (though that means they're technically still maintained).
20:18
@Skillmon Okay, that's good to know!
I’m developing an expl3 class for typesetting theses at my university. Since the thesis must be written in one of two languages—English or Italian—English is set as the default.

Currently, I’m loading the `babel` package directly within the class. However, if the language is not explicitly set, `csquotes` generates the following warning:

```
Package csquotes Warning: No style for language 'nil'
```

While searching for a solution, I came across a question posted by @UlrikeFischer. However, since it has been eleven years, I suspect there might now be a more modern approach.
@EmanueleNardi If you only have two different languages to support just add an option for these two and use a Boolean switch. Then evaluate that Boolean to either call the first or second line, do the same for csquotes.
cfr
cfr
21:16
@Skillmon that's why I'm too lazy to learn it. (well, ok, I may be too lazy anyway.)
@UlrikeFischer It seems @cfr is to blame for that
cfr
cfr
@barbarabeeton embearssies
@Skillmon Since this is my first experience writing a LaTeX class, I am struggling to navigate the differences between LaTeX2e and more modern syntax (I personally find the LaTeX2e code more readable). I'm unsure how to handle options effectively. Ideally, I would like to keep things simple by allowing users to specify \documentclass{unitnthesis} or \documentclass[italian]{unitnthesis} directly, while also optionally supporting a syntax like \documentclass[language=italian]{unitnthesis}
@EmanueleNardi if english is the default, my question is not relevant - my main problem there was that I wanted a different default language. But you reminded me that the answer is not longer correct, one has to extend \@raw@classoptionslist to, and I extended my answer.
@EmanueleNardi and the real modern idea is that the main language is set with \DocumentMetadata{lang=en} or \DocumentMetadata{lang=it}, but currently this isn't yet picked up by babel.
@DavidCarlisle but I added the answer so I clearly should be rewarded by a larger amount of blame.
cfr
cfr
21:33
@DavidCarlisle it's my fault @UlrikeFischer wrote a better answer?
@EmanueleNardi i think a key-value approach is easier for users and simpler to implement, but I already said this more-or-less. in your question, you said you preferred expl3, but you find 2e syntax more readable?
@Skillmon @JasperHabicht xkeyval was always horrible to deal with. but maybe that's just my ineptitude. but it was certainly more complicated.
@cfr never liked it as well.
@cfr It's easier to understand at first glance, but I prefer the programmable nature of expl3, even though it requires much more effort on my part.
@EmanueleNardi yes, \hb@xt@ is much easier to understand... :P
cfr
cfr
@DavidCarlisle @UlrikeFischer @JasperHabicht and fortunately nobody has mentioned the memoize thing ....
@DavidCarlisle Ah well, I do not have the time to make an in-depth appeal to my case, but the thought behind that question was to benefit students like myself. A lot of my classmates are even worse than me at basic typesetting in LaTeX, and so I thought a question where all the basics are covered in 1 thread along with examples would make it more comprehensible for my peers since it can be hard to know what to search for in particular.
cfr
cfr
21:46
@Skillmon I've been gradually rewriting code which used it just to get rid of it. keyval was not so bad, but just much more limited.
@cfr well, I used pgfopts and later l3keys2e. But I'm only using LaTeX since around 2013 or 2014.
Am I on the right path?

% Define a Boolean for the Italian language
\bool_new:N \l_unitnthesis_language_italian_bool

% Define the language key to process options
\keys_define:nn { unitnthesis / language }
{
english .code:n = { \bool_set_false:N \l_unitnthesis_language_italian_bool },
italian .code:n = { \bool_set_true:N \l_unitnthesis_language_italian_bool },
.default:n = { \bool_set_false:N \l_unitnthesis_language_italian_bool }, % Default to English
}

% Conditionally load the babel package based on the language option
cfr
cfr
@Atex that's really not doable on this site. even if you consider only a very specific group of users, it's too much.
@EmanueleNardi The .default:n is not doing what you think (it should throw an error).
@EmanueleNardi also you're missing the step to actually parse the options.
@cfr that's completely fair. You guys probably know way better than me what kind of questions are possible to execute with success and which aren't. I shall adjust the scope of my "General questions" if I ever intend to ask on behalf of a certain target group in the future!
21:51
@Atex this isn't a tutorial site, for that you should use learnlatex.org or similar, it's a Q&A site, tutorials are not a bad idea, this is just the wrong place for them.
3
@Skillmon I've read about \ProcessKeysOptions and \ProcessKeys, but I'm feeling a bit confused. I think my brain is tired, so it's time to go to sleep and start counting ducks. quack!
cfr
cfr
@Skillmon I suspect pgfopts existed, but I probably didn't find it. l3keys2e probably didn't exist. but I strongly suspect I used the xkv stuff because it was similar to keyval which was similar to the standard options processing and I'd copied code from a modified version of amsbook.cls.
@EmanueleNardi you could do that but it does mean language switching in your class is different to every other document, you could simply use \RequirePackage{babel} and your users could use [italian] or main=english, italian] or whatever and just hav ebabel bick up the options from the \docuemntclass line.
\bool_new:N \l_unitnthesis_language_italian_bool

\keys_define:nn { unitnthesis }
  {
     language .choice:
    ,language / english .code:n = \bool_set_false:N \l_unitnthesis_language_italian_bool
    ,language / italian .code:n = \bool_set_true:N  \l_unitnthesis_language_italian_bool
    ,language .initial:n = english
    ,english .meta:n = { language = english }
    ,italian .meta:n = { language = italian }
  }

\ProcessKeyOptions[unitnthesis]

\bool_if:NTF \l_unitnthesis_language_italian_bool
@EmanueleNardi ^^^
@DavidCarlisle oooh, so it's strictly for questions and clearing up confusions, got it! On that note, I've done a bit of research and heard the The Not So Short Introduction To LaTeX should be a really good read, covering basic typesetting etiquettes and some more introductory stuff. Would you recommend the book for that purpose, or are there better alternatives?
Btw I have seen this thread but there are a lot of differing answers, and some recommend one thing while others disagree etc. so I thought it'd be good to ask you for clarification
cfr
cfr
21:58
@Skillmon @EmanueleNardi but just because the university only accepts theses in two languages, doesn't mean it only accepts two languages in theses. even setting linguists aside, I regularly want extra languages. and, yes, you can add them anyway, but the easy way is still \documentclass[welsh,greek,british]{} or whatever.
@DavidCarlisle How do I do that?
"just have babel pick up the options from the \documentclass line"
cfr
cfr
@Atex you should ask somebody who reads documentation.
@Atex it was one of the first good free alternatives to the (not free) latex book but it was mostly written last century and I don't think it's had a lot of updates since then, so it's a good source for the basic principles but not going to give current best practice . I don't know most of the books in that list other than the latex companion which is essentially the official latex manual, for free up to date sources I'd start with learnlatex.org (but along with Joseph I maintain that)
cfr
cfr
@EmanueleNardi you don't have to do anything. \documentclass[welsh]{<some class>} -> babel and everything else pick up the language. this matters for all kinds of packages: csquotes, fancyref/cleveref, etc. etc.
@EmanueleNardi all packages always do that, you don't need to do anything
cfr
cfr
22:03
@DavidCarlisle I don't think the latex companion is a good place to start, though. it's too overwhelming (and expensive).
@Skillmon So basically this code superfluous
Thank you very much @Skillmon I will use this code for another functionality
cfr
cfr
@EmanueleNardi I would use the key-value stuff for the other things you mentioned needing. but for the language stuff, not. I'd add strings for the two languages using the babel mechanism. then just let the standard processing handle the selection and user options.
@EmanueleNardi that depends. A thesis class for a specific university may have non-standard language requirements, eg you might need to hide the standard babel options and prevent language switching if the university only accepts thesis in Italian for example, allowing the user to do \documentclass[welsh]{yourclass} may be a standard interface but not what you want. You need to choose.
@cfr yes but it's a book I know. Most of the other books I don't know.
@cfr I guess 'expensive' depends on your point of view - to me, for a 'work' book it's pretty cheap
cfr
cfr
@DavidCarlisle but a thesis at berkeley, say, might well want \documentclass[welsh,american]{book}. even though they wouldn't accept a thesis in welsh (I assume), a student of welsh might well want to include welsh in a thesis.
22:12
@cfr yes and in any case using standard options means that other packages like varioref will see them as well, but I wanted to flag the general principle that passing on class options implicitly or explicitly should be a concious decision.
@cfr Can you recommend someone? Or where to find out who reads documentation?
cfr
cfr
@JosephWright yes, but you doubtless have rather more money than I do. but I really meant: it's expensive for a beginner, who might or might not turn out to use latex for more than a semester or two.
@DavidCarlisle The issue I encountered is that when you import Babel using \RequirePackage{babel} in the class without specifying any options, and the class is loaded without any options (e.g., \documentclass{unitnthesis}), the \languagename ends up being Nil. In this specific scenario, I want the default language to be set to English.
Thanks so much for all your advice, happy duck counting!
@DavidCarlisle I'll probably check that out when I have some spare time. Does it only cover basics, or does it also cover some slightly more advanced things such as integrating tikz with the usage of a header like this? I just asked this question because I attempted to figure out myself but failed to replicate the example which inspired me, even though it taught me some nice tikz commands
@cfr @EmanueleNardi Strongly agree with this. I think specifying a language in the class itself is a bad idea.
22:27
@Atex it's mostly a beginner course (but also has an online service so you can interact and run all examples) there are other sites specifically for tikz eg tikz.net (which uses the same online latex example service) (hosted by Stefan at texlive.net but I wrote)
22:47
@DavidCarlisle oh wow, that website looks oddly familiar - It reminds me of this!
23:25
@Atex well given both those are served from the same machine, that's not entirely surprising
@Atex see the sites using texlive.net to run examples. Apart from the learnlatex and the french faq, all the other forums and tutorial sites are run by Stefan on the same host that hosts texlive.net (which I originally ran on an AWS machine until the free trial year ran out, and Stefan offered to host it) list at: texlive.net

« first day (5145 days earlier)      last day (43 days later) »