« first day (2702 days earlier)      last day (1346 days later) » 

12:15 AM
@PeterGrill Yes, the code at the end (below “Full example”) works for me. (At least, no errors; haven't looked at the output.)
 
@ShreevatsaR Can you complare the output of \listfiles? I must have some package outof date.
 
12:34 AM
@PeterGrill It gives an error on MiKTeX and on ShareLaTeX, but works fine with my TeX Live 2017. I have older versions of etoolbox.sty, mathtools.sty,
 
@ShreevatsaR I am also using TeXLive2017 and all pacakges are up to date as of today.
 
12:48 AM
? ! Undefined control sequence.
\shortintertext ...lbaselines \if_dim:w \if_dim:w
 
@DavidCarlisle Yeah that is what I get
But is seemed to work for @ShreevatsaR
 
@PeterGrill it's one in the morning so I don't care, blame @JosephWright for etoolbox or @daleif for mathtools
 
@DavidCarlisle :-) Good night.
 
@PeterGrill The newer mathtools seems to have stuff like \MH_if_dim:w instead of \if_dim:w … I imagine you need an older mathtools (or rather upgrade Heiko's answer to newer matthools).
 
@ShreevatsaR @PeterGrill ah I recall some conversations about making the mathtools fork of latex3 conventions look less like expl3 as it doesn't actually use expl3
 
12:58 AM
@ShreevatsaR Replacing \if_dim with \MH_if_dim does not seem like it is enough. Just leads to other errors.
 
@PeterGrill ping here if you sort it out or I'll look tomorrow. good night
 
1:24 AM
@DavidCarlisle @ShreevatsaR: Looks like that solution works fine with mathools from TeXLive 2016. Won't work with TeXLive 2017 and changing it is not as simple as replacing \if_dim with \MH_if_dim.
 
 
5 hours later…
6:10 AM
@PeterGrill heikos answer definitely does not match latest mathtools, which was released in 2017, in it the language it is written in (precursor to the expl3 syntax) was redone so it does not clash with expl3. Not really my problem when people mess with internals
 
@daleif Yep, that is what I concluded as well. Unfortinately I am unable to fix as it is in expl3ish form.
 
6:33 AM
@PeterGrill it does not seem Heiko is loading expl3 unless etoolbox is. Then it should be enough to prefix all macros with _ in the name with MH, otherwise, simply search for the rest of the macro name in mhsetup and mathtools.
 
7:02 AM
Dear experts, which one is better? ^^^
Is it clear if I put the percentage sign only in the header?
 
@CarLaTeX I am no expert, but I have a slight preference for the percentage signs in each entry, although it makes the table look slightly more cluttered. I wouldn' really complain much about the lack of clarity when they're in the header, though. After all, the header is where you look when trying to understand the numbers.
 
@HaraldHanche-Olsen Thank you, I also prefer the one with the percentage sign in every row because these are not percentages from a calculation...
 
7:21 AM
:43605848: I tried to replace the` \if_dim` with \MH_if_dim and then other things broke. I'll let Heiko know.
 
 
1 hour later…
8:40 AM
@CarLaTeX Usually the unit should be in the header. With percent (which is not really a unit) most people might find it clearer if it is with each entry.
Also, you should add a half space between number and unit (using \,)
Or using siunitx package
 
8:58 AM
@MartinScharrer Thank you! I'll use siunitx :)
 
geometry update is on ctan:-)
 
@DavidCarlisle cool
 
9:14 AM
@MartinScharrer Did you also remove the need for luatex85 pkg with the new standalone version?
 
@AlexG I added the LuaTeX support patch I got.
 
@MartinScharrer Thanks, this will certainly do.
 
@MartinScharrer thanks and I just did the same to geometry, so that's probably all the main packages updated for luatex now.
 
@AlanMunn sadly no, but I can add one. :)
 
10:03 AM
LaTeX の inputenc で UTF-8 が既定になった場合?
2
 
@DavidCarlisle Good stuff
@DavidCarlisle Should I talk about it in the blog?
 
@DavidCarlisle then the LuaTeX team reveals a brand new non backwards compatible engine in TUG 2018. :)
 
@JosephWright a bit of publicity wouldn't hurt, I feel it's bound to break something unexpected... (eg I hadn't thought of enctex, and our test suite wouldn't have picked that up if fmtutil --all hadn't complained)
@PauloCereda with harfbuzz, hopefully
 
@PauloCereda Probably
 
@DavidCarlisle That would be a welcoming headache. :)
 
