« first day (915 days earlier)      last day (4016 days later) » 
00:00 - 21:0021:00 - 00:00

9:01 PM
@MarcoDaniel There are problems with category codes in using \xpretocmd in \ExplSyntaxOn.
[debug] tracing \pretocmd on input line 10
[debug] analyzing '\begin'
[debug] ++ control sequence is defined
[debug] ++ control sequence is a macro
[debug] ++ control sequence is a macro with parameters
[debug] -- macro cannot be retokenized cleanly
[debug] -> the macro may have been defined under a category
[debug]    code regime different from the current one
[debug] -> the replacement text may contain special control
[debug]    sequence tokens formed with \csname...\endcsname;
[debug] -> the replacement text may contain carriage return,
 
@MarcoDaniel no, do you particularly want to use L3 or do you just want to add color to the start of \begin ? as in let\oldbegin\begin \def\begin{color\par\oldbegin} ?
 
@egreg Damn. WIth the current approach I have also no success.
The complete aim is the following:
\NewDocumentCommand \Surroundwithxframed { O{} m }
 {
   \xframed_before_env:n { #2 } { \begin{xframed}[#1] }
   \xframed_after_env:n  { #2 } { \end{xframed}       }
 }

%%use the command only if exists
\cs_new:Npn  \xframed_csuse_withouterrors:n #1
 {
  \cs_if_exist:cT { #1 }
    { \use_c { #1 } }
 }

%%puts material before the environment
%%  \xframed_before_env:n{env-name}{material}
\cs_new:Npn \xframed_before_env:n #1
 {
  \tl_gput_left:cn {xframed_beforebegin_#1_hook}
 }
%%puts material after the environment
I want to ad the new environment xframed before the current environment starts.
@DavidCarlisle I don't want to use such a simple solution ;-). I am trying to adapt everything with L3.
 
@MarcoDaniel L3 is supposed to make things easier:-)
 
@DavidCarlisle ;-) supposed ;-)
 
@MarcoDaniel but don't you want to patch the environment command eg \center not \begin. Of course one of the problems is the interface to 2e, if every latex3 enviornment had a before and after hook you would just add to those token lists using tl_put... but if you have t cope with 2e environments that might just have been defined via \def\center{..} things are less structured...
 
9:09 PM
@DavidCarlisle You are absolutely right. So I must define my own hook.
 
@MarcoDaniel Why not using the method of etoolbox?
 
@egreg I tried it. My aim was/is to avoid loading etoolbox.
 
@MarcoDaniel Use regexpatch, but not in \ExplSyntaxOn
\documentclass{article}
\usepackage{regexpatch}

\makeatletter
\regexpatchcmd{\begin}
  {\A}
  {\c{xframed_csuse_withouterrors:n}  { xframed_beforebegin_\cP\#1_hook } }
  {}{}
\makeatother
\show\begin
Correction:
\makeatletter
\regexpatchcmd{\begin}
  {\A}
  {\c{xframed_csuse_withouterrors:n}  \cB\{ xframed_beforebegin_\cP\#1_hook \cE\} }
  {}{}
\makeatother
@MarcoDaniel Similarly for \end
 
9:27 PM
@egreg End I tried:
\xpatchcmd
 { \end }
 {\if@ignore}
 {
  \xframed_csuse_withouterrors:n  { xframed_afterend_#1_hook }
  \if@ignore
 }
 {
  \msg_info:nnn {xframed} { patching-worked } { \end }
 }
 {
  \msg_warning:nnn {xframed} { patching-failed } { \end }
 }
However I had never reached \end ;-)
@egreg Why \makeatletter?
 
@MarcoDaniel Because \regexpatch does a \scantokens and \begin contains commands with @. This is the patch for \end:
\makeatletter
\regexpatchcmd{\begin}
  {\A}
  {\c{xframed_csuse_withouterrors:n}  \cB\{ xframed_beforebegin_\cP\#1_hook \cE\} }
  {}{}
\regexpatchcmd{\end}
 {\c{if@ignore}}
 {\c{xframed_csuse_withouterrors:n}  \cB\{ xframed_afterend_\cP\#1_hook \cE\}
  \c{if@ignore}}
 {}{}
\show\begin
\show\end

\makeatother
 
@egreg Thanks I tried it in the following example. Unfortunately it fails again. I can cry.
\documentclass{article}
\usepackage{xparse,regexpatch,framed}
\ExplSyntaxOn
\NewDocumentCommand \Surroundwithxframed { O{} m }
 {
   \xframed_before_env:nn { #2 } { \begin{framed} }
   \xframed_after_env:nn  { #2 } { \end{framed}      }
 }
%%use the command only if exists
\cs_new:Npn  \xframed_csuse_withouterrors:n #1
 {
  \cs_if_exist:cT { #1 }
    { \use:c { #1 } }
 }

%%puts material before the environment
%%  \xframed_before_env:n{env-name}{material}
 \cs_new:Npn \xframed_before_env:nn #1 #2
@PauloCereda: Can you check my edit.
 
9:44 PM
@MarcoDaniel Which edit?
 
@tohecz I think you should get noticed of this:
@Speravir I also found tohectz comment a bit rude/offensive - asking for sources is perfectly fine, implying I'm a liar not quite - and replied accordingly. — Thorbjørn Ravn Andersen 15 hours ago
 
@MarcoDaniel Ah cool, it's correct. :)
 
@tohecz … and my reaction:
@ThorbjørnRavnAndersen I’m sure he did not intend in implying this, he was jst asking for a sorce of your statement, and I tried to assist him. Please know tohecz is not a native English speaker (me too BTW, and in sum the most here on TeX.SX), and I am pretty sure you also are not. My very, very wild guess is, you’re living in Denmark. ;-) If you would have written this the way you do now, nobody would have complained. I hope everything’s clarified now. — Speravir 3 mins ago
Oh, my edits of this comment above are not shown here …
@PauloCereda So, the related question is not off-topic, it seems.
 
@Speravir I don't think so. :)
 
9:53 PM
@MarcoDaniel There seems to be a bug somewhere:
\tl_gput_left:cn { l_eg_tl } {xxx}
\tl_show:c {l_eg_tl}
This gives
> \l_eg_tl=macro:
->xxx\l_eg_tl .
that is clearly wrong
 
@PauloCereda What? It is off-topic? ;-)
 
@Speravir LOL it's not offtopic.
I fail grammarz.
 
@PauloCereda So, I guessed right … (hence the smilie)
 
@egreg is l_eg_tl a tl already, or is it undefined (so gets to be \relax ?)
 
@DavidCarlisle It's undefined
@MarcoDaniel Define the variables before using them:
%%puts material before the environment
%%  \xframed_before_env:n{env-name}{material}
\cs_new:Npn \xframed_before_env:nn #1 #2
 {
  \tl_if_exist:cF { xframed_beforebegin_#1_hook }
   { \tl_new:c { xframed_beforebegin_#1_hook } }
  \tl_gput_left:cn {xframed_beforebegin_#1_hook}{ #2 }
 }
%%puts material after the environment
%%  \xframed_after_env:n{env-name}{material}
\cs_new:Npn \xframed_after_env:nn #1 #2
 {
  \tl_if_exist:cF { xframed_afterend_#1_hook }
   { \tl_new:c { xframed_afterend_#1_hook } }
 
9:57 PM
@egreg so I don't think you can use it with \tl_gput_left you need to tl_new it first, it needs to be a macro so it can have stuff added to its definitiin
 
@DavidCarlisle Indeed!
 
@egreg just goes to show error detection is as good as ever: one missing declaration and you silently define an infinite loop:-)
 
@Qrrbrbirlbel Exactly: tex.stackexchange.com/faq#reputation You need rep of 10000 for voting on deleting and access to mod tools, and I guess from this point on you also see “deleted” answers. With my speed of rep increasing I need another 1 a half year.
 
@egreg Thanks you very much. I can sleep without nightmares.
 
!!/battle
 
10:06 PM
@MarioS.E. Psmith is sick
 
@DavidCarlisle No way! what happened?
 
@MarioS.E. apparently sx. changed the APi
 
@DavidCarlisle Well, lets hope he gets well
 
@MarioS.E. but it's 305 @egreg to 275 me. Disgraceful:-)
 
@DavidCarlisle Close...
 
10:11 PM
@MarioS.E. I wondered about answering you pdf question but I don't think I can be bothered tonight, I could answer off the top of my head but probably should check dates and stuff:-) but basically the three are just different.
 
@DavidCarlisle hahahahahahahahahahah
 
10:23 PM
@DavidCarlisle Hey! I had 320 till some minutes ago! :(
 
@egreg glad to see you are moving in the right direction.
 
@DavidCarlisle Herbert answered to a question in the way the question should have been posed. :)
 
Ahoi. I think I'm blackouting at the moment. I think I want to "export" a boolean declared in a class with \DeclareBoolOption{finalsubmission} to "user space", i.e. to the document so that the user can do things conditionally. How would I create a new visible boolean that is linked to the internal one and that the user can use with i.e. \ifthenelse?
 
How do you think about enumitem conflict with french babel? It is solved by updating babel, and so “too localized”. But in MiKTeX (the OP does use this) still babel 3.8m is the recent version, and also in my portable TeX Live Windows I was not able to update for known reasons. What to do? Leave it as it is, since an accepted answer exists?
 
@FrederickNord If you're using kvoptions, then the \ifclassname@finalsubmission conditional should be defined. Here classname should be the name of your class
 
10:28 PM
@egreg it is. But that's messy for the user of the class due to the @.
 
@NicolaTalbot What was this? I just saw you flying away and coming back instantly. So, your avatar went away and came back in the same moment.
 
@FrederickNord \newcommand{\iffinalsubmission}{\ifclassname@finalsubmission\expandafter\@first‌​ofttwo\else\expandafter\@secondoftwo\fi} Then one can write \iffinalsubmission{Yes}{No}
 
@egreg cool. Does it behave like a boolean defined with \newboolean?
 
@FrederickNord Yes.
 
grazie mille
 
10:34 PM
@DavidCarlisle 320 again: TeX.sx users know what answer to accept. :P
 
@egreg You just bribe them with duck pictures.
 
10:50 PM
@DavidCarlisle Ducks always win.
 
@egreg 290:-) (no ducks needed)
 
@egreg BTW Where is this image from? duck.<img-extension>
 
@egreg Did you get it from there, too? I really thought it would be in some Mac or Linux software.
 
11:15 PM
@Speravir Yes, I simply googled for "duck images"
 
@egreg Aah, I simply was misguided, because kan used obviously the same or similar source.
 
00:00 - 21:0021:00 - 00:00

« first day (915 days earlier)      last day (4016 days later) »