4
votes
1answer
57 views

How to make a hbox several lines under the specified place?

Recently I asked How to colourfuly highlight some lines of an algorithm using algorithm2e? I wanted to acheive this effect using the algorithm2e package: Thanks to JLDiaz's answer I know how to do ...
4
votes
2answers
64 views

Why is \color moving the relative position of an entire \picture environment?

I've been writing a set of simple line drawing macros for some piecewise functions. For some reason, when I attempt to add color to the lines, each segment is translated to the right. I've verified ...
5
votes
0answers
46 views

What are the differences between creating a new macro command vs. a new environment? [duplicate]

For the purposes of collaboration, I want to create a number of short commands or environments that will color the text within its scope so as to identify the author. My first thought was to simply ...
4
votes
2answers
120 views

Variable color for section titles

The following def takes first three letters as an argument: \newcounter{colorCounter} \def\@sectioncolor#1#2#3{% {% \color{% \ifcase\value{colorCounter}% blue\or% red\or% ...
2
votes
2answers
127 views

Variable parameters in xcolor package

This doesn't work and I'm having trouble thinking of a minimum working example, but I'd like to do something like this where I have a parameter to a command as a variable: \usepackage{xcolor} ...
9
votes
3answers
262 views

Defining a macro for “real” colored delimiters

I recently looked up J. van Hoorn's question on How to color delimiters in Math Mode, and so I decided to test my LaTeX knowledge by trying to define a new appropriate command: ...
4
votes
3answers
197 views

What's a better way to define individual link colours for a url in a macro?

I've got a document where I'd like two colours of links - cyan for links in headers that since it's brighter, and navy blue for links in the main body which is more subtle/less distracting. I already ...
3
votes
2answers
111 views

Using \color in a paragraph column inside a tabular environment results in a line break [duplicate]

Some of my documents are compiled into multiple outputs. Some Versions contain certain parts, while other versions contain only a placeholder. For this purpose I have a macro \markup that colors its ...
3
votes
0answers
626 views

Texmaker. Color in the editor. Math mode [closed]

I am starting to use Texmaker with the default configuration. When I use the math mode ($...$) all of it is coloured in green in the editor, making long formulas difficult to follow. I would like ...
4
votes
1answer
181 views

Redefining formatting commands to add colors

I'm writing a document, and I'd like for all bold text to be red. I was wondering how I could renewcommand the textbf command so that it would be wrapped in \textcolor{red}? Thanks
5
votes
1answer
443 views

RGB colour macro: is it possible to divide by 255 in Latex?

I'm fiddling with source code display (Objective-C) and the listings package. I want to colour comments the same green that appears in XCode. I determined that it has an RGB value of 67, 133, 34. To ...
2
votes
1answer
64 views

Automate replacement of `\not` when in `\bm` mode

Hendrik Vogt has provided a \longnot macro to alleviate the issues related to Interaction of \boldmath and \not. This seems to work fine, but I run into a snag when I try to automatically use ...
10
votes
1answer
384 views

Interaction of \boldmath and \not

It seems that using \boldmath (or \bm) along with the \not does not quite work so well. Here is an example using \not\subseteq and \not\le where the line representing negation does not stretch ...
5
votes
1answer
157 views

Underscore should not force mathmode in macro

When trying to color words in arabic (transliteration), LaTeX wants me to be in mathmode (Missing $ inserted.), as there is an underscore in the transliteration. This is of course completely wrong as ...
4
votes
1answer
336 views

wrapping inline long lines and adding background color

Objective I'm trying to achieve the following output. Here's the code I used to produce it. I had to hack it \begin{document} \begin{description} \item In ...
4
votes
1answer
298 views

How can I make a custom \item for use in a list?

I would like to change the color of an \item in a list and I would like the item to look like a regular item. \begin{itemize} \item item one \reditem item two \item item three \end{itemize} and ...
4
votes
1answer
387 views

\lstinline & \colorbox

Why the command below don't work? How can I fix it? \documentclass[11pt]{book} \usepackage[dvipsnames]{xcolor} \usepackage{listings} \lstset{language=[LaTeX]Tex, ...
6
votes
2answers
169 views

Impossible to use array value

I am trying to use the value of an array in a function. But it does not work. Any ideas? See below my LaTeX code \documentclass{article} \usepackage{color} \usepackage{arrayjob} \newarray\Color ...
6
votes
3answers
587 views

New paragraph style for newbie

This question may have already been asked, but with all of my searching, I couldn’t find it. I am new to LaTeX and after a few rough starts, I am finding my way. I am using this tool to create ...
28
votes
7answers
1k views

How to replace a large block of text by an empty block of the same size?

I know there exists the \phantom command, but does it work on large blocks of text (containing several paragraphs or even several pages)? What I want is to have some commands, call them \hide and ...
1
vote
1answer
217 views

What is the best way to setup this statblock as a macro?

I'd like to get a macro setup for this statblock format. Basically, I will be converting an XML document containing the data for the instances within the document. This is a sample of the format I am ...
9
votes
1answer
8k views

How to define macro for colored text?

I know that it is possible to obtain colored text in Latex by including the color package and writing like \textcolor{red}{This is red text} How could I define a macro which would produce text of a ...
7
votes
3answers
642 views

How can I redefine the \verb|…| command?

I'd like to redefine the \verb|...| command so that it had a light-gray background and a little bit darker border around it, and a little bit of padding to make this background "box" noticable. Anyone ...
26
votes
1answer
25k views

How to color math symbols?

One can use the command such as \textcolor[rgb]{1.00,0.00,0.00}{boundary} to color the word "boundary" in a document. Here is my question: How to color the math symbols in $$? For example, can one ...
30
votes
2answers
804 views

How to color the characters in LaTeX2e logo?

I want to get the LaTeX2e logo but with each character having a different color. I know that \LaTeXe produces the logo, but how do I give a color to each character?
1
vote
1answer
1k views

New command to insert a couple of red XXX as placeholder?

I seem to misunderstand the documentation, as \newcommand\ph{\textcolor{red}{XXX}} causes pdflatex to halt. I'm not sure if this is the error: ! Argument of \sf@@subfloat has an extra }. And I ...
14
votes
3answers
1k views

Can I change the font and colour of a letter permanently?

For my lectures, I like to colour the symbols in the equations to make it easier to follow what's going on - a bit like syntax highlighting. So all vector spaces are one colour, all sets another, e ...