10:08 AM
@PauloCereda although you should not do a major update until you have finished your thesis so texlive 2018 should not be a concern for you
 
@DavidCarlisle oh no
 
10:34 AM
@DavidCarlisle What about Latin-1 encoded documents that only rely on fontenc? I know they're wrong, but I think there are several of them around.
 
@egreg We discussed that
@egreg They'll have to be updated
 
@JosephWright Hence we have to be very clear about it and advertise it in big letters. ;-)
 
@egreg that's one reason why I improved the detection of bad utf8 sequences to get a better error message for them
@egreg although the test file I added is:
\documentclass{article}
\usepackage[T1]{fontenc}


%\usepackage[cp1252]{inputenc}

\begin{document}

a\"O ``x'' \ss

aÖ “x” ß

\end{document}
@egreg if that was saved in cp1252 then previously you got no error, now you do, but since the old output was nonsense I think we can argue that this is a feature (I know some examples were not nonsense but...)
 
10:51 AM
@DavidCarlisle You make it more friendly by using "Grüße" ;-). But does the discussion means that you are planning to add the equivalent of \usepackage[utf8]{inputenc} to the format?
 
@UlrikeFischer actually not equivalent, exactly that.
 
Out of curiosity, are you talking about LaTeX 3 here, or a future update to 2e?
 
@HaraldHanche-Olsen 2e, next week
 
Oi. That's going to break documents. But not mine. 8-)
 
@HaraldHanche-Olsen why?
@UlrikeFischer:
 
11:00 AM
@DavidCarlisle Those that don't use \inputenc? I am pretty sure I have seen them in the wild. Never understood why they work.
@DavidCarlisle Or were you asking why mine won't break? ;-)
 
@HaraldHanche-Olsen they work because (in the first weeks of 2e testing) we backed out the error check that stopped them working, but it only works for that subset of latin1 that is the same as T1 so or example it doesn't work for German ß
@HaraldHanche-Olsen such documents will get an error but they can add \usepackage[latin1]{inputenc} or \RequirePackage[2018-01-01]{latexrelease} or they could save the file in UTF-8. Breaking changes are not something we do often but it is that or still be using 8bit encoding default (and not even a standard ISO encoding) for the rest of time.
 
@DavidCarlisle I think it's a good change. And it's so easy to fix broken documents, but still I think it will generate waves. The best fix for most users is probably to change the file encoding to UTF-8. Unfortunately, that is not easy for many users.
@DavidCarlisle I think TeXshop, for example, does not let you change the encoding of an existing file. The workaround is to create a new file with the desired encoding, then copy and paste from the old to the new file.
@DavidCarlisle If only everybody was using emacs!
 
153
Q: fontenc vs inputenc

PhilippI just don't seem to get it. So I come from the german speaking part of Switzerland and naturally I need ä ü ö a lot when I write german texts. So in LaTeX I have the option to go via "a "u "o which isn't really comfortable, or I can use an additional package. So now the confusion starts. I can...

 
@DavidCarlisle This means that they will much more active chars from the start on. What should a document do that want to revert this and reset all catcodes to the "normal" state?
 
@egreg That's the first time I have seen the advice to load fontenc before inputenc. I must not have been paying attention. Why should it be done that way?
 
11:14 AM
@HaraldHanche-Olsen that's partly why I'm discussing it in public here (and opened a public github issue for the same)
@UlrikeFischer currently only using latexrelease to roll back the change. However i did consider adding a new \uspepackage[raw]{inputenc} or some such option with an encoding def file that sets all the 8bit characters to catcode 12, would be easy to add if there is a plausible use case.
@HaraldHanche-Olsen only emacs users really matter
 
@DavidCarlisle I suppose it won't bite until TeX Live 2018 is released. (Those who run the beta version will know how to cope.) So you just need to plan your summer holidays to start the day TL2018 is out.
But very often I come across colleagues' machines having TL installations as much as four years old. They just don't feel like changing something that works for them.
 
@DavidCarlisle I don't know about a concrete use case but as this is the major change I was considering if there are files which more or less expect the chars to be non-active. E.g. would language patterns break if the chars were already active when they are loaded?
 
