- Questo topic ha 5 risposte, 2 partecipanti ed è stato aggiornato l'ultima volta 13 anni, 9 mesi fa da
carlo.
-
CreatoreTopic
-
8 Dicembre 2012 alle 19:12 #81228::
Devo inserire delle immagini i formato .png e siccome hanno lo sfondo bianco dovrei contornarle in qualche modo.Per inserire l’immagine uso
`\begin{center}
\includegraphics[width=15cm]{prova_01.png}
\end{center}`Sarebbe anche bello mettere una cornice con ombreggiatura, su una guida ho letto che si può usare \psshadowbox
ma sinceramente non ho capito come 😕
(Sto usando una derivata Ubuntu)
-
CreatoreTopic
-
AutoreRisposte
-
-
9 Dicembre 2012 alle 7:27 #81229::
carlo2002″ post=80452Devo inserire delle immagini i formato .png e siccome hanno lo sfondo bianco dovrei contornarle in qualche modo.
Per inserire l’immagine uso
`\begin{center}
\includegraphics[width=15cm]{prova_01.png}
\end{center}`Sarebbe anche bello mettere una cornice con ombreggiatura, su una guida ho letto che si può usare \psshadowbox
ma sinceramente non ho capito come 😕
(Sto usando una derivata Ubuntu)
Una soluzione con TikZ:
`
\documentclass[11pt,a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{shadows}
% alcuni stili… diciamo predefiniti: si differenziano per il tipo di ombreggiatura
\tikzset{riquadro 1/.style={inner sep=2pt,draw, fill=white,drop shadow}}
\tikzset{riquadro 2/.style={inner sep=2pt,draw, fill=white,copy shadow}}
\tikzset{riquadro 3/.style={inner sep=2pt,draw, fill=white,double copy shadow}}% comando per impostare il tipo di riquadro
\newcommand{\usariquadro}[1]{\tikzset{riquadro/.style={#1}}}
% ad esempio
\usariquadro{riquadro 1}% comando per inserire la figura con riquadro ed ombreggiatura
\newcommand{\riquadraombreggia}[2][]{
\tikz[baseline=-0.5ex]\node[riquadro]{\includegraphics[#1]{#2}};
}\begin{document}
% uso lo stile di default: il riquadro 1
\begin{center}
\riquadraombreggia[width=5cm]{foto}
\end{center}\usariquadro{riquadro 2}
\begin{center}
\riquadraombreggia[width=5cm]{foto}
\end{center}\usariquadro{riquadro 3}
\begin{center}
\riquadraombreggia[width=5cm]{foto}
\end{center}% Invento un nuovo stile: questo è il modo giusto per personalizzare riquadro ed ombreggiatura (non è bello il risultato, ma è un esempio)
\tikzset{il mio fantastico riquadro/.style={
inner sep=2pt,
draw=blue, dashed, ultra thick,
fill=white,general shadow={
shadow scale=1, shadow xshift=.7ex, shadow yshift=-.7ex,
solid,top color=orange!10, bottom color=orange!90}
}
}\usariquadro{il mio fantastico riquadro}
\begin{center}
\riquadraombreggia[width=5cm]{foto}
\end{center}
\end{document}
` Il risultato è:[attachment=546]Immagine_2012-12-09.jpg[/attachment]
Ciao
Claudio
Attachments:
You must be logged in to view attached files. -
9 Dicembre 2012 alle 8:12 #81230
-
9 Dicembre 2012 alle 10:49 #81231::
Ho provato così ma non funzione
`\documentclass[a4paper,11pt]{book}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}\usepackage{tikz}
\usetikzlibrary{shadows}
\tikzset{riquadro 1/.style={inner sep=2pt,draw, fill=white,drop shadow}}
\tikzset{riquadro 2/.style={inner sep=2pt,draw, fill=white,copy shadow}}
\tikzset{riquadro 3/.style={inner sep=2pt,draw, fill=white,double copy shadow}}\newcommand{\usariquadro}[1]{\tikzset{riquadro/.style={#1}}}
\newcommand{\riquadraombreggia}[2][]{
\tikzset[baseline=-0.5ex]\node[riquadro]{\includegraphics[#1]{#2}};
}\title{File di prova}
\author{me stesso}
\date{}\begin{document}
\maketitle\chapter{Prova di un documento Latex}
\section{Immagine con ombreggiatura}
\begin{center}
\riquadraombreggia[width=10cm]{immagine_01.png}
\end{center}\end{document}`
Questo è il messaggio di errore che ottengo
`! Package pgfkeys Error: I do not know the key '/tikz/[' and I am going to igno
re it. Perhaps you misspelled it.
See the pgfkeys package documentation for explanation.
Type Hfor immediate help.
…
l.29 …adraombreggia[width=10cm]{immagine_01.png}
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.
! Undefined control sequence.
\\riquadraombreggia …set [baseline=-0.5ex]\node
[riquadro]{\includegraphic…
l.29 …adraombreggia[width=10cm]{immagine_01.png}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
File: immagine_01.png Graphic file (type png)
-
9 Dicembre 2012 alle 15:21 #81232::
carlo2002″ post=80462Ho provato così ma non funzione
`\documentclass[a4paper,11pt]{book}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}\usepackage{tikz}
\usetikzlibrary{shadows}
\tikzset{riquadro 1/.style={inner sep=2pt,draw, fill=white,drop shadow}}
\tikzset{riquadro 2/.style={inner sep=2pt,draw, fill=white,copy shadow}}
\tikzset{riquadro 3/.style={inner sep=2pt,draw, fill=white,double copy shadow}}\newcommand{\usariquadro}[1]{\tikzset{riquadro/.style={#1}}}
\newcommand{\riquadraombreggia}[2][]{
\tikzset[baseline=-0.5ex]\node[riquadro]{\includegraphics[#1]{#2}};
}\title{File di prova}
\author{me stesso}
\date{}\begin{document}
\maketitle\chapter{Prova di un documento Latex}
\section{Immagine con ombreggiatura}
\begin{center}
\riquadraombreggia[width=10cm]{immagine_01.png}
\end{center}\end{document}`
Questo è il messaggio di errore che ottengo
`! Package pgfkeys Error: I do not know the key '/tikz/[' and I am going to igno
re it. Perhaps you misspelled it.
See the pgfkeys package documentation for explanation.
Type Hfor immediate help.
…
l.29 …adraombreggia[width=10cm]{immagine_01.png}
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.
! Undefined control sequence.
\\riquadraombreggia …set [baseline=-0.5ex]\node
[riquadro]{\includegraphic…
l.29 …adraombreggia[width=10cm]{immagine_01.png}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
File: immagine_01.png Graphic file (type png)
I problemi sono due:
1) questo codice: `
\newcommand{\riquadraombreggia}[2][]{
\tikzset[baseline=-0.5ex]\node[riquadro]{\includegraphics[#1]{#2}};
}
` non va bene perché devi usare il comando [tt]\tikz[/tt] per inserire un nodo e non [tt]\tikzset[/tt] che semplicemente definisce delle opzioni;2) se definisci `\newcommand{\usariquadro}[1]{\tikzset{riquadro/.style={#1}}}` ma poi non lo usi almeno una volta per impostare il default ecco che il nodo precedentemente definito non sa quale sia lo stile [tt]riquadro[/tt].
Ecco quindi il tuo codice corretto:`
\documentclass[a4paper,11pt]{book}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}\usepackage{tikz}
\usetikzlibrary{shadows}
\tikzset{riquadro 1/.style={inner sep=2pt,draw, fill=white,drop shadow}}
\tikzset{riquadro 2/.style={inner sep=2pt,draw, fill=white,copy shadow}}
\tikzset{riquadro 3/.style={inner sep=2pt,draw, fill=white,double copy shadow}}\newcommand{\usariquadro}[1]{\tikzset{riquadro/.style={#1}}}
\usariquadro{riquadro 1}
\newcommand{\riquadraombreggia}[2][]{
\tikz[baseline=-0.5ex]\node[riquadro]{\includegraphics[#1]{#2}};
}\title{File di prova}
\author{me stesso}
\date{}\begin{document}
\maketitle\chapter{Prova di un documento Latex}
\section{Immagine con ombreggiatura}
\begin{center}
\riquadraombreggia[width=10cm]{foto}
\end{center}\end{document}
`Ciao
Claudio
-
9 Dicembre 2012 alle 16:59 #81233
-
-
AutoreRisposte
- Devi essere connesso per rispondere a questo topic.