I've been using this code to change the appearance of references (enclosing the number within round brackets):  \let\oldref\ref \renewcommand{\ref}[1]{(\oldref{#1})}   After that, I wanted to make references "clickable" so I added the package hyperref using the hidelinks option:  \usepackage[hidelinks]{hyperref}   The links work fine but I'm wondering why the brackets are no longer visible. Obviously hyperref is redefining \ref but \let should update my definition too. This is independent of the order in which those instructions appear in the code. Where's the problem?
I'm editing a book that includes about 25 papers written in LaTeX by different authors.  Since many of them use the same \label, to avoid collisions I redefined the \label command (and \ref and \pageref and \cite and \bibitem)  so that if the third paper has  \label{main_theorem} the aux file actually uses the tag "iii:main_theorem", and \ref{main_theorem} actually refers to the same tag.  I did a similar thing for \cite and \bibitem.  %*************** bib/cite hacks \let\TheReal@citex=\@citex \let\TheReal@bibitem=\@bibitem \let\TheReal@lbibitem=\@lbibitem \gdef\@lbibitem[#1]#2{\TheReal@lbibitem[{#1}]{#2\roman{chapter}}} \gdef\@bibitem#1{\TheReal@bibitem{#1\roman{chapter}}} \gdef\@citex[#1]#2{% \toks@={}\count@=0% \@for\@citec:=#2\do{% \advance\count@ 1 \ifnum\count@=1\edef\0{\the\toks@\expandafter\expandafter\noexpand\@citec\roman{chapter}}% \else\edef\0{\the\toks@,\expandafter\expandafter\noexpand\@citec\roman{chapter}} \fi% \toks@=\expandafter{\0}}% \TheReal@citex[#1]{\the\toks@}% } %************** label/ref/pageref hacks  %%%%%%%%%%%%% must be before ams pkgs \let\TheRealLabel=\label \let\TheRealRef=\ref \let\TheRealPageref=\pageref \gdef\label#1{\TheRealLabel{\roman{chapter}:#1}} \gdef\ref#1{\TheRealRef{\roman{chapter}:#1}} \gdef\pageref#1{\TheRealPageref{\roman{chapter}:#1}}   This all worked fine until I used hyperref, which seems to ignore the redefinition of \label, whether I load it before or after the above code.  Any suggestions?  It would be nice if the redefinition would work whether or not hyperref was loaded, so I don't want to just grab the defintion of \label out of the package and tweak it.  I'm also open to alternative methods.  Redefining \label and \ref just seemed the most straightforward (to me) solution.  Note that I also want to be able to refer to the inner labels from outside, as well.  For example, I might want to say "the main theorem of the third paper is  \ChapRef{iii}{main_theorem}  from within the introduction (a different chapter).
XPath select node with namespace "Be yet to do" vs "have yet to do" This theory has yet to be proven. This theory is yet to be proven. This is yet to be done. This has yet to be done. I have yet to spend summer in the mountains. I am yet to spend summer in the mountains.  Are they all correct? How are &quot;have yet to do&quot; and &quot;be yet to do&quot; different? Thank you! How to draw a torus Is there an easy way to draw a contour image of torus below with tikz? Or for that matter with any other graphics package. How can I make subsections lose the section number within the section and gain the section number outside it? For a paper I am typesetting, the author wants subsections to be written with single numerals.  So far, OK,   \renewcommand{\thesubsection}{\arabic{subsection}}   does the job.  Yet frequently, he wants to cite the subsection in a later section, and wants both section and subsection numbers in references; i.e., he wants to quote Section 1.1 from Section 2.      My current workaround is to give both the section and subsection numbers in the reference.   MWE  \documentclass[11pt]{amsart} \usepackage{hyperref} \usepackage[backend=bibtex,citestyle=alphabetic]{biblatex} \renewcommand{\thesubsection}{\arabic{subsection}}  \begin{document} \section{A section} \label{sec:first} \subsection{A subsection} \label{subsect:first} Something cool. \section{New section} Now I want to cite the coolness in Section~\ref{sec:first}.\ref{subsect:first}. \end{document}     This works fine, except that the hyperref is set up so that if you click on the first 1, you go to Section 1, not Subsection 1.  Yet I would prefer that both numerals go to the same place in the hyperref links.       I could just wrap each such citation in \renewcommand{\thesubsection}'s, but is there  an easier way to add section numbers when citing subsections from a different section?   Note: Since I'm using biblatex, titlesec is not applicable. A saying for something that's good but also has a downside I'm trying to transition from a list of pros to a list of cons, and would like to have some sort of transition quote. Something in the form of,  "But, alas, (((something something quote quote)))"  Everything that has a beginning has an end, something along the lines of that. What exactly is weakly informative prior? Is there a precise definition of weakly informative prior?  How is it different from a subjective prior with broad support? What's the difference between the 'ref' and 'out' keywords? I'm creating a function where I need to pass an object so that it can be modified by the function. What is the difference between:  public void myFunction(ref MyClass someClass)   and  public void myFunction(out MyClass someClass)   Which should I use and why? Drafts for edits get lost on leaving the Android app When editing in the Stack Exchange Android app and navigating away to get some reference URLs the text is gone when I go back into the app.  Seems like the edit isn't kept in memory. Can you please save them in memory? (drafts) Plotting discontinuous functions without spurious vertical segments Convergence of $U_n=\frac{1}{\sqrt{2n\sigma^2}}\left(\Sigma X_j-\Sigma Y_j\right)$ - central limit theorem Suppose that $U_n=\frac{1}{\sqrt{2n\sigma^2}}\left(\Sigma X_j-\Sigma Y_j\right)$,  where $X_1,X_2,\ldots$ and $Y_i,Y_2, \ldots$ are i.i.d. sequences of random variables with mean $\mu$ and variance $\sigma^2$ and the sequences $\{X_i\}$ and $\{Y_i\}$ are independent.  Then, for all real numbers $x$, show that, as $n\to \infty$,  $$\mathbb{P}(U_n\leq x) \to  \int_{-\infty}^{x} \frac{1}{(\sqrt(2\pi))} \:e^{-\frac 12{u^2}}\mathrm du $$ Approach  I tried to carry out the integration on the right, but this does not integrate nicely. It ends up involving an error function, so I figured this was the wrong was to go.  Should I be looking at convergence in probability to answer this question? Is Chebyshev's inequality relevant here? If so, how and how does that relate to the integral? Can I see which seats are available on a British Airways flight before I book? I currently have a 75% credit utilization, which I know is not favorable on about 35,000 revolving credit.  I am getting my year end bonus and plan on using that to completely pay off all of my credit cards leaving me with a 0% credit utilization.  Currently my credit score is 668, mostly due to my utilization, I pay everything on time, but just have too much debt, which is why i'm paying it all off.  My question is how much will paying off all my revolving credit and having a 0% utilization on 35,000 credit availability positively effect my credit score? Let's say we have $2$ particles facing each other and each traveling (almost) at speed of light.    Let's say I'm sitting on #$1$ particle so in my point of view #$2$ particle's speed is (almost) $c+c=2c$, double light speed? Please say why I am incorrect :)    EDIT: About sitting me is just example, so in point of view of #1 particle, the second one moves at (almost) $c+c=2c$ speed? Just installed Ubuntu 17.10 and it seems that the keyboard layout switching has changed its behavior.  In the previous version of Ubuntu (such as 16.04 Unity), if I have 3 different keyboard layouts (for example EN-TH-JA), hitting Super+Space would always cycle to the next layout in the same order (e.g. EN to TH to JA then back to EN).  However since Ubuntu 17.10, this is no longer the case. It cycles through the layout in the MRU (Most Recently Used) ordering. So suppose that the layout starts with EN, then I cycled to TH. Next time I hit Super+Space, it would give me EN instead of JA.   I tried to dig up and found that the culprit is the newly implemented DCONF settings inside org.gnome.desktop.input-sources and there seems to be no way to change this behavior.   So my question is: Is there a way to change this behavior to "static ordering" of keyboard layout switching?    (As a side-note, the new behavior is very bad when we have three or more layouts. Most of the time we as a user couldn't remember the MRU layouts, so layout switching is very inconvenient and much slower than already knowing what the next layout would be if static ordering is used.)  If there is no settings to change this behavior, where should I report this as a bug or a feature request? Write18: capturing shell (script) output as command/variable? Let's say I compile the following file with pdflatex -shell-escape test.tex:   \documentclass{minimal}  \begin{document}  File listing is:  \immediate\write18{ls /usr}  \end{document}   This will send the output of the command ls /usr to report/log of pdflatex (primarily to stdout).   There are then two cases I'd like to utilize:    The output of ls /usr being included directly in the document (LaTeX stream). The output of ls /usr becoming the contents of a \newcommand (by this I mean, that I'd like the script to be executed when the \newcommand is executed first - and upon subsequent calls to the new command, the shell code should not be executed anew).    I have read through , but I'm not sure if this "pipe input" can be applied to \newcommand.   I have also read through  - and it seems that Tex' file I/O should be used; but I'm quite disliking the fact that I'd still have to redirect the script output (actually, in this case, the ls /usr output) to a file, and then read it in, to have it as contents of a command.   So, is there an easier way to achieve what I'd want (hopefully, illustrated through an example based on the above code)?     EDIT: Ehm, I should have asked one more question earlier :) I'll try with an edit here, although it will probably get missed .. :)   I originally asked for a \newcommand that will execute shell code only upon its definition (i.e., in a sense it is "cached"); and the answer from @egreg does exactly that. But then - would it be possible to have a different \newcommand definition, such that each time this newcommand is called, the shell command is executed anew? I.e. executing something like \@@input|"cat tempfile" (which cannot be executed as such), where tempfile changes between calls? Prove that $n^3=n \text{ mod }6$ for every integer $n$. Prove that for every integer $n$ , $n^3=n \text{ mod }6$  I was having no clue how to do this, then I thought of case-by-case analysis and obviously it worked. The problem is that there were six case and together they are long.   Is there any shorter method of proving this. Kindly provide some hints. Whats this white stuff on my board? The cartesian product $\mathbb{N} \times \mathbb{N}$ is countable I'm examining a proof I have read that claims to show that the Cartesian product $\mathbb{N} \times \mathbb{N}$ is countable, and as part of this proof, I am looking to show that the given map is surjective (indeed bijective), but I'm afraid that I can't see why this is the case. I wonder whether you might be able to point me in the right direction?  Indeed, the proof begins like this:  "For each $n \in \mathbb{N}$, let $k_n, l_n$ be such that $n = 2^{k_n - 1} \left(2l_n - 1 \right)$; that is, $k_n - 1$ is the power of $2$ in the prime factorisation of $n$, and $2 l_n - 1$ is the (necessarily odd) number $\frac{n}{2^{k_n - 1}}$."  It then states that $n \mapsto \left(k_n , l_n \right)$ is a surjection from $\mathbb{N}$ to $\mathbb{N} \times \mathbb{N}$, and so ends the proof.  I can intuitively see why this should be a bijection, I think, but I'm not sure how to make these feelings rigorous?   I suppose I'd say that the map is surjective since given any $\left(k_n , l_n \right) \in \mathbb{N} \times \mathbb{N}$ we can simply take $n$ indeed to be equal to $2^{k_n - 1} \left(2l_n - 1 \right)$ and note that $k_n - 1 \geq 0$ and thus $2^{k_n - 1}$  is both greater or equal to one so is a natural number (making the obvious inductive argument, noting that multiplication on $\mathbb{N}$ is closed), and similarly that $2 l_n - 1 \geq 2\cdot 1 - 1 = 1$ and is also a natural number, and thus the product of these two, $n$ must also be a natural number. Is it just as simple as this?  I suppose my gut feeling in the proving that the map is injective would be to assume that $2^{k_n - 1} \left(2 l_n - 1 \right) = 2^{k_m - 1} \left(2 l_m - 1 \right)$ and then use the Fundamental Theorem of Arithmetic to conclude that $n = m$. Is this going along the right lines? The 'implicit' definition of the mapping has me a little confused about the approach.    On a related, but separate note, I am indeed aware that if $K$ and $L$ are any countable sets, then so is $K \times L$, so trivially, taking the identity mapping we see trivially that this map is bijective and therefore that $\mathbb{N}$ is certainly countable (!), and thus so is $\mathbb{N} \times \mathbb{N}$. Hence, it's not really the statement that I'm interested in, but rather the exciting excursion into number theory that the above alternative proof provides. How do you join on the same table, twice, in mysql? I have 2 tables. One (domains) has domain ids, and domain names (dom_id, dom_url).  the other contains actual data, 2 of which columns require a TO and FROM domain names. So I have 2 columns rev_dom_from and rev_dom_for, both of which store the domain name id, from the domains table.  Simple.  Now I need to actually display both domain names on the webpage. I know how to display one or the other, via the LEFT JOIN domains ON reviews.rev_dom_for = domains.dom_url query, and then you echo out the dom_url, which would echo out the domain name in the rev_dom_for column.  But how would I make it echo out the 2nd domain name, in the dom_rev_from column? How to customise GNOME default background and lock screen image? I am building a Custom ISO of Ubuntu 18.04 LTS using CUBIC and I'd like to change the default background and lock screen image.  I added the backgrounds in /usr/share/backgrounds, changed the background in /usr/share/gnome-background-properties/ubuntu-wallpapers.xml file, but it does not seems to affect new users (for example the OEM user).  Also, I did not find any way to change the lock screen image.