@UlrikeFischer the chars are active in the patterns anyway as the utf8 patterns use their own decoder, but inputenc is loaded in ltfinal as almost the last thing, after hyphenation, so that should be OK. (at least my format says it's loaded 84 language patterns without complaint)
I suppose I should google to see if there are any answers saying that some package should be loaded after inputenc, as such packages may have problems in the new setup, I'll see what I can find....
 
@DavidCarlisle I guessed that you load it late and after the patterns ;-). But it would be interesting to know if the patterns would break if it were before.
 
@egreg If there are wrong usages of code or typographical doubtful constructs, it's perhaps time to let such document breaks nowadays and force the users that commited this typographical crime to update their documents
 
11:29 AM
@UlrikeFischer yes they would as inputenc typically makes characters expand to whatever is needed eg some funky \ooalign constrict to make a comma-under accent and that doen't work too well in patterns
@ChristianHupfer you wouldn't say that if you were maintaining arXiv and had 20 years worth of legacy documents and you had no idea what encoding they are in and may or may not have declared
 
@DavidCarlisle on should also consider the packages which changes their behaviour depending on the encoding, e.g. biblatex. They will perhaps get questions from their users.
 
@DavidCarlisle I would say: Bad luck ;-)
 
@UlrikeFischer they should only be affected on documents using undeclared 8bit encoding and really there should be very few of them.
 
Another palindrome, but @DavidCarlisle will complain about the '+', of course ;-)
 
@DavidCarlisle Yes, I doubt that there will be large problems but @JosephWright could ping moewe so that he knows what's going on in case a question pops up.
 
11:43 AM
Jun 16 '17 at 12:57, by David Carlisle
@UlrikeFischer first rule of latex maintenance: any change breaks something:-)
 
TikZ pie chart jokes #432523
user image
10
 
12:06 PM
@DavidCarlisle ;-). I think it is a good change.
 
12:27 PM
@HaraldHanche-Olsen It's not really necessary nowadays, but some time ago I got problems when Cyrillic was involved and I found out that fontenc-inputenc-babel was the ordering that solved them.
 
12:42 PM
@percusse LOL
@ChristianHupfer @DavidCarlisle complains about either commas or pluses, it's difficult to avoid his criticisms :):):)
 
1:13 PM
@egreg just got a report that it breaks mltex so (like enctex) i need to guard against that...
 
 
1 hour later…
2:18 PM
Look what my local grocery store is trying to sell me:
Ready to make the pizza.
 
@AlanMunn seems reasonable
 
@ChristianHupfer -- don't say that to a production shop. what you would get then is an increase in cost to produce journals and books, and thus a price increase to customers. we've got books that have been in production for several years, and switching horses in midstream isn't an option. (we even have one book with a contract signed ten years ago; fortunately, the manuscript hasn't been delivered yet, so we can just upgrade the content to the latest active version when it arrives.)
 
@barbarabeeton They are not the sort of places to update their software (LaTeX or anything else) very often though, or at least I'd imagine so
@barbarabeeton Here, our major concern is documents relying on default behaviour rather than having \usepackage[latin1]{inputenc} - largely fixable
 
@JosephWright -- latex, no (still running with telive 16, previous active version tex live 12). however, the microsoft windows software has been updated nearly weekly for the past several months. that's a real pain. don't know about the other users here, but i lose about an hour each time, getting my window arrangements back to where i want them.
 
2:34 PM
@barbarabeeton Hmm
 
@JosephWright which versions of tex and l3build do I use to make travis happy? also I get an error on the TU tests now?
 
@barbarabeeton I was imagining it much like our work instruments: we have loads still running Windows XP
@DavidCarlisle Travis always has the TeX Live release, so you need TL'17 'final'
 
@JosephWright if I use l3build check -e etex it passes all teh main tests then tries TU and gives
Running checks on
  tu-asciiquotes01 (1/9)
Error: failed to find .pdf, .tlg or .lve file for tu-asciiquotes01!
@JosephWright with l3build from tl as well I assume? I'll see what fails...
 
@DavidCarlisle That will happen: you've passed -e etex but it doesn't apply to the TU tests, you want -e etex -c build to restrict purely to the 'main' series
 
@JosephWright -- nope, windows 7 professional. and the exchange server just hiccupped. hung on change of folder for a minute and a half. fie. i miss (al)pine.
 
2:37 PM
@barbarabeeton Also likely pine here: same issues (we are on Office365 at work)
 
@JosephWright ah that makes sense, I thought I wasn't getting that yesterday (but I was doing a full check) I just added -e etex just now to speed things up a bit and got the failure, OK
 
