New answers tagged

1

You can use the command \defineunderbar. See example: \setuplayout [width=9.4cm] \definebar [foobar] [color=yellow, rulethickness=1.2em, offset=1.2, continue=yes, order=background] \starttext There must be \foobar{a way to set the background color when I need to highlight multiple lines of text. And then return to normal mode} without ...


2

Section titles are sometimes made uppercase. Then the uppercase command (\MakeUppercase or \uppercase) also converts the argument of \color to uppercase: \color{red} => \color{RED} Workarounds: Defining color RED, e.g.: \usepackage{xcolor} \colorlet{RED}{red} Hiding the color command as protected macro, e.g.: ...


0

Here is an answer which depends heavily on the work done in User Mico's answer, but instead; whenever a \hyperlink (linking to a certain \hypertarget) is inserted, the title of that target (the second argument of \hypertarget) is automatically used as a second argument for that \hyperlink, by adding the following excerpt of code: \makeatletter ...


0

I had this problem too. The colors were bugged even when I chose to represent them in CMYK. To solve it, I replaced the line \RequirePackage[cmyk]{xcolor} with the line \RequirePackage[usenames,dvipsnames]{xcolor} in the baposter.cls file and the colors returned to normal (and now I can use more color names).


1

Here's a solution that makes use of the \hypertarget/\hyperlink machinery of the hyperref package to create cross-referencing links. The \hypertarget macro places the "anchor", and the \hyperlink macro generates a call-out (in the form of a hyperlink) to the anchor generated by \hypertarget. Both macros take two arguments: the first is the "anchor text" ...


1

Use \RequirePackage{xcolor} \documentclass{sciposter} \usepackage{lipsum} [ ... ]


4

You can create a “red text” Keyboard Binding in TeXShop. To do so, navigate to the “Edit Key Bingings File…” menu option: Next, add the following line (note that the ̉ in the Input field is OPT+SHIFT+Z): Finally, click the “+” button to add it, and click “Save” to save changes and close the dialogue. Now, whenever I select some text and type ...


0

