Is there a `for each` loop in primitive (La)TeX? I am trying to iterate over the list of all basic colours:  \def\thecolors{black, blue, brown, cyan, darkgray, gray, green, lightgray, lime, magenta, olive, orange, pink, purple, red, teal, violet, white, yellow}   I want to define a command for each of them with some kind of for each loop, more or less as follows:  \foreach \x in \thecolors%   {\newcommand{\csname command\x\endcsname}     {\textcolor{\x}{Some text including the string \x.}}   I know this is more or less the way to do it with pgf/tikz, but I was wondering whether there is a way to do it only with (La)TeX primitive commands.  Thanks in advance for any answer.  PS: Do I need to explicitly define \thecolors or are LaTeX basic colours already stored in some command?  EDIT  I don't think this is a duplicate of  since it explicitly asks for a (La)TeX primitive method.
How to iterate over a comma separated list? How can I iterate, loop, process, or otherwise do something, with each element from a comma separated list of things?  This question       , and the are already lots of very good answers everywhere. However I think it would also be valuable to have a single reference point where all such alternative techniques are explained in detail, with their advantages and disadvantages discussed.  All of plain-TeX, LaTeX, LaTeX3, LuaTeX, Context, etoolbox, pgffor, etc. answers are invited. Please consider explaining, for example:   How does the command/method deal with whitespace around items? How does the command/method deal with empty/missing items? (e.g. a,b,,c) How does the command/method deal with a trailing comma? Can the command/method work of a list stored on a macro? Is each iteration evaluated globally or on a local group? (i.e., if a command is defined during an iteration, does the command survive the loop?) Do items get expanded or somehow mangled before being processed? What about lists where items are key=value or some other kind of pairs? Does the method work for lists separated with something other than a comma? Any other thing I should know before deciding to use this method?
Re-use Mavericks install file I have three Macs I want to upgrade to Mavericks.  Is there a way of re-using the install files, so I don't have to do three separate 5gb downloads? I understand that the output voltage is determined by the ratio between the two resistor values, and that if the both resistors are same then output voltage will be exactly same for all; but what's the basis of picking the resistor values?there is any need of consider output current to choose resistor value. Is it possible to call the base method from a prototype method in JavaScript if it's been overridden?  MyClass = function(name){     this.name = name;     this.do = function() {         //do somthing      } };  MyClass.prototype.do = function() {       if (this.name === 'something') {         //do something new     } else {         //CALL BASE METHOD     } }; Strange distance measurements in distance matrix I'm trying to create a distance matrix between two point shapefiles in QGIS 2.6. Both are in WGS84 UTM Zone 30N co-ordinates (and so is the project file), but the distance matrix returns values such as 5673346.938, instead of expected numbers of between 1 and 5km.  I saw a similar thread mentioning disabling 'on the fly projection changes' - I've done this, and no change. Threads already checked:     Here are samples of the two shapefiles I'm using, stripped down to just ID and location. How do I install Ubuntu to a USB key? (without using Startup Disk Creator) In the experiments for photoelectric emission, the light is incident on one face of the emitting plate, for example the anode, when determining the stopping potential. The electrons are emitted by this face of the plate. Why are the electrons emitted in the direction of the incident light, and not opposite to it?  I have read a little about photons (the key words being, a little), and from what i gather, they have an intrinsic momentum $p=h/\lambda$, which is transferred entirely to the particle that absorbs it (along with the energy $h\nu$). This should imply that the electrons try to move further into the cathode, and not escape it! What is the fault in the reasoning?  Thanks! Evaluate : $1+\frac{2}{6}+\frac{2\cdot 5}{6\cdot 12}+\frac{2\cdot 5\cdot 8}{6\cdot12\cdot 18}+\ldots$ Evaluate : $$1+\frac{2}{6}+\frac{2\cdot 5}{6\cdot 12}+\frac{2\cdot 5\cdot 8}{6\cdot12\cdot 18}+\ldots$$  thought: I have tried to manipulate the series so that the sum upto n terms , can be simplified. But I can't figure out any profitable result. Why are my objects in all layers? This is my circuit. I need to find the power dissipated by Vlamp. So the lamp turns on if the Vlamp is more than 2V. When the lamp is on it has an internal resistance of 10 Ohms, and when it is off it acts like an open circuit.  How would I find the power dissipated? I know how to do it for Voltage sources and Resistors, but not elements like these.  One more thing, I already figured out that: Battery has open circuit voltage of 4V R1 = 5 Ohms R2 = 5 Ohms k = 0.2A/V When lamp on and Vlamp = 2V, Rbat = 10 Ohms   . My 13 year old daughter says she wants to be a boy. This is out of character for her. Is this a phase? My daughter, 13, has said she wants to be a boy. A little background: we moved to a new state a year and a half ago. In her new school, she felt isolated among her peers until she met a girl in art, and became good friends. She joined the drama club, and made  friends with some 8th graders. They joined “the diversity club”. This club is a LGBT club. The kids put on a play they wrote and starred in, which had homosexual connotations. “Romeo and Juliet”, but script  rewritten to include  2 females as the couple, for instance.   My daughter got so wrapped up in it, that her life was as if she was copying the play. She’s no longer friends with the friend from art, but remains close with the 8th grade crowd. They all labeled themselves. One week, my daughter said she was gay, then, changed to bi, then onto pan. (I had to google that one). Now she is emphatic about being disgusted with her body and wants to be a boy. She wants to donate all the “girly” clothes she picked out last year, and tossed out all the makeup she bought a few months ago.   All her life, she was the classic girly girl. She had crushes on boys, and she and this boy were inseparable since first grade. She was sad when it came time to move away. When we settled here, she became sullen and angry, putting herself down. She now sees a therapist who she really likes. We’ve been working on her self esteem issues. She’s wanting us to call her “he” and by a male name. I can’t do that. She’s my daughter. She is female. Had we seen this coming, maybe I could come to accepting. But it happened out of the blue.  Sometimes the old her comes back-I got a makeup sample and she was interested in trying it, looked at me, then quickly put it down and said “ewww, makeup”—just a few months ago, she bought a bunch. She’s now wanting to wear boys clothes and talks of wearing a suit to her prom. She is very impressionable, and seems affected by viral YouTube videos about kids coming coming out to their mothers, and the mothers gleefully embrace with happy tears. She has told me when she’s 18, she’s having her breasts removed.    Nothing seems normal to me anymore-in terms of how she always was-this new situation just doesn’t fit.  My gut tells me this is a phase.  I’m hoping it’s a phase. But with all I’m seeing in the media about this, I’m not sure. I love her; this is too much for me to process. I’m a stay at home mom; we were inseparable. I knew her. Until now.:(  She cut off all her beautiful hair, and wears boys shorts, baggy tee shirts, and bought this awful men’s deodorant spray. Please help me sort this out. I’m at my wits end.  Do you think this is a phase? Is this common? 'I have decided to purchase a jet for getting to NYC and back more quickly.' Are the following sentences grammatical or not? If not, does substituting a to-infinite make them grammatical? (Optional: designate if the sentence expresses purpose, reason, aim, or function)  1 I have decided to purchase a jet for getting to NYC and back more quickly. 2 I have decided to buy a jet for having a quicker way to get to NYC and back.  This is my only reason and aim; this will be the jet's only purpose and function.  3 I hate hairdryers, so I am buying a space heater for drying my hair more naturally, and that is my only aim &amp; purpose &amp; reason and that will be its only function 4 For having a lasting shine in your hair, buy ShineOn Shampoo. 5 My neighbor and I have decided to cooperate more for having a better life together.   Research done: ELL  (Note the  here is a restatement of Cambridge Dictionary's ) ELL  ELL  BBC English  (Currently the best site I've found.) ELU  All of which have answers that I find  (i) incomplete (ii) contradictory (iii) terribly confusing, if not (iv) wrong. To sort through the haze, I am focusing on one issue. Background Some sources say that you need to use a to-infinitive for expressing purpose, aim, function, reason, etc. I find these to be rather hazy distinctions, given that the ODO defines  as The reason for which something is done or created or for which something exists and the same work lists as : aim, reason, function, etc. It is my assertion that at least some of the following sentences demonstrate that one can use the -ing form (be it a gerund, verbal noun, participle) to express individual purpose (aim, reason, function, intention, whatever you want to call it). Do you agree, or not? Why (not)?  In shorter terms, are the sentences grammatical? or do we have to substitute a to-infinitive (including in order to + infinitive) to make them grammatical? (Optional: designate if the sentence expresses purpose, reason, aim, function, etc.) Is the vector cross product only defined for 3D? How to include jQuery and JavaScript files correctly? I'm doing it right now with the following code:   function uw_load_scripts() {     // De-register the built in jQuery     wp_deregister_script('jquery');     // Register the CDN version     wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', array(), null, false);      // Load it in your theme     wp_enqueue_script( 'jquery' ); } add_action( 'wp_enqueue_scripts', 'uw_load_scripts' );   This works, but should I do this for everyone, like this, or for everyone but admin (so that backend uses the WordPress version?):  if (function_exists('load_my_scripts')) {   function load_my_scripts() {       if (!is_admin()) {       wp_deregister_script( 'jquery' );       wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', array(), null, false);      wp_enqueue_script('jquery');        }   }   }   add_action('init', 'load_my_scripts');   This version doesn't work at all actually, I get the WordPress jQuery-version and not the Google one.  Therefore, should I deregister the jQuery that is included in WordPress at all?    Also, how do I add my own scripts (slider scripts, modernizr and my own custom.js) the correct way? I guess I should do this via functions.php as well and not in the header like I'm doing it now, but I'm unsure of how I would do that. What is Active Directory Domain Services and how does it work? This is a  about Active Directory Domain Services (AD DS).         I find myself explaining some of what I assume is common knowledge about it almost daily. This question will, hopefully, serve as a canonical question and answer for most basic Active Directory questions. If you feel that you can improve the answer to this question, please edit away. I know, it's been asked before but I couldn't really get a satisfying answer for some details/backgrounds and I guess it's an important question for many.    Some application seem only to be running with Adobe Flash 15 (or at least I know it does, because I have that version on my Windows Partition).  The official Adobe website says:     NOTE: Adobe Flash Player 11.2 will be the last version to target Linux as a supported platform. Adobe will continue to provide security backports to Flash Player 11.2 for Linux.   Some search on the web like "Ubuntu Adobe Flash 15" or similar does not return any good websites.  I found something that says   (using a "pepper-based version"), and  .   Is it impossible to use this for Firefox too? Would it be a privacy risk?  Are there no alternative projects (I know it's closed source but there are so many so very bright people out there using something similar to wine but just for the plugin....)?  How about the Mac-Version? Shouldn't someone be able to port that one to Linux? Famous puzzle: Girl/Boy proportion problem (Sum of infinite series) Only Guest User login is Available in my new Dell Vostro Laptop I bought a New Dell Vostro 3558 Laptop today. Ubuntu was pre-installed in that. However, i am facing the below 2 issues in it.   Only Guest user login is available. Linux Terminal is not working in Guest user login   Could someone please advise what i should do now. Cool Text Highlighting in LaTeX How do I split a string so I can access item x? Using SQL Server, how do I split a string so I can access item x?  Take a string "Hello John Smith". How can I split the string by space and access the item at index 1 which should return "John"? How to make /sbin/shutdown, /sbin/reboot etc. require sudo again in 16.04? For whatever reason, we do no longer need to be root (or using sudo) to run /sbin/shutdown, /sbin/reboot etc.  This seems to be because those executables are now symlinks to /bin/systemctl which handles everything as normal user.  However, what if I want shutdown and reboot to require root authentication again? How can I achieve this?