@DavidCarlisle I guess I should provide a better error message in this case
 
running tests again with tl2017...
 
@ChristianHupfer Without any + sign. ;-)
 
@marmot fake news
 
2:45 PM
@DavidCarlisle No, TikZ
 
@marmot as I said
 
@DavidCarlisle What is new about TikZ? And what fake?
 
@marmot it's a fake version of the one true picture mode
 
@DavidCarlisle I see. Then, please, draw the above with the true picture mode. (Please take your time, I am still in hibernation. ;-)
 
 
1 hour later…
3:59 PM
@marmot Your reputation gain at Cheating.SE? ;-)
 
4:28 PM
@ChristianHupfer Not really. I never claimed that (a) this is a reputation gain nor (b) that this has anything to do with me. I just created a palindrome without +. ;-)
 
@marmot I joked about Cheating.SE ... but you seemed to have missed that
 
@ChristianHupfer Well, the whole thing was a joke. (I did not mean to make you angry ;-)
 
@marmot I AM NOT ANGRY GRRRRRRRRRRRRRR ;-)
@PauloCereda: Isn't there a MP episode about self-defense against nudging @marmot s? ;-)
 
@ChristianHupfer I didn't realize that MetaPost had episodes.
 
@AlanMunn Au contraire! Meta Post's Flying Circus, of course ;-)
 
4:35 PM
@ChristianHupfer @CarLaTeX @samcarter @PauloCereda Has anybody ever attempted to decompose the examples of the pgfmanual into small MWEs, each of which just loads just the necessary libraries? Would that even be OK with the copyright? Would that be useful (OK, for me definitely yes)?
 
@marmot I can say only that I've not tried that yet. But you should never, never, never ask me TiKZ related things...
 
@marmot It would certainly be useful. That's the one frustrating part of the TiKZ manual, you can't always tell what's needed to compile the example code.
 
@marmot 1) Never tried 2) I don't think there are copyright problems 3) Absolutely useful, I always go crazy searching for the right library to use ;)
 
@AlanMunn Yes, this the way I feel, too. BTW, here's a question for you: I read very often that "a particle has a heavy mass", even if the author is a native speaker. Is such a phrase OK? (I thought a mass can be large, not heavy.)
 
@marmot Sounds odd to me too.
 
4:41 PM
@CarLaTeX OK, let's assume that someone starts this. Is there a way to post the outcome somewhere? I guess a simple question & answer may not be appropriate, or is it?
 
@marmot You could post it on CTAN, there are also only-documentation package, see here, for example: ctan.org/pkg/docsurvey
 
4:53 PM
user image
4
@ChristianHupfer ^^^^^
 
@JosephWright I just realised my texlive 2017 isn't exactly "as delivered" ...
 
@UlrikeFischer In Czech language Grrrr is a whole book, most likely ;-)
 
@CarLaTeX I don't think that this something that a single person (or duck or marmot) might want to do in her or his spare time, and even if this person wants to do it, it might not want to maintain the whole stuff. And as for CTAN, if someone searches for LaTeX related stuff with google, (s)he usually ends up on the main site, not on CTAN.
 
@AlanMunn Like cold temperatures and expensive prices. No, most of the time the price is free – you can get it just by asking – even if the item in question is expensive.
 
4:55 PM
@JosephWright must a config-file in l3build (for special tests) start with "config"??
 
@HaraldHanche-Olsen Oh god, don't lets have another discussion on adjective meanings. :)
 
@marmot outside of scientific use mass and weight are treated pretty much as synonyms I would say (although I suppose even weight should really be larger rather than heavier)
 
@AlanMunn There's been one here before? Sorry.
 
