Latex font color - latex

I'm trying to typeset a document I'm working on.
Currently I'm trying to format a piece of text such that the text consists of two colors: a fill color and a line color. In this way the header should pop out more.
I found \psset with options such as linecolor and fillcolor, but I can't get it to work. Can someone provide an example of how I could do this?
Just providing a color using the color-package is no problem, but also not what I want because using this package I can only provide a single color for a piece of text.

Maybe this is what you're looking for: Contour package. Here's the doc containing examples.

Related

Angular Material Custom Theme from Material Color Tool

Material.io has this great tool called the Material Palette Generator: https://material.io/design/color/#tools-for-picking-colors. Using it, you can pick a primary and secondary color, and then click a link "View in Color Tool" which takes you to a page where you can see your choices in different ways: https://material.io/resources/color/#!/?view.left=0&view.right=0&primary.color=6002ee&secondary.color=c63131.
But there doesn't seem to be an easy way of exporting your palette into a format usable for generating a custom Angular Material theme. They have an export link, but the closest format seems to be CodePen. But once you open it in CodePen, the CSS doesn't seem to have the palette information you need.
My question: has anyone tried these tools, and is there a pre-established pathway from Material palette to Angular Material custom theme? Or are they unrelated? If unrelated, is there a simple way to copy the color codes needed from the former to the latter?
Thanks.
You can use this website for generate a material color. For you only need a hex code, and after this you can generate the expected color format.
Expected color format:
Generated result:

How to efficiently block text with a font colour?

How can I make this markdown code for blocking text with a font colour applied?
I am beginner to markdown and I have applied the code below and it works, but is there a more efficient way of doing without repeating \textcolor{blue}{....} and >?
\textcolor{blue}{rm(A)}
\textcolor{blue}{rm(B,C)}
\textcolor{blue}{rm(A)}
Please help.
You can define a new command for color blue
\newcommand\blue[1]{{\color{blue}#1}}
Everytime you need to change the text color to blue, you just type
\blue{some text}

How to configure tcolorbox in lyx?

I’ve been trying for the days now to format attractive code listings in lyx for an Erlang programming book that I’m working on.
The tcolorbox package looks like it should do the trick, but frustrates me at every turn,
Requirements:
Shaded Box with rounded corners, white header text on black, black outline, black on white body text
Head centered and of the form “Listing CN.LN comment” where CN is chapter number and LN is listing number and comment is in italics.
I can do this with a LaTeX macro, but can’t make it work in the head of a shaded box.
Code listing in the body must be mono space font with bold face highlighting.
I’ve read the tcolorbox manual, but still don’t understand how it works in lyx.
Can some kind souls please help dispel my ignorance?
LRP
I'm not sure about all the details of your requirements (could you post the LaTeX that works?) Try the following to get you started (I'm using LyX 2.2.x):
Document > Settings > Modules > Fancy Colored Boxes > Add > Apply
Insert > Custom Insets > Color Box
Inside the Color Box inset, you can find Color Box Options (right-click, or ALT-A 1 in Windows). Those options look similar to the syntax of tcolorbox, e.g.:
title=An enhanced box with a color gradient, enhanced, frame style={left color=red!75!black, right color=blue!75!black}, interior style={left color=red!20!white, right color=yellow!50!white}
Finally, there's an Example (in the LyX Resources/Examples folder) called colored-boxes.lyx that has a lot of info.

Latex color box inline with text

I'm trying to put together a LaTeX color box. The xcolor package \fcolorbox seem to be what I want, but I can't get the rendering quite correct. When I use
\fcolorbox{black}{red}{}
it renders a small box sunken to the bottom of the text line. The best I've managed to do is to fake it with a similar text color:
\fcolorbox{black}{red}{\textcolor{red}{--}}
However, I'm worried that this won't render correctly in all situations with defined colors. Is there a way I can declare an empty text box with full in-line text height? Is there another solution?
I'm basically looking for the code that produces the color boxes all through the document at ftp://ftp.dante.de/pub/tex/macros/latex/contrib/xcolor/xcolor.pdf. The boxes I'm referring to are used throughout, but the first instance is on page 4. Thanks.
The xcolor.dtx file in the same directory as the pdf contains the source for the package and the source for the documentation. The relevant bits from the source for the documentation:
\def\testclr#1#{\#testclr{#1}}
\def\#testclr#1#2{{\fboxsep\z#\fbox{\colorbox#1{#2}{\phantom{XX}}}}}
...
(Answer: 40\% \testclr{green} $+$ 60\% \testclr{yellow} $=$ \testclr{green!40!yellow}, e.g., |\color{green!40!yellow}|)
Basically, use \phantom{} on the contents of your color box, and make sure that at least one of the phantom characters is full-height.
Also, https://tex.stackexchange.com/

How to add changebar in latex?

In Latex, I've created a new command 'changedtext' to mark specifics parts in my document and make it appear blue:
\newcommand{\changedtext}[1]{\textcolor{blue}{#1} }
Is there any easy way to alter the command to have change bars appear next to the text in the resulting PDF?
If not possible, any other suggestion for a visual markup (other than change bars) that would be clear on a black & white printout would be useful as well.
Update: It might be of interest to readers of this question that some time ago I started using the latexdiff script to mark up changes between two versions. I use it in combination with SVN, which I think works great; if you split up your LaTeX files, you might want to look at this tex.stackexchange question though.
Use one of the changebar macro packages in your command.
One other way which would be very clear in B&W would be highlight (shows as gray background).
Use packages soul and color and define your highlight color:
\usepackage{soul}
\usepackage{color}
\definecolor{lightgray}{rgb}{.92,.92,.92}
\sethlcolor{lightgray}
Now you can use \hl{highlighted text} in text to highlight.
Some half-baked solution (not satisfactory) I just came up with myself, is the use of \marginpar to have some arbitrary indication in the margin, e.g.:
\newcommand{\changedtext}[1]{\textcolor{blue}{#1 \marginpar{r1}} }
will put the text 'r1' (from revision 1) in the margin.
However, when using this, the \changedtext command can not be used everywhere (e.g. in formulas, captions) because LateX will complain (in my case) about 'float(s) lost'.
Still,it might be useful to some people...

Resources