Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

38

You could use the pgf-blur package, which gives you this: In fact, it can add a "faded" drop shadow to pretty much anything: The shadow fading is not continuous, like in the previously accepted answer. It fades in a number of discrete steps, but that number can be changed, see the documentation. Here's the code for the examples: \documentclass{article} \...


26

This solution, using nested stack insets, still has vertical height/depth to the overlay. The relative placement of the insets is controlled by the length parameters (2nd and 4th arguments of \stackinset are (x,y) offsets). \documentclass{article} \usepackage{stackengine} \usepackage{xcolor} \begin{document} \def\MyText{not scary} \newcommand\mytext[1][...


25

One possibility is to use Caramdir's answer to Faded drop-shadow using tikz-based rounded rectangle?) (all credit goes to Caramdir). Using the \drawshadow command form the linked answer, I defined a \shadowpicture command with one optional argument (the options that will be passed to the optional argument of \includegraphics), and a mandatory argument (the ...


22

Here are some additions using tcolorbox. You can use a macro \tcbhighmath which is designed for such a task. The style can be varied also by options given to this macro. \documentclass{article} \usepackage[skins,theorems]{tcolorbox} \tcbset{highlight math style={enhanced, colframe=red,colback=white,arc=0pt,boxrule=1pt}} \begin{document} \begin{equation} \...


17

This is a terrible hack, and doesn't really fit your situation exactly, but I'm new to TeX and TikZ. Just an idea to get the ball rolling. \documentclass{article} \usepackage{tikz} \newcommand\importantstuff[3]{ \node[black!30!white] at (#1+0.1,#2-0.1) { \scalebox{2}{\Huge\texttt{#3}} }; \node at (#1,#2) { \scalebox{2}{\Huge\...


17

Note sure if it is more efficient, but it is a lot easier to work with if you define the coordinates first, and then draw them. BTW: +1 for a nice usable MWE \documentclass[border=5pt,tikz]{standalone} \usetikzlibrary{backgrounds,calc} \definecolor{hellblau}{RGB}{18,158,181} \definecolor{dunkelblau}{RGB}{22,141,163} \newcommand{\changefont}[3]{\...


16

I assume you're using \shadowbox from the fancybox package. You need to save the definition of \includegraphics and to pass it to \shadowbox: \documentclass{article} \usepackage{graphicx,fancybox,letltxmacro} % save the meaning of \includegraphics \LetLtxMacro\latexincludegraphics\includegraphics % pass the image to \shadowbox \renewcommand{\...


16

You can define your own spy style with the example given in Section 49.5 of PGF/TikZ manual. Here is one such modification with shadowed spy windows. \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{spy,shadows} \tikzset{spy using overlaysshadow/.style={ spy scope={#1, every spy on node/.style={ circle, ...


16

New answer I've found the correct answer which, of course, is perfectly explained in pgfmanual. I must give some credit to Jake's answer in How to combine fill and pattern in a pgfplot bar plot? because it switched on the light. It's called preaction or postaction and you can read about them in section (v3.0.0) 15.10 Doing Multiple Actions on a Path. /...


14

This answer gets the job done, but it might not be as clean and efficient as you would like. It builds on the answer to your previous question and adds layers (background layer). \documentclass[border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{backgrounds} \usetikzlibrary{shapes.geometric} \usetikzlibrary{shadows} \newcommand{\dbpart}[1]{ \node[...


14

To add a shadow to a node, you may use the shadows library and its drop shadow option. To add a shadow to a path, you may define a shadowed style using transform canvas option. \documentclass[tikz]{standalone} \usetikzlibrary{shadows} \begin{document} \begin{tikzpicture} \tikzset{ arr/.style={->,blue,very thick}, lbl/.style={draw,blue,very ...


14

To avoid seeing the shadow in the transparent area, you can put the button inside a knockout transparency group. If the background and the shadow are in the same knockout group, the group "knocks out" the shadow:(I added some background text to show the transparency of the button and text opacity to increase the contrast) \documentclass{article} \usepackage{...


13

(credit) \documentclass{article} \usepackage{longtable} \usepackage{color,array} \def\lsdw{\smash{\lower5pt\rlap{\textcolor[gray]{.9}{\vrule width 5pt height\ht\strutbox depth \dp\strutbox}}}} \begin{document} \begin{longtable}{|l|l!{\vline\lsdw}} \hline \textbf{Ze} & \textbf{Header} \\ \hline \endhead \hline \multispan{2}% ...


13

I'm not sure if you want the whole graph, but here's an example node. The commands to build it might change depending on the use you want to make of it. Output Code \documentclass[margin=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{fadings,decorations.pathmorphing} \tikzfading[name=fade out, inner color=transparent!0, outer color=...


13

I'm not sure which of the things shown you want. The ones on the right or the ones on the left? Will it always be circles? I've assumed not always circles and both. However, I've used circles for my examples, but this is just convenience. Four possibilities: The four circles are all drawn in the same way in gray with 50% opacity as circular nodes with ...


12

Completely EDIT 2012-03-04: I uploaded the new version 1.3 to CTAN. At the moment the files are available at github. This version provides a key named shadow. This allows to draw a shadow. The shadow can be manipulated by the new keys shadowsize and shadowcolor If you use framemethod=tikz it is important to load the TikZ library shadows. mdframed can ...


12

\documentclass{article} \usepackage{tikz} \usetikzlibrary{shadows} \newcommand{\raisedtext}[1]{% \begin{tikzpicture} [baseline=(X.base)]\node [drop shadow,fill=white,draw,very thin] (X) {#1}; \end{tikzpicture}} \begin{document} Text \raisedtext{Hello World!} Text \end{document}


12

You can set the title page template to suppress the shadow (this will leave the shadow for the blocks unaltered): \documentclass{beamer} \usetheme{Warsaw} \title{The Title} \author{The Author} \setbeamertemplate{title page}[default][colsep=-4bp,rounded=true] \begin{document} \begin{frame} \maketitle \end{frame} \begin{frame} \begin{exampleblock}{...


12

This is just for demonstration purposes. That is, it is not intended to actually look like something you might use but rather to indicate how to achieve some effects which you might find useful in creating something which you would like to use. I thought I would play around with shadowtext and use the excuse to install the emerald fonts. The 'scary' text is ...


12

Using iterative tricks you could obtain better result. RESULT: MWE: \documentclass[border=5pt,tikz]{standalone} \definecolor{hellblau}{HTML}{129EB5} \definecolor{dunkelblau}{HTML}{168DA3} \usetikzlibrary{backgrounds} \pagecolor{hellblau} \newcommand{\changefont}[3]{\fontfamily{#1}\fontseries{#2}\fontshape{#3}\selectfont}%Nice code! \begin{document} \...


11

A shadow adds a preaction. TikZ does not provide a way to remove preactions. In your preamble, you may define your own reset preactions key : \makeatletter \tikzset{reset preactions/.code={\def\tikz@preactions{}}} \makeatother Here is a complete example: \documentclass[margin=2mm]{standalone} \usepackage{tikz} \usetikzlibrary{positioning,shadows} \...


10

What if we enclose the node (or nodes that we don't want to shade) in a scope with the option general shadow/.style={}? \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,shadows} \tikzset{ every node/.style={ draw, drop shadow = {opacity=0.5,fill=red}, fill = white, }, } \begin{document} \begin{tikzpicture} \...


10

At the core of the problem is that with xelatex \pgfdeclarefading uses internally \pgfsys@fadingfrombox. And this means that it stores the fading in a box and reuses it if the fading is used again, and this fails if the fading should be used in different sizes. The problem can be shown also with a fading: \documentclass{report} \usepackage{tikz} \...


9

A possible first approach, redefining \beamerboxesrounded and \endbeamerboxesrounded (as defined in beamerbaseboxes.sty) to use a change of opacity through \pgfsetfillopacity; the lines of code that were included are marked with % NEW; the desired opacity can be changed using the \opacity command (initially set to 0.5): \documentclass{beamer} \usepackage{...


8

The follow-up question Pass options to the scope that is internally created by preaction was, to my amazement, solvable with my code from "Z-level" in TikZ. I'm going to have to resort to astonishment (and plagarism) now because it turns out that this works with drop shadow with no modification (my solutions tend to be the epitome of hackishness ...


8

To get real transparency for box shadows with beamer, you could use this patch from the beamer repository. At this time, this patch is not included in beamer (see discussion). If you use pdflatex, you can use the patched version of beamerbaseboxes.sty. Here is the result of my MWE: Here is the patched version of beamerbaseboxes.sty (put it in the same ...


8

I can't say I know all the ins and outs of tcolorbox, but this demonstrates that it works with equation material. \documentclass{article} \usepackage{tcolorbox} \begin{document} Testing \begin{equation} \tcbox[nobeforeafter]{\( \Delta = b^2 - 4ac \)} \end{equation} \end{document}


8

Here is a tikz implementation that underlays the "scary replication" using atbegshi, thus preserving the black overlaid text. \documentclass{article} \usepackage{tikz,atbegshi} \usetikzlibrary{calc} \newcounter{wordcount} \newcommand{\scarymacro}[2][10]{% \stepcounter{wordcount}% \tikz[remember picture, baseline, inner sep = 0pt] \node[anchor = base] (...


8

Use transform shape: \documentclass{beamer} \usepackage{tcolorbox} \tcbuselibrary{skins} \begin{document} \begin{frame} \begin{tcolorbox}[enhanced,width=16.6cm,drop large lifted shadow, width=5cm,tikz={rotate=15,transform shape}]% test \end{tcolorbox} \end{frame} \end{document} The output:


8

Here is a solution that prevents you from doing things twice: defining the boundary of the dunkelblau area and drawing the thick white lines. This can be done using edge options with which you can draw single parts of a path with different styles. The hexagon is just a regular polygon which comes with shapes.geometric, and it is easier to work with relative ...


Only top voted, non community-wiki answers of a minimum length are eligible