@HaraldHanche-Olsen Not here. Happening in parallel (and I'm just joking).
 
Argh. So I spent (at least) two hours answering a question, I believe it was a good answer, but the OP hasn't accepted the answer. In this case I think it's either that the OP doesn't know about this or maybe just haven't returned. But this isn't the only occurrence and it's very frustrating! Is there anything that is done about this? Like a review queue accepting answers or the like?
 
4:57 PM
@HaraldHanche-Olsen deja vu is the rule here, you should know
 
@marmot I don't know, then...
 
Mar 22 at 16:26, by Harald Hanche-Olsen
@ChristianHupfer What, joking on tex.se? Heresy!
 
@AndreasStorvikStrauman Only the questioner can accept an answer. And many people don't, especially if they are new users who pop in for one question and leave.
 
@AndreasStorvikStrauman how long ago often you get an acceptance a few months later
 
@DavidCarlisle Or even years. (Happened to one of my answers recently.)
 
4:59 PM
@DavidCarlisle ... yesterday. Yeah I regularly log in to StackOverflow (haven't been active there in a while) and from time to time I suddenly have accepted answers from a loong time ago.
But why isn't there a review queue? This has to have been discussed in meta at some point?
 
@AndreasStorvikStrauman oh well nothing strange at all then, especially at a weekend,
@AndreasStorvikStrauman how can you have a review queue??? If other people think it is a good answer they vote, perhaps 100 people vote and you get a great answer gold badge, but only the OP can say if they used that answer and give an accept or not.
 
@AndreasStorvikStrauman Just think of al these sites as a big sociology experiment.
2
 
@AndreasStorvikStrauman Acceptance ≠ correct. It's whichever answer helped the OP, and nothing more.
 
@DavidCarlisle Well, I was thinking if the answer clearly answers the asked question, and the solution worked, then it should be accepted. Couldn't that work?
@marmot hahaha x)
@AlanMunn I guess....
 
@AndreasStorvikStrauman no, people vote if they think it is the right answer, people give the accept tick if they use the answer (even if it is wrong)
 
5:06 PM
@DavidCarlisle Huh. Guess I'll just have to learn to live with it :p
 
@AndreasStorvikStrauman For some evidence, see: tex.stackexchange.com/help/badges/39/populist
 
@AndreasStorvikStrauman @egreg would never have the rep he had if people only gave the tick to correct answers.
2
 
@DavidCarlisle Ouch xD
 
@DavidCarlisle Yes, it would be even higher then ;-)
 
@marmot I thought you were asleep
 
5:17 PM
Tikzducks rule TeX.SE!
2
 
5:29 PM
I've lost the ability to add comments with links. (Firefox). Anyone seeing this?
 
@AlanMunn How so? Using the markdown syntax, with link text in square brackets followed by the link in parentheses? (On the main site, I assume?) I have a hard time seeing how it could be browser dependent.
 
@HaraldHanche-Olsen It might be that my ScriptMonkey script to insert the link is interfering since my FF just updated.
 
@AlanMunn I see. I have always just done it by hand.
 
@HaraldHanche-Olsen It's a nice script: you copy the link and it automatically rewrites it with the question title and the link. I.e. copy https://tex.stackexchange.com/q/xxx -> [Question title](https://...).
 
5:49 PM
@marmot If you had included the top user on the left hand site, it would be 3/4 with the tikzduck tag :)
@marmot This would probably be very helpful! I usually end up searching on tex.se for the missing library :) However I'd suggest to ask the authors first what they think of this idea. Maybe one could do this as a github repo or something, so everyone willing to participate could do so.
 
@samcarter Do you know how to contact the authors (without going on their nerves)? (I'd be happy to work on some reasonable fraction of these MWEs, but the whole manual would take longer than the rest of the hibernation time...)
 
@samcarter I'm not ducking your tikzducks question about improving the package :) you asked earlier here. One thing that struck me about the code was that all the extra things like clothing etc. are just a series of \if statements, and each of the attributes are independently defined with \def\duck@foo{#1}. A consequence of this (I think) is that you can't e.g. define a new attribute in a user document. Is this right?
@samcarter So some helper macros that would allow people to make new attributes would go a long way to making things more modular I think.
 
6:08 PM
@marmot There is a soureforge page, including a ticket system for feature requests and a discussion site sourceforge.net/p/pgf/discussion (Not sure what the best strategy is ...)
 
@marmot Looking at the code preamble for the manual it has the helpful comment: % We need lots of libraries and the proceeds to load 60. :)
 
@AlanMunn Thanks for your feedback! In the long run, this would certainly be a nice thing to have, however I currently have no good idea yet how to make the code more modular.
 
@samcarter Would it be possible to make each attribute a style instead of an \if... inside \duck@draw?
 
 
2 hours later…
8:35 PM
Hello Martin Scharrer,

CTAN has successfully received an upload.

Package: texdef
Version: 1.8
Changes:
* Added "dvitex" and "dvilatex" as formats. These will set DVI mode on "tex" or "latex".
* Escaped further braces in regexs to avoid "Unescaped left brace in regex is deprecated" warnings or errors.
* Added option '--texoptions' to allow the passing of compiler options for special cases.
 
