I'm trying to modify the numeric-comp style so in-text citations appear with parentheses rather than brackets for both \cite and \textcite i.e. [1] becomes (1) and Smith et al. [1] becomes Smith et al. (1).    This was no problem for \cite - I just changed the command:  \DeclareCiteCommand{\cite}[\mkbibparens]   {\usebibmacro{cite:init}%    \usebibmacro{prenote}}   {\usebibmacro{citeindex}%    \usebibmacro{cite:comp}}   {}   {\usebibmacro{cite:dump}%    \usebibmacro{postnote}}   For \textcite, I assumed that I could redefine the textcite macro replacing \bibopenbracket with \bibopenparen and \bibclosebracket with \bibcloseparen, like so:  \renewbibmacro*{textcite}{%   \iffieldequals{namehash}{\cbx@lasthash}     {\usebibmacro{cite:comp}}     {\usebibmacro{cite:dump}\cbx@tempa     \usebibmacro{cite:init}%  \ifnameundef{labelname}        {\printfield[citetitle]{labeltitle}}        {\printnames{labelname}}%      \addspace\bibopenparen      \ifnumequal{\value{citecount}}{1}        {\usebibmacro{prenote}}        {}%      \usebibmacro{cite:comp}}%   \savefield{namehash}{\cbx@lasthash}%   \gdef\cbx@tempa{\bibcloseparen\multicitedelim}}   But when I compile (after running biber) this I get the error "Argument of \@secondoftwo has an extra }". In fact this happens even if I renew the textcite macro to be exactly as it appears in numeric-comp.cbx. Is there something I'm not understanding here, or is it a bug? And is there another way?  (I'm using TeXShop 3.21 on Mac OS X.)  Minimal example to reproduce the error:  \documentclass{article} \usepackage{filecontents} \usepackage[style=numeric-comp, sorting=none, backend=biber, firstinits=true, maxcitenames=1]{biblatex}  \begin{filecontents}{testref.bib} @article{a_reference,     Author = {Smith, A A and Jones, Z Z},     Journal = {A Journal},     Number = {4},     Pages = {267--277},     Title = {A title},     Volume = {75},     Year = {2008}} \end{filecontents}    \renewbibmacro*{textcite}{%   \iffieldequals{namehash}{\cbx@lasthash}     {\usebibmacro{cite:comp}}     {\usebibmacro{cite:dump}\cbx@tempa      \usebibmacro{cite:init}%      \ifnameundef{labelname}        {\printfield[citetitle]{labeltitle}}        {\printnames{labelname}}%      \addspace\bibopenparen      \ifnumequal{\value{citecount}}{1}        {\usebibmacro{prenote}}        {}%      \usebibmacro{cite:comp}}%   \savefield{namehash}{\cbx@lasthash}%   \gdef\cbx@tempa{\bibcloseparen\multicitedelim}}  \bibliography{testref} \begin{document}  We \textbackslash cite \cite{a_reference} and then \textbackslash textcite -\textcite{a_reference}.  \printbibliography \end{document}
Many LaTeX “hacks” begin with \makeatletter and end with \makeatother. What do these commands do?
How do you prevent web pages from appearing in the Google search index? Why does shell Command Substitution gobble up a trailing newline char? Continuity of $L^1$ functions with respect to translation Can one attack for damage after having grappled an opponent? The grappling rules sure are... light. Supposing one has an Extra Attack:   Assuming one has successfully grappled an opponent with one's first attack, can one then perform a normal attack action with one's Extra Attack? Against the grappled opponent or any opponent within reach? Limitations on weapons (e.g. one-handed only)? Assuming one has successfully grappled an opponent with one's first attack, can one's grappled opponent (now with move 0) perform a normal attack action? Against you or against any one in reach? Do advantage and disadvantage (along the lines of restraint) come into play? Are there grappling-specific attacks for damage (e.g. choke-hold)? "It's time something was / were done about the problem." It's time something was done about the problem.   It is a sentence from Murphy's "Grammar". Using was confused me, for me it should be were. It looks like this clause is in subjunctive mood&mdash;something that is unreal / imaginary, and in that case you always use were for any object.  Unless, of course, it is not the subjunctive mood, what would knock me down. Is a 1st-level spell cast using a 4th-level slot a 1st-level spell, or a 4th-level spell? How to integrate a paper where I am third author, but did a lot of work, into my master's thesis? I am writing my thesis currently and I want to include papers that I am included on as an author.  I will have a couple papers where I am 1st author, but there is one where I am third but did a lot of the work.  How do I go about integrating it into my thesis?  Can I copy/paste most of the text still or do I need to rewrite it?  I don't want to plagiarize but don't want to rewrite it if I don't have to. I have a content type with multiple fields. Some of the fields are accessible to everyone and there are other fields for which the access is controlled.   Example: There is a content type called Reports with fields like title, summary, body etc. Title and summary should be visible to everyone but the access to body field is controlled.  For implementing this I need to have 2 view modes. one of them will have the fields title and summary displayed with the rest of the fields hidden. The other view mode will have only the body field visible. I am planning to implement the hook hook_node_access to derive the access permissions for the node. So how can I get the view mode in this hook so that I can have my access check based on the view mode. Why does the order of the loops affect performance when iterating over a 2D array? Methods to find $\lim\limits_{n\to\infty}\frac1n\sum\limits_{k=1}^nn^{1/k} $ What would you suggest here?  $$\lim_{n\to\infty} \frac{1}{n} \sum_{k=1}^{n} n^{1/k} $$ Rotate whole animation by 90 degrees I make my animation and now I realized that its pointed in wrong direction I used -y (native blender) as direction but I need to be pointed at x axis so what would be the easiest way to rotate whole animation, to switch -y with x :) How do I use regular expressions in bash scripts? I want to check if a variable has a valid year using a regular expression. Reading the  I understand I could use the operator =~  Looking at the example below, I would expect to see "not OK" but I see "OK". What am I doing wrong?  i="test" if [ $i=~"200[78]" ] then   echo "OK" else   echo "not OK" fi Does the std::stack in the C++ STL expose any iterators of the underlying container or should I use that container directly? What does the AE/AF lock button do that half-pressing the shutter doesn't? The Sony A6000 has an AEL button, while Nikon SLRs have an AE/AF lock button. What do these do that half-pressing the shutter to lock focus and exposure, and then recomposing, doesn't? I'm used to the latter method, and never used a camera that has a dedicated button.  I read that you have to keep both the AE/AF lock button pressed and the shutter half-pressed while recomposing. Isn't this harder than just keeping the shutter button half-pressed?  I'm aware that you can customize the AE/AF lock button to lock only focus, or only exposure, or both. This leads to two follow-up questions:   Can't you customize the half-press shutter to lock only AE or only AF? If you don't care about this level of customization, does the AE / AF lock button do anything that half-pressing the shutter doesn't? KKT points and nonlinear optimality (theory) I have some questions about Karush Kuhn Tucker conditions. I am not clear about the theory. There are plenty of theorems and I am confused with it. Let us say we have the following problem: We have a general problem, not a convex problem. $$\min f(x)\\g_{j}(x)\le 0,\forall j\in J\\h_{k}(x)=0,\forall k \in K. $$ I will solve it.....Lagrange function, verifying primal feasibility, dual feasibility and complementary slackness and I will get some KKT points. Now what is the conclusion?  If I get no KKT point, can I say that the problem has no solution or what is the conclusion? If I get only one KKT point, is it a local minimum or even a global minimum? If I get more KKT points, what is the conclusion? In which case I will verify SOSC condition? If I get more KKT points or even for one point is it necessary? And the conclusion is what? The KKT points which satisfies the SOSC condition are strick local minimum and the poins which does not satisfy it are not the solution of the problem?  I am so sorry for so many questions, but any help would be very appreciated. Thank you very much in advance. Polygon Touch detection Google Map API V2 Difference between '>' and '-gt' What's the difference between these:  SEC=$(mysql -hxxx -Pxxx -uxxx -pxxx -se "SELECT Seconds FROM tablename")  SEC=100   Both return the same result (100). But when I test it with:  if [ ${SEC} &gt; 1 ] then     echo "SEC GT 1" else     echo "SEC LT 1" fi   The first one returns:  "SEC GT 1"   The second one returns:  "SEC LT 1"   If however, I change it to:  if [ ${SEC} -gt 1 ]   then the result is reversed.  I'm assuming it's got something to do with the datatype, and that I presumbaly need to cast one or the other to get the same result.  It's just that at present it's messing up my testing, as I have to remember to change the IF section every time. What is an intuitive explanation for how PCA turns from a geometric problem (with distances) to a linear algebra problem (with eigenvectors)? I've read a lot about PCA, including various tutorials and questions (such as , , , and ).   The geometric problem that PCA is trying to optimize is clear to me: PCA tries to find the first principal component by minimizing the reconstruction (projection) error, which simultaneously maximizes the variance of the projected data.    When I first read that, I immediately thought of something like linear regression; maybe you can solve it using gradient descent if needed.  However, then my mind was blown when I read that the optimization problem is solved by using linear algebra and finding eigenvectors and eigenvalues. I simply do not understand how this use of linear algebra comes into play.  So my question is: How can PCA turn from a geometric optimization problem to a linear algebra problem? Can someone provide an intuitive explanation?  I am not looking for an answer like  that says "When you solve the mathematical problem of PCA, it ends up being equivalent to finding the eigenvalues and eigenvectors of the covariance matrix." Please explain why eigenvectors come out to be the principal components and why the eigenvalues come out to be variance of the data projected onto them  I am a software engineer and not a mathematician, by the way.  Note: the figure above was taken and modified from . I stumbled upon a  with the following paragraph:     MBIE has launched an investigation into claims Chinese galvanised   steel coil imports have been dumped on the local market, causing   "material injury" to New Zealand industry, and the case will end up on   the table of newly appointed Commerce Minister Jacqui Dean.   I thought that sentence was grammatically wrong because the author should put the word "that" (as a conjunction) right after the word "claim". I don't see why the author could drop the conjunction. Is this a prevailing phenomenon in American or Australian English? Calculate the sum of the infinite series $\sum_{n=0}^{\infty} \frac{n}{4^n}$ A previous problem had us solving $\sum_{n=0}^{\infty} \frac{1}{4^n}$ which I calculated to be $\frac{4}{3}$ using a bit of mathematical manipulation.   Wonderful. Thank you for all the prompt responses.  Could anyone suggest an alternate technique that does not involve differentiation?