Preview too wide

View: New views
4 Messages — Rating Filter:   Alert me  

Preview too wide

by Michael Kubovy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Friends,

Below is the code for a figure I am producing. My problem is that it  
is not cropped enough horizontally. Is there a remedy? (It would help  
me if you could cc my email when replying to the list.)

Thanks,
MK

%! program = pdflatexmk

\documentclass[]{article}
\usepackage{tikz,pgfbaseimage}
\usepackage{amssymb,amsmath,pifont,latexsym,lmodern}
\usetikzlibrary{shapes,arrows,calc}
\usepgfmodule{matrix}
\usepackage{xspace}
\newcommand{\aV} {$\boldsymbol{a}$\xspace} %
\newcommand{\bV} {$\boldsymbol{b}$\xspace} %
\newcommand{\cV} {$\boldsymbol{c}$\xspace} %
\newcommand{\dV} {$\boldsymbol{d}$\xspace} %
\newcommand{\aD} {$| \boldsymbol{a}|$\xspace} %
\newcommand{\bD} {$| \boldsymbol{b}|$\xspace} %
\newcommand{\cD} {$| \boldsymbol{c}|$\xspace} %
\newcommand{\dD} {$| \boldsymbol{d}|$\xspace} %
\newcommand{\vD} {$| \boldsymbol{v}|$\xspace} %
\usepackage[active,tightpage,pdftex]{preview}

\PreviewEnvironment{tikzpicture}
\begin{document}
\begin{preview}
\begin{center}
{\sf
\begin{tikzpicture}[scale = 1]
        \filldraw[fill=red!50!white,draw=black]
                (0,0) -- (20mm,0mm) arc (0:360:20mm) -- (0,0);
        \filldraw[fill=green!50!white,draw=black]
                (0,0) -- (20mm,0mm) arc (0:321: 20mm) -- (0,0);
        \filldraw[fill=blue!50!white,draw=black]
                (0,0) -- (20mm,0mm) arc (0:253: 20mm) -- (0,0);
        \filldraw[fill=yellow!50!white,draw=black]
                (0,0) -- (20mm,0mm) arc (0:151: 20mm) -- (0,0);
        \draw (22mm,-5mm)
                node[fill=red!20!white]{${\scriptstyle p(d) = 0.11}$} -- (22mm,25mm)
                node[fill=red!20!white]{${\scriptstyle k\,\varphi(d) = 38}$} --  
(22mm,35mm)
                node[fill=red!20!white]{\scriptsize \dD};
        \draw (0mm,10mm)
                node[fill=yellow!20!white]{${\scriptstyle p(a) = 0.42}$} -- (0mm,25mm)
                node[fill= yellow!20!white]{${\scriptstyle k\,\varphi(a) = 150}$}
                node[left=7mm]
                        {\textsf{
                                $\genfrac{}{}{0pt}{}
                                {\text{orientation-tuned}}
                                {\text{interpolators}}\Rightarrow$
                        }} -- (0mm,35mm)
                node[fill= yellow!20!white]{\scriptsize \aD}
                node[left=7mm]
                        {\textsf{
                                $\genfrac{}{}{0pt}{}
                                {\text{orientation-tuned}}
                                {\text{interpolators}}\Rightarrow$
                        }};
        \draw (-12mm,-3mm)
                node[fill=blue!20!white]{${\scriptstyle p(b) = 0.28}$}
                        -- (-12mm,-25mm)
                node[fill= blue!20!white]{${\scriptstyle k\,\varphi(b) = 99}$}
                        -- (-12mm,-35mm)
                node[fill= blue!20!white]{\scriptsize \bD};
        \draw (5mm,-12mm)
                node[fill=green!20!white]{${\scriptstyle p(c) = 0.19}$} -- (5mm,-25mm)
                node[fill= green!20!white]{${\scriptstyle k\,\varphi(c) = 68}$}
                node[right=7mm]
                        {\textsf{
                                $\Leftarrow \genfrac{}{}{0pt}{}
                                {\text{orientation-tuned}}
                                {\text{interpolators}}$
                        }} -- (5mm,-35mm)
                node[fill= green!20!white]{\scriptsize \cD}
                node[right=7mm]
                        {\textsf{
                                $\Leftarrow \genfrac{}{}{0pt}{}
                                {\text{orientation-tuned}}
                                {\text{interpolators}}$
                        }};
\end{tikzpicture}
}
\end{center}
\end{preview}

\end{document}



_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
       McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/



------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Preview too wide

by David Haberthür-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Michael.
I've struggled with stuff like that, and as I have said before on this  
list, sometimes some "%" do wonders.

In general I also use "\centering" instead of "\begin" and  
"\end{center}"

In your case I just removed line 21 and 77 (or 76 after removing  
21 :)) which make the centering and get a nicely cropped version of  
your impressive chart.

have a nice weekend
habi

On 30.05.2009, at 17:34, Michael Kubovy wrote:

> Dear Friends,
>
> Below is the code for a figure I am producing. My problem is that it
> is not cropped enough horizontally. Is there a remedy? (It would help
> me if you could cc my email when replying to the list.)
>
> Thanks,
> MK
>
> %! program = pdflatexmk
>
> \documentclass[]{article}
> \usepackage{tikz,pgfbaseimage}
> \usepackage{amssymb,amsmath,pifont,latexsym,lmodern}
> \usetikzlibrary{shapes,arrows,calc}
> \usepgfmodule{matrix}
> \usepackage{xspace}
> \newcommand{\aV} {$\boldsymbol{a}$\xspace} %
> \newcommand{\bV} {$\boldsymbol{b}$\xspace} %
> \newcommand{\cV} {$\boldsymbol{c}$\xspace} %
> \newcommand{\dV} {$\boldsymbol{d}$\xspace} %
> \newcommand{\aD} {$| \boldsymbol{a}|$\xspace} %
> \newcommand{\bD} {$| \boldsymbol{b}|$\xspace} %
> \newcommand{\cD} {$| \boldsymbol{c}|$\xspace} %
> \newcommand{\dD} {$| \boldsymbol{d}|$\xspace} %
> \newcommand{\vD} {$| \boldsymbol{v}|$\xspace} %
> \usepackage[active,tightpage,pdftex]{preview}
>
> \PreviewEnvironment{tikzpicture}
> \begin{document}
> \begin{preview}
> \begin{center}
> {\sf
> \begin{tikzpicture}[scale = 1]
> \filldraw[fill=red!50!white,draw=black]
> (0,0) -- (20mm,0mm) arc (0:360:20mm) -- (0,0);
> \filldraw[fill=green!50!white,draw=black]
> (0,0) -- (20mm,0mm) arc (0:321: 20mm) -- (0,0);
> \filldraw[fill=blue!50!white,draw=black]
> (0,0) -- (20mm,0mm) arc (0:253: 20mm) -- (0,0);
> \filldraw[fill=yellow!50!white,draw=black]
> (0,0) -- (20mm,0mm) arc (0:151: 20mm) -- (0,0);
> \draw (22mm,-5mm)
> node[fill=red!20!white]{${\scriptstyle p(d) = 0.11}$} -- (22mm,25mm)
> node[fill=red!20!white]{${\scriptstyle k\,\varphi(d) = 38}$} --
> (22mm,35mm)
> node[fill=red!20!white]{\scriptsize \dD};
> \draw (0mm,10mm)
> node[fill=yellow!20!white]{${\scriptstyle p(a) = 0.42}$} -- (0mm,
> 25mm)
> node[fill= yellow!20!white]{${\scriptstyle k\,\varphi(a) = 150}$}
> node[left=7mm]
> {\textsf{
> $\genfrac{}{}{0pt}{}
> {\text{orientation-tuned}}
> {\text{interpolators}}\Rightarrow$
> }} -- (0mm,35mm)
> node[fill= yellow!20!white]{\scriptsize \aD}
> node[left=7mm]
> {\textsf{
> $\genfrac{}{}{0pt}{}
> {\text{orientation-tuned}}
> {\text{interpolators}}\Rightarrow$
> }};
> \draw (-12mm,-3mm)
> node[fill=blue!20!white]{${\scriptstyle p(b) = 0.28}$}
> -- (-12mm,-25mm)
> node[fill= blue!20!white]{${\scriptstyle k\,\varphi(b) = 99}$}
> -- (-12mm,-35mm)
> node[fill= blue!20!white]{\scriptsize \bD};
> \draw (5mm,-12mm)
> node[fill=green!20!white]{${\scriptstyle p(c) = 0.19}$} --  
> (5mm,-25mm)
> node[fill= green!20!white]{${\scriptstyle k\,\varphi(c) = 68}$}
> node[right=7mm]
> {\textsf{
> $\Leftarrow \genfrac{}{}{0pt}{}
> {\text{orientation-tuned}}
> {\text{interpolators}}$
> }} -- (5mm,-35mm)
> node[fill= green!20!white]{\scriptsize \cD}
> node[right=7mm]
> {\textsf{
> $\Leftarrow \genfrac{}{}{0pt}{}
> {\text{orientation-tuned}}
> {\text{interpolators}}$
> }};
> \end{tikzpicture}
> }
> \end{center}
> \end{preview}
>
> \end{document}
>
>
>
> _____________________________
> Professor Michael Kubovy
> University of Virginia
> Department of Psychology
> USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
> Parcels:    Room 102        Gilmer Hall
>       McCormick Road    Charlottesville, VA 22903
> Office:    B011    +1-434-982-4729
> Lab:        B019    +1-434-982-4751
> Fax:        +1-434-982-4766
> WWW:    http://www.people.virginia.edu/~mk9y/
>
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity  
> professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like  
> Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> _______________________________________________
> pgf-users mailing list
> pgf-users@...
> https://lists.sourceforge.net/lists/listinfo/pgf-users


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Preview too wide

by JL Diaz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is not a problem of pgf/tikz. If you put your tikzpicture into a \fbox, you'll see that the box is tight.

It is then a problem of the preview package. I'm not familiar with this package, but apparently, removing the preview environment solves the problem. It is not required, since you already declared tikzpicture as an enviroment to be "previewed".

Saludos,
--JL Diaz


On Sat, May 30, 2009 at 5:34 PM, Michael Kubovy <kubovy@...> wrote:
Dear Friends,

Below is the code for a figure I am producing. My problem is that it
is not cropped enough horizontally. Is there a remedy? (It would help
me if you could cc my email when replying to the list.)


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Preview too wide

by Michael Kubovy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Friends,

Thanks to JL Diaz, David Habenthür, and Aren Röhrs (off list) for solving the problem: the environment preview is indeed the culprit.I just need to tell LaTeX to use the package.


_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
      McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/



------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users