@percusse Hi, how are you?
 
@samcarter you won't get much distance. Not only they visit the bug tracker every 3 years but also sourceforge is just... not good.
@AlanMunn 'ello! It's good. How do you do much-esteemed sir?
I have no idea what esteemed means but you probably have a lot of it.
 
@percusse lol I'm fine thanks.
 
@AlanMunn Any breakthrough in the linguistic world yet? Do I still need to learn the languages the hard way?
 
@percusse Although esteem is something you have for others I think. So we can have it for each other.
@percusse Just tell your brain to do deep learning. It's simple. :)
 
8:40 PM
@AlanMunn Somebody esteemed for you then :D
@AlanMunn I am doing enough data-science lately for 5 people. I don't think that's a viable option anymore
 
@percusse Are you still in the Netherlands?
 
@AlanMunn Yes. It's been a cold winter. My nipples basically disappeared from prolonged contraction.
Or fell off. I didin't notice
 
@percusse I just saw a fantastic dance group from there: Nederlands Dans Theater. If you like modern dance, go see them. They're amazing.
@percusse How cold is cold? (Of course it's made much worse by the perpetual dampness of Holland.)
 
@AlanMunn Yes, they are kind of a big deal here. We occasionally go, my old neighbor is a dancer there.
@AlanMunn It was roughly around -2 but it feels like your skin is peeling off because of the wind and humidity.
 
@percusse I figured you might have seen them. I saw them in Berlin many years ago, and now again last night. I had forgotten how great they are.
@percusse -2? That's nothing. Come to Michigan and experience proper cold. :)
 
we had -10 here in frankfurt, but it felt like -40 because of strong winds
even my husky mix felt cold
 
Check out 1:00 minute mark it's super fun
 
@percusse Ok, you win! In the second clip, is that a tardis? :)
 
@AlanMunn Nah not for competition. It was really screwed up. Climate change and whatnot.
 
@percusse Yeah, it looks terrifying, actually.
 
8:49 PM
@AlanMunn Portable toilet :) I guess tomato-tomato
 
@percusse Clearly it's having a shitty day.
 
@AlanMunn Oh and the pun seal is broken hahah
 
@percusse Have you seen our rune seeker? "I want TikZ". It's not really clear what that even means.
 
@AlanMunn It's the internet. All kinds of people end up all kinds of places
 
@percusse These days it's full of ducks.
 
8:52 PM
@AlanMunn Yea apparently I'm missing the latest gag about ducks. There is a lot of stuff happening under tag
Gotta run. Good night everybody!
 
@percusse Bye
 
 
1 hour later…
10:11 PM
@AlanMunn @samcarter Well, in my opinion it might be rather straightforward: scan the code for the examples and put each of them in a standalone that only loads the relevant libraries. It's the second step which will be tedious. One might scan for codeexample environments in the various files that are included pgfmanual-en-main-body.tex and put them into standalone documents. Then one has to guess which libraries are needed. But clearly one needs to check back with the authors first.
 
10:22 PM
@marmot Of course, but as you say, it's a big undertaking, just to do that.
 
