I'm not able to remove the spacing in a for-loop as numbers are not coming in the same for making the pattern.  My code:  for i in range(1,5):     for j in range(1,i):        print(j)   Produces the following result:  1 1 2 1 2 3   But my desired output is:  1 12 123 1234
3114
I'd like to do it in Python. What I'd like to do in this example in C: #include &lt;stdio.h&gt;  int main() {     int i;     for (i=0; i&lt;10; i++) printf(&quot;.&quot;);     return 0; }  Output: ..........  In Python: &gt;&gt;&gt; for i in range(10): print('.') . . . . . . . . . . &gt;&gt;&gt; print('.', '.', '.', '.', '.', '.', '.', '.', '.', '.') . . . . . . . . . .  In Python print will add a \n or space, how can I avoid that? Now, it's just an example, don't tell me I can first build a string then print it. I'd like to know how to &quot;append&quot; strings to stdout.
8585
Is there a built-in that removes duplicates from list in Python, whilst preserving order? I know that I can use a set to remove duplicates, but that destroys the original order. I also know that I can roll my own like this:  def uniq(input):   output = []   for x in input:     if x not in output:       output.append(x)   return output   (Thanks to  for that .)  But I'd like to avail myself of a built-in or a more Pythonic idiom if possible.  Related question:
27113
Is there a way to consistently increase the vertical spacing between equation lines in a gather (or gather*) environment from amsmath?  Specifically, I want to produce something like  \begin{gather*} a = b \\[2ex] c = d \\[2ex] e = f \end{gather*}   without having to write [2ex] at the end of each equation line.  I can think of some hacks that redefine \\ to automatically add the spacing, but is there some cleaner/better way to achieve this?
16147
How do I iterate over a range of numbers in Bash when the range is given by a variable?  I know I can do this (called "sequence expression" in the Bash ):   for i in {1..5}; do echo $i; done   Which gives:     1    2    3    4    5   Yet, how can I replace either of the range endpoints with a variable? This doesn't work:  END=5 for i in {1..$END}; do echo $i; done   Which prints:     {1..5}
8446
I split the question into two parts and included some answers.  1. Alternatives to the permute-package  The permute-package is very old (version 0.2, 1999) and can lead to .  Is there an up-to-date package (or possibility) that generates similarly appealing results with the same ease?  Consider the following small working example, which demonstrates just a few possibilies of permute:  \documentclass{article} \usepackage{permute} \begin{document}  That's what I want to have:  % $\pmt{(123)(45)}$ without star: no spacing between numbers  % $\pmt*{(123)(45)}$ with star: no difference (see note)  \renewcommand*\pmtseparator{\;} % thickspace, but see note below  % $\pmt{(123)(45)}$ without star: no spacing between numbers  $\pmt*{(123)(45)}$ with star: spaces between numbers  I do \emph{not} want to write something horrific like $\begin{array}{llllll}(1&amp;2&amp;3)(4&amp;5)\end{array}$.  Of course I could write $(123)(45)$ or $(1,2,3)(4,5)$,  but I would like to have an apperance different from that of tuples, and numbers greater than 10 rule out the first possibility anyway. \end{document}   Notes:   Concerning \pmtseparator. The separator is included if the *-variant of \pmt is used. It is predefined as a space &nbsp;. Hence, it only appears in text mode. Redefining it to \ , as the manual suggests, makes the space visible both in text and math mode. If you use \pmt only in math mode, it is better, as Philippe Goutet pointed out, to use \, for a thinspace or \; for a thickspace. (.) Verbose permutations can be created with \pmtv.   Solutions so far:   There seems to be no alternative, but the package permute works. Alternatively, if you do not insist on a special appearance, you use one of the two possibilities from the last paragraph.   (However, the permute-package has some limitations concerning the order of multiplication and the use of numbers greater than 9, but this could be discussed later and in another question.)  2. Typesetting permutations with LaTeX  Or what do typographers or other authors say about (1 2 3)(4 5) vs. (1,2,3)(4,5) vs. (123)(45)?
12628
Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:  &gt;&gt;&gt; 6/3 2 &gt;&gt;&gt; 6//3 2
76061
I'm working with booktabs package. My goal is to get the same space between each word.   For example: LaTeX TikZ, tabular myframed titleps. \ Not like this one: LaTeX~~~~~TikZ,~~~~~tabular~~myframed~~~titleps .  Code sample:  \documentclass[twoside]{article} \usepackage[utf8]{inputenc} \usepackage[MeX]{polski}  \usepackage{array}% http://ctan.org/pkg/array \usepackage{booktabs}  \usepackage{tabularx} \usepackage{longtable}  \usepackage{xcolor}  \usepackage[left=4.50cm, right=4.50cm, top=3.50cm, bottom=3.50cm]{geometry} \frenchspacing  \makeatletter     \renewcommand\@seccntformat[1]{\csname the#1\endcsname.\quad}     \renewcommand\numberline[1]{#1.\hskip0.7em}     \renewcommand\quote{\list{}{\leftmargin=10pt\rightmargin=0pt}\item[]}  {\endlist}         \newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}     \newcommand{\rr}{\raggedright}      \newcommand{\tn}{\tabularnewline} \makeatother  \begin{document}   \begin{table}[!ht]  \ra{2}  \setlength\tabcolsep{3pt}  \ignorespaces  {\setlength{\extrarowheight}{5pt}%  \begin{tabular}{m{\dimexpr.25\textwidth-2\tabcolsep-0.8pt}                 m{\dimexpr.35\textwidth-2\tabcolsep-0.4pt}                 m{\dimexpr.35\textwidth-2\tabcolsep-0.4pt}}\toprule    \textbf{Item 1} &amp;\textbf{Item2}&amp; \textbf{Item3 someLongerWord}\\ \midrule  \textbf{SubItem1 some text someLongerWord}\rr  &amp; Lorem Ipsum jest tekstem  stosowanym jako przykładowy wypełniacz w przemyśle poligraficznym. Został po raz    pierwszy użyty w XV w. przez nieznanego drukarza do wypełnienia tekstem próbnej książki. &amp; Lorem Ipsum jest tekstem stosowanym jako przykładowy wypełniacz w przemyśle poligraficznym. Został po raz pierwszy użyty w XV w. przez nieznanego drukarza do wypełnienia tekstem próbnej książki. Pięć wieków później zaczął być używany przemyśle elektronicznym, pozostając praktycznie niezmienionym.          \\  \addlinespace[4pt] \midrule   \textbf{SubItem2 some text} &amp; Przeciwstawne wyobrażenia i~pojęcia występują razem i~mogą wzajemnie siebie zastępować. &amp; Pogardzany nauczyciel wychowania fizycznego reprezentuje w~pamięci uwielbianego nauczyciela sztuki.\\   \addlinespace[4pt] \midrule    \textbf{Reprezentacja przez analogię bądź aluzję}\rr&amp; Części obiektu bądź pamięci reprezentują całość. Podobne wyobrażenia są~wzajemnie swobodnie wymienianie. &amp; Wyobrażenie huśtawki reprezentuje czas spędzony w dzieciństwie na zabawie z~ojcem.  \\\addlinespace[14pt] \midrule   \textbf{Płynność form}\rr&amp; Wyobrażenia wrażeń zmysłowych odpowiadają słowom czy pojęciom. &amp; Uczucie dreszczy z zimna reprezentuje gniew mężczyzny, który umówił się na randkę w ciemno i~czeka w padającym śniegu na~kobietę, która nie przychodzi.  \\ \addlinespace[4pt]\midrule   \textbf{No Time At All someLongerWord}\rr&amp; Brak logicznego czy czasowego następstwa. Przeszłość, teraźniejszość a~nawet przyszłość stanowią jedną całość. &amp; Obecny mąż pojawia się we~śnie odnoszącym się do~wcześniejszego etapu życia żony.  \\  \bottomrule  \addlinespace[10pt] %  \end{tabular}}  \small\caption{\small Charakterystyczne cechy poznawcze procesu pierwotnego}  \end{table} \end{document}
39055
I have the following code:  \begin{align} &amp; a+b+c+d+e+f = 15000 &amp; \text{for } a = 1 ... 15  \\ &amp; D_t=  \begin{cases}    \text{equation} , &amp; \text{for } t = 1 ... 10 \\    \text{another equation} , &amp; \text{for } t = 1 ... 10 \\ \end{cases}  \end{align}   This produces the following:   However, I would like the "for" arguments in cases to be aligned to those in the align environment, which would look something like:    I was wondering if there is a way of doing this automatically, rather than using manual spacing. I have tried using arrays, however it didn't seem to solve the issue.  Thank you.
124013
How can I stretch the spacing between consecutive lines in an align* environment? I have a few lines with \fracs in which both the numerator and the denominator consist of textual phrases, not math symbols, and the result looks too cluttered.  \begin{align*} X &amp;= \frac{\textit{Some text here}}{\textit{And some text here}}\\ Y &amp;= \frac{\textit{Will make everything}}{\textit{Look too close together}} \end{align*}
90370
What is wrong with this command? It says it has a problem with value separators, but i can't find it  /summon ArmorStand ~ ~ ~10 {ShowArms:1,NoBasePlate:1,Pose:{LeftArm:[0f,0f0f],RightArm:[0f,0f,0f],Body:[0f,0f,0f],LeftLeg:[0f,0f,0f],RightLeg:[0f,0f,0f],Head:[0f,0f,0f]},ArmorItems:{id:diamond_boots,ench:[{id:protection,lvl:1000},{id:blast_protection,lvl:1000},{id:thorns,lvl:1000},{id:unbreaking,lvl:1000}]},{id:diamond_leggings,ench:[{id:protection,lvl:1000},{id:blast_protection,lvl:1000}, {id:thorns,lvl:1000},{id:unbreaking,lvl:1000}]}, {id:diamond_chestplate,ench:[{id:protection,lvl:1000},{id:blast_protection,lvl:1000},{id:thorns,lvl:1000},{id:unbreaking,lvl:1000}]},{id:diamond_helmet,ench:[{id:protection,lvl:1000},{id:blast_protection,lvl:1000},{id:thorns,lvl:1000},{id:unbreaking,lvl:1000}]}}
93040
Input  testing on Linux [Remove white space] testing on Linux   Output  testing on Linux [Removewhitespace] testing on Linux   So, how can we just remove all the white space between the brackets and achieve output as given?
106121
I'd like to set $1024 \times 768$ without any space between the three items. Is this possible? If so, how?  E.g., what I get is:     1024 x 768   and what I want is:     1024x768
72109
I'm trying to create a pmatrix whose components are rather complicated fractions (Christoffel symbols), and the line spacing is too small making the whole thing a bit cramped and hard to read.  Is there any easy way to increase the spacing (about 1.5 the default would be perfect)?
106427
I want to write open and half-open intervals using the following notation:  ]a, b[ ]a, b] ]-∞, b]   When writing them just like that in the LaTeX source, the spacing doesn't come out right. For example, for this equation:   \(X = ]-\frac{π}{2}, +\frac{π}{2}[\)   the minus sign is typeset as a binary operator. I can solve this by surrounding the whole value in braces, but then the spacing around the equal sign is still not correct. For other combinations of intervals and operators, different spacing inconsistencies arise.  What is the correct and easy  way to input intervals in order to avoid having to take care of this at all?
26157
I've a file named addresses.txt :  address1@domain.com address2@domain.com address3@domain.com   I'd like to echo "address1@domain.com.html" using for loop. Here's what I did :  cat addresses.txt | while read address do echo "${address}.html" done   Here's the result :  .htmlss1@domain.com .htmlss2@domain.com .htmlss3@domain.com   Same result if I add a space between the variable and ".html"  What am I miss ?  Thanks
11919
I have a string ABCCEF and I want to find the number of permutations not counting the duplicates. I ran a piece of python code     len(set([''.join(i) for i in itertools.permutations('ABCCEF')]))   and the output was 360. This piece of code determines all the permutations of ABCCEF (including the duplicates), creates a set of the permutations, then spits out the length of that set.  I am really rusty in the subject of combinatorics but through the magic guess and check, I BELIEVE that the value 360 is determined from  5*4*3*3*2*1 = 360   I determined this from the string have 6 values but only 5 unique values. So on the first slot I have 5 options to choose from, then 4, then 3. then 3 again (2 C's), then 2, then 1.  I dont really have a firm grasp of this concept. I was wondering if anyone could point out flaws in my logic and/or help me with a better process to solve this problem. Pretty much explain to me why I am correct...OR WRONG!
57516
When the fleqn option is used, the vertical spacing before an equation placed right after a "long" text line (exactly \linewidth I would say) is improperly set up. See below:    From the mathmode user guide, this could probably be fixed through the \topsep length. Is it the right way to proceed? The problem is reproduced by the code below:  \documentclass[12pt,fleqn]{book} \usepackage{amsmath} \usepackage{hyperref} \begin{document} \chapter{plo} \section{plo} eoiu oieu oeiuoe ueoi ueoi ueoiu eoiu oeu oe iupaêio umùaeoiuaem oeiu eoiu eoiu oeee. eoiu oieu oeiuoe ueoi ueoi ueoiu eoiu oeu oe iupaêio umùaeoiuaemm \begin{equation} \cos\pi=-1 \end{equation} eoiu oieu oeiuoe ueoi ueoi ueoiu eoiu oeu oe iupaêio umùaeoiuaem oeiu eoiu eoiu oeee. eoiu oieu oeiuoe ueoi ueoi ueoiu eoiu oeu oe iupaêio umùae \begin{equation} \cos\pi=-1 \end{equation} \end{document}   There is something wrong involving hyperref, amsmath, and fleqn. Removing one of those removes the problem.