I am writing a presentation with Beamer, where I show the benchmarks of a program I wrote. This involve comparing a lot of number coming from different sources. These numbers can differ only in the last two or three decimal digits. What I would like to do, is to color only the digits that differes from one numbe to another. The problem is that these numbers are normally contained in a command \num or \SI of the siunitx package.  Is there any way of coloring only the last decimal digits of a number contained in the commands \num or \SI?
123044
I would like to highlight specific digits in a number. Since the number is large I would like to use \num{} from . Of course I can do it manually as in the MWE below, but was hoping that there might be an easy way to use the commented out syntax to accomplish this:  Code: \documentclass{article} \usepackage{xcolor} \usepackage{siunitx}  \newcommand*{\Color}[2][red]{\textcolor{#1}{#2}}%  \begin{document}  \num{99 976}  88\,9\Color{76} %\num{88 9\Color{76}}  77\,\Color{976} %\num{77 \Color{976}}  \end{document}
65022
I want to implement a function name color highlighting and I use the listings package. My 'regex' for this is def %s( where def (including space) is the first delimiter %s is the function name and ( is the second delimtier. Now my aim is to color only %s in purple. So basically I want to only touch the part between the delimiters and the delimiters should stay untouched.  Here is what I tried so far:  \documentclass{article} \usepackage{xcolor,listings} \usepackage[ngerman]{babel} \usepackage{fontspec} \setmonofont{Courier New}  \begin{document}  \lstset{language=Python,     escapebegin=\color{orange},     keywordstyle=\color{blue}\bfseries,     commentstyle=\color{orange!80!red},     stringstyle=\ttfamily\color{gray},     %moredelim = [is][\color{blue}\bfseries def \mdseries\color{purple}]{def\ }{(},     moredelim = [s][\color{purple}]{def\ }{(},     showstringspaces=false}‎ \lstset{literate=%    *{0}{{{\color{red}0}}}1     {1}{{{\color{red}1}}}1     {2}{{{\color{red}2}}}1     {3}{{{\color{red}3}}}1     {4}{{{\color{red}4}}}1     {5}{{{\color{red}5}}}1     {6}{{{\color{red}6}}}1     {7}{{{\color{red}7}}}1     {8}{{{\color{red}8}}}1     {9}{{{\color{red}9}}}1 }  ‎‎\begin{lstlisting}[basicstyle=\ttfamily,mathescape] def fancy_function_name(page_url = 'tex.stackexchange.com'):     return page_url.split('.')[0] \end{lstlisting}  \end{document}   This code will generate:   You can see that it matches the right place but is too greedy and colors the delimiters too. So I thought about the uncommented line: %moredelim = [is][\color{blue}\bfseries def \mdseries\color{purple}]{def\ }{(}, If I use this one and uncomment the line below I get this result:    It's nearly what I wan't but I cannot add the last, now missing ( in black color.  Does anyone has a solution for this without pretouching the code and add all the @@ symbols?
106926
Find the last $2$ digits of $$\large7^{7^{7^{10217}}}$$   So far I have: $17\cdot 601=10217$ and $7=7 \pmod{10}$. Any help greatly appreciated.
122147
I am trying to code a command in LaTeX to type the . You can see in the Wikipedia link above that these are rather simple tables. There is a vertical line at the beginning, after the first column, and there is a horizontal line at the end, before the last row.   I would like to have a command that I can pass the numerical entries of the table and ir draw the rest.   How to do this?  I would like something like \ruffini{...} and in entries we either enter the list of numbers, perhaps separated by commas. Or maybe even entering the numbers with the separators &amp; and \\ to format in what position the go in the table. But I wouldn't want to be thinking about the lines in the table. I would like the command to take care of the line.
70491
I was wandering if there's a way to make only one footnote appear with a symbol (*) instead of the number.  Thanks!!!
92025
I am trying to calculate the last two digits of $3^{400}$, but working $\bmod {100}$ is proving intractable. I did the last digit case pretty handily, and now I'm stuck at last two.
21600
Hello I'm writing a beamer presentation and I would like to change the colour of the text in the theorem block from one place and it will affect my whole presentation.  Is this possible?  My example:  \documentclass{beamer}   \usetheme{Madrid}   \usecolortheme[RGB={201,20,35}]{structure}   \setbeamercolor{background canvas}{bg=black}  \setbeamercolor{normal text}{fg=white}   \setbeamercolor{theorem text}{fg=black}    %\useoutertheme{shadow}  \useinnertheme{rounded}   \usepackage[utf8]{inputenc}  \usepackage{default}   \begin{document}   \begin{frame}{Primul Slide}   Bla bla bla    Bla bla bla   \begin{theorem}  This is a theorem it is very important!!  \end{theorem}   \end{frame}   \end{document}
56985
What is the shortest way to compute the last 3 digits of $17^{256}$ ?  My solution: \begin{align} 17^{256} &amp;=289^{128} \\ &amp;=(290 - 1)^{128}\\ &amp;=\binom{128}{0}290^{128} -  ... +\binom{128}{126}290^2 - \binom{128}{127}290 + \binom{128}{128} \end{align}  Computed the last 3 terms whose last 3 digits gave the last 3 digits of $17^{256}$.  Is there any shorter method to do this(which requires much less computation) ?
78834
I want to elaborate a command that would print differently simple differential dx and multidimensional differential d^3x. For this purpose I invented the command \dif with one optional argument. It is defined as follows:  \newcommand{\dif}[1][]{%     \def\@tmp@a{#1}%     \ifx\@tmp@a\@empty         [b1]\mathrm{d}     \else         [b2]\mathrm{d}^{#1}{} \!     \fi }   Here [b1] and [b2] are added for debugging. Branch [b1] is intended for the case when the command is called without any argument, e.g. \dif{x}. Second branch [b2] should be taken in case where, e.g., the command \dif[3]{x} is used to print d^3x. The definition, shown above, seems to work fine. However, if \@empty is substituted with \empty first branch is always ignored.   The command \empty is explained in The TeXBook, so that initially I tried it for this code and only occasionally reverted to \@empty having remembered a post at this site where it was said that the  \end command of Plain TeX is redefined to \@@end in LaTeX.     Can somebody explain what is the difference between \empty and   \@empty in LaTeX and, perhaps, suggest a better solution for my   problem?
124252
Find the smallest integer $n$ greater than $1$ such that the last $3$ digits of $n^2$ are the same as the last $3$ digits of $n$.  So far I've got $n^2 = 1000k + n$ which means $n^2 ≡ n \mod 1000$. I  don't know how to proceed since 1000 seems to be a bit high.
113221
I need to bold and align numeric values in a table while using both  and  packages. I've looked at  for bold and alignment in a tabular environment with the siunitx package, however this breaks when specifying \setallmainfonts(Digits){Helvetica} with the mathspec package.  The MWE below shows proper numeric fonts in the displayed math (from the "Digits" specification), the 3.060 is properly aligned, the decimal is properly bold, but the digits are not bold. If the \setallmainfonts(Digits){Helvetica} is commented, then the table data is correctly bold and aligned, but then the display math digits revert to CM. Does anyone know how to reconcile these two?  \documentclass{article} \usepackage{etoolbox} \usepackage{siunitx} \usepackage{booktabs}  \usepackage{mathspec} \setallmainfonts(Latin,Greek)[Ligatures=TeX]{Helvetica} \setallmainfonts(Digits){Helvetica}  \robustify\bfseries  \begin{document}  \begin{table} \begin{tabular}{S[table-format=3.3,detect-weight]}    \toprule    {Header 35} \\    \midrule      \bfseries 3.060\\    100.59\\    0.64\\    0.52\\    \bottomrule \end{tabular} \end{table}  This is the number 2. \[\int_{-\infty}^{\infty} 2 x^{2}_{i} dx \]  \end{document}
103563
I read that different cultures have different ways of grouping digits before the decimal point for readability e.g. 1234567890 can be grouped as 1 234 567 890 (English), 12 3456 7890 (Chinese) or 1 23 45 67 890 (Indian), but is there an established convention for grouping digits of a real number after the decimal point for readability e.g. should 3.14159265358979 be grouped as 3.141 592 653 589 79, 3.14159 26535 8979 or something else?
100530
How do I color only the vector symbol in \vec f? I'm using beamer, so xcolor is already loaded.  Extra "points" to an answer that also explains  how to fish..and not only gives me the fish.  Thanks!
40845
I wrote the two methods below to automatically select N distinct colors. It works by defining a piecewise linear function on the RGB cube. The benefit of this is you can also get a progressive scale if that's what you want, but when N gets large the colors can start to look similar. I can also imagine evenly subdividing the RGB cube into a lattice and then drawing points. Does anyone know any other methods? I'm ruling out defining a list and then just cycling through it. I should also say I don't generally care if they clash or don't look nice, they just have to be visually distinct.  public static List&lt;Color&gt; pick(int num) {     List&lt;Color&gt; colors = new ArrayList&lt;Color&gt;();     if (num &lt; 2)         return colors;     float dx = 1.0f / (float) (num - 1);     for (int i = 0; i &lt; num; i++) {         colors.add(get(i * dx));     }     return colors; }  public static Color get(float x) {     float r = 0.0f;     float g = 0.0f;     float b = 1.0f;     if (x &gt;= 0.0f &amp;&amp; x &lt; 0.2f) {         x = x / 0.2f;         r = 0.0f;         g = x;         b = 1.0f;     } else if (x &gt;= 0.2f &amp;&amp; x &lt; 0.4f) {         x = (x - 0.2f) / 0.2f;         r = 0.0f;         g = 1.0f;         b = 1.0f - x;     } else if (x &gt;= 0.4f &amp;&amp; x &lt; 0.6f) {         x = (x - 0.4f) / 0.2f;         r = x;         g = 1.0f;         b = 0.0f;     } else if (x &gt;= 0.6f &amp;&amp; x &lt; 0.8f) {         x = (x - 0.6f) / 0.2f;         r = 1.0f;         g = 1.0f - x;         b = 0.0f;     } else if (x &gt;= 0.8f &amp;&amp; x &lt;= 1.0f) {         x = (x - 0.8f) / 0.2f;         r = 1.0f;         g = 0.0f;         b = x;     }     return new Color(r, g, b); }
96227
I'd like to use a different + symbol in addition to + in math mode, preferably one which is just bolder than the standard one.  I'm currently using \pmb{+} from the amsbsy package, but it's a bit too lean for my taste, and it looks a bit pointy to the ends.   I am aware of \ding{58} from the pifont package, as well as \Plus from bbding, both of which seem to be non-math mode symbols, and look really bad next to math symbols.  Am I missing some other option to produce a bold +, apart from drawing the symbol myself?
71984
The following image illustrates what am looking for:    Essentially I want the numbering to occur as shown above but using the multicol and enumitem package. But when I try it by using the following code:  \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{enumitem,multicol} \begin{document} \begin{enumerate} \item Evaluate each of the following if $x$ is a non-zero real number.     \begin{multicols}{2}     \begin{enumerate}[itemsep=1cm]% The item sep is my choice here.     \item $\dfrac{|x|}{x}$     \item $\dfrac{x}{|x|}$     \item $\dfrac{|-x|}{-x}$     \item $|x|-|-x|$     \end{enumerate}      \end{multicols} \end{enumerate} \end{document}   I get:    Essentially, I want the (b) to be where the (c) is. I know this has been done but I can't seem to find it.
93000
I use TeX Live on Mac and I get my weekly updates through the TeX Live Utility. I am working on some slides for an upcoming talk. I am using the same Beamer templates and settings that I always use, so I was surprised to see that the page numbers that I always include at the bottom of my slides suddenly appeared in a different color. Here's an MWE:  \documentclass{beamer} \useoutertheme{infolines} \usecolortheme{beaver} \title{Title} \date{\today} %\setbeamercolor{page number in head/foot}{fg=darkred!60!black} \begin{document} \begin{frame} \end{frame} \end{document}     As you can see in the bottom right corner of the slide the page number appears but its color looks off. Until recently it would look exactly the same color as the date appearing next to it.  By Googling around a bit I managed to figure out how to get this to look normal again using the line commented out in the code above:  \setbeamercolor{page number in head/foot}{fg=darkred!60!black}   By uncommenting this line I got back the desired behavior:    So my question is not so much about how to fix this problem, but about why this is happening in the first place. Is this a bug that was introduced in a recent update, and if so will it be fixed? Is this a deliberate choice on the part of the developers (if so I can't imagine why)? Or am I doing something wrong or is something broken in my TeX setup?  I'd appreciate any insight on this. Thanks in advance!