@AlanMunn Maybe ... or maybe not ... The first step can almost certainly be done by a Perl script (say). And as for the second step, I think that most of the snippets only use one or two libraries, and very often it is rather obvious which they are. (Am I allowed to write "they" here even if it's only one library ;-) On a larger scale, the perhaps most pressing issue might be to link these MWEs to the pgfmanual. This will be only possible with the help of the authors, I think.
 
Hey all. I have a stupid question. What does ## do in (re)newcommand?
If I do something like \newcommand{\publicCommand}[1]{\newcommand{\private@command}{foo: ##1}}, does ##1 expand to the argument of the "first" newcommand?
 
10:42 PM
59
Q: What is the meaning of double pound symbol (number sign, hash character) ##1 in an argument?

adnI've seen sometimes that people use a double pound sign (##) when defining/using arguments. What is the difference between the normal argument, #1, and the double sign one, ##1? Are there any restrictions for its use? Can you list the good practices, if any, for this type of arguments.

@Landak E.g.
\documentclass{article}
\newcommand{\mycmd}{}
\newcommand{\foo}[1]{\renewcommand{\mycmd}[1]{\csname#1\endcsname{##1}}}
\begin{document}
\foo{emph}
\mycmd{Test}
\foo{textbf}
\mycmd{Test}
\end{document}
So ##1 is the equivalent of #1 of the embedded \renewcommand if that \renewcommand weren't embedded. Each layer of embedding doubles the number of #.
 
10:59 PM
That makes sense
Thank you!
I'm trying to make a class file for the journal I publish in most often as there isn't one on the web and I thought it would be a nice thing to do
 
@Landak TeX must distinguish between the arguments of the outer and the inner macro, so it uses ##1 etc for the inner one. If you would use #1 for the inner it would apply that one, which is not what you want here, most likely
 
yes
That is what I thought -- I was just getting slightly confusing messages probably because of the lack of csname / endcsname
 
@Landak What are you trying to do, specifically? You may not need \csname etc. I just used that because it came into my head...
 
I'm trying to parse a default option to chead, part of the fancyhdr package that can be over-written by a "user friendly" macro like \runningtitle as opposed to having to \makeatletter\renewcommand{\somethingPrivate}{...
Hmn
that doesn't appear to work
 
@Landak Most of fancyhdr commands could just be done with simple wrappers, except for redefining the various mark commands. Perhaps you're complicating things unnecessarily?
 
11:10 PM
Writing those 'simple wrappers' are essentially what I'm trying to do
 
@Landak So maybe give me a concrete use example and I can get you on the right track.
 
Thank you :-).

Example.tex:

\documentclass[a4paper]{mrmarticle}
\usepackage{lipsum}
%\mrmrunningtitle{A new running title}
\begin{document}
\title{A Paper}
\author{Me}
\date{Now }
\maketitle
\section*{Hello world!}
\pagestyle{fancy}
\lipsum
\end{document}
Relevant bit of mrmarticle.cls:

\RequirePackage{fancyhdr}
\newcommand{\mrm@runnningTitle}{A default title} %I'd like to set this to the title if defined
\newcommand{\mrmrunningtitle}[1]{\renewcommand{\mrm@runnningTitle}[1]{\csname#1\endcsname{##1}}}
\chead{\mrm@runningTitle}
 
@Landak And you want mrmrunningtitle just to set the \chead?
 
Yes
and if it's not called just set chead to title
 
@Landak Got it. Hang on.
 
11:15 PM
At the moment, compiling that example.tex results in an error I don't entirely understand -- ./example.tex:12: Undefined control sequence.
\f@ncyoch ->\mrm@runningTitle
\strut
l.12 \end{document}
Thank you!
 
\documentclass{article}
\usepackage{fancyhdr}
\makeatletter
\newcommand{\default@chead}{My default}
\let\mrmrunningtitle\chead
\mrmrunningtitle{\default@chead} % put this in your class
\makeatother
\mrmrunningtitle{User defined title} % user uses the same thing
\pagestyle{fancy}
\begin{document}
Some text.
\end{document}
This is the simplest way: just use \let to make your user command a synonym of \chead.
 
Yes
That makes sense
 
@Landak At least in this case, there's no need to redefine anything.
@Landak Another common wrapper technique is e.g. \newcommand{\my@internal}{foo}\newcommand{\setinternal}[1]{\renewcommand{\my@in‌​ternal}{#1}}
 
That's what I thought I'd done originally, but without the optional [1] and the lack of [1] the second time around
I'd tried \newcommand{\my@internal}{foo}\newcommand{\setinternal}[1]{\renewcommand{\my@in‌‌​​ternal}{##1}}, which failed
I think I now see why
Thank you very much for your help
Some more silly questions -- what variable actually holds the contents of \title, if it's been called?
 
@Landak It's kind of weird: they (\title, \author etc.) are stored in \@title etc. but reset to {} after \maketitle is issued. So standardly they are unavailable. See:
74
Q: Use the values of \title, \author and \date on a custom title page

Tiago VelosoI am trying to create a title page of my own. Is there a way to make use of the \title, \author and \date commands inside the title page? For instance: ... \title{Something Cool} \author{Cool Dude} \date{\today} \begin{document} \begin{titlepage} The title is \title It was written by \author...

 
11:32 PM
Hmn
They're also always blank when the class is called
hence \@title expands to an error
I've renewed the definition of maketitle to create a local copy of @title, done a default of \let\my@internal\relax and then also edited maketitle to change \my@internal to @title
that works
Thank you very much for your help -- I'm off to bed now
 

« first day (2702 days earlier)      last day (1346 days later) »