title: Minimum width for 2 nodes at once

text: In this MWE, I can put a minimu size by hand, but how determine it automaticaly: let say max width of the two nodes + 4pt on each side ? ![enter image description here](http://i.stack.imgur.com/504Bs.png)               \documentclass[french]{article}     \usepackage{tikz}          \pgfkeys{/tikz/.cd,         BLS/.store in=\BLS,         BLS=\baselineskip         }          \begin{document}          \tikzset{%         TDPnode/.style={outer sep=0pt,inner sep=1pt,                                     minimum height=\BLS,draw},         TDPetq/.style={TDPnode,anchor=north east},         }          \begin{tikzpicture}[yscale=-1,          TDPetq/.append style={minimum width=1.5cm}         ]          \node[TDPetq] (A0) at (0,0) {angle (degree)} ;      \node[TDPetq] (B0) at (0,\BLS) {temps (h)} ;           \end{tikzpicture}          \end{document}


title: Recreating a logo (text around a circle)

text: My objective is to figure out how to put text around the circumference of a circle as shown below. ![enter image description here](http://i.stack.imgur.com/cglbO.png) I have read Calligraphic logo in tikz which answer part of my question but not completely as shown in the bottom text. I have the following:               \documentclass[letterpaper]{article}     \usepackage[dvipsnames]{xcolor}     \usepackage{tikz,amsmath,amssymb}     \usetikzlibrary{decorations.text}     \begin{document}     \begin{tikzpicture}     \begin{scope}     \draw[color=gray,fill=MidnightBlue] (0,0) circle (3.5cm);     \draw[color=gray,fill=white] (0,0) circle (2.6cm);     \end{scope}     \draw[color=gray] (0,0) circle (2.5cm) node {\Huge\bf MTG};     \draw[color=gray] (0,0) circle (3.6cm);     \path [postaction={decorate,decoration={raise=-2pt,text along path,      text=St. John's College}}] (0,0) circle (3.05cm);     \end{tikzpicture}     \end{document}      This yields: ![enter image description here](http://i.stack.imgur.com/o654u.png) which of course is not what I want.


title: "! Misplaced \omit" error

text: The code below describes a table that goes like:               |_|x x|x x|          |x|x|x|x|x|          |x|x|x|x|x|      where `|_|` = empty cell, `|x x|` = `multicolumn{2}`, `|x|` = cell with text in it.               \begin{tabular}{c|c|c|c|c|}     \label{tlc}     \cline{2-5}     & \multicolumn{2}{|c}{1 Sec Trials} & \multicolumn{2}{|c|}{100 Sec Trials} \\     \hline     \multicolumn{1}{|c|}{Target Rate} & Mean & Std. Dev & Mean & Std. Dev \\     \hline     \multicolumn{1}{|r|}{1Hz} & 1.07 & 1.08 & 1.22 & 0.11 \\     \multicolumn{1}{|r|}{5Hz} & 4.71 & 2.09 & 4.51 & 0.21 \\     \multicolumn{1}{|r|}{10Hz} & 10.3 & 3.28  & 10.1 & 0.32 \\     \multicolumn{1}{|r|}{100Hz} & 93.6 & 9.91 & 94.6 & 0.97 \\     \hline     \end{tabular}      However, when I run it I get an error that reads               ! Misplaced \omit.     \@cline #1-#2\@nil ->\omit     \@multicnt #1\advance \@multispan \m@ne \ifnum \@...     l.60 \cline{2-5}     I expect to see \omit only after tab marks or the \cr of     an alignment. Proceed, and I'll ignore this case.      I've Googled around and it seems that people often get errors like this when nesting `\multicolumns` inside `\multirows`, or when they put text in the cell before starting the `\multicolumn`. But that is not the case in my code. Can anyone tell me what is going on??


title: How to use shading in TikZ when rotating the picture?

text: I have the following problem: I want to draw a rectangle and around it, there should be some smooth fading to the background (white). I found the shading technique of tikz quite interesting. The problem is, that it does not behave as I suspect. See the following example:               \documentclass{minimal}     \usepackage{tikz}     \usetikzlibrary{scopes,fadings}     \begin{document}     \begin{tikzpicture}       \shade [top color=white,bottom color=red,shading angle=90] (-1,-1) rectangle (1,1);       \filldraw [color=red,xshift=2cm] (-1,-1) rectangle (1,1);       \shade [top color=red,bottom color=white,shading angle=90,xshift=4cm] (-1,-1) rectangle (1,1);       { [ xshift=10cm,rotate=-30]         \shade [top color=white,bottom color=red,shading angle=60] (-1,-1) rectangle (1,5);         \filldraw [color=red,xshift=2cm] (-1,-1) rectangle (1,5);         \shade [top color=red,bottom color=white,shading angle=60,xshift=4cm] (-1,-1) rectangle (1,5);       }     \end{tikzpicture}     \end{document}      I for me get using pdflatex two blocks. The left is drawn correctly but (clearly) not rotated. In the right picture the colors at the ends of the fadings are not set correctly: I can see a difference between the white background and the nearly white upper left end. Also in the middle at the conjunction with the red square the color is not correct. Can you tell me what I am doing wrong?


title: Luatex os.execute not working

text: 1. I've hooked luatex's `stop_run` callback so I can do some processing on the output pdf after it is generated.   2. To process the pdf I need to call os.execute. When doing so I an error saying "All command executes disabled" but otherwise everything works normal execute os.execute doesn't execute the command I want.   3. I use `-shell-escape` to try and get os.execute to work   4. I then get an error that that the  Failed to open PDF file: Main.pdf Errors encountered. No output created. Done. Input errors, so no output created. Error: Failed to open PDF file: Main.pdf Errors encountered. No output created. Done. Input errors, so no output created. yet Main.pdf is clearly created but os.execute still does not execute(note that adding `-shell-execute` to the command line is the only change that creates this error). I get a different error from my os.execute too. It is no `1` instead. ALSO! If I simply use 'copy ...' to try and copy the main.pdf file to a tmp location(thinking maybe it was locked) I get a new pdf but it is not complete as if the buffers were not fully flushed. (if that were the case then I would just get that annoying error message but otherwise everything else would be ok) To recap:   1. Trying to get os.excute to work. I use `shell-escape` but this cases other problems   2. My callback is suppose to be called after the pdf is generated BUT when I simply try to copy it, it seems to not copy all of the file. Either the pdf is not being flushed or something is adding additional stuff to the end of the pdf(although I wouldn't expect this and at the very least would expect the original pdf to be valid). I've tried writing several minutes and the copy still doesn't get the whole file(it's missing about 1kb at the end after some hyperref stuff). Anyone have any ideas whats going on? (if I can get this to work I should have the ability to make `\include` precompilable(so it will not compile the included file unless the tex file changed but will import a precompiled version))


title: Left align a Table?

text: I write a simple table code in LaTeX, but it is aligned in the centre of my page. I want to align the whole table in left position. How is this possible?               \begin{table}[h]     \begin{tabular}{| l |p{1in}|p{1in}| l | l |}       \hline     {\bf Examination} & {\bf School/college} & {\bf Board/University} &{\bf Year of passing }& $\%$ \\ \hline     B.Tech& A &B & 2014 &   \\ \hline     Plus Two & Science &  B & & \\ \hline     SSLC & SSLC & B & & \\     \hline      \end{tabular}      \end{table}


title: Adding buffer to 1D coordinate

text: I have the following MWE               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pst-node, pst-plot}          \psset{unit=0.1cm}               \begin{document}     \begin{pspicture}[showgrid=false](-3.0, -25)(110, 24.0)          \psaxes[Ox=0,Dx=10,yAxis=false]{->}(-2.0,-20)(105,23)          \end{pspicture}     \end{document}      The axis runs from `0..100`, as desired - but I would like for it to start at e.g. -2 or -3, such that there is a "buffer" before the axis starts. The ticks should be as they are now, i.e. at 0, 10, 20, .... All I want is a "buffer- axis" that starts at -2. If I use `Ox=-2`, then the ticks run from -2, 8, ...


title: Problem with memoir and biblatex together

text: For no reason I can understand, I can't compile the following using TexLive 2011:               \documentclass[12pt,a4paper]{memoir}          \usepackage{biblatex}          \bibliography{mnwe-thesis}     \begin{document}          Following Serre\cite{serre_Trees}          \end{document}      with the `.bib` file `mnwe-thesis.bib`:               @Book{ serre_Trees,     address = "Berlin",     series = "Springer Monographs in Mathematics",     title = "Trees",     isbn = "3-540-44237-5",     url = "http://www.ams.org/mathscinet-getitem?mr=1954121",     publisher = "{Springer-Verlag}",     author = "{Jean-Pierre} Serre",     year = "2003",         note = "Translated from the French original by John Stillwell, Corrected 2nd   printing of the 1980 English translation"     }      The error I'm getting is:               .     .     .     (./mnwe.bbl)     Package biblatex Info: Reference section=0 on input line 6.     Package biblatex Info: Reference segment=0 on input line 6.          ! Undefined control sequence.     \biburlsetup ->\Urlmuskip                            =0mu plus 3mu\relax \mathchardef \UrlBigBreakPenal...     l.13 Following Serre\cite{serre_Trees}      I'm highly surprised since `memoir` is listed specifically as a _compatible_ package in the `biblatex` docs. **Edit:** Changing the documentclass to `article` doesn't help. I also added `\listfiles` after `\begin{document}`. The output is here: http://pastebin.com/9dMgNzpz.


title: Is there a specific rule on how to choose package/class names?

text: ## Preamble I recently started the "custom package writing" path, which at first I found very interesting because it helped me to define standard callings of packages/commands that would have occupied thousands of lines of preamble code. ## Main Question The first lines of code written inside any `pkgname.sty` file should be the following:               % This is my first package.     %      % (c) <authorname>     % LPPL LaTeX Public Project License     %      \NeedsTeXFormat{LaTeX2e}     \ProvidesPackage{<pkgname>}[yyyy/mm/dd Custom Package]     %      Following the instructions, I created and inserted correctly the package inside the `C:\Local TeX Files\tex\latex\custompkgs` folder synchronized with MiKTeX 2.9. The problem arose when I tried to define the package name, knowing that it could be anything I wanted, because observing other package names I found some defined, sistematic events. Packages whose name is written with:   * More than one uppercase letter   * Normal letters but more than three numbers   * More than two words separated by a white space are extremely rare. From this data, I certainly won't name my package `Super Duper Cool pkg.sty` in the first place, because I have good taste and because it seems that there are certain rules that have to be applied in order to obtain the results observed above. From the references I haven't found any link to this strange behaviour on package names; although I think that these rules have to be written somewhere, I couldn't find them. _Is it true that package names in fact do follow a specific formatting rule?_ ## References   * First documentation for beginners. (http://tutex.tug.org/pracjourn/2005-4/hefferon/hefferon.pdf)   * Package/Class writing complete guide. (http://latex-project.org/guides/clsguide.pdf)   * Main Wikibook article. (http://en.wikibooks.org/wiki/LaTeX/Creating_Packages)


title: In-text citation: list all authors for pieces with three (or fewer) authors?

text: I'm preparing a manuscript for submission to a journal that uses a citation format similar to `natbib`'s `authoryear`, but that requires full author lists for in-text citations when there are three authors, as well as when there are two authors. Is there a package or command that will do this automatically for me? The commands `\citet*` and `\citep*` from `natbib` are great, but they don't automatically identify cases where there are three or fewer authors. Furthermore it gets really tricky when I'm parenthetically citing multiple sources (in the same citation), some of which have three authors, and some of which have more authors.


title: import input pgfplots with relative paths

text: The package import makes it posible to `\input` (and `\include`) a `.tex` document which itself `\input` (or `\includegraphics` etc.) stuff using relative paths. I was hoping that this also would work with the `\addplot file` in `pgfplots`, but it does not. Is there a way to use relative paths in `pgfplots`? * * * **Failing example** : Place main.tex anywhere and edit path to `fig.tex`. - File `fig.tex`, `input.tex` and `plot.dat` in same directory. I can compile the standalone `fig.tex`, but `main.tex` can not find `plot.dat`. ### `main.tex`               \documentclass{article}     \usepackage{import}     \usepackage{standalone}     \usepackage{pgfplots}     \begin{document}     mainMain     \import{\absolute\path\to\fig.tex}{fig.tex}     \end{document}      * * * ### `fig.tex`               \documentclass{standalone}     \usepackage{pgfplots}     \begin{document}     \input{input.tex}  %this is ok     \begin{tikzpicture}       \begin{axis}         \addplot file {plot.dat};  %this is not working       \end{axis}     \end{tikzpicture}     \end{document}      * * * ### `input.tex`               anything      * * * ### `plot.dat`               1   2      * * *


title: Undefined control sequence \equal in section title while using packages hyperref and ifthen

text: I have a command that uses package `ifthen`. I use the command in section titles. I have to protect the command because otherwise I obtained the error Undefined control sequence `\equal`. So far, so good. Now I started using package `hyperref`, and the error is here again. How could I solve it? An example follows. Thanks.               \documentclass{article}     \usepackage{ifthen}     \usepackage{hyperref} % remove this line => no error     \newcommand{\something}[1]{Was something}     \newcommand{\somethingelse}[1]{\ifthenelse{\equal{#1}{X}}{Was X}{Was not X}}     \begin{document}          \tableofcontents          \section{\something{}}          \section{\protect\somethingelse{}} % remove this line => no error     \end{document}


title: How to break long equations while keeping alignment?

text: I have the following long equations:               \documentclass[]{article}     \usepackage{amsmath}     \begin{document}          \begin{displaymath}     \begin{aligned}     (\chi_1|\chi_1)     &=\frac{1}{24}\left(\left(\chi_1(1)\right)^2+\left(\chi_1(b^2)\right)^2+2.\left(\chi_1(a)\right)^2+2.\left(\chi_1(a^3)\right)^2+2.\left(\chi_1(a^5)\right)^2+2.\left(\chi_1(a^2)\right)^2+2.\left(\chi_1(a^2b^2)\right)^2+6.\left(\chi_1(b)\right)^2+6.\left(\chi_1(ab)\right)^2\right)\\     &=\frac{1}{24}\left(\left(Sp(I_2)\right)^2+\left(Sp(B^2)\right)^2+2.\left(Sp(A_1)\right)^2+2.\left(Sp({A_1}^3)\right)^2+2.\left(Sp({A_1}^5)\right)^2+2.\left(Sp({A_1}^2)\right)^2+2.\left(Sp({A_1}^2B^2)\right)^2+6.\left(Sp(B)\right)^2+6.\left(Sp(A_1B)\right)^2\right)\\     \end{aligned}     \end{displaymath}          \end{document}      I'd like to break the equations and keep the "=" aligned. I tried this:               \documentclass[]{article}     \usepackage{amsmath}     \begin{document}          \begin{displaymath}     \begin{aligned}     (\chi_1|\chi_1)     &=\frac{1}{24}\left(\left(\chi_1(1)\right)^2+\left(\chi_1(b^2)\right)^2+2.\left(\chi_1(a)\right)^2+2.\left(\chi_1(a^3)\right)^2+2.\left(\chi_1(a^5)\right)^2+2.\left(\chi_1(a^2)\right)^2\\& +2.\left(\chi_1(a^2b^2)\right)^2+6.\left(\chi_1(b)\right)^2+6.\left(\chi_1(ab)\right)^2\right)\\     &=\frac{1}{24}\left(\left(Sp(I_2)\right)^2+\left(Sp(B^2)\right)^2+2.\left(Sp(A_1)\right)^2+2.\left(Sp({A_1}^3)\right)^2+2.\left(Sp({A_1}^5)\right)^2+\\& 2.\left(Sp({A_1}^2)\right)^2+2.\left(Sp({A_1}^2B^2)\right)^2+6.\left(Sp(B)\right)^2+6.\left(Sp(A_1B)\right)^2\right)\\     \end{aligned}     \end{displaymath}          \end{document}      But that ruins my bracket structure. In the end, I'd like to have something like this (of course the brackets don't have the correct height in the image): ![Equations](http://i.stack.imgur.com/RLEVY.png) Mind that the second part of the equation has to start from the first big bracket. How can I do this?


title: Two line expressions using a single bracket

text: I want to fit two expression inside a large bracket something like this: ![img](http://i.imgur.com/ZGJw7qP.png) I looked some of the examples like this one, however, I need variables such as `x1` instead of `1`. Help appreciated.


title: fancyhdr too long names of the sections, lines at the right and left

text: I am using fancyhdr for my header. The problem is, that some of my section names are too long and it looks quite stupid. I attached a screenshot.   1. So how can I have this correctly? So it does not look that stupid anymore.    2. Then my second question is: I want to have a line on the left and on the right (not above), I also attached a screenshot how it should look like (they should be the same as the line under it). Here is my code:               \documentclass{book}     \usepackage{geometry}     \geometry{left=4cm,right=3cm, top=2cm, bottom=2cm}      \usepackage[pagestyles]{titlesec}     \titlespacing*{\chapter}{0pt}{-30pt}{20pt}     \titleformat{\chapter}[display]{\color{headercolor}\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}          \titleformat{\section}     {\color{headercolor}\normalfont\Large\bfseries}{\thesection}{1em}{}          \titleformat{\subsection}     {\color{headercolor}\normalfont\Large\bfseries}{\thesubsection}{1em}{}          \titleformat{\subsubsection}     {\color{headercolor}\normalfont\large\bfseries}{\thesubsubsection}{1em}{}          \titleformat{\paragraph}     {\color{headercolor}\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}     \usepackage[ngerman]{babel}     \usepackage{mathptmx}     \usepackage{helvet}     \usepackage{wallpaper}     \usepackage{color}     \usepackage[final]{pdfpages}      %,bookmarksopenlevel={1}     %\usepackage[hidelinks,bookmarks=true,bookmarksopen=true,bookmarksnumbered=true,colorlinks=true,linkcolor=black,]{hyperref}     \usepackage[colorlinks,linkcolor=black,bookmarksopen=false,     hypertexnames=TRUE,pdfpagelabels=true]{hyperref}[2011/02/05]     \hypersetup{        pdftitle={},     %  pdfauthor={\textcopyright },       pdfsubject={Statistics book},        pdfkeywords={},        }     \usepackage{xcolor,bookmark}     \usepackage{scrextend}     \usepackage{titlepic}     \usepackage{shorttoc}     \usepackage{courier}     %\usepackage[titles]{tocloft}     \usepackage{type1cm}              \usepackage{zref-abspage}     \usepackage{makeidx}              \usepackage{graphicx}             \usepackage{multicol}            \usepackage[bottom]{footmisc}     \usepackage{tocstyle}     \usetocstyle{allwithdot}      %\usepackage{thmbox}     \usepackage{shadethm}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{marginnote}     %\usetocstyle{KOMAlike}     \usepackage{wrapfig}     \usepackage{paralist}     \usepackage{amssymb}     \usepackage[framemethod=tikz]{mdframed}     \usepackage{ulem}     \usepackage{fancyhdr}     %\usepackage{sectsty}          \definecolor{headercolor}{rgb}{0.6941,0.6745,0.4863}               \setlength{\headheight}{21pt}%          \begin{document}     \mainmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \pagestyle{fancy}     \fancyhf{}     %\fancyhead[L]{\parbox{0.7\textwidth}{\textbf{ \textcolor{headercolor}\leftmark\text{ }\textcolor{headercolor}{\rightmark}}}}     \fancyhead[L]{ \textcolor{headercolor}\leftmark \text{ }\textcolor{headercolor}{\rightmark}}%\thesection     \fancyhead[R]{\textcolor{headercolor}{\thepage}}     %\renewcommand{\headrule}{\vbox to 0pt{\hbox     %to\headwidth{\textcolor{headercolor}{\hrulefill}}\vss}}      %%\renewcommand{\headrulewidth}{2pt}           \renewcommand{\headrulewidth}{2pt}% 2pt header rule       \renewcommand{\headrule}{\vbox to 0pt{\hbox         to\headwidth{\textcolor{headercolor}{\rule{\linewidth}{\headrulewidth}}}\vss}}           % here comes the sections part, I commented to have a running sample:          %\include{part1}      %\include{chapter1}          % There I have those sections like     \section{very long text, really long, too long text, this looks not good but the names have to be like they are, yeah, really long, ..... ..... ..... ..... ..... ..... ..... ..}          text text\\text\\text\\text\\text and so on          \end{document}      Here is the screenshot: Problem 1: ![enter image description here](http://i.stack.imgur.com/reIbg.png) ![enter image description here](http://i.stack.imgur.com/1Ojzw.png) Problem 2: ![enter image description here](http://i.stack.imgur.com/DZBhF.png)


title: Change appearance of "zero" symbol in teletype txfonts

text: Is it possible to tweak the teletype fonts of `txfonts` so that the "zero symbol" 0 does not have the rather 1980-style stroke? ![Zero](http://i.stack.imgur.com/Xwddu.png) Perhaps a replacement glyph has been specified by the font? Using `newtxtext` is not an option at the moment.               \documentclass{scrartcl}     \usepackage{txfonts}     \pagestyle{empty}          \begin{document}       \texttt{0}     \end{document}


title: Absolutely, definitely, preventing page break

text: This is a question that has been asked before in various ways, but I have yet to find a general answer to it. Perhaps I'm misunderstanding something and the solution is actually very simple. I have a section of a document where page breaks are absolutely not accepted. It consists of a few paragraphs, followed by some formulas. What I want is that the section should be bumped down to the next page if there is not enough space for it on the current page, even if that means that the current page would only contain a single row of text. I've tried all the usual solutions. When I use `\begin{samepage}`, I still sometimes get page breaks in the middle of the section. If I use `\begin{minipage}`, then the section does not get a page break in the middle of it, but instead it gets pushed to the bottom of the previous page (i.e. it flows beyond the end of the page). Is there any generic solution for what I want to do? If so, how? And if not, how can I solve this? One more note: This document is automatically generated, so I can't solve it by manually putting page breaks where they are needed.


title: how to align equations with some text

text: I want to align the equations with text. Though the equations are aligned as I want it to be but still the text is not aligned.               \begin{align}      \mathscr{F}^\prime(x_0)^{-1}&\in L(Y,X) \quad &\textrm{for some } x_0\in{D}; \nonumber\\     \big\Vert{\mathscr{F}^\prime(x_0)^{-1}\mathscr{F}(x_0)}\big\Vert&\le {\color{red}\eta} &{}\nonumber     \\     \big\Vert{\mathscr{F}^\prime(x_0)^{-1}\big[\mathscr{F}^\prime(x)-\mathscr{F}^\prime(x_0)\big]}     \big\Vert &\le L_0     \left\Vert{x-x_0}\right\Vert\quad &\textrm{for all } x\in{D}; \nonumber\\     \big\Vert{\mathscr{F}^\prime(x_0)^{-1}\big[\mathscr{F}^\prime(x)-\mathscr{F}^\prime(y)\big]}     \big\Vert &\le L     \left\Vert{x-y}\right\Vert\quad &\textrm{for all } x,y\in{D}; \nonumber\\     h_{AH} = \xoverline{L}_{\eta} &\le \dfrac{1}{2} &{}     \intertext{and}     \xoverline{U}(x_0,\lambda_0) &\subseteq D, &{}\nonumber     \end{align}      Another question: is there any way to write the preceding equations more aesthetically? Thank your response.


title: Text affected by using txfonts package

text: I am using a `\usepackage{txfonts}` because of this symbol `\multimapdotbothB` but the body text or fonts are affected. How can this be not to be affected?               \documentclass{article}          \usepackage{lipsum}     \usepackage{txfonts}          \begin{document}          \lipsum[1]          $\multimapdotbothB$     \end{document}


title: Should lambdas in lambda-calculus be set in italics?

text: _This question is not specific to TeX and derivatives, but I feel that this community is the best to answer it._ Should the letter lambda (λ) be typeset upright or in italics in the following situations occurring in lambda-calculus?   1. in lambda-expressions such as: λ x . x+2   2. in names such as: λ-calculus, λ-abstraction


title: Problems with newpage and pdfpageattr

text: I have a document (`article` class) in which sections of text are interrupted by sideways tables. In order to be able to view the document properly I am using               \newpage     \global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}      and               \newpage     \global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 0}      to turn the pages in the viewer. The turning works well however I cannot use `\newpage` after a text section and then rotate using `pdfpageattr` without inserting text inbetween. If I do that all the tables disappear. Here an example of this:               \newpage     text I dont Want But Need To But There For Tables to show up!     %************************************************************     % FS Tables     %************************************************************          \global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}          %%% Table I: Loan Amount     \begin{sidewaystable}            \centering            \caption{Loan Amount - Closest-Saathi to Client km}            \input{reg_fs_e_sewaloan_amount_iv1}     \end{sidewaystable}      I would usually include a minimalist document here but in this case it seems rather complicated because I am importing tables etc. Perhaps we can answer the question this way.


title: How to replicate TeXify / Yap current page display behavior with PDFTeXify / Adobe Reader?

text: After TeXify finishes, Yap displays the same page it was on prior to the TeXify. How do I replicate this behavior with PDFTeXify / Adobe Reader so that it displays the same page I was on prior to the recompile? Presently, Reader displays the first page by default after PDFTeXify creates the pdf file. Thanks. Current setup: MikTex 2.9, WinEdt 7.0, Adobe Reader X and Yap 2.9.


title: Incorrect position of hyperref links in block environments in beamer

text: I use a template for `beamer` that redefines the block environment to make a real shadow, outline and custom bend corners. The look of it is quite nice but unfortunatly comes with the side effect of an incorrect position of the hyperref links inside the block environment. I would like to leave the template pretty much as it is and correct the link positions, if this is possible. The position of the links are too high, which seems to be caused by the vertical offset introduced here that only effects the text but not the link:               \pgfputat{\pgfpoint{0pt}{-3ex}}{\pgftext[left,base]{\copy\bmb@bodybox}}      **MWE**               \documentclass{beamer}     \usepackage[backref=true, backend=biber]{biblatex}     \bibliography{biblatex-examples}     \usepackage{tikz}     \setbeamertemplate{blocks}[rounded]          \makeatletter     \newbox\bmb@headbox     \newbox\bmb@bodybox          \renewcommand\beamerboxesrounded[2][]{%       \setkeys{beamerboxes}{upper=block title,lower=block body,width=\textwidth}%       \setbox\bmb@headbox=\hbox{%         \begin{minipage}[b]{\bmb@width}%           #2%         \end{minipage}}%       \setbox\bmb@bodybox=\hbox\bgroup\begin{minipage}[b]{\bmb@width}%     }          \def\endbeamerboxesrounded{%       \end{minipage}\egroup%       \begin{tikzpicture}         \pgfputat{\pgfpoint{0pt}{0pt}}{\pgftext[left,base]{\copy\bmb@headbox}}         \pgfputat{\pgfpoint{0pt}{-3ex}}{\pgftext[left,base]{\copy\bmb@bodybox}}       \end{tikzpicture}     }     \makeatother          \begin{document}     \begin{frame}     \begin{block}{This is the block title}     This is where the citation occurs \cite{kastenholz}     \end{block}     \end{frame}     \end{document}


title: colortbl: \rowcolor in tables with \begin{tabular}{@{}ccc@{}}

text: I'm trying to make a table with the following code:               \begin{tabular}{@{}ccc@{}}       \hline        \rowcolor[gray]{.9} a & b & c \\       \hline     \end{tabular}      Unfortunately the `\rowcolor` command seems to not care about the empty leading and ending spaces in the table, i.e. the `@{}`'s in the `tabular` 'preamble'. Any suggestions to overcome this issue are most welcome.


title: Latin Modern Math in LaTeX

text: It seems that Latin Modern Math font works fine only with XeTeX and LuaTeX. Is it possible to use Latin Modern Math font with LaTeX and pdfLaTeX? * * * The publisher requires that I use LaTeX/pdfLaTeX, so using XeTeX or LuaTeX is not an option. I cannot use strange packages, I have to use minimal additional packages. The article's font is Latin Modern and the encoding of the file is set to uft8 and I am not permitted to change these. I want to use the `\lBrack` symbol in Latin Modern Math font. The font is defined according to Unicode Math Symbols in Latin Modern Math. However, when I use `\lBrack` pdfLaTeX tells me that `\lBrack` is not defined. The issue is not the command `\lBrack` itself. I don't mind defining it. I just want to have the symbol for `\lBrack` (Unicode 027E6) from the Latin Modern Math font appear in my output, i.e. the PDF file generated by pdfLaTeX. I don't want to use other packages that provide similar symbols, it is not an option. If I were using XeLaTeX I could have written something like:               \documentclass{article}          \usepackage[T1]{fontenc}     \usepackage{unicode-math}     \pagestyle{empty}          \begin{document}          $\lBrack$          \end{document}      But as I wrote I am not allowed to use XeLaTeX and have to use pdfLaTeX. If I run pdfLaTeX on the same code I get an error because `unicode-math` requires XeLaTeX or LuaTex engine. Essentially, I want to has some command without add anymore packages which does what the code above does in XeLaTeX. I have tried to directly access the charter but it doesn't seem to work. For example, I tried:               \documentclass{article}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}     \usepackage{amssymb}     \pagestyle{empty}          \begin{document}          $\mathsf{\mathbf{}}$           ${\mathchar"027E8}$          \end{document}      This does compile with pdfLaTeX but it doesn't work correctly: it produces another character, not `\lBrack`. ps: I don't have a clue why I need to put `\mathsf{\mathbf{}}` there, neither I understand why I need the `amssymb package`, but without these it doesn't compile. It gives an error               \textfont 7 is undefined (character è)


title: Use a symbol in a formula that's been defined over elsewhere

text: In my document preamble, I'm using:               \usepackage{fancyvrb}     \DefineShortVerb{\|}      It means I can indicate that things are to be rendered as code with `|This_is_monospaced|`, but now I'm trying to use vertical bars to represent magnitude in a formula, as such: `$|V|$` (typeset with amsmath) What I'm currently getting is a verbatim environment within my formula. Is there a way of temporarily disabling the monospacing behaviour so my formula still renders normally?


title: How to count all characters including spaces?

text: How can I count the number of characters in the compiled version of a Latex file? This should include spaces and all of the document (index, footnotes, bibliography etc)


title: \vfill between items in a list

text: I want to create a list and have `\vfill` between all the items. Something like this:               \documentclass{article}          \begin{document}          \begin{itemize}     \item One \vfill     \item Two \vfill     \item Three \vfill     \item Four \vfill     \end{itemize}          \end{document}      which works, but would be more elegant if it was like this:               \documentclass{article}          \begin{document}          \renewcommand{\itemsep}{\vfill}     \begin{itemize}         \item One         \item Two         \item Three         \item Four     \end{itemize}          \end{document}      But I get errors (because `\itemsep` is a length?). So how can this be achieved? Further, I would want it only to affect the local environment, rather than globally for all such lists.


title: How can I adjust the position of xlabel and ylabel with pgfplots?

text: I would like to have `\sin x` on top of the y-axis' arrow tip and `x` somewhere on the right of the x-axis' arrow tip. How can I achieve that? On top of that, I would like to know how I can tweak the distances myself. There is 7.4.1 in the manual but using that code does not work out. **MWE (taken from p. 50)**               \documentclass{scrartcl}          \usepackage{     pgfplots,     amsmath     }          \usepackage[T1]{fontenc}     \usepackage{lmodern}               %\pgfplotsset{every axis label/append .style={}}     %\pgfplotsset{every axis x label/append .style={     %at={(0.5,0)},     %right,     %yshift=5pt}}          \begin{document}     \begin{center}     \begin{tikzpicture}     \begin{axis}[     minor tick num=2,     axis y line=left,     axis x line=middle,     xlabel=$x$,ylabel=$\sin x$     ]     \addplot[blue,mark=none]     plot[domain=-5:5,samples=40]     (\x,{sin(\x r)});     \end{axis}     \end{tikzpicture}     \end{center}     \end{document}


title: Bend 3D cylindrical object

text: I am trying to draw the following image with TIKZ. My question is that, is it possible to bend 3D objects in TIKZ. I would like to bend the cylinder object in the code that I have given below and produce the following figure. ![enter image description here](http://i.stack.imgur.com/IdeXy.png) What I have achieved so far is to draw a cylinder with tikz -               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \pgfmathsetmacro{\radius}{0.25}     \pgfmathsetmacro{\length}{5}          \fill[fill=white] (\radius,0) -- (\radius,\length) arc (360:180:\radius cm and 0.5*\radius cm) -- (-\radius,0) arc (180:360:\radius cm and \radius cm);     \fill[top color=gray!90!,bottom color=gray!2,middle color=gray!30,shading=axis,opacity=0.25] (0,\length) circle (\radius cm and 0.5*\radius cm);     \draw[ultra thick,gray!90] (-\radius,\length) -- (-\radius,0) arc (180:360:\radius cm and \radius cm) -- (\radius,\length) ++ (-\radius,0) circle (\radius cm and 0.5*\radius cm);     \end{tikzpicture}      \end{document}       Thank You !


title: Reference range of sections with a dash

text: In my document, I reference a string of sections within a sentence. A representative example would be:               I am referencing Sections \ref{A}, \ref{B}, \ref{C}.      This then comes out t something like:               I am referencing Sections 6.1, 6.2, 6.3.      How can I get it to display:               I am referencing Sections 6.1-3      without hard-coding it?


title: pgfplots stacked bar chart: remove spacing between bars

text: How can I completely remove the spacing between the bars in a pgfplots stacked bar chart? I've tried using code from this answer, but it doesn't produce a legend. Here's the example from the manual.               \pgfplotsset{width=7cm,compat=newest}     \begin{document}     \begin{tikzpicture}     \begin{axis}[ybar stacked]     \addplot coordinates     {(0,1) (1,1) (2,3) (3,2) (4,1.5)};     \addplot coordinates     {(0,1) (1,1) (2,3) (3,2) (4,1.5)};     \addplot coordinates     {(0,1) (1,1) (2,3) (3,2) (4,1.5)};     \end{axis}     \end{tikzpicture}     \end{document}


title: Parentheses in thebibliography environment

text: I want to change the default square brackets in the entries of the thebibliography environment to parentheses. Sample:               % sample.tex          \documentclass{article}          \begin{document}     \pagestyle{empty}     \begin{thebibliography}{99}     \bibitem[Sample]{Sample} Sample.     \end{thebibliography}          \end{document}      The output is: ![enter image description here](http://i.stack.imgur.com/tTvMD.png) but I want:               (Sample) Sample      Is it possible to change it in "thebibliography" environment?


title: PGFplots - label each group plots

text: In this group plot how do I add labels to individual graphs. I want to label each graph as (a), (b), (c)...                \documentclass[margin=5mm]{standalone}             \usepackage{pgfplots}             \usetikzlibrary{matrix}             \usepgfplotslibrary{groupplots}             \pgfplotsset{compat=newest}             \begin{document}                  \begin{tikzpicture}                     \begin{groupplot}[group style={group size= 2 by 4},height=5cm,width=6.4cm]                             \nextgroupplot[title=type1,ylabel={Range1 }]                                             \addplot[blue] {x};\label{plots:plot1}                                             \addplot[red] {x^2};\label{plots:plot2}                                             \addplot[green] {2*x};\label{plots:plot3}                                             \coordinate (top) at (rel axis cs:0,1);% coordinate at top of the first plot                             \nextgroupplot[title=type2]                                             \addplot[blue]{x};                             \nextgroupplot[ylabel={Range2 }]                                             \addplot[blue]{x};                             \nextgroupplot                                             \addplot[blue]{x};                             \nextgroupplot[ylabel={Range3 }]                                             \addplot[blue]{x};                             \nextgroupplot                                             \addplot[blue]{x};                             \nextgroupplot[xlabel={Number of Threads},ylabel={Range4 }]                                             \addplot[blue]{x};                             \nextgroupplot[xlabel={Number of Threads}]                                             \addplot[blue]{x};                                             \coordinate (bot) at (rel axis cs:1,0);% coordinate at bottom of the last plot                     \end{groupplot}                     \path (top-|current bounding box.west)--                                  node[anchor=south,rotate=90] {throughput}                                  (bot-|current bounding box.west);             % legend             \path (top|-current bounding box.north)--                         coordinate(legendpos)                         (bot|-current bounding box.north);             \matrix[                     matrix of nodes,                     anchor=south,                     draw,                     inner sep=0.2em,                     draw                 ]at([yshift=1ex]legendpos)                 {                     \ref{plots:plot1}& curve 1&[5pt]                     \ref{plots:plot2}& curve2&[5pt]                     \ref{plots:plot3}& curve 3\\};             \end{tikzpicture}             \end{document}      output: ![output](http://i.stack.imgur.com/IDJYs.png)


title: latex math symbol for pointer in object oriented context

text: I need to use the pointer symbol (like P->a) in math latex. If I use normal characters like hyphen and > it doesn't look good. I guess there should be a specific symbol for it in latex, but I didn't find it anywhere. The hyphen should be connected to the edge of ">", like when you type --> in microsoft office and it changes it automatically. Any idea?


How can I produce this table of cumulative numbers? I tried without success. ![table cumulative numbers](http://i.stack.imgur.com/N6RN3.png)


title: Adding space after paragraphs affects references

text: I am using the following command in order to have an empty line after each paragraph.               \setlength{\parskip}{\baselineskip}     \setlength{\parindent}{0pt}%      However, by doing so, the references generated with bibtex also get some spaces which I do not want and which disappear if I remove the code above. Is there any way of removing that space? Also, is there any way of removing the spacing before a chosen paragraph?


title: Numbered equation with inline text

text: I am quite new to LaTeX so please excuse me for my ignorance. I can not figure out how to write a numbered equation with inline text. Can someone please tell me why this does not work? I use `\usepackage{amsmath}`.               \begin{equation}     \sqrt{\lambda}=n \pi \qquad \text{for $n=1,2,3$ \ldots}     \end{equation}      The expression works fine without the text but I really need it included because my expression is a series.


title: Latex mirror margins

text: I need to have my document binded after being being printed, and so I need a 3.75 margin on every page on the side that will be binded. Is there any way of doing this?


title: How to give reference to used programming files in my thesis?

text: I am writing my thesis and I use a programming language to do the analysis of my empirical part in my thesis. I give interpretations, tables and graphics according to the code in the programming files. Now, I want to give reference to this files in my master thesis, whenever I interpret the results or show graphics, which were generated by these files. Sometimes it is just one file, sometimes more than one file. In the text, I could use the margins to give reference to the files. In the graphics and tables, I could include it in the caption. However, I wanted to ask, if there is a professional solution for this problem. I would like to create a designes reference, e.g. see this: Under a table, they give reference to the .xpl file with a self-created logo: ![sl](http://i.stack.imgur.com/TsjFU.png) I am aware of the fact, that the design of the logo itself I have to do with a graphical tool, but how can I implement this logo with the filename in a professional way? It does NOT need to be a hyperlink or active link.


title: Listings package: including punctuation in "emph" list

text: I'm typesetting some examples of a system which has this sort of look:               In:  2+2     Out: 4      and I'd like to emphasis the "In:" and "Out": This works:               \begin{lstlisting}[basicstyle=\ttfamily,emph={In,Out},emphstyle=\bfseries]       In:  2+2       Out: 4     \end{lstlisting}      but this:               \begin{lstlisting}[basicstyle=\ttfamily,emph={In:,Out:},emphstyle=\bfseries]       In:  2+2       Out: 4     \end{lstlisting}      where I want to include the colons in the emphasis, doesn't. I've experimented with including `alsoletter={:}` in the options, to no effect. Is there a simple way to achieve this? Note, I am in fact using listings as part of a new environment defined with the `tcolorbox` package. So:               \newenvironment{pyth}{%        \tcblisting{listing only,colback=vlgray,colframe=vlgray,enhanced,         overlay={\node[draw,fill=black,xshift=-10pt,yshift=4pt,left,text=white,              anchor=east,font=\footnotesize\bfseries]               at (frame.south east) {Python};},%         listing options={alsoletter={:},emph={In:,Out:},emphstyle=\bfseries,         basicstyle=\small\ttfamily,breaklines=true,language=Python},}}     {\endtcblisting}      and then in my text:               \begin{pyth}     In:  2+2     Out: 4     \end{pyth}      In this particular environment `alsoletter` appears to have no effect.


title: How to plot Feynman diagrams with PSTricks

text: I need to plot some Feynman diagrams for my research papers. Although I had some experience in plotting with PSTricks, it is still not an easy job to plot Feynman diagrams. Could someone provide some tips to make it easier? Many thanks in advance!


title: Use CSV data in table caption?

text: I want to use some data, imported with csvsimple, in a table caption.               \begin{filecontents*}{data.csv}     column1,column2,column3     name1,val1a,val1b     name2,val2a,val2b     \end{filecontents*}          \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{csvsimple}          \newcommand{\csvget}[3]{\csvreader[no head, filter equal={\thecsvinputline}{#2}]{#1}{}{#3}}          \begin{document}     \listoftables          \begin{table}        \centering        My Tabular        \caption{A caption \csvget{data.csv}{2}{\csvcolii}}     \end{table}          \end{document}      Using the code from above I get an error like `Argument of \@caption has an extra...`   Any suggestions? Thanks in advance   CX


title: Place image and Text in same title line

text: I have title part in latex code and i want to put image in left side. Page is in center.               \title{\vspace{-15mm}     \fontsize{25pt}{10pt}\selectfont     \textbf{\hspace*{-1pt}      \includegraphics[width=0.15\textwidth]{./img/logo.png}\hfill      \hspace*{-100pt} This Text}}      But After this code "This Text" is going to left side (something between left and center) How to put them correctly? Thanks for attention...


title: Full screen Beamer problems

text: Is it possible to do full screen which covers the whole screen? When I use full screen option for my pdf file created from beamer presentation, I see some space is being wasted on right and left side of the screen.. But as we know power point in full screen mode covers the entire screen without leaving any black spaces ...Any help would be really appreciated ..               \documentclass{beamer}          \usetheme{CambridgeUS}     \usecolortheme {orchid}                   \setbeamercolor*{palette tertiary}{use=structure,fg=white,bg=blue}                    \mode<presentation>          \usepackage{graphicx}     \usepackage{comment}     \usepackage{hyperref}     \usepackage {xcolor}     \usepackage{graphicx,epsfig,setspace,subfig,url,amsmath}     \usepackage{indentfirst}     \usepackage{listings}     \usepackage{array}     \usepackage{multirow}     \usepackage{multicol}     \usepackage{enumerate}     \usepackage[english]{babel}     \usepackage{booktabs}     \usepackage{etex}     \usepackage[all]{xypic}     \usepackage{color}     \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \usepackage{times}     \usepackage[T1]{fontenc}                    \title[Random Sampling ] % (optional, use only with long paper titles)     {Random Sampling\\ Case Study}                                    \pgfdeclareimage[height=1 cm, interpolate=false]{university-logo}{university-logo-filename}      \logo{\pgfuseimage{university-logo}}          \setbeamercolor*{title}{bg=blue,fg=white}               \begin{document}               \section{Introduction}               % FRAME 1     \begin{frame}{Introduction}      Random sampling is done to gather data about the population in order to make an inference that can be generalized to the population.\\     \vspace{12pt}     Steps in sampling     \begin{itemize}     \item   Define population $(N)$ to be sampled     \item Determine sample size $(n)$     \item Control for bias and error     \item Select sample     \end{itemize}      \end{frame}                         % FRAME 2     \begin{frame}{Introduction}     \textbf{Define population to be sampled}: - Identify the group of interest and its characteristics to which the findings of the study will be generalized.\\     \vspace{12pt}     \textbf{Determine sample size $(n)$}:- The size of the sample influences both the representativeness of the sample and the statistical analysis of the data.\\     \vspace{12pt}     \textbf{Control for bias and error}: - Be aware of the sources of sampling bias and identify how to avoid it and decide whether the bias is so severe that the results of the study will be seriously affected.\\     \vspace{12pt}     \textbf{Select sample}:- A process by which the researcher attempts to ensure that the sample is representative of the population from which it is to be selected.     \end{frame}                    \end{document}


title: Problem with hyperref and hypdvips

text: In my table of contents, there are entries that span more than one line. Since I compile with LaTeX -> PS -> PDF, the links created by `hyperref` are not correctly displayed in the output file (pdf). To fix this issue, I added `\usepackage{hypdvips}` in my preamble. Here is my minimal working example:               \documentclass{scrbook}          %\usepackage[USenglish]{babel}     %\usepackage[T1]{fontenc}     %\usepackage[latin1]{inputenc}      \usepackage[breaklinks=true]{hyperref} %breaklinks=true allows link text to break across lines;     \usepackage{hypdvips} %The hypdvips package fixes some problems when using hyperref with dvips as backend driver.          \listfiles          \begin{document}          \tableofcontents          \chapter{A short chapter heading}              \section{A short section heading}          \chapter{A very long never ending far reaching comprehensive illustrative long chapter heading}              \section{A very long never ending far reaching comprehensive illustrative long section heading}                  \subsection{Short: Two alternative models for the workforce assignment problem}                   \subsection{Long: Limitations of the models and potential remedies and extensions}           \end{document}      However, adding **hypdvips** leads to two error messages:   1.     ! Undefined control sequence.     \tableofcontents ->\backrefsetup                                       {disable}\pp@backup@tableofcontents \backre...     l.15 \tableofcontents        2.     ! Undefined control sequence.     \tableofcontents ...tableofcontents \backrefsetup                                                        {enable}     l.15 \tableofcontents      The output file is created and all links are correctly displayed but the words „disable“ and „enable“ appear in the output file. The problem seems to resemble the issue that has already been reported here. I use the latest version of the `hypdvips` package (Version 3.01), and pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=latex 2014.3.24). The error occurs for all document classes that I tested (`scrbook`, `book`, `scrartcl`, `article`, `scrreprt`, `report`). Any help would be appreciated.


title: In TeXnicCenter, click on error in output window does not show where error occured

text: I recently downloaded the most recent version of TeXnicCenter. In the past when I built my project, I could click on an error or warning message in the output window and a green arrow would appear to the left of the line number in the source code window where the error occurred. This doesn't work any more. Could someone please explain to me how to set this up?


title: How to set document font to times new roman by command

text: I wanted to know how to set font of a document to **Times New Roman** and size to 12 for text and for **Chapter Heading 14 only** , for the whole document. I don't want to use the `fontspec` package for this. Please help me out on this.


title: "! Missing $ Inserted" After writing an equation?

text: I've written the following lines,               \begin{equation}     FeTiO_{3} + 2H_{2}SO_{4} \rightarrow FeSO_{4} + TiOSO_{4} + 2H_{2}O     \end{equation}          After this, the resulting titanium oxygen sulphate is      extracted and hydrolised to form titanium dioxide. Before      My problem that I have is that, after trying to write a phrase after ending the equation, I get the error message, "! Missing $ Inserted" for both lines 78 and 79 (The two lines beginning the paragraph) followed by < insertedtext >$. I'm fairly new to latex and texmaker, so I'm not sure if this problem is easily solved or not, but it's really impeding on my progress with an assignment! Is there something I'm missing with this?


title: label in subcaption and customize cell size of an array

text: Using the following code               \documentclass[11pt]{article}     \usepackage{caption}     \usepackage{subcaption}     \DeclareCaptionSubType*[arabic]{table}     \captionsetup[subtable]{labelformat=simple,labelsep=space}          \begin{document}          \begin{table}[ht]     \begin{subtable}{.5\textwidth}     \centering     $\begin{array}{ | c | c | c | c | } \hline     \ast & \ast & \ast & \ast \\ \hline     \ast & \ast & \ast & \ast \\ \hline     \ast & \ast & \ast & \ast \\ \hline     \ast & \ast & \ast & \ast \\ \hline     \end{array}$     \subcaption{Subtable 1}     \label{lab1}     \end{subtable}     \begin{subtable}{.5\textwidth}     \centering     $\begin{array}{ | c | c | c | c | } \hline     \ast & \ast & \ast & \ast \\ \hline     \ast & \ast & \ast & \ast \\ \hline     \ast & \ast & \ast & \ast \\ \hline     \ast & \ast & \ast & \ast \\ \hline     \end{array}$     \subcaption{Subtable 1}     \label{lab2}     \end{subtable}     \caption{Sub Tables}     \label{lab3}     \end{table}          \end{document}      I can produce the below table and subtables. One question is how to use 1a, 1b as label (counter?), instead of 1.1, 1.2. ![pic](http://i.stack.imgur.com/ItOXn.png) The second question is how to customize the cell size in an array? In the above example, each cell is an exact square, but if I type something inside, it become (not exact ) rectangle automatically. One can use `\begin{array}{ | p{1cm} | p{1cm} | }` to fix the cell width to 1cm, but I didn't find a way to fix cell height. Also, even one can fix the size, how to put the content in the center? Final question is how to put a diagonal line or a cross in a cell? (I found a way which use TikZ, but if there is eaiser way? )


title: Use pgfplots and a custom length to define global width when inputing the plot

text: I'm trying to set the width for all my plots, that are defined in other files and imported into the main document, using a custom width, `\sz`. I'm trying to set this length because I want to change it for one or two columns. Like in this example, `main.tex`:               \documentclass{minimal}          \usepackage{standalone}     \usepackage{tikz}     \usepackage{pgfplots}          \newlength{\sz}     \setlength{\sz}{0.5\linewidth}     \pgfplotsset{width=\sz,compat=newest}          \begin{document}     \input{test}     \end{document}      `test.tex`:               \documentclass{standalone}          \usepackage{tikz}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[     x tick label style={     /pgf/number format/1000 sep=},     ylabel=Population,     enlargelimits=0.05,     legend style={at={(0.5,-0.15)},     anchor=north,legend columns=-1},     ybar interval=0.7,     cycle list name=color list     ]     \addplot     coordinates {(1930,50e6) (1940,33e6)     (1950,40e6) (1960,50e6) (1970,70e6)};     \addplot     coordinates {(1930,38e6) (1940,42e6)     (1950,43e6) (1960,45e6) (1970,65e6)};     \addplot     coordinates {(1930,15e6) (1940,12e6)     (1950,13e6) (1960,25e6) (1970,35e6)};     \addplot     coordinates {(1930,15e6) (1940,12e6)     (1950,13e6) (1960,25e6) (1970,35e6)};          \legend{Far,Near,Here,There}     \end{axis}     \end{tikzpicture}     \end{document}      However, when I'm compiling it, the length of `\sz` is reset to zero. And I get the error: `Error: Plot width '0.0pt' is too small.` Is there any way of setting the length so that the figure in the other file is able to 'see' it?


title: scrlttr2: How can I remove the white space between "address" and "Subject:" line?

text: How may I remove excessive white space at the top, between my address in top- left, and the Subject: line?               \documentclass{scrlttr2}     \usepackage[english]{babel}     \usepackage{graphicx}     \KOMAoptions{fromalign=left, fromlogo=false, addrfield=false, backaddress=false, subject=titled}          \setkomavar{fromname}{My Name blah}     \setkomavar{signature}{blah blah}     \setkomavar{fromaddress}{blah blah\\blah blah}     \setkomavar{fromemail}{blah@blah}     \setkomavar{fromphone}{123456789}     \setkomavar{subject}{Reference: blah blah}          \begin{document}     \begin{letter}{asde\\werd\\wesd}     \opening{Dear Adam,}     blah blah     \closing{Yours Sincerely\\ \mbox{}}     \end{letter}     \end{document}


title: PDF bookmark customization

text: I've seen a couple of PDFs which have come of their bookmarks ("index" tab in most viewers) set either in italics, bold or both. Googling around I found that the `bookmark` package is supposed to do this (I even used its `\bookmarksetup{startatroot}` command to have a bookmark to an unnumbered chapter before the first part of the document appear as it should) but I find the documentation a bit confusing. I tried setting the style for the bookmarks with either               \bookmarksetup{italic}      and               \bookmarksetupnext{italic}      but it seems nothing happens. Maybe it's a viewer issue (I'm using Evince 3.2.0 under Ubuntu right now). Has anyone succeeded in this? how so?


title: Aligning nodes with TikZ

text: Consider this: ![misaligned nodes](http://i.stack.imgur.com/tRBpZ.png) There are several problems:   1. The `\exists` operator is not horizontaly aligned with the following node (a,b).   2. There is too little space between `foobar` and the node below it and between the (a,b) node and the nodes below it.   3. The right arrow is not horizontally aligned with the preceding and following nodes. (I know that I can draw arrows with TikZ, this is just a placeholder.) Any help on resolving these issues is greatly appreciated. Here is the code at present.               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{shapes.multipart,positioning,fit}          \begin{document}          \begin{tikzpicture}[       node distance=3mm and 3mm,       drs/.style={draw, rectangle split, rectangle split parts=2}       ]       \node[drs,align=left]         { foo           \nodepart{two}                  foobar \\                  \tikz{               \node (operator) {$\exists$};               \node[drs,right=of operator]{                 a%                 \nodepart{two}{                   b%                 }               };             } \\                  \tikz{               \node[drs] (left side)                 { 1%                   \nodepart{two}                     2%                 };               \node[right=of left side] (operator) {$\rightarrow$};               \node[drs,right=of operator] (right side)                 { 3%                   \nodepart{two}                     4 \\                     5 \\                     6%                 };             }         };     \end{tikzpicture}               \end{document}


title: How to put part of a TikZ graphic into a box to measure its size

text: After adding support for tooltips today in `pdfcomment` (`\pdftooltip`) I wanted to make a `TikZ` example with tooltip annotations. Within `\pdftooltip` the annotated element is set into a box to measure the size, which does not work for parts of a `TikZ` graphic. There are workarounds (manual box or `\textbullet`) in the following example:               \documentclass{article}     \usepackage{tikz}     \usepackage{pdfcomment}[2011/05/19]     % http://svn.berlios.de/viewvc/pdfcomment/trunk/dev/tex/latex/pdfcomment/pdfcomment.sty?revision=11     \begin{document}     \begin{tikzpicture}[scale=1.5]         % Draw axes         \draw [<->,thick] (0,2) node (yaxis) [above] {$y$}             |- (3,0) node (xaxis) [right] {$x$};         % Draw two intersecting lines         \draw (0,0) coordinate (a_1) -- (2,1.8) coordinate (a_2);         \draw (0,1.5) coordinate (b_1) -- (2.5,0) coordinate (b_2);         % Calculate the intersection of the lines a_1 -- a_2 and b_1 -- b_2         % and store the coordinate in c.         \coordinate (c) at (intersection of a_1--a_2 and b_1--b_2);         % Draw lines indicating intersection with y and x axis. Here we use         % the perpendicular coordinate system         \draw[dashed] (yaxis |- c) node[left] {$y'$}             -| (xaxis -| c) node[below] {$x'$};         % Draw a dot to indicate intersection point         %% 1 - add a box manually %%         \fill[red] (c) circle (2pt);         \draw (c) node {\pdftooltip{\rule{0pt}{5pt}\rule{5pt}{0pt}}{This is the intersection point\textCR of the two lines!}};         %% 2 - use \textbullet, which produxes a size in a box %%         %\draw[red] (c) node {\pdftooltip{\textbullet}{This is the intersection point\textCR of the two lines!}};         %% 3 - produces an error %%         % "\fill[red] (c) circle (2pt);" can not be put in a box to measure the size         %\pdftooltip{\fill[red] (c) circle (2pt);}{This is the intersection point\textCR of the two lines!}}         \end{tikzpicture}     \end{document}      ![graphic with tooltip annotation](http://i.stack.imgur.com/efA3T.png) Is there a way that part of a `TikZ` graphic does produce a size when set into a box?


title: TikZ: draw only a certain central length of a given path

text: I have two nodes (A) and (B), and I want to only draw a central segment of the straight line between them, of a certain given length (say 2cm, but will vary). Is there some way I can do this? I am guaranteed that (A) and (B) are at least 2cm apart. I know about shorten < and shorten >, but the problem is that I don't know the exact amount to shorten by, and I don't want to have to do the calculation myself each time.


title: Compile just a part of the contents in a .tex file

text: > **Possible Duplicate:**   >  How can I ignore everything _except_ a specified environment? I am looking for a package or a command, say `compileonly`, that can do the following task: For a `.tex` file as following,               \begin{document}          This is A.          \begin{compileonly}     This is B     \end{compileonly}          This is C          \end{document}       The result will be `This is B`. Does such a thing exist? * * * Thanks all the reply. Finally, the best solution is to use `xcomment` package and define a new environment `\compileconly` and use `\begin{compileonly}` and `\end{compileonly}` inside `\begin{xcomment}{compileonly}` and `\end{xcomment}`


title: How to reference the page of a figure?

text: Is it possible to make a reference to the page where a figure is rendered? I would like to write something like               see figure~\ref{figure-xyz} on page NN      where NN will automatically be maintained by LaTeX. The figure that prompted my question is almost a page so it may be floated further in the doc. I suppose it's possible, after all the figure-to-page mapping is generated by `\listoffigures`.


title: How to define a macro that uses image width and height to define a variable for later use

text: Ok, the title might be a bit cryptic and my question is a bit lengthy, so please bear with me. What I want to do is: I have two images with different aspect ratios that I want to place next to each other using `subfloat`. Together both images should fill the `\textwidth` and on the other hand have the same height. Also a gap between both images should be allowed. Analytically there is only one physical height (say `\finalheight`) for both images, such that all conditions are fullfilled:               \finalheight = (\textwidth - gap_width) / (width_im_1/height_im_1 + width_im_2/height_im_2)      where the annotations `_im_1` and `_im_2` refer to the first and the second image, respectively. Once calculated the `\finalheight` can then used in the figure command as follows:               \begin{figure}     \begin{centering}       \subfloat[]{\includegraphics[height=\finalheight]{fistimage}}       \hfill       \subfloat[]{\includegraphics[height=\finalheight]{secondimage}}     \end{centering}     \end{figure}       I have already a code that works within the body of the document i.e.:               \newlength\firstheight     \newlength\firstwidth     \newlength\firstratio     \newlength\secondheight     \newlength\secondwidth     \newlength\secondratio     \newlength\gapspace     \newlength\finalheight     \newlength\effwidth     \newlength\sumratio          \def\first{\includegraphics{pathToFirstImage}}     \setlength{\firstheight}{\heightof{\first}}     \setlength{\firstwidth}{\widthof{\first}}     \pgfmathsetmacro{\firstratio}{\firstwidth/\firstheight}          \def\second{\includegraphics{pathToSecondImage}}     \setlength{\secondheight}{\heightof{\second}}     \setlength{\secondwidth}{\widthof{\second}}     \pgfmathsetmacro{\secondratio}{\secondwidth/\secondheight}          \setlength{\gapspace}{0.5cm}          \setlength{\effwidth}{\textwidth-\gapspace}     \setlength{\sumratio}{\firstratio+\secondratio}          \pgfmathsetmacro{\finalheight}{\effwidth/\sumratio}      However, I now tried to package the above code as a macro:               \newcommand{\calcoptimalheight}{3}[0.5cm]{     ...      }      with only these lines modified:               \def\first{\includegraphics{#2}}     \def\second{\includegraphics{#3}}     \setlength{\gapspace}{#1}  .      This however results in an               "! Illegal unit of measure (pt inserted)"       error when trying to evaluate               \def\first{\includegraphics{#2}}  .       **Now finally my question:** Is there some reason that `\includegraphics` may not be used this way in a macro. If not is the approach altogether wrong to use a macro to set a variable as explained above. I've been using LaTeX for quite some time, but I never messed too much with macros or custom variables myself and could not find help for this issue searching the web. **Edit** : Inculding the suggestions from the answer below the code works, the problem was the wrong syntax in the `\newcommand` definition: `{3}` instead of `[3]`. Unfortunately, the error message sent me on the wrong path, I should have seen that. After inculsion of the improvemts from How to preserve lenghts to use with \includegraphics scaling, when calculating them with pgf also the error message is solved. In case it is useful for somebody I add an minimal working example including the solutions from the answers to this and the other question:               \documentclass[12pt, twoside, paper=A4]{scrbook}     %     \usepackage{calc}     \usepackage{pgf}     \usepackage{graphicx}     \usepackage{subfig}     %     \newcommand{\optimalheight}[3][0.5cm]{%       \newlength\firstheight%       \newlength\firstwidth%       \newlength\secondheight%       \newlength\secondwidth%       \newlength\effwidth%       \newlength\finalheight%       \def\firstim{\includegraphics{<imageA>}}%       \def\secondim{\includegraphics{<imageB>}}%       \setlength{\firstheight}{\heightof{\firstim}}%       \setlength{\firstwidth}{\widthof{\firstim}}%       \pgfmathsetmacro{\firstratio}{\firstwidth/\firstheight}%       \setlength{\secondheight}{\heightof{\secondim}}%       \setlength{\secondwidth}{\widthof{\secondim}}%       \pgfmathsetmacro{\secondratio}{\secondwidth/\secondheight}%       \pgfmathsetmacro{\gapspace}{0.5cm}%       \pgfmathsetlength{\effwidth}{\textwidth-\gapspace}%       \pgfmathsetmacro{\sumratio}{\firstratio+\secondratio}%       \pgfmathsetlength{\finalheight}{\effwidth/\sumratio}%       }     %        \newcommand{\subfloatsSameheight}[3][0.5cm]{%       \optimalheight{#2}{#3}%       \subfloat[a)]{\includegraphics[height=\finalheight]{#2}}%       \hfill%       \subfloat[b)]{\includegraphics[height=\finalheight]{#3}}%     }     %     \begin{document}     %     \begin{figure}[]      \begin{centering}        \subfloatsSameheight{<imageA>}{<imageB>}        \caption[]{}        \label{}      \end{centering}     \end{figure}      %     \end{document}


title: Regarding Changing Captions and Including Them in Different Lists of Interest

text: I have created several large tables in Excel and MATLAB. Since it is very time-consuming to manually copy and paste these tables in LaTeX, I would like to include them as figures in LaTeX. I would really appreciate it if someone could help me with the following questions:   1. Is it possible to include tables from MATLAB or Excel without having to manually copy and paste the cells in LaTeX?   2. If I import a table as a figure into LaTeX, how can I change the caption from "Figure" to "Table" and have it listed in the "List of Tables" instead of "List of Figures"? Thank you very much in advance for your time and help.


title: create a framed environment for a margin note

text: What am trying to achieve is the following: ![enter image description here](http://i.stack.imgur.com/Yig6j.png) Of course, if this can be done so that there is a switch between even and odd pages. Currently I am only interested in the not appearing on the LHS margin. I currently do not have a MWE but I am throwing out the question. Probably you can start from here:               \documentclass[letterpaper]{article}     \usepackage[dvipsnames]{xcolor}     \usepackage{marginnote}     \usepackage{etoolbox}     \usepackage{calc}          \makeatletter     \patchcmd{\@mn@margintest}{\@tempswafalse}{\@tempswatrue}{}{}     \patchcmd{\@mn@margintest}{\@tempswafalse}{\@tempswatrue}{}{}     \reversemarginpar     \makeatother          \setlength{\marginparwidth}{2in}          \oddsidemargin 2in          \def\fbx#1{\vbox{\hbox{\hbox{#1}\setbox0\lastbox\copy0\kern\fboxsep\vrule width\fboxrule depth\dimexpr \fboxsep+\dp0\relax}%                 \hrule height\fboxrule}}           \newcommand\caution[1]{%     \renewcommand*{\raggedleftmarginnote}{}     \relax\leavevmode\marginnote{%             {\sffamily\bfseries\textcolor{BrickRed}{Caution!}}\\[1pt]%             \fbx{\parbox[t]{\dimexpr\linewidth-3\marginparsep\relax}{#1}}%         }     }     \begin{document}     test \caution{some random text for testing caution frame}. some random text some random text some random text some random text some random text.     \end{document}      ![enter image description here](http://i.stack.imgur.com/1fDTq.png)


title: Correct way to use include and includeonly when writing a large document like a thesis

text: I am writing a large document with several chapters and I would like to work on each chapter separately. In my `main.tex` I include the chapters either like                \include{chap1.tex}      \include{chap2.tex}      \include{chap3.tex}      or                \input{chap1.tex}      \input{chap2.tex}      \input{chap3.tex}      I think `\include` is preferable if I want things to be referenced and cited correctly? but doing it the `\include` way `latex main.tex` I don't get any `dvi` output whereas with `\input` things compile fine to `dvi`. What's going wrong here? I would then like to use `\includeonly` (or `\excludeonly` ) to work on individual sections of the document whilst maintaining the referencing etc. thanks for any help.


title: Htlatex and subcaption - can htlatex be extended?

text: To start with MWE:               \documentclass{article}          \def\pgfsysdriver{pgfsys-tex4ht.def}     \usepackage{tikz}          \usepackage{subcaption}          \begin{document}          \begin{figure}     \subcaptionbox{Small} { \tikz \draw (0cm,0cm) circle(5mm); }     \subcaptionbox{Big}   { \tikz \draw (0cm,0cm)  circle(20mm); }     \caption{Circles}     \end{figure}          \end{document}      This works to some degree with `htlatex`. However, `subcaption`-package gives warnings and I must press enter several times to get this compiled. Also, this could generate something like `<TD>Small . . . <TD COLSPAN=2>Circles...`, but does not. As a second and easier example, `\subpdfbookmark` gives error with `htlatex`. Is it possible to modify htlatex and/or packages and get this working properly?


title: How to draw and scale for large data values as a sparklines-like diagram with datatool & TikZ?

text: I want to draw rectangles by the measure of `++(1pt, 4pt)` at `(x, y)` where _x_ and _y_ are based on external data, but I am unsure on how I can proceed to get a proper graph for this. The obvious ideal example would be   ![ideal output](http://i.stack.imgur.com/yEdmT.png)   but like I said in the title I'm not strictly after 'sparklines', I guess it could also be called a scatterplot. So this is the text in the .csv-file. As you can see, I used the opportunity to include all sorts of columns and data in the .csv file and name the headers, which I find really useful. At least I think this is possible and I would like to continue doing it this way; I hope I didn't make an error along the way. I did this to create soem fake data to be able to get something out of it in TikZ because it said the dimensions were too large originally. **MWE**               \documentclass{scrartcl}          \usepackage{     tikz,     relsize,     amsmath     }     \usetikzlibrary{calc,trees,shadows,positioning,arrows,chains,shapes.geometric,shapes,matrix,shapes.symbols,patterns}          \usepackage[T1]{fontenc}     \usepackage{lmodern}          \usepackage{     datatool,     databar     }          \DTLloaddb[noheader=false]{Zeitreihen-BalanceLargeBank-1999-2013}{Balance-of-Large-Bank-1999-01-to-2013-04.csv}          \begin{document}     \begin{center}     \begin{tikzpicture}[font=\sffamily\small]         \DTLforeach*{Zeitreihen-BalanceLargeBank-1999-2013}{\x=xnum, \y=y}{\draw[fill=black] (\x*2 pt,\y cm) rectangle ++(1pt,4pt);}         \DTLforeach*{Zeitreihen-BalanceLargeBank-1999-2013}{\x=xnum, \y=xjahr}{\draw (\x*2 pt,0) node[anchor=north] {\y};}     \end{tikzpicture}     \end{center}     \end{document}


title: Problem listing more than 100 images in index

text: I have an appendix for a thesis with more than 100 images. The problem I have is that the generated index for those images _glues_ the numbers with the caption. Here is an image of what is happening: ![problem_image](http://i.stack.imgur.com/h0Mso.png) However, for images below 100, everything seems to be fine: ![wanted_result](http://i.stack.imgur.com/p2e9r.png) I am using a template from my university, which I present here:   * https://github.com/joaomlourenco/unlthesis/tree/master/LaTeX How can I fix this problem?


title: TikZ shadings and printing incompatibility

text: I would like to use some effects provided by the `shadings library` of `tikz`. More specifically, I am trying to use the `ball` and `radial` shadings (tikz 2.10 manual, p. 412-). The resulting pdf looks ok on screen, but causes problems when printing (tried with two different printers). Using the `ball` shading causes the printer to stall, showing just "processing.." indefinitely (well, at least for several minutes, for a very simple test figure). The `radial` shading makes the shaded node to print out as completely black. The printers stall also when trying to print the pages of the manual that contain examples of these shadings. The manual does warn about compatibility issues with `transparency` and `fadings`, but not directly about issues with `shadings`. Apparently similar issues nevertheless apply to shadings also. Question: a) Is there a way to make the `shadings library` to produce printer-friendly output? If not, then b) Are there safer (but still "simple") alternatives to produce similar effects within `tikz`? I have tried to play around with `ps2pdf` and `ps2pdf13`, but the resulting pdf behaves strangely even on screen (in evince): it looks soft (rasterized?) at certain zoom levels, zooming around is slow, and so on.


title: Different ways to enter mathmode - pros and cons

text: I know there are at least a few ways to enter mathmode in a `.tex` document, including `$ ... $`, `$$ ... $$`, `\( ... \)`, `\[ ... \]`, `\ensuremath{}`, and maybe more. Are there other ways to enter mathmode, and what are the differences between all of the possible ways to enter mathmode? I at least know that the difference between `\( ... \)` and `\[ ... \]` is a difference between inline mathmode and display mathmode, respectively. What are the differences between all of the other methods, and what are the pros and cons of each method? Are some meant to be used in certain cases; for example, are some meant for writing macros and others for actually writing content of the document? I know that this question provides an answer at least for the difference between `\[ ... \]` and `$$ ... $$`, but I am curious to know more about how they are _all_ different and what the pros and cons of each of them in different cases are (e.g., for macros, for content, etc.).


title: How to use soul with glossaries to space-out acronyms?

text: I want to increase the spacing between capital letters of acronyms inside text. Acronyms are printed by `\ac`, `\acs`, etc. commands of the `glossaries` package. `soul` package provides a nice command `\caps`. How can I modify glossaries to use `\caps` for acronyms? Here is an example that does not work.               \documentclass{article}     \usepackage{soul}      \usepackage[acronym,shortcuts]{glossaries}      \makeglossaries       \newacronym{OFDM}{OFDM}{Orthogonal Frequency Division Multiplexing}      \let\acbak\ac     \renewcommand{\ac}[1]{\caps\acbak{#1}}     \begin{document}            \noindent          \ac{OFDM} \\         \ac{OFDM} \\         \caps{OFDM}     \end{document}


title: Creating simple table (picture included)

text: I'm quite struggling. I'd like to centralize pretty much everything except Table X, Three long words and the left panel (Bla of... + abcde). Thanks for your suggestions. So far I came up with this:               \begin{table}          \caption{name}          \centering           \begin{tabular}{llllllll}          \hline          ~ & \multicolumn{5}{c}{Three long words}   \\           Blue of bla of ble  & 1 & 2 & 3 & 4 & 5  \\ \hline          A       &  10.2  & 10.2  &  10.2  &  10.2  &  10.2    \\          B       &   111.2 & 111.2 & 111.2 & 111.2 & 111.2 \\ \hline          \end{tabular}          \end{table}      But it doesn't work well. What I want to create: ![What I want to create](http://i.stack.imgur.com/JrJrA.jpg)


title: How can I programmatically populate a PDF's pdfcreator field?

text: As I understand it, embedding (as metadata) the typesetting engine that was used to produce a PDF document is good practice. Here is an example of how this can be done using the `hyperref` package:               \hypersetup{pdfcreator={pdflatex 1.40.14}}      However, hardcoding this information is error-prone. What if, between now and the final version of my document, I decide to switch typesetting engine, or what if a new version gets released, and I forget to update the metadata? If possible, I'd like to avoid hardcoding the typesetting engine (name and version) used... Is there an easy way of accessing that information during a run of that engine on my `tex` file?


title: A problem with placing a formula at the left side of the page

text: I'm having the integral of a function over path C1 and C2 .I want to have both c1 and c2 on the left side of my page but anything I use doesn't work . I tried to put it with the align* , itemize , [], and many other things , but the result was always the same . what should I do to put them on the left side of the page ?               \documentclass{article}               \usepackage{amsmath,amssymb}            \begin{document}     \begin{align*}     C_1:  x= y \implies z(t) = x(t)+ iy(t)= (1+i)t \qquad 0 \leqslant t \leqslant 1 \\     f[z(t)] = Re z(t) = t, \quad dz = (1+i)dt  \\     \int Re z dz  = (1+i) \int_{0}^{1} t dt = \frac{1}{2}(1+i) \\[1cm]     C_2:  z(t)  =      \left\{\!\! \begin{array}{l}     t \qquad  0 \leqslant t \leqslant 1 \\     1+i(t-1) \qquad a \leqslant 1 \leqslant 2     \end{array}\right.  \\     \int_{c_2} Rez dz = \int_{0}^{1} t dt  + i \int_{1}^{2}  dt = \frac{1}{2} + i      \end{align*}          \end{document}      ![enter image description here](http://i.stack.imgur.com/AxvYw.jpg)


title: Canvas transformation of grid to curvilinear grid

text: I would like to draw a curvilinear grid/mesh like this (sorry for freehand drawing) ![curvilinear grid](http://i.stack.imgur.com/Ad0DY.png) I thought the easiest (and most elegant) solution would be to apply a canvas transformation to a regular `grid` in _TikZ_. However, I found only this example in the _pgf/TikZ manual_ , which rotates a grid:               \documentclass{standalone}     \usepackage{pgf}       \begin{document}         \begin{pgfpicture}         \pgftransformrotate{10}         \pgfpathgrid[stepx=1mm,stepy=2mm]{\pgfpoint{0mm}{0mm}}{\pgfpoint{30mm}{30mm}}         \pgfusepath{stroke}       \end{pgfpicture}     \end{document}      ![rotated grid](http://i.stack.imgur.com/Owasj.png) Do these kind of transformations exist or should I use the recommended solution in this question on polar grids.


title: Is there no easier way to float objects and set margins?

text: I come from a HTML / CSS background and am used to a particular way of setting margins, floats, etc. As a beginner in TeX, I am having a hard time positioning elements, probably because my mindset is still in CSS positioning and I do not yet grasp the TeX way. After struggling for two hours, I now more or less set up a letterhead that I soon want to set out as a background (which I just learned here). But I feel my code took way too long (I'm learning, but still) to write and not clean (I feel I'm using the wrong commands). So to get a better grasp on positioning, I would like to ask how I _should_ get this done: ![enter image description here](http://i.stack.imgur.com/FpRhL.png) This is something I made in HTML and it is supposed to be the header of a letter (used a placeholder logo for this sample). From my standpoint, this is what I need to do:   * Create a page with this particular height and width   * Set the text to appear in the vertical center, and with a little distance from the left   * Float the logo to the right hand side, with a little space from the top and right After my struggle, this is the code I put together:               \documentclass[a4paper]{article}     \usepackage{graphicx}     \graphicspath{{./img/}}     \usepackage{color}     \usepackage{xcolor}     \definecolor{grey}{HTML}{F4F4F4}     \definecolor{darkgrey}{HTML}{333333}     \usepackage{wrapfig}     \usepackage{fullpage}     \usepackage[margin=0.1cm, paperwidth=497pt, paperheight=40mm]{geometry}          \begin{document}          \pagecolor{grey}          \begin{wrapfigure}{r}{3cm}     \includegraphics[height=3cm]{html5}     \end{wrapfigure}          \Large \textcolor{darkgrey}{\\ \\ \textbf{Our Company} \\ Our Slogan}          \end{document}      This is what I get: ![enter image description here](http://i.stack.imgur.com/WPwpU.png) My problems:   * I _had_ to use several newlines to get the text centered vertically. If I used `vfill`, my logo jumped away.    * The logo borders are 'rugged', whereas they are smooth in the HTML version. The logo is high resolution and looks fine if I zoom in in the PDF to 500%, but it looks bad at 100%.    * The way I float the image feels wrong. It's quite some code to just float it (remember, I come from `float:right`, so I am biased here, maybe this _is_ the way to go)... is that how it should be? Any other tips on better understanding floating and margins is appreciated, especially taking into consideration these kinds of 'designs' rather than articles and more standard text documents.


title: What is a good way to hack apacite to show DOIs in apa 6th style?

text: I've needed to add doi's to the end of my references in order to comply with APA 6th edition. At first, I found this discussion about DOIs and apacite, but it didn't really provide a solution. After reading the apacite manual and then the apacite.sty file, I found out about how to apply modifications. In the end I've adopted a hack: I place the doi in the `note` field of the each bibtex reference. I then add the following command to my document preamble in order to prevent the doi from being enclosed in brackets.               \renewcommand{\APACrefnote}[1]{%       \ifx\@empty#1\@empty       \else         {#1}%       \fi     }      It seems to work, but it also feels like a bit of hack.   * Can you see any problems with the above approach?   * Is there a better option at this point for incorporating dois into apa references?


title: How to repeat chapter numbers

text: I'm writing my Ph.D. thesis, and I have to write the Introduction both in English and in Spanish. Since the content is the same, I want to repeat the number of this first chapter: >   1. Introducción. >   2. Introduction. >   3. Next Chapter, etc. > If I simply reset the counter by calling `\setcounter{chapter}{0}` I obtain the desired numbering, but the table of contents that appears in the left margin of pdf viewers looks odd: All the chapters are nested into the first one. On the other hand, the links in the `\tableofcontents` page don't behave properly, i.e. if I click on the link corresponding to the spanish introduction, I'm sent to the english (the last) one. I guess I should create a special kind of chapter for the spanish introduction in order to obtain a repeated number that do not interfere with the `\tableofcontents` or associate a new counter to `\chapter` in order to separate the two versions. Any help?


title: Tufte-Style Asides

text: I have been using the Tufte-Style template for documents for a while, but found them to be restrictive on other document formats that I have been asked to produce. I make extensive use of 'asides' and footnotes, and so it is nice to define footnotes like his, but the regular Tufte style doesn't fit specifications for the rest of the document. I am mainly interested in redefining the footnote command as he did and implement this in a regular LaTeX article or book class. Specifically, I wish to create a mini-style file that defines footnotes like this: ![Paper written by Jason Catena](http://i.stack.imgur.com/U80n5.png) but still allows me to work with regular LaTeX. Does anyone have a good method of creating these? Margin notes with a counter works but with multiple notes they tend to overlap when more than one note is used. If it helps, I have found that it is implemented in tufte-common.def, but I am not knowledgeable on the subject to implement it otherwise.


title: how to manage header of first page and rest of the pages differently

text: I want different header of first page of the article and on rest of the pages I want author name and article name to appear alternately.


title: Passing (a lot of) parameters to a file at compilation time

text: It is possible to pass some parameters when compiling a `myfile.tex` file:               pdflatex "\some\parameters\input{myfile}"      But, if the number of parameters increase, this is not very practicable. So I'd like to store them in a file (possibly a personal package), say `myparameters.sty`, and load them at the compilation time. Of course:               pdflatex "\input{myparameters.sty}\input{myfile}"      doesn't work as the compiled file is `myparameters.sty`. But, whereas the following file (say `supermyfile.tex`):               \RequirePackage{myparameters}     \input{myfile}      compiles like a charm with:               pdflatex supermyfile      the following:               pdflatex "\RequirePackage{myparameters}\input{myfile}"      doesn't work as the compiled file is `myparameters.sty` here as well. Hence my question: how to pass (a lot of) parameters to a file at compilation time?


title: Get bibliography sorted by year in Elsevier article?

text: Using this code I can not get bibliography sorted by year. It is just mixed and even not in order of appearance in the `myrefs.bib` file (which is exactly by year).               \documentclass[pdftex,preprint,12pt,final,5p,times,twocolumn]{elsarticle}          \biboptions{square}     \nocite{*}          \begin{document}       ...       \bibliographystyle{elsarticle-num}       \bibliography{myrefs}     \end{document}      How can I solve it? Google does not know anything about elsevier article.


title: Why picture is not clear?

text: I am writing in latex for the very first time. I have tried to insert a figure using               \begin{figure}[p]         \centering         \includegraphics[width=0.8\textwidth]{figures/quicksort.png}         \caption{Quicksort Run Time for Sorting Random Data}         \label{fig:quicksort_random_data_runtime}     \end{figure}.      However, while my picture is very clear, when inserted at latex and compiled, it is not very clear at the pdf. Do you know how I can avoid that?


title: conflict with biblatex and custom class

text: I am customizing `apa6e` for a large report. I need the functionality of `apa6e`'s `leavefloats` option. But when that option is passed to the class, `biblatex-apa` doesn't work, giving me an error about the argument of `\MakeLowercase` having an extra `}`. By removing `leavefloats`, everything works perfectly. I can't figure out why exactly from reading the code, I'd appreciate if someone can point me in the right direction. A latex example:               \documentclass[leavefloats]{apa6e}     \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage[style=apa, backend=biber]{biblatex}     \DeclareLanguageMapping{american}{american-apa}     \bibliography{books}     \title{Test}     \shorttitle{Test}     \author{Johnny B. Good}     \authornote{\ldots}     \abstract{\ldots}     \begin{document}       \maketitle       This is my example \parencite{good}.       \newpage       \printbibliography     \end{document}      The accompanying bib file:               @Book{good,           author={Johnny B. Good},           title={My great book},           publisher={Good Publishing},           year={1910}     }


title: Drawing a rectangle along the border of a circle

text: I would like to draw a rectangle along the border of a circle. The `\draw` with the `\angle` operation might do it, but it is rather cumbersome.   I was wondering if there is another more elegant/shorter solution, i.e. a command that draws shapes along other shapes. Ok sorry for the late update. What I want to do is more something along the following: ![Rectangle 'along' a circle](http://i.stack.imgur.com/SuRFq.png) A (badly) drawn rectangle following the border of a circle.


title: TikZ chains etc: modify automatic node placement

text: I’m trying to draw a chain, roughly like: ![crooked chain](http://i.stack.imgur.com/wAIwm.png) The catch: I want to manually specify the vertical placement of node _C_ , but I still want to use TikZ’s default horizontal placement. Currently, I can only work out how to have the placement of _C_ either completely automatic, or completely manual. MWE code for the above:               \documentclass{minimal}     \usepackage{tikz} \usetikzlibrary{chains,positioning,scopes}     \begin{document}          \begin{tikzpicture} [start chain=going right,                          every on chain/.style=join,                          every join/.style=->]     \node [on chain] {$A$};     \node [on chain] {$B$};     \node [on chain=going below right] {$C$};     \node [on chain] {$D$};      \end{tikzpicture}          \end{document}      (I also want to do the same thing with vertical and horizontal interchanged, but I guess the same solution should probably do this as well.)


title: Reference undefined

text: I receive the a `Reference "LastPage" undefined` error when trying to compile a document with this syntax:               \fancyfoot[R]{\thepage/\pageref{LastPage}}      What is necesarry to prevent this error? I'm using TeXworks Version 0.4.3 (MiKTeX 2.9) and pdfLaTeX.


title: How to have overlapping under-braces and over-braces

text: I am trying to typeset an equation that has overlapping over and under braces as per the image below: ![enter image description here](http://i.stack.imgur.com/DGtin.png) I have managed to typeset it using a sort of a hack, by typing the equation twice, once using `\phantom` commands and then raising it. Is there an easier way, perhaps a macro? MWE for the image above is shown below.               \documentclass[12pt]{article}     \usepackage{amsmath}     \begin{document}     \[a+b+\overbrace{c+d+e+f+g}^{x}+h+i+k+l=e^2\]     \vspace{-35pt}     \[\phantom{+b+c+d+}\underbrace{\phantom{e+f+g+h+i}}_{y}\phantom{+k+=e^2}\]     \end{document}


title: Accessing individual table elements with pgfplots?

text: I want to create a plot using a non-standard plot-style that I don't see in the pgfplots manual. It would be nice if I could take advantage of the `\pgfplotstableread` function and then somehow loop over the rows and columns of the table to create my custom plot with a tikz picture. I have been looking at the pgfplots and pgfplotstable manuals and I am having trouble seeing if there is a way to do this! Any help would be appreciated!


title: Draw a path along one existing path and then another

text: I have drawn two shapes in the code below, a red curve, and a black rectangle. I have labeled four points, A, B, C and D. I would like to know how to draw a path along the black rectangle from A to B, along the red curve from B to C, and then back along the black rectangle from C to D back to A. I should mention that I would ultimately like to fill the region enclosed by this shape ABCD.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{intersections}               \begin{document}          \begin{tikzpicture}          \draw[name path=p0] (0,.8) node[above left] {$D$} -- ++(3,0) |- (0,2) node[above left] {$A$} -- cycle;          \draw[red,name path=p2] (.2,3) .. controls (.5,3) and (3,.2) .. (3.5,.2);          \fill[name intersections={of=p0 and p2}] (intersection-1) circle (2pt) node[below left] {$C$} (intersection-2) circle (2pt) node[above left] {$B$};          \end{tikzpicture}          \end{document}


title: Create a list of beamer slides

text: How can I create a list of all beamer slides (by their frame-title) like the table of contents in a regular latex document? I just need it as a bird's eye view of my presentation, thus it must not be anything fancy. It should also be able to cope with the following slide that I have at the end of my presentation               \begin{frame}         {\Huge             \vspace {0.35\textwidth}     % Don't remove             \begin{columns}[ccc]                 \begin{column}{0.3\textwidth}                 \end{column}     % Don't remove                 \begin{column}{0.3\textwidth}                         \textbf{Thanks!}                 \end{column}     % Don't remove                 \begin{column}{0.3\textwidth}                 \end{column}             \end{columns}         }     \end{frame}


title: Accented (French) characters in BibTeX database

text: I am having some difficulty using French letters in my LaTeX document. In my bibliography, I have this reference:               @article{CLDM03,       title={A Cinematography System for Virtual Storytelling},       author={Nicolas Courty and Fabrice Lamarche and Stéphane Donikian and Éric Marchand},       journal={Lecture Notes in Computer Science},       pages={30--34},       isbn={3540205357},       issn={0302-9743},       year={2003},       publisher={Springer}     }      But what I get in the references section of my document is this: [CLDÃM03] C OURTY N., L AMARCHE F., D ONIKIAN S., ÃL'RIC M ARCHAND: A cinematography system for virtual storytelling. Lecture Notes in Computer Science (2003), 30–34. Obviously, the abbreviation is incorrect. It should be CLDM03 (the first letter of the last names of the authors), but also there are some strange letters in the names! Any idea how that could be fixed? By the way, just in case you are wondering, I already have texlive-full installed.


title: Switch to one-side layout in KOMA-Script scrbook

text: I'm using `scrbook` as document class for my thesis. The two-page layout is just fine in general, but I want the Appendix to be one-sided only. I read the following post Switch to one-sided mode in the appendix of a double-sided document, but the solution seems a bit too overcomplicated to me. Is there no native komascript option to switch to one-paged layout within the document? `\KOMAoptions{onepage}` only gives me               Package scrkbase Error: unknown KOMA option `onepage' \KOMAoptions{onepage}      Alternatively, I might have to compile two different documents and combine them in the end, but this might make referencing harder. Thanks for your comments! Christian


title: Multiple indices with ledmac and the book class

text: The package for critical editions, `Ledmac`, provides an `\edindex{}` command to have references to the page and line number in the standard `Makeindex` index. The package documentation also specifies that, when used with the Memoir class, it is also possible to have multiple indices with the following syntax `\edindex[indexName]{}`. This syntax is quite close to the one provided by the `Multind` package, so I would like to know if anyone knew of a possibility to have multiple critical indices without using the _memoir_ class, but instead the more standard _book_ class, and a package dedicated to multiple indices (doesn't seem to work with the `Multind` package though). Edit : Here is the part of the `Ledmac` code concerning multi-indexing with the `memoir` class :               \@ifclassloaded{memoir}{%         \g@addto@macro{\makememindexhook}{%             \def\edindex{\@bsphack%             \@ifnextchar [{\l@d@index}{\l@d@index[\jobname]}}}         \newcommand{\edindex}[2][\jobname]{\@bsphack\@esphack}          \def\l@d@index[#1]{%         \@ifundefined{#1@idxfile}%         {\ifreportnoidxfile         \led@warn@NoIndexFile{#1}%     \fi     \begingroup     \@sanitize     \@nowrindex}%     {\def\@idxfile{#1}%     \doedindexlabel     \begingroup     \@sanitize     \l@d@wrindexm@m}}     \newcommand{\l@d@wrindexm@m}[1]{\l@d@@wrindexhyp#1||\\}     \def\l@d@@wrindexhyp#1|#2|#3\\{%         \ifshowindexmark\@showidx{#1}\fi         \ifx\\#2\\%         \protected@write\@auxout{}%         {\string\@@wrindexm@m{\@idxfile}{#1|hyperpage}{\thepageline}}%         \else         \def\Hy@temp@A{#2}%         \ifx\Hy@temp@A\HyInd@ParenLeft         \protected@write\@auxout{}%           {\string\@@wrindexm@m{\@idxfile}{#1|#2hyperpage}{\thepageline}}%         \else         \protected@write\@auxout{}%           {\string\@@wrindexm@m{\@idxfile}{#1|#2}{\thepageline}}%       \fi     \fi     \endgroup     \@esphack}     }


title: Using listing for displaying Matlab code

text: I'm trying to display matlab code in a LaTeX document and the comments are typeset with an ugly space between letters:               \documentclass{article}          \usepackage{listings}     \lstset{language=Matlab}     \lstset{tabsize=2}          \begin{document}     \begin{lstlisting}     function gramschmidt(A) %The columns of A are the initial basis to the subspace     \end{lstlisting}     \end{document}      results in ![alt text](http://i.stack.imgur.com/UAUEo.png) Is there a way to improve the kerning (or whatever its called) of the text in the comments?