I am trying to produce a picture showing the mean value theorem for definite integrals. To do this I am using pgfplots with fillbetween. However, when using the standalone class I get a lot of blank space in the produced pdf file that shouldn't be there.  MWE:  \RequirePackage{luatex85} \documentclass{standalone} \usepackage{ifluatex} \ifluatex   \usepackage{fontspec}   \setmainfont{Calibri}   \usepackage{unicode-math}   \setmathfont{Cambria Math} \else   \usepackage[utf8]{inputenc} \fi  \usepackage{pgfplots} \usepgfplotslibrary{fillbetween}  \begin{document} \begin{tikzpicture}[scale=1.5]   \begin{axis}[axis equal image,%     axis lines=middle,%     axis line style=thick,%     clip=false,%     xmin=0,%     xmax=4,%     ymin=0,%     ymax=2.5,%     every axis x label/.style={       at={(ticklabel* cs:1.025)},       anchor=west,     },%     every axis y label/.style={       at={(ticklabel* cs:1.025)},       anchor=south,     },%     xlabel=$x$,%     ylabel=$y$,%     ticks=none,%     axis line style={-&gt;}]     \addplot[thick,samples=200,domain=1:1.7436,name path=fEn]       (x,{(x-2)*cos(3*pi*deg(x)/5) + 1});     \addplot[thick,name path=cEn] coordinates {       (1,1.2537) (1.7436,1.2537)};     \addplot+[thick,fill=green!20] fill between [of=fEn and cEn];      \addplot[thick,samples=200,domain=1.7436:2.6975,name path=fTo]       (x,{(x-2)*cos(3*pi*deg(x)/5) + 1});     \addplot[thick,name path=cTo] coordinates {       (1.7436,1.2537) (2.6975,1.2537)};     \addplot+[thick,fill=red!20] fill between [of=fTo and cTo];      \addplot[thick,samples=200,domain=2.6975:3,name path=fTre]       (x,{(x-2)*cos(3*pi*deg(x)/5) + 1});     \addplot[thick,name path=cTre] coordinates {       (2.6975,1.2537) (3,1.2537)};     \addplot+[thick,fill=green!20] fill between [of=fTre and cTre];      \addplot[thick,samples=200,domain=1:3]       (x,{(x-2)*cos(3*pi*deg(x)/5) + 1}) node[near       start,yshift=0.75cm,xshift=-0.125cm]{$y = f(x)$};     \addplot[thick,densely dashed,domain=0:1.2537] (1.7436,1.2537 - x)       node[below]{$c$};     \addplot[thick] coordinates {       (1,1.2537) (3,1.2537)};     \addplot[thick,densely dashed,domain=0:1.309] (1,1.309 - x)       node[below]{$a$};     \addplot[thick,densely dashed,domain=0:1.809] (3,1.809 - x)       node[below]{$b$};   \end{axis} \end{tikzpicture} \end{document}   Any thoughts?
120542
I'm trying to use the method outline in   to create a graph of the area between two curves to insert into a solution sheet. However, when I do, the box is placed incorrectly. The tikzpicture ends up way higher than it should be, rather than being in line, and so covers up text, or other pictures placed above it. My code is as follows:  \documentclass[11pt]{article}  \usepackage{tikz} \usepackage{pgfplots}  \usepgfplotslibrary{fillbetween} \usetikzlibrary{patterns}  \begin{document} The box for the tikzpicture appears to be much higher than it should be.\\ {\begin{tikzpicture}[scale=0.75] \begin{axis}[ xmin=0,xmax=5,     ymin=-1, ymax=6,         xtick = {-1,1},     ytick = {1,2,3,4,5,6},     axis lines=center,     axis line style = &lt;-&gt;,         ticklabel style = {font=\small} ]  \addplot[name path=F,domain={0:5}] {x}; \addplot[name path=G,domain={0:5}] {(x-2)^2}; \addplot[pattern=north west lines, pattern color=gray!50]fill between[of=F and G, soft clip={domain=1:4}]; \end{axis} \end{tikzpicture}} \end{document}
64489
I've already checked this out, but it doesn't help, since I already applied the solution suggested.    Here's what I have; there's no fill despite it being constrained to 2d and the fill option being selected. Not sure if this is relevant, but it was originally modeled on the XZ axis, but I rotated it onto the XY one. I made sure the curve was closed as well (toggle cyclic doesn't solve the problem). Help would be appreciated.
107556
I am loading two curves from a file and plot them with \addplot table [...] {the table.txt}; I have managed to fill the area under a single curve, but I want the minimum of the two curves filled. What is the preferred way to accomplish this using tikz and pgfplots? The image shows an example of the desired result.  Thanks for any help.
73731
I am trying to use pdftex to lay out a document including images made in inkscape.  From inkscape I can output the images as pdfs with accompanying pdf_tex files and put these in a figure environment.  This works if the figures are in the main file. However, I have each chapter in a separate folder with all the images for that chapter. When I include images in a chapter I get the error : "Package pdftex.def Error: File 'peeling_flow_constant_width.pdf' not found."  Googling around (here: ) suggests that if I had all my images in the same folder then I could use \graphicspath. This doesn't work for my case of having graphics in each of the separate chapter subfolders.  I think the problem comes from the fact that the .pdf_tex file automatically generated by inkscape includes the command: \put(0,0){\includegraphics[width=\unitlength]{base_peeling_flow_constant_width.pdf}}%  This command doesn't have any information about the path to the pdf file.  My minimal working example is   \documentclass[12pt,chapterprefix,openright,twoside,a4paper,numbers=noenddot,DIV11,BCOR1cm]{scrbook} %\include{l_preamble} \usepackage{graphicx} % to be able to use \includegraphics \usepackage[rgb]{xcolor} % Needed by pdfcomment  \begin{document}  \begin{figure}[htb] \input{base_peeling_flow_constant_width.pdf_tex} \end{figure}  \include{chapter1/chapter1}  \end{document}   with the chapter 1 file  \section{test chapter1}  \begin{figure}[htb] \input{chapter1/peeling_flow_constant_width.pdf_tex} \end{figure}
9921
I tried to get the following example working on Windows 10 (Texmaker V5.0.1);   I used it for a long time on Mac OS and it worked very well. But on Windows 10 the geometry parameters seam not to work. The page is DIN A4 but not in a smaller size for kindle as I expect.  What can I do?  Thank you!  P.S.: I use MikTex 2.9 (64 bit)  P.P.S.: The minimal example:  \documentclass[8pt]{memoir}  \usepackage[utf8]{inputenc} \usepackage[paperwidth=9cm, paperheight=11.5cm, top=0.5cm, left=0.5cm, right=0.5cm, bottom=0.5cm]{geometry} \usepackage{graphicx} \usepackage{tikz, blindtext}  \makechapterstyle{box}{   \renewcommand*{\printchaptername}{}   \renewcommand*{\chapnumfont}{\normalfont\sffamily\huge\bfseries}   \renewcommand*{\printchapternum}{     \flushright     \begin{tikzpicture}       \draw[fill,color=black] (0,0) rectangle (2cm,2cm);       \draw[color=white] (1cm,1cm) node { \chapnumfont\thechapter };     \end{tikzpicture}   }   \renewcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries}   \renewcommand*{\printchaptertitle}[1]{\flushright\chaptitlefont##1} }  %Begin Decorative packages \usepackage{type1cm} \usepackage{lettrine} %End decorative packages  \usepackage[T1]{fontenc} \usepackage[scaled]{helvet} \renewcommand*\familydefault{\sfdefault}  \frenchspacing \sloppy \pagestyle{empty}  \chapterstyle{box} \begin{document}  \title{Latex Template for Kindle} \author{by YOUR NAME} \date{} \maketitle \newpage  \newpage \chapter{Preface}{}  \lettrine[lines=3,slope=4pt,findent=-3pt]{O}{nce upon} a time, lala lala lalala lalalala.   \newpage \chapter{Introduction}  \lettrine[lines=3,slope=4pt,findent=-3pt]{O}{nce upon} a time, lala lala lalala lalalala.   \end{document}
18856
using QGIS 2.6  I import a TIF file, and expect the import to show an image that has black lines on a white background (with some other colors here and there), as the native windows viewer will see a white background.   The file, 49MB, imports, but   The TIF image has a dark gray background instead of a white background  I can't tell why.   Any hints?  The same thing happens if I import the TIF image into georeference, which is how I discovered this in the first place.  I created/exported the TIF image using PDFCreator (from a print of a PDF to a TIF, using that program).   Within PDFCreator, I chose a TIF export that set the color map to 4096 colors, as the default created a TIF file that was twice as large.  On testing with the default size (16 million colors or some such).... That file imported and showed the background as white.  And I can't tell why, for that, either.   Any hints?  ======== In response to the comment/question by @BradHards:  The TIFFTAG_PHOTOMETRIC is not present in either file.  The gdalinfo for the large file and small file are identical, but for the presence of two extra lines on the file where the white background turns to dark gray.  Each band sets NBITS=4 for Image Structure Metadata: eg:     Band 1 Block=5100x68 Type=Byte, ColorInterp=Red   Image Structure Metadata:     NBITS=4 Band 2 Block=5100x68 Type=Byte, ColorInterp=Green   Image Structure Metadata:     NBITS=4 Band 3 Block=5100x68 Type=Byte, ColorInterp=Blue   Image Structure Metadata:     NBITS=4   Something about the NBITS=4 state turns the background dark gray.  Alternatively, there is some other problem with the PDFCreator export.  These are the full GDALInfo:  Small with dark gray background:   Driver: GTiff/GeoTIFF Files: small file.tif Size is 5100, 6600 Coordinate System is `' Metadata:   TIFFTAG_DATETIME=2015:01:28 16:41:04   TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)   TIFFTAG_SOFTWARE=GPL Ghostscript 9.07   TIFFTAG_XRESOLUTION=600   TIFFTAG_YRESOLUTION=600 Image Structure Metadata:   INTERLEAVE=PIXEL Corner Coordinates: Upper Left  (    0.0,    0.0) Lower Left  (    0.0, 6600.0) Upper Right ( 5100.0,    0.0) Lower Right ( 5100.0, 6600.0) Center      ( 2550.0, 3300.0) Band 1 Block=5100x68 Type=Byte, ColorInterp=Red   Image Structure Metadata:     NBITS=4 Band 2 Block=5100x68 Type=Byte, ColorInterp=Green   Image Structure Metadata:     NBITS=4 Band 3 Block=5100x68 Type=Byte, ColorInterp=Blue   Image Structure Metadata:     NBITS=4   Large with white background   Driver: GTiff/GeoTIFF Files: larger file.tif Size is 5100, 6600 Coordinate System is `' Metadata:   TIFFTAG_DATETIME=2015:01:28 17:07:16   TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)   TIFFTAG_SOFTWARE=GPL Ghostscript 9.07   TIFFTAG_XRESOLUTION=600   TIFFTAG_YRESOLUTION=600 Image Structure Metadata:   INTERLEAVE=PIXEL Corner Coordinates: Upper Left  (    0.0,    0.0) Lower Left  (    0.0, 6600.0) Upper Right ( 5100.0,    0.0) Lower Right ( 5100.0, 6600.0) Center      ( 2550.0, 3300.0) Band 1 Block=5100x68 Type=Byte, ColorInterp=Red Band 2 Block=5100x68 Type=Byte, ColorInterp=Green Band 3 Block=5100x68 Type=Byte, ColorInterp=Blue
44938
My question is just like the title. Here is a MWE for my case :  \usepackage[paperwidth=16cm,paperheight=24cm]{geometry} \usepackage{amsmath,amsxtra,amssymb,latexsym,amscd,amsfonts,enumerate,ifthen,stmaryrd,amsthm,amstext} \usepackage[mathscr]{eucal} \usepackage[pdftex]{graphicx} \usepackage{xspace} \usepackage{multicol,color} \usepackage{mathrsfs} \usepackage{makeidx} \usepackage{indentfirst} \usepackage[utf8]{inputenc} \usepackage[utf8]{vietnam}  \usepackage{eso-pic} \usepackage{perpage}  \MakePerPage{footnote} \usepackage{fancyhdr} \renewcommand{\headrulewidth}{0pt}  \makeindex \begin{document} \pagenumbering{roman} \pagestyle{fancy} \tableofcontents  \chapter*{Foreword}  Blah blah blah  \chapter*{Preface}  \pagenumbering{arabic}     Blah Blah   Mirella gọi là papa, dạy toán ở nhà cho Mirella.   \thispagestyle{plain}  \chapter{Dido's problem}  \label{chapter:Dido}  \index{Dido (công chúa)} \index{bài toán công chúa Dido}    Blah blah blah   \end{document}   Why the unnumered chapter does not appear in the table of content ? Please help me. Thanks.
59017
I'm trying out  with gnuplot to generate the data.  This works by having pgfplots write some stuff to an external file, run gnuplot on the file, and then use the generated data to plot the graph.  The problem I'm having is that I get different behaviour under xelatex as pdflatex or lualatex.  In xelatex, the data file is littered with ^^I whereas in the other two formats these are tabs.  It appears that the code ^^I is getting stored as a macro which then gets written out to the file, so possibly there's something funny going on with the ^^I syntax: xelatex is reading it literally.  Indeed, when I do \show\pgfplots@TAB (the macro in question) then for pdflatex and lualatex then I get a literal tab whereas for xelatex I get ^^I.  So how do I get a tab in xelatex?  And why isn't \gdef\pgfplots@TAB{^^I} working?  (The previous line in the code, by the way, is \catcode`\^^I=12 - I don't know if that has anything to do with it.)
105772
I have the following LaTeX file, whose sole purpose is to wrap a JPEG file. This file does not convert well to PDF, so I'm using this unorthodox technique to convert it.  \documentclass{article} \usepackage[pdftex]{graphicx} \pagenumbering{gobble} \begin{document}  \centering\includegraphics[height=650pt]{foo.jpg} \end{document}   This produces a PDF file including the document, but it first includes a blank page, and thus produces a 2 page document, rather than a 1 page document. How do I get rid of this blank page? Using \textheight instead of 650pt as an argument to \includegraphicsmakes the  problem go away, but I'd prefer the larger size I get from using 650pt.  Here is the relevant information from the log file.  &lt;foo.jpg, id=1, 162.6075pt x 1165.35374pt&gt; File: foo.jpg Graphic file (type jpg)  &lt;use foo.jpg&gt; Package pdftex.def Info: foo.jpg used on input line 14. (pdftex.def)             Requested size: 90.6998pt x 650.0pt.  [1  ] Overfull \vbox (100.0pt too high) has occurred while \output is active []   [2 &lt;./foo.jpg&gt;] (./foo.aux) )    I'd prefer to not make the actual document public. Therefore the code above is not a MWE. However, if anyone has tips on how to create a dummy JPEG of the same size, let me know.
100839
I am doing factor analysis with factanal in R and observe empty spaces in the loadings table:  factanal(x = ~V1 + V2 + V3 + V4 + V5, factors = 2, data = airfoil_self_noise)  Uniquenesses:    V1    V2    V3    V4    V5  0.898 0.005 0.005 0.995 0.394   Loadings:    Factor1 Factor2 V1 -0.319          V2  0.877  -0.474  V3          0.997  V4                 V5  0.754  -0.194    Here, I have no idea what empty space means in Factor1-V3, Factor1-V4, Factor2-V1, and Factor2-V4. Weren't they supposed to be filled with some numbers, like with 0?  The same sometimes happens in PCA using principal function.
94870
I have the following problem with pgfplots and \addplot3. I have a graph in [0,1]x[0,1] that should display a mesh plot and a line plot that traces a particular line across the mesh. The line plot is characterized by the following triplet (x, 0.8-x, f(x,y)), which is really (x, 0.8-x, f(x)). In the code below, f(x,y) is called fgm and f(x) is called fgmct.  Here's the working code:  \documentclass{standalone} \usepackage{pgfplots}  \pgfplotsset{compat=1.6}  \begin{document}  \pgfplotsset{ colormap={whitered}{color(0cm)=(white); color(1cm)=(orange!75!red)} }  \begin{tikzpicture}[ scale=1, declare function={fgm(\theta)=1+\theta*(1-2*x)*(1-2*y);}, declare function={fgmct(\theta,\val)=1+\theta*(1-2*x)*(1-2*(\val-x));}]  \begin{axis}[ colormap name=whitered, width=15cm, view={-45}{60}, enlargelimits=false, disabledatascaling, grid=major, domain=0:1, y domain=0:1, samples=30, xlabel=$x_1$, ylabel=$x_2$, zlabel={$f(x_1,x_2)$}, colorbar horizontal, colorbar style={     at={(0,0.9)},     anchor=south west,     width=0.25*\pgfkeysvalueof{/pgfplots/parent axis width},     title={$f(x_1,x_2)$} } ]  \addplot3 [surf] {fgm(-0.5)}; \addplot3 [domain=0:0.8, y domain=0:0.8, samples y=30, black!70, smooth] (x, 0.8-x, {fgmct(-0.5,0.8)});  \end{axis} \end{tikzpicture} \end{document}   Here is what happens:   Seems to me that I should only see the concave line across the surface plot, without the wrap-arounds and the straight line going across it. I would appreciate any pointers as to what I'm doing wrong here.
64479
(I had a feeling this was a duplicate, but couldn't find an older question about it. Forgive me if I'm just bad at searching.)  Consider the minimal example  \documentclass{article} \usepackage{mathtools} \usepackage{unicode-math} \setmathfont{lmmath-regular.otf} \begin{document} \begin{equation*}   \int f(x) \, \mathrm{d}x \end{equation*} \end{document}   When compiled with lualatex the space between the integral sign and f(x) is too large, larger than what I get if I compile with xelatex (or if I'm not using unicode-math).   With lualatex:       With xelatex:       Without unicode-math:      I'm using a recently updated TeXlive 2011, and the same thing happens with Asana-Math.otf or xits-math.otf as math font. Can this be corrected somehow?
12759
Consider the following MWE.  \documentclass[preview,border=12pt,varwidth]{standalone} \usepackage{amsmath}  \begin{document} \abovedisplayskip=0pt\relax \begin{equation} \begin{cases} ax + by =c \\ px + qy = r \end{cases} \end{equation} \end{document}   produces an output as follows.    What I want to achieve is as follows.    Is there any idea?  My attempt is as follows, but it does not compile.  \documentclass[preview,border=12pt,varwidth]{standalone} \usepackage{amsmath}  \begin{document} \abovedisplayskip=0pt\relax \begin{equation} \begin{cases} ax + by =c \tag{OK}\\ px + qy = r \tag{Yes} \end{cases} \end{equation} \end{document}
91952
I have extra whitespace to the left of a TikZ image produced in a standalone environment:    I don't know why this is occurring. I thought perhaps the left projector bounding box, but the right projector is a mirror of the first using \begin{scope}[xscale=-1], and it doesn't produce the same whitespace to the right.   I can probably crop this fairly easily, but I'd like to know why it's happening to prevent it in the future.   Comments on my code are welcome; I'm new to TikZ. My working example:  \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes}  \begin{document}  \pgfmathsetmacro{\cubex}{1} \pgfmathsetmacro{\cubey}{1} \pgfmathsetmacro{\cubez}{1}  \def\projector[#1:#2:#3] {     % Angle and place the projector     \begin{scope}[rotate around={#1:(#2,#3)}]         % Projector and lens         \draw [red] (#2, #3) rectangle (#2 + 1, #3 + .5);         \draw [red] (#2 + 1, #3 + .175) rectangle (#2 + 1.25, #3 + .325);         % Field-Of-View annotation         \draw ( #2 + 1.25, #3 + .325 ) -- ( #2 + 4, #3 + 2);         \draw ( #2 + 1.25, #3 + .175 ) -- ( #2 + 4, #3 - 1);     \end{scope} }  \begin{tikzpicture} % Draw a cube. \draw[fill=blue] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,  0) -- cycle; \draw[fill=green] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,      \cubez) -- cycle; \draw[fill=red] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,   0) -- cycle; % Draw a projector. \projector[-40:-4.5:2] % Second projector is mirrored \begin{scope}[xscale=-1]     \projector[-40:-3.5:2] \end{scope}  \end{tikzpicture}  \end{document}
103302
MWE:  \documentclass{article}  \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=newest} \usepgfplotslibrary{groupplots} \usepgfplotslibrary{fillbetween}  \usepackage{filecontents}  \begin{filecontents}{testdata.dat} t lineLow lineHigh lineMedian 0 1 1 1 1 2 2 2 2 2 3 2.5 3 2 4 3 4 2 4 3 \end{filecontents}  \begin{document}  \begin{tikzpicture}     \begin{groupplot}     [         group style={group size=1 by 2, vertical sep=30pt}     ]         \nextgroupplot         [         ]          \addplot[name path=lineLow] table[x=t, y=lineLow] {testdata.dat};         \addplot[name path=lineHigh] table[x=t, y=lineHigh] {testdata.dat};         \addplot[fill=red] fill between[of=lineLow and lineHigh];         \addplot table[x=t, y=lineMedian] {testdata.dat};     \end{groupplot} \end{tikzpicture}  \begin{tikzpicture}     \begin{axis}         \addplot[name path=lineLow] table[x=t, y=lineLow] {testdata.dat};         \addplot[name path=lineHigh] table[x=t, y=lineHigh] {testdata.dat};         \addplot[fill=red] fill between[of=lineLow and lineHigh];         \addplot table[x=t, y=lineMedian] {testdata.dat};     \end{axis} \end{tikzpicture}  \end{document}   Problem: the fill area between the lines does not work inside groupplots. Is there a workaround for this?  Versions:   pgf 3.0.0  pgfplots 1.11
7717
iam trying to fill above the green and the red line, between the two brown lines. Ive tried it with soft clip and domain, but i cant get it working. Here is what iam trying to achieve (thick organe lines or just this space filled).  Code so far is: \documentclass{standalone}  \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \usetikzlibrary{patterns}  \begin{document} \begin{tikzpicture}     \begin{axis}[grid=both,ymin=-5,ymax=5,xmax=5,xmin=-5,xticklabel=\empty,yticklabel=\empty,       minor tick num=1,axis lines = middle,xlabel=$x_1$,ylabel=$x_2$,label style =       {at={(ticklabel cs:1.1)}}]       \addplot[draw=green, name path=A]{7/2 -2*x};        \addplot[draw=red, name path=B]{3/2 - x/2};       \addplot[draw=blue, name path=C]{1- x/3};        \addplot +[mark=none,draw=brown, name path=D] coordinates {(1,-6) (1,6)};       \addplot +[mark=none,draw=brown, name path=E] coordinates {(2,-6) (2,6)};      \end{axis}   \end{tikzpicture} \end{document}  Thanks in advance!
104516
I am using a float inside the text. As I found out, using \intextsep I could set space above and below the float and the texts. But when I am using \setlength{\intextsep}{5mm}, the space below the float is more than the one above it. Why they are not equal?  % Preview source code  %% LyX 2.0.0beta1 created this file.  For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[english]{report} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \setcounter{secnumdepth}{3} \setcounter{tocdepth}{3} \usepackage{graphicx}  \makeatletter  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands. %% A simple dot to overcome graphicx limitations \newcommand{\lyxdot}{.}   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. \usepackage{setspace} \setlength{\intextsep}{5mm} \setlength{\belowcaptionskip}{0mm}  \setstretch{2}  \makeatother  \usepackage{babel}  \begin{document} Text Text Text Text Text Text Text Text Text Text Text Text  \begin{figure}[h] \begin{centering} \includegraphics[scale=0.5]{\lyxdot \lyxdot /Pictures/fedora} \par\end{centering}  \caption{}  \end{figure} Text Text Text Text Text Text Text Text Text Text Text Text \end{document}