This is the solution from the pgfmanual.pgf: \documentclass[border=1pt, tikz]{standalone} \usetikzlibrary{fit, backgrounds} \begin{document} \begin{tikzpicture}[level distance=8mm] \node (root) {root} child { node (a) {a} } child { node (b) {b} child { node (d) {d} } child { node (e) {e} } } child { ...


2

Oooo this is ugly... \documentclass[tikz,border=5]{standalone} \def\atchar{@} \tikzset{set color/.style 2 args={.. set color={#2!@!@;0;;#1;}}, .. set color/.code args={#1!#2;#3;#4;#5;}{ \def\tmp{#1}\ifx\tmp\atchar% \tikzset{#5=#4}% \else% \ifcase#3\relax \tikzset{.. set color/.expanded={#2;1;#1;#5;}}% \or ...


1

\documentclass{article} \usepackage[utf8]{inputenc} \usepackage[LAE]{fontenc} % from the arabi package to get the colored short vowel \usepackage{xcolor} \usepackage{arabtex} \newcommand{\ARtextcolor}[2]{\LR{\textcolor{#1}{\RL{#2}}}} \allowarab{\ARtextcolor} \begin{document} \setarab \Large \newsavebox{\uu} \savebox{\uu}{\textcolor{red}{u}} ...


0

The following is basicly just adapted from User Mico's answer in the mentioned post "Macro: Replace all occurrences of a word": % !TEX TS-program = lualatex \documentclass{article} \usepackage{xcolor} \usepackage{luacode,luatexbase} %%% RED SET %%% \begin{luacode} local function vartosrcvar ( line ) return string.gsub(line, "colour it red" , " ...


5

(Updated the answer after OP indicated that he/she uses the book document class and may have instances of search strings in the arguments of \chapter and \section.) Here's a LuaLaTeX-based solution. In addition to the Lua fuction, named colorize, that does the colorizing work, the code also sets up two TeX-side macros, \colorizeOn and \colorizeOff. As their ...


2

You can use named colors and change them in the document: \documentclass{article} \usepackage{xcolor} \colorlet{mylinkcolor}{red!80!black} \colorlet{myurlcolor}{green!50!black} \colorlet{mysectioncolor}{blue!50!black} \usepackage{hyperref} \usepackage{bookmark} \hypersetup{ colorlinks=true, linkcolor=mylinkcolor, urlcolor=myurlcolor, ...


3

You can also use \texorpdfstring from hyperref as the problem is (generally speaking) based on the use of formatting commands while harvesting the meta data. That way you prevent that \alert gets ever in touch with pdf-specific procedures. The compiler usually don't likes to see anything but plain text there -- especially with TikZ commands it becomes really ...


3

If \title is defined after \begin{document} but before \maketitle, the problem is solved. \documentclass{beamer} \usepackage[utf8]{inputenc} \usetheme{m}%\usetheme{m}%-->problem \usepackage{tikz} \usetikzlibrary{arrows,shapes} \begin{document} \author{} \title{Hello \protect\alert{World}!} \begin{frame} \titlepage \end{frame} \end{document} ...


4

You can call \hypersetup{hidelinks} in the "before" part of \titleformat, as this will only affect the section title locally: \documentclass{article} \usepackage{fontspec} \usepackage{xcolor} \usepackage{hyperref} \usepackage{bookmark} \hypersetup{ colorlinks=true, linkcolor=red!80!black, urlcolor=green!50!black, hyperfootnotes=false, ...


1

pstricks loads the xcolor package. If you want a broader choice, pass the option, say, x11names to xcolor (via \documentclass). This option gives access to nearly 320 predefined colours. See § 4, Colors by Names, pp38–40 of the documentation. You also can use the option svgnames which more or less the same as HTML colour names. Example: ...


4

beamer has a command \donotcoloroutermaths to remove math coloring. You can insert this into the template for titles as in the example below. I use red as the maths color for better clarity in the demonstration. \documentclass{beamer} \setbeamercolor{math text}{fg=red} \addtobeamertemplate{frametitle}{\donotcoloroutermaths} \begin{document} ...


1

This is a known viewer issue, as also pointed out by @ChristianHupfer. In this case, you can increase the \arrayrulewidth or just open with another viewer. \documentclass[12pt,a4paper]{article} \usepackage{colortbl} \usepackage{xcolor} \begin{document} \setlength{\arrayrulewidth}{1.5pt} \begin{tabular}{| p{10cm} | c |} \hline & \\ {\bf Requirement:} ...


2

You could use cprotect, but you should think twice before using \verb when, perhaps,\texttt` might suffice. \documentclass{article} \usepackage{xcolor,cprotect} \newcommand{\test}[1]{\textcolor{blue}{#1}} \begin{document} This works \verb+\num{6.022e-23}+ \cprotect\test{This is a test of a \verb+\num{6.022e-23}+} \end{document} If you have several ...


2

As I commented, \verb can neither appear in a macro definition nor argument. However, depending on your need, this may suffice. One saves a verbbox in advance, and can pass that as an argument. \documentclass{article} \usepackage{xcolor,verbatimbox} \newcommand{\test}[1]{{\color{blue}#1}} \usepackage{siunitx,booktabs} \begin{document} This works ...


1

It has to be \newcommand*{\blue}{{\cellcolor{blue!25}}} with an extra set of curly braces.


0

Quick hack: add the following redefinitions to your file (all to the same value of whatever colour you want in the headlines, e.g. to get all light blue) \definecolor{green}{HTML}{6CE0F1} \definecolor{orange}{HTML}{6CE0F1} \definecolor{purple}{HTML}{6CE0F1} \definecolor{red}{HTML}{6CE0F1} \definecolor{blue}{HTML}{6CE0F1} \definecolor{brown}{HTML}{6CE0F1} ...


5

Don't use \color unless you specifically need it (which should be rare); use \textcolor, instead. \documentclass{scrartcl} \usepackage{tabulary} \usepackage{xcolor} \begin{document} \begin{tabulary}{.5\textwidth}{|L|L|R|} \hline foo & \rule{1cm}{1ex} & bar \\ \hline foo & \rule{1cm}{1ex} bar & baz \\ \hline foo & bar ...


2

A workaound: add >{\mbox{}} (or >{\leavevmode} in the preamnle of the table for the relevant columns: \documentclass{scrartcl} \usepackage{tabulary} \usepackage{xcolor} \begin{document} \begin{tabulary}{.5\textwidth}{|L|L|R|} \hline% foo & \rule{1cm}{1ex} & bar ...


3

For the coloring of the background, you can draw it all as one path, and fill that. For the curved gray lines, you can use clipping and circles as in the following: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \pgfdeclarelayer{background} \pgfsetlayers{background,main} \node (mth) [align=center] at (0,0) {parameter space ...


1

For the first part just construct the inner path as a single \draw command without breaking the path: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node (so32) [align=center] at (-5,-1) {heterotic\\$SO(32)$}; \node (e8e8) [align=center] at (-3,4) {heterotic\\$E(8) \times E(8)$}; \node (tiia) [align=center] ...


1

Increasing the font size from 10 to 12 pt increases the widths of the unbreakable header cells, in the process making the entire table wider than the text block. I suggest you use a tabularx environment instead of tabular and allow line breaks in all four columns. Since you're using alternating colors to provide visual distinctions between rows, you can ...


1

Instead of using pdfpages to change the background colour, you may draw a white box around it in beamer: \colorbox{white}{\includegraphics{your-pdf-figure}} Read more here: ADDING white background to an image?


3

The smartdiagram documentation lists numerous options for smartdiagramset, but many of those options are specific to each diagram type. The following may be close to what you want. \documentclass[border=10pt]{standalone} \usepackage{smartdiagram} \smartdiagramset{border color=none,uniform color list=blue for all items} \begin{document} ...


1

A \addfontfeature command will overwrite the standard font colours and other features within the specified stretch, e.g. {\addfontfeature{BoldItalicFeatures={Colour=red}}\bfseries\itshape these words are red} But this might not be too practical. A \newcommand might work: \newcommand{\mycolouredtext}[2]{{\addfontfeature{% ItalicFeatures={Colour=#1},% ...


3

The colors for the beaver theme are set in beamercolorthemebeaver.sty, and are mostly based on \definecolor{darkred}{rgb}{0.8,0,0}. You can replace all occurrences of darkred with, for example, myblue, and define myblue as \definecolor{myblue}{HTML}{00a1e5} to get the desired result. It's probably better to place the color definitions in a separate file ...


2

To change the colours in beamer, you can use \definecolor{mycolor}{RGB}{206,202,177} \setbeamercolor{background canvas}{bg=mycolor} \setbeamercolor{section in head/foot}{fg=white, bg=black} \setbeamercolor{subsection in head/foot}{fg=white, bg=black} Note: I got the RGB values from your image, but check if this are the correct values or if they were ...


2

After your edit of question, it appear as total new and different question. SO I decided to respond to it with new answer in which I focus on design of tree tables with equal width of columns. Coloring is already solved in my first answer, and equal horizontal positioning in my answer on your question "How can I align the two tables?" (as I see from your ...


1

Package colortbl of David Carlisle provides \arrayrulecolor, e.g.: \documentclass{article} \usepackage{booktabs} \usepackage{colortbl} \begin{document} \arrayrulecolor{blue} \begin{tabular}{l} \toprule Header\\ \midrule abc\\ def\\ \bottomrule \end{tabular} \end{document}


7

For example, if you would like to color the first column of the second table: \documentclass[xcolor={dvipsnames,table}]{beamer} \usepackage{tikz} \usepackage{amssymb,amsmath} \usepackage{tikzpagenodes} \usetikzlibrary{angles, backgrounds, calc, decorations.pathreplacing, fit, arrows, ...


0

It is cleaner and clearer to avoid hard-coding formatting in the content of commands like \title. Although this is typically a once-off command in a document - if only because \maketitle enforces this by wiping everything - it is still best avoided, I think. And the alternative is not the scary-looking patching of internal commands. It is, as in the case of ...


0

If you want to get the whole task in red, you need a small patch of an internal expl3 code as it currently resets everything to black: \documentclass{article} \usepackage{tasks} \settasks{style=enumerate} \ExplSyntaxOn\makeatletter %patch needed to get a around a problem in the l3-drivers \AtBeginDocument{ \cs_set_protected_nopar:Npn ...


1

I assume that just the math material should be in red. If that's the case, the following code will achieve your formatting-related objective. \documentclass{article} \usepackage{tasks} \usepackage{etoolbox} \AtBeginEnvironment{tasks}{\everymath{\color{red}}} \begin{document} \begin{tasks}(3) \task $3x^3 - 21x$ \task $5x^6 + 15x^4$ \task $4x^3 + 10x^2 ...


2

A solution with simple \columncolors. I took the opportunity to improve vertical padding of rows with the cellspace package, and grouped some rows with makecell:: \documentclass{article} \usepackage{colortbl} \usepackage[table, x11names]{xcolor} \usepackage[many]{tcolorbox} \usepackage{efbox} \efboxsetup{linecolor=fucsia!100, linewidth=0.96pt, ...


0

Even after several time trying I could not resolve the issue using siunitx, but I found a way using dcolumn and want to share my solution (which is more like a workaround though): \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage[table]{xcolor} \usepackage{booktabs} \usepackage{dcolumn} \begin{document} \rowcolors{2}{black!10}{} ...


1

For example \input opmac \def\yellowbox#1{\setbox0=\vbox{{\medskip#1\medskip}}% {\localcolor \Yellow \hrule height\ht0 width\wd0}\kern-\ht0 \box0 } \yellowbox{ This is text $$ a^2+b^2=c^2 \eqno (1) $$ another text. } \bye If you want to print only coloured rectangles then you need not TikZ. TeX primitives \vrule or \hrule are sufficient.


0

Question answered in comments. It appears the TikZ library, combined with OPmac does the job. When I switch to TikZ I have to use pdftex, which disables the epsf macros. So now I import my images via OPmac. The only downside to this I see at present is I can't use psfrag with this set-up. But thankfully my current application does not call for psfrag. ...



Top 50 recent answers are included