title: Proper referencing to programmatic nodes in pgfplots axis? (no shape is known, ill-formatted floating point number ...)

text: This is going to be a slightly messy/unclear question, but here it goes. Basically, I want to work with a plot in `pgfplots`, where I want to also generate programmatically some nodes (maybe as result of intersections with the plot); and then fill areas between the plot and nodes which may be derived from the intersection nodes. I basically got a MWE to work (below); I'll try to explain the workflow:   * I start with a plot of a function (here `sin(x)`) and a set of points (here `\xPoints`) which are predefined x coordinates   * I want to set off vertical lines from `\xPoints`, and find intersections with `sin(x)`, and store those points as nodes. That is not the problem here, so I avoided using intersections at all - as a stand in for those nodes, I use the `(tnode\i)` nodes (blue), which have x-positions at `\xPoints`, and an arbitrary y-position   * I want to generate programmatically a second set of nodes, based on `(tnode\i)`. In this case, those are the `(txnode\i)` nodes (red), which are simply the `(tnode\i)` nodes locations, but their y position changed to `(tnode\i).y+\i*2.0`; where `\i` is the index of the node (allowed by `count`). Thus, the position of the `(txnode\i)` depends on both the corresponding `(tnode\i)` element location, and on the index itself.    * Based on the second set of nodes, `(txnode\i)`, I want to derive a third set of points, such that their .x is the same, and their .y is again a formula `(txnode\i).y+0.7` (in this particular case, it doesn't use the `count` index, but in general it might - hence the need for it to spin in a `\foreach`).   * This third set of points does not need to be shown/rendered as a node, but it will be used in a fill area, between a point from the third set and corresponding pieces of the plot function `sin(x)`.  The MWE generates this image: ![test_pdf](http://i.stack.imgur.com/GbVRum.png) ... with the following problems:   * If I don't use `\pgfplotsextra`, I cannot use `\gettikzxy` in a `\foreach` (Error: "No shape named" ... "is known")   * (If don't want to use `\pgfplotsforeachungrouped` - it seems it doesn't have a `[count=`, which I need to generate node names)    * If I do use `\pgfplotsextra`, I cannot use stuff like `domain=\x:\upx` where `\x`, `\upx` are provided by a `\foreach`, because then I get "... ill-formatted floating point number '97.191'" (which is even weirder, because '97.191', '0.0' etc should **not** be ill-formatted floats?)   * I can try to run that `\foreach` code _after_ the `\pgfplotsextra` - but then again I cannot use `\gettikzxy` inside, as I will get "No shape named" error again; however, if I simply directly refer to the node in the `\addplot` command, then it works ???! Obviously, the last solution doesn't quite cut it for me, because I'd like to calculate stuff based on the nodes (like it is shown in the snippet near "%\temp % the problem line ..."). So, my question is - how to write the code, so in the end I can get a reference to the `txnode\i` nodes (the red ones on the image), calculate some coordinates based on them, and use those calculations in an `\addplot`? Below is the code:               \documentclass{standalone}     %\url{http://tex.stackexchange.com/q/33703/86}     \usepackage{pgfplots}     \usepackage{tikz}     \usetikzlibrary{intersections} %% named intersections     \usetikzlibrary{calc}          \makeatletter     % http://tex.stackexchange.com/questions/33703/extract-x-y-     \newcommand{\gettikzxy}[3]{%       \tikz@scan@one@point\pgfutil@firstofone#1\relax       \edef#2{\the\pgf@x}%       \edef#3{\the\pgf@y}%     }     \makeatother               \begin{document}          \def\xPoints{0.0,0.625,1.25,1.875,2.5,3.125,3.75,4.375}          \begin{tikzpicture}     \begin{axis}[ymin = 0, ymax = 2]            \addplot[blue,domain=0:3.1] {sin(deg(x))}; % must have            \foreach [count=\i] \x in \xPoints {         \edef\temp{           \noexpand\node [draw,blue] (tnode\i) at ({axis cs:\x,1.0}) {} ;         }         \temp       }                 \pgfplotsextra{ % must have, else Package pgf Error: "No shape named" txnode1 "is known" for gettikzxy              \newlength{\tl}         \foreach [count=\i] \x in \xPoints {           \gettikzxy{(tnode\i)}{\tix}{\tiy}           \pgfmathsetmacro{\newy}{\tiy+\i*2.0}           \setlength{\tl}{\newy pt}           \edef\temp{             \noexpand\node [draw,red] (txnode\i) at ({axis cs:\x,0}|-{0,\tl}) {} ;           }           \temp         } % \foreach              \foreach [count=\i] \x             [evaluate=\x as \upx using (\x+0.1)]         in \xPoints {           \gettikzxy{(txnode\i)}{\tix}{\tiy}           \pgfmathsetmacro{\newy}{\tiy+0.7}           \setlength{\tl}{\newy pt}           \edef\temp{             \noexpand\addplot[color=blue!50,restrict x to domain=\x:\upx,domain=\x:\upx]             plot[fill] {sin(deg(x))} |- ({axis cs:\x,0}|-{0,\tl}) -- cycle;           }           %\temp % the problem line - generates:           %! Package PGF Math Error: Sorry, an internal routine of the floating point unit           % got an ill-formatted floating point number `97.191'. The unreadable part was n           %ear '97.191'..         } % \foreach            } % \pgfplotsextra                 % seems to work here:       \foreach [count=\i] \x           [evaluate=\x as \upx using (\x+0.1)]       in \xPoints {         %\gettikzxy{(txnode\i)}{\tix}{\tiy} % No shape named txnode1 is known.         %\pgfmathsetmacro{\newy}{\tiy+0.7}         %\setlength{\tl}{\newy pt}         %\edef\temp{         %  \noexpand\addplot[color=blue!50,restrict x to domain=\x:\upx,domain=\x:\upx]         %  plot[fill] {sin(deg(x))} |- ({axis cs:\x,0}|-{0,\tl}) -- cycle;         %}         % this works, though?         \edef\temp{           \noexpand\addplot[color=blue!50,restrict x to domain=\x:\upx,domain=\x:\upx]           plot[fill] {sin(deg(x))} |- (txnode\i) -- cycle;         }         \temp       } % \foreach          \end{axis}     \end{tikzpicture}          \end{document}


title: How to generate charts with arrows?

text: Recently, I discovered LaTeX and started working with it. Currently, I´m able to create simple summaries, etc. with formulas, lists, etc. Although LaTeX is still really new for me. Anyway, now I would like to create a chart with a structure similar to this one: http://upload.wikimedia.org/wikipedia/de/a/a6/Systemarchetyp09.png My topic is an economic one, but I guess that doesn´t matter regarding the things I´d like to know. So it is basically about creating those arrows, especially the concave ones. And also the remarks written next to those arrows and the boxes around the connected elements. I guess a specific package has to be implemented to get this done? If anybody could help me, I´d really appreciate it ;-) Thank you in advance.


title: \newcommand - Missing \begin{document}

text: On defining a new command, and using it, LaTeX throws an error that `Missing \begin{document}`. What is the issue here?               \documentclass[12pt]{article}     \newcommand{details}[2]{     #1 \hspace{2cm} : #2     }     \begin{document}     \details{name}{test}     \end{document}


title: Adjust position of node label

text: In the MWE below, how can I get to adjust the position of the node labels? Note that the nodes are defined by               dot/.style={circle,inner sep=1pt,fill,label={#1},name=#1}      but I cannot figure out how to keep the same setting will being able to adjust the positioning of the label. For example, something like `dot=M,left` or `dot=M,right`. The original source of the code is gotten from http://tex.stackexchange.com/a/21759/10898 ![enter image description here](http://i.stack.imgur.com/C3fE9.png)               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}          \tikzset{         right angle quadrant/.code={             \pgfmathsetmacro\quadranta{{1,1,-1,-1}[#1-1]}     % Arrays for selecting quadrant             \pgfmathsetmacro\quadrantb{{1,-1,-1,1}[#1-1]}},         right angle quadrant=1, % Make sure it is set, even if not called explicitly         right angle length/.code={\def\rightanglelength{#1}},   % Length of symbol         right angle length=2ex, % Make sure it is set...         right angle symbol/.style n args={3}{             insert path={                 let \p0 = ($(#1)!(#3)!(#2)$) in     % Intersection                     let \p1 = ($(\p0)!\quadranta*\rightanglelength!(#3)$), % Point on base line                     \p2 = ($(\p0)!\quadrantb*\rightanglelength!(#2)$) in % Point on perpendicular line                     let \p3 = ($(\p1)+(\p2)-(\p0)$) in  % Corner point of symbol                 (\p1) -- (\p3) -- (\p2)             }         }     }          \begin{document}     \begin{tikzpicture}[dot/.style={circle,inner sep=1pt,fill,label={#1},name=#1},       extended line/.style={shorten >=-#1,shorten <=-#1},       extended line/.default=1cm]          \node [dot=L] at (1,0) {};     \node [dot=M] at (4,0) {};     \node [dot=N] at (4,5) {};          \draw [extended line=0.5cm] (L) -- (M) node [below,midway] {3};     \draw [extended line=0.5cm] (L) -- (N) node [above left,midway] {6};     \draw [extended line=0.5cm] ($(L)!(N)!(M)$) -- (N) node [right,midway] {$x$};     \draw [red,right angle symbol={M}{N}{L}];          \end{tikzpicture}     \end{document}      Note, what am looking for is to move the `N` to the right, `L` to lower left and `M` to lower right.


title: Can I make footnote inside an equation?

text: Can I make a footnote to clarify an important point inside an equation?


title: Landscape mode for the flacard class

text: I'm using the flacards document class to create flashcards. When I try and make the document landscape using geometry (`\usepackage[landscape]{geometry}`) I get the following error: `! LaTeX Error: Option clash for package geometry.` Consequently, I can't get my flashcards to print in a landscape orientation. Has anybody got a solution?


title: Figures should be numbered 4.1.1 and 4.2.1 both numbered 4.1 in list of figures

text: As I look at my document in LyX, the figure numbering looks like `chapter.section.figurenumber`. However, when a PDF is created the "section" portion of the figure number disappears, and I have multiple figures with the same figure number. I'm using a custom class created at my University for the thesis that's based on memoir. One of the comments in it is that memoir only numbers section down to section & for most users this isn't enough. So they reset them with               \maxsecnumdepth{subsubsection}     \setsecnumdepth{subsubsection}     \maxtocdepth{subsubsection}      I did some searching and tried               \setcounter{lofdepth}{9}      to try to get the subsections (being unsure how large the integer should be...), but this did not have any effect after updating the class. There doesn't seem to be a similar               \maxlofdepth{subsubsection}      type command? Most of my search finds talked about labeling subfigures not figures in subsections.


title: Removing hyperlink borders from ToC

text: I don't want to disable hyper reference package as I like those borders in the text. I just want to remove borders around chapters/sections in the table of contents if possible. Any idea? E.g.               \documentclass{report}      \usepackage{hyperref}     \begin{document}          \tableofcontents          \chapter{AAA}     \section{aaa}     \subsection{aaa}          \end{document}      Thank you!


title: "pdflatex: ! Core one to three" error

text: I used a `javascript`program to generate a rather long `.tex` file (8500 lines), but whenever I try to compile it, it gives me an                `pdflatex: ! Core one to three`       error. The error doesn't seem to do anything as there is still an output. There is also no other information and it still occurs if I delete the paragraphs where it is probably located. I guessed the location within the source from the surrounding **overfull-boxes-warnings**. Any idea what this error-message is actually meaning? # EDIT: So I found the real error-position and where the text comes from:               \color{authortext}\rmfamily\normalsize     \\{}\ttfamily "We may as well have with that formation they're taking! Cores one to three are making a triangle, and each one's right around 100 meters off of the center, where the unseen seal is. That's max supercore range as far as we know . I bet that one's got all the good modules and stuff, because he's the only one who can assist the other three." \color{authortext}\rmfamily\normalsize says Scanner.      authortext is a color defined with the color-package. `\\\\{}` I use the `{}`, so in case it is followed by a `[` . `\rmfamily\normalsize` are used so often as I generate this output automatically, so there are paragraphs where this is changed in between. You might see: "... they're taking **! Cores one to three** are making a triangle, and ..." That's where the error comes from. However, what's wrong with this line? ' and " were used previously just fine... But if I comment this line out, the other 8500 lines are compiled without error... # EDIT & SOLUTION Actually this is a bug in TeXnicCenter as it seems. The log revieled:               Underfull \hbox (badness 10000) in paragraph at lines 3265--3275      \OT1/cmtt/m/n/10.95 "We may as well have with that for-ma-tion they're tak-ing     ! Cores one to three       []      However, TeXnicCenter counted all the lines with a leading ! as error to display a total error amount at the end of compiling. In reality, this is actually just a underfull box that contains the line `"We may as well have with that formation they're taking! Cores one to three` which was accidentally linebroken at the ! within the log.


title: Multiple figures layout

text: I have 5 figures: A, b, c, d, e. I have a question in laying out multi-figures like below:               ---------      A | b c      A | d e           {  A  } is a single long figure using multirow     ---------             A      A is a long figure, and b, c, d and e are small square figures. I tried to use multirow to create one. But it works bad. The figures generated by my code is like this:                --------         | b c       A  | d e      A      --------      My code is here:                   \begin{table*}[t]     \begin{tabular}{ccc}      \multirow{2}{*}{             \includegraphics[width = 0.2\textwidth]{figs/cluster/gMaps.eps}         } &           \includegraphics[width = 0.2\textwidth]{figs/cluster/2.eps}       &            \includegraphics[width = 0.2\textwidth]{figs/cluster/5.eps}       \\   &           \includegraphics[width = 0.2\textwidth]{figs/cluster/10.eps}       &           \includegraphics[width = 0.2\textwidth]{figs/cluster/20.eps}       \\      \end{tabular}     \end{table*}      How can I create the layout?


title: What are the new features in TikZ/pgf 3.0?

text: Since the December 20, 2013, we have new major release of the wonderful TikZ/pgf package: version 3.0.0! 1 Unfortunately, I was not able to find a nice human readable list of changes, that goes to some depth and maybe even provides some examples. This page probably comes closest to it: 2 Therefore, I would like to ask you to point out some of the new features and give examples of their usage! A bounty might be awarded `;-)`. * * * 1. http://sourceforge.net/projects/pgf/   2. http://sourceforge.net/projects/pgf/files/pgf/version%203.0.0/


title: How to output sequence elements and total in expl3

text: Suppose, I have a sequence of numbers: {1,2,3}. I want to output it like this: 1 + 2 + 3 = 6 I created this code:               \documentclass{article}     \usepackage{xparse}     \usepackage{expl3}     \setlength{\parindent}{0cm}     \begin{document}     \makeatletter     \ExplSyntaxOn     % The following three macros are well defined     \NewDocumentCommand{\newfpvar}{m}{\fp_new:N #1}     \NewDocumentCommand{\setfpvar}{mm}{\fp_set:Nn #1 { #2 }}     \NewDocumentCommand{\getfpvar}{m}{\fp_use:N #1}           \cs_new_protected:Npn \mmmmxxxv_define_fp_var:Nn #1 #2      {          \cs_if_exist:NF #1          {              \fp_new:N #1              \fp_set:Nn { #1 } { #2 }          }      }          %#1 - sequence name     %#2 - value     \cs_new_protected:Npn \mmmmxxxv_seq_put_fp_var_right:Nn #1 #2      {       \seq_put_right:Nx #1 { \fp_eval:n { #2 } }      }          \seq_new:N \l_mmmmxxxv_fp_seq     \mmmmxxxv_seq_put_fp_var_right:Nn \l_mmmmxxxv_fp_seq { 1 }     \mmmmxxxv_seq_put_fp_var_right:Nn \l_mmmmxxxv_fp_seq { 2 }     \mmmmxxxv_seq_put_fp_var_right:Nn \l_mmmmxxxv_fp_seq { 3 }          \tl_new:N \__text     \mmmmxxxv_define_fp_var:Nn{\Total}{0}     \seq_map_inline:Nn \l_mmmmxxxv_fp_seq      {        %here I don't understand, how to check that we are processing the last        %element of sequence and don't put '+'        \tl_put_right:Nx \__text {\getfpvar{#1} +}        \fp_add:Nn \Total #1      }     \show\__text     \ExplSyntaxOff     \makeatother     %want to show here: 1 + 2 + 3 = 6 --- \__text = \getfpvar{\Total}     \getfpvar{\Total}     \end{document}      It creates a sequence, calculates the total and tries to store the numbers in __text variable. \show__text prints this:               > \__text=macro:     ->\getfpvar {1}+\getfpvar {2}+\getfpvar {3}+.      \Total is correct But when I try to output __text, it gives an error:               ! Use of \__fp_to_decimal_dispatch:w doesn't match its definition.     <recently read> 1


title: Alignment of tikz nodes in a chain

text: How can the north anchors of the nodes in a going to the right chain be aligned in a `tikz` picture? As can be demonstrated by the following example, by default they seem to be aligned by the center anchor.               \documentclass[tikz]{standalone}          \usetikzlibrary{shapes.multipart,chains,}          \tikzset{       token/.style={         rectangle split,         rectangle split parts=2,         rectangle split part fill={cyan!25,yellow!50},         rectangle split ignore empty parts,         draw,       },     }          \begin{document}          \begin{tikzpicture}[start chain=going right,node distance=1mm]       \node[on chain,token] {TWhile};       \node[on chain,token] {TLParen};       \node[on chain,token] {TId\nodepart{two}ip};       \node[on chain,token] {TEq};       \node[on chain,token] {TId\nodepart{two}z};       \node[on chain,token] {TRParen};       \node[on chain,token] {TPlusPlus};       \node[on chain,token] {TId\nodepart{two}ip};     \end{tikzpicture}          \end{document}      ![Output of the given document:](http://i.stack.imgur.com/2ZhjO.png)


title: Better alternative to Circuitikz?

text: I'm a bit confused about all possible package to draw electrical circuits. I'm new to drawing these diagrams (although I'm well known to TikZ). Is there a better package than circuitikz? I found it's documentation a bit confusing. But above all, it doesn't seem to be aiming it the **ultimate consistency** I'm looking for (oh god, how I love consistency). Even the code isn't consistent (to my TikZ-used eyes at least). Is someone using another package that does the trick (perhaps a TikZ library I don't know of)? I'd like to keep on using TikZ though, so don't stray too far. PS: this is not a _diss_ for the Circuitikz package. It's been the best packege I found to draw circuitz so far and seems to do quite well. It just hasn't got the ulimate tweaking abilities I want. (If it does, please enlighten me!)


title: Document Class for Briefing Notes

text: I was wondering whether there was a document class for briefing notes/memos in LaTeX. If there is not any what is the easiest way of making my own? **PS:** Sorry, I should have given an example. Here are a few (PDF): http://writingforresults.net/Acro_3/templates.pdf more specifically but I need something like the one on page A-25 of the link. Only the first page is the problem, it should have the following attributes:   1. First line: "Memorandum to XXXX", where XXXX depends on the content.   2. Title: centered with the last line underlined.   3. Below title produce "For XXXX", where XXXX depends on the content.   4. Then comes "Summary", it can not exceed the first page, it should be in a box, with "Summary" centered inside the box on the first line.


title: Using tabularx package with xtable package in R

text: I am trying to solve the problem of having a latex table (produced using the xtable from R, then combined into a tex file using Sweave), exceeding the margins of my LaTeX document. I found that one such solution can be based on the tabularx package, and I am wondering what would be the best way to implement it (or if there is a better solution I am overlooking). Right now the only way I am thinking of is to edit print.xtable so it would work with the tabularx LaTeX package. Any other suggestions will be most welcomed. Thanks. update: Here is an example code for such a table:               \begin{table}     \begin{center}     \begin{tabular}{rlrrrrrr}       \hline      & SOSo letter's locations & resubstitution (full tree) & K-CV  (full tree) & resubstitution (prune min) & K-CV  (prune min) & resubstitution (prune min+1SE) & K-CV  (prune min+1SE) \\        \hline     1 & bar\_SOSo\_top & 0.88869 & 0.86281 & 0.88794 & 0.86281 & 0.88266 & 0.85779 \\        2 & bar\_SOSo\_left & 0.88618 & 0.81281 & 0.88593 & 0.81307 & 0.87362 & 0.80704 \\        3 & bar\_SOSo\_right & 0.89799 & 0.79070 & 0.89774 & 0.79121 & 0.88191 & 0.78543 \\        4 & bar\_SOSo\_top\_left & 0.99573 & 0.96985 & 0.99548 & 0.96985 & 0.99070 & 0.96759 \\        5 & bar\_SOSo\_top\_right & 0.99221 & 0.95603 & 0.99196 & 0.95653 & 0.98995 & 0.95402 \\        6 & bar\_SOSo\_left\_right & 0.99221 & 0.88920 & 0.98442 & 0.89095 & 0.97814 & 0.88995 \\        7 & bar\_SOSo\_top\_left\_right & 0.99925 & 0.97111 & 0.99673 & 0.97337 & 0.98492 & 0.97261 \\         \hline     \end{tabular}     \caption{Some table}     \end{center}     \end{table}


title: Citations not showing up in text and bibiography

text: I have a `References.bib` file that contains all references I will cite. My `Paper.tex` looks like this:               \documentclass{article}     \usepackage{makeidx}  % allows for indexgeneration     \usepackage{ifpdf}     \usepackage{url}     \usepackage{graphicx}           \begin{figure}[h]        \centering        \includegraphics[scale=.89,bb=0 0 291 279]{f1.png}        \caption{Some description about the picture}        \label{picture-label}     \end{figure}     TEXT \cite{1}          \bibliographystyle{plain}     \bibliography{References.bib}     \end{document}      But I did not get the `References` at the end of the PDF file, and also I did not get the citation after the text. instead I get `[?]`. How can I make my references show up in the text?


title: BibTeX "1. No Title" Reference?

text: I am having a strange error with my bibliography. Notice the first reference in the attached screen-shot (number 1). It says "No title". Moreover, if I search for the reference all over the PDF file that results from pdflatex, reference 1 is not cited anywhere so I cannot figure out which reference is wrong in the bib file (I have a huge bib file from Mendeley, so manual analysis is not an option...) Can anyone shed any light on this? ![Error in bibliography](http://i.stack.imgur.com/cO1QL.png)


title: How to cite within a reference entry using biblatex

text: In my bibliography I have a reference to a talk and another reference to the cartoons rendering of the concepts covered in the first talk. My solution is to cite both entries in the text and to put a reference in the addendum field of the cartoons rendering:               @ONLINE{Pink2010,         author = {Daniel Pink},         title = {Drive: The surprising truth about what motivates us},         url = {http://comment.rsablogs.org.uk/2010/04/08/rsa-animate-drive/},         addendum = {Versione cartoon di \cite{Pink2010a}}     }          @ONLINE{Pink2010a,         author = {Daniel Pink},         title = {Drive},         url = {http://www.thersa.org/events/vision/vision-videos/dan-pink-drive}     }      Is this the correct way to enter these references?


title: Using listings for R code with ## in rangeprefix

text: In R, comments are preceded by the symbol `#`. Moreover, to avoid messing with the indentation, it's usually `##` instead of `#`. Therefore, as I want to include some R code in a LaTeX document, I am using the `listings` package with these instructions. However, this gives me the following error:               Illegal parameter number in definition of \lst@rangebegin      Here is the R code:               ##--GOLL0----     GetObsLogLik <- function(data, w, mu, sigma){       N <- nrow(data)       S <- ncol(data)       K <- nrow(mu)       sum(sapply(1:N, function(i){         log(sum(sapply(1:K, function(k){           w[k] * dmvnorm(x=data[i,], mean=mu[k,],                          sigma=sigma[k]^2 * diag(S))         })))       }))     }     ##--GOLL1----      And here is the LaTeX code:               \documentclass{article}          \usepackage{listings}     \lstset{language=R,       frame=single,       basicstyle=\small,       rangeprefix=##--,       rangesuffix=----,       includerangemarker=false}          \begin{document}          \lstinputlisting[linerange=GOLL0-GOLL1]{test.R}          \end{document}      The error disappears when I replace `##` by `//`. But this is not a solution as `//` are not valid in R. I also tried the solution provided here but it doesn't work either.


title: How do I put a note into the right margin, regardless of whether it's an even or odd page?

text: Suppose I am writing a book in which some sections are especially important. I would like those sections to be identified by a `*` after the page number in the table of contents. How do I get it there? I can get extra stuff into the table of contents by putting `\addtocontents` into my text at appropriate places. So in this case I'd presumably write something like `\addtocontents{\protect\marginpar{*}}` in my text in appropriate places. But that's not right, because `\marginpar` tries to put its contents into the outside margin. I always want to put the `*` into the right margin, regardless of whether I'm on an even or odd page. It seems like it should be extremely easy to do this, but I can't see how. Suggestions?


title: Figure reference management

text: I'm writing an academic report and it is required that I include my figure/picture references (almost exclusively URLs). Already tried to use BibLatex to make sub-bibliographies but that proved to be too unstable. Does anyone have an idea on how to solve this?


title: Repeated slides in beamer

text: I have about 200 JPEG files that I need to include in a PDF document, one JPEG per page (i.e. 200 pages + intro slide). The following code successfully does this with one JPEG.               \documentclass{beamer}     \usepackage{graphics}          \title{Overview of Jpegs}     \subtitle{Example}     \author{Chris}     \institute{Office}     \date{February 02, 2012}          \begin{document}          \begin{frame}     \titlepage     \end{frame}          \begin{frame}{Slide with jpeg number 1}.     \includegraphics[height=8cm]{File_1.jpg}     \end{frame}          \end{document}      The JPEGs are named `File_1.jpg`, `File_2.jpg`, and so on. I suppose a for-loop would be in place, but no matter how I try, I can't get it to work. I created the JPEGs in RStudio (programming in R), but maybe this is more a pure LaTeX-question. I prefer to use JPEG as they are smaller than other formats.


title: Number every line of pages

text: When editing documents it is convenient to have all the lines on a page numbered (on the left margin) so that the reviewer can refer to them in his report. How can I achieve this with LaTeX?


title: Hyperref and nonumber/notag in equations:

text: When compiling my text document, I get the following warning:               [5] [6] [7pdfTeX warning (ext4): destination with the same identifier (name{equ     ation.2.0.10}) has been already used, duplicate ignored          \AtBegShi@Output ...ipout \box \AtBeginShipoutBox                                                    \fi \fi      l.210     \end{equation}      A quick google search reveals that this is a problem hyperref has with suppressed equation numbers: It suggests using               \begin{align*} ... \end{align*}      instead of               \begin{align} ... \notag \end{align}      Which has the same visual effect of not displaying an equation number. So far, so good. **But** what if I want to have an equation number for the last line of my align-environment, and only suppress the numbering of all the preceding lines? I'm also confused about this warning occurring only once, although I use `\notag` all the time. Here is a minimal example:               \documentclass{report}          \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage[T1]{fontenc}          \usepackage[pdftex, colorlinks=true,bookmarksnumbered=true]{hyperref}     \usepackage{amsmath}          \usepackage[hyperref, amsmath, thmmarks]{ntheorem}          \begin{document}       \begin{equation}         \begin{split}             (a+b)^2 = \\             a^2 + 2ab + b^2         \end{split}       \end{equation}     \end{document}      The offending package is `ntheorem` and the offending command is the split environment if I remove either of the, I get no warning any more.


title: Resize images to half of text width only if too big for page margin

text: I want the images I'm using that exceed the page's text width to be scaled down to half the text width. Images that aren't wider than the text width don't need to be scaled. I have one markdown document that I'm converting to both html and pdf using pandoc. The following code is in the preamble.               \usepackage{graphicx}     \makeatletter     \def\maxwidth{     \ifdim\Gin@nat@width>\linewidth         \linewidth     \else         \Gin@nat@width     \fi}     \makeatother     \let\Oldincludegraphics\includegraphics     \renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}      What syntax do I use to have maxwidth = x * \linewidth where x = .5 (or some other number)? This is the 5th line in code block.


title: How to cache the results of a macro

text: TeX's ability as a programming language can be leveraged to produce documents that include fairly sophisticated calculations. Although not everybody's cup of tea, such documents are akin to literate programming in that you can describe what you are about to calculate, as well as perform the calculation. In How to typeset large numbers, I used a simple macro to calculate the Mersenne prime for 1279, which took a few seconds to compile. (This is also noticeably slow using other scripting languages with big integer libraries). **How can I cache the result from a macro, so that the calculation is not repeated in following runs?** I was thinking of something using `\pdfmdfivesum` to create a hash for a filename and use this to cache the results. The reason for the hash is that one might want to call the macro with different values - so the md5 hash can for example be the macro name plus a value.


title: Printing LaTeX code in LuaTeX

text: A calculation is done in Lua, and according to the result a certain type of cell must display the data. This works:               \multicolumn{3}{p{11cm}}{Test}&-10\\[0.4cm]      But this doesn't               \directlua{tex.print(\multicolumn{3}{p{11cm}}{Test}&-10\\[0.4cm])}      with the following error message:               ! Undefined control sequence.     \@setfontsize ...b ####1<#2}\@tempa >##2<##3\@nil                                                        {\def \bright@baselineskip...      What is the right way to print LaTeX code in `directlua` ? Here is a minimal example:               \documentclass{article}     \usepackage{array,longtable}     \begin{document}          \begin{longtable}{p{8cm}rrr}     \textbf{1}&2é&3&4\\ \hline\\     \multicolumn{3}{l}{1}&\bf 2\\     \multicolumn{3}{l}{1}&\bf 2\\     \directlua{tex.print("\multicolumn{3}{l}{1}&\bf 2")}     %\directlua{dofile('test.lua')}     \end{longtable}          \end{document}


title: How to make good bibliography with hyperlink?

text: I have been struggling to have something like this: 1) In the text: > 'It has been shown (Arnold et al., 2011) that space technology is expected > to...' 2) In bibliography: > Arnold, J. P., S. J. Peter (2011), The growth of space instrumentation. > Journal of Adv. Tech., 63,5565-5578. How can I have it as above with a hyperlink on "Arnold et al., 2011" without necessarily having it as > [1] Arnold, J. P.... Any help will be greatly appreciated.


title: Dashed box environment

text: I am new to LaTeX and I'm having a hard time trying to create a dashed box environment without success. Can someone please share a code for a dashed box environment such as the one in the image? ![](http://i.stack.imgur.com/J0ja4.png) I would like to use it the following way:               My Elaboration     \begin{elaboration}{My item list is shown below:}       \item dummy item       \item dummy item 2       \item dummy item 3     \end{elaboration}      By the way, how could be the code for the same environment but with a continuous box (not dashed)? Thanks in advance!


title: Heatmap of a triangular matrix (or a sparse matrix)

text: So let me first of all shamelessly steal heatmap code from this answer to Drawing heatmaps using TikZ               \documentclass{standalone}     \usepackage{colortbl}     \usepackage{pgfplots}     \usepackage{pgfplotstable}          \pgfplotstableset{         /color cells/min/.initial=0,         /color cells/max/.initial=1000,         /color cells/textcolor/.initial=,         %         % Usage: 'color cells={min=<value which is mapped to lowest color>,          %   max = <value which is mapped to largest>}         color cells/.code={%             \pgfqkeys{/color cells}{#1}%             \pgfkeysalso{%                 postproc cell content/.code={%                     %                     \begingroup                     %                     % acquire the value before any number printer changed                     % it:                     \pgfkeysgetvalue{/pgfplots/table/@preprocessed cell content}\value                     \pgfmathfloatparsenumber{\value}%                     \pgfmathfloattofixed{\pgfmathresult}%                     \let\value=\pgfmathresult                     %                     % map that value:                     \pgfplotscolormapaccess                         [\pgfkeysvalueof{/color cells/min}:\pgfkeysvalueof{/color cells/max}]                         {\value}                         {\pgfkeysvalueof{/pgfplots/colormap name}}                     % now, \pgfmathresult contains {<R>,<G>,<B>}                     %                      % acquire the value AFTER any preprocessor or                     % typesetter (like number printer) worked on it:                     \pgfkeysgetvalue{/pgfplots/table/@cell content}\typesetvalue                     \pgfkeysgetvalue{/color cells/textcolor}\textcolorvalue                     %                     % tex-expansion control                     % see http://tex.stackexchange.com/questions/12668/where-do-i-start-latex-programming/27589#27589                     \toks0=\expandafter{\typesetvalue}%                     \xdef\temp{%                         \noexpand\pgfkeysalso{%                             @cell content={%                                 \noexpand\cellcolor[rgb]{\pgfmathresult}%                                 \noexpand\definecolor{mapped color}{rgb}{\pgfmathresult}%                                 \ifx\textcolorvalue\empty                                 \else                                     \noexpand\color{\textcolorvalue}%                                 \fi                                 \the\toks0 %                             }%                         }%                     }%                     \endgroup                     \temp                 }%             }%         }     }          \begin{document}     \pgfplotstabletypeset[          color cells={min=-1,max=1,textcolor=black},          /pgfplots/colormap={orangewhiteorange}{rgb255=(255,170,0) color=(white) rgb255=(255,170,0)},         /pgf/number format/fixed,         /pgf/number format/precision=3,         col sep=comma,         columns/Correlations/.style={reset styles,string type}     ]{     Correlations,a,b,c,d     a,1,,,     b,0.448,1,,     c,-0.295,-0.136,1,     d,-0.350,-0.154,0.313,1     }     \end{document}      This would work just fine, if only there weren't those empty cells which produce nasty errors because they can't be parsed as a floating point number. I tried to blindly fiddle around with stuff like `\ifx\value\empty\let\value=0\fi` but I only managed to produce different errors. What this is supposed to look is this table (just more regular and with better alignment): ![heatmap of triangular matrix](http://i.stack.imgur.com/1HL2O.png)


title: How to use fonts that need different fontenc together?

text: I want to use one font for text and another for dropped capitals. Unfortunately, the font catalogue states that one needs `fontenc` parameter `T1` and the other `B1`. Now, using `T1` kind of works.               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{auncial,anttor}     \usepackage{lettrine}     \renewcommand{\LettrineFontHook}{\aunclfamily}          \begin{document}       \lettrine[lines=3]{L}{orem} ipsum ...     \end{document}      That is both fonts are used: ![with T1](http://i.stack.imgur.com/YxIp7.png) However, `pdflatex` (rightfully) complains               ./test.tex:9: LaTeX Error: Encoding scheme `B1' unknown.      at the lettrine command. Also, I noticed that the capital looks different when I use `\usepackage[B1]{fontenc}`: ![with B1](http://i.stack.imgur.com/lMdQt.png) Is it possible to properly use fonts together that need different `fontenc` settings? If so, how?


title: fontspec & microtype: fine tune OpenType fonts

text: I just began to try LuaTeX in order to make use of OpenType fonts. After loading fontspec I select such a font the usual way:               \setmainfont{Adobe Garamond Pro}      Now I wonder how I can fine tune the typesetting by the means of microtype, i.e. how I can set up protrusion rules for the selected font. The microtype manual only mentions fonts which adhere to Karl Berry's naming scheme:               \SetProtrusion        { encoding = T1,          family   = cmr }        { A              = {50,50},          \textquoteleft = {700, } }      My Question is: How does the way of using OT fonts with fontspec relate to these settings? For starters I want to use the predefined settings for the Type1 version `pad` by the means of `\DeclareMicrotypeAlias{<font name>}{<alias font>}` but `mt- pad.cfg` won't get loaded with the following file:               \documentclass{scrartcl}     \usepackage{fontspec}     \defaultfontfeatures{Ligatures=TeX,Numbers={OldStyle,Proportional}}     \setmainfont{Adobe Garamond Pro}     \usepackage{microtype}     \DeclareMicrotypeAlias{Adobe Garamond Pro}{pad}     \begin{document}       Some Text.     \end{document}      * * * **EDIT:** I just realized that LuaTeX uses EU2 as internal font enconding which renders the deaults in `mt-pad.cfg` useless. Nevertheless the question remains: What is the name of the font family I have to use in the microtype directives?


title: Text tree using tikz-qtree is too wide, don't know how to break lines and make the tree compact

text: I want to make a tree like this one: ![original tree](http://i.stack.imgur.com/uGoB5.png) It doesn't need to be exactly the same, but I want to translate the text, so I need to rebuild it, I'd also want to add a node, but that's easy. My first try:               \documentclass{standalone}     \usepackage{booktabs}     \usepackage{pgfplotstable}     \usepackage{graphicx}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}               \usepackage{tikz}     \usepackage{tikz-qtree}     \begin{document}               \begin{tikzpicture}     \Tree      [.{Métodos de otimização}           [.{Métodos exatos}             [.{Branch-and-X}                 [{Branch-and-bound} ]                 [{Branch-and-cut} ]                 [{Branch-and-price} ]             ]             [{Programação de restrições} ]             [{Programação dinâmica} ]             [{A*, IDA*} ]             ]           [.{Métodos aproximados}              [.{Algoritmos Heurísticos}                 [.{Meta-heurísticas}                     [{Meta-heurísticas baseadas em solução única} ]                     [{Meta-heurísticas baseadasem população} ]                 ]                 [{Heurísticas específicas do problema} ]             ]             [{Algoritmos de aproximação} ]             ]      ]     \end{tikzpicture}          }     \end{document}      Giving me this ugly WIDE tree: ![enter image description here](http://i.stack.imgur.com/D0Ts9.png) The first problem is that I don't know how to break lines in each node. I tried `\\\\\\\` and it does nothing; should I use a tabular for each text line? The second problem is the subnodes of each subtree won't be placed on the same column. Is this fixable or hackable? Like "Metaheuristics" on the fourth row and "A*, IDA*" on the third, they are from different subtrees, but are on the same column. Any other ideas?


title: Is it possible to use latex in the minted environment outside of comments?

text: I am wondering if it's possible to add a bit code in latex, perhaps by using some kind of escape character, to mark parts of the minted environment that should be executed as regular latex code?


title: How can I automatically add the number of the document last page to the header?

text: I need add the numbers of the first and last page to the header of the first page. To make it look like this: Document title, date, **pp. 1 - 30** The number of the first page is `\thepage`, because are in the header of itself. I'm using `fancyhdr` to make the headers. How can I do it preferably without using the `lastpage` package? If the document is twosided with `\cleradoublepage`, the `lastpage` package doesn't work well if I add `\AtEndDocument{Some text}` in the preamble. Here an MWE:               \documentclass[twoside]{article}     \usepackage{lipsum}% http://ctan.org/pkg/lipsum     \usepackage{lastpage}% http://ctan.org/pkg/lastpage     \usepackage{fancyhdr}% http://ctan.org/pkg/fancyhdr     \fancyhf{}% Clear header/footer     \fancyhead[C]{Document title, \today, \textbf{pp.\ \pageref{FirstPage}~-~\pageref{LastPage}}}     \AtBeginDocument{\label{FirstPage}}%     \AtEndDocument{Some text that I need put at the end of text. \cleardoublepage}     \pagestyle{fancy}     \begin{document}        \section{First section}\lipsum[1]     \end{document}


title: Bibtex JabRef and moderncv

text: I am trying to create my cv using moderncv class. Everything look fine until the publication section. I have a publication database under the title "publications.bib" that is created in JabRef. I want to use import the publications included in this database in my cv. I tried to modify the `plainyr.bst` file like here Sorted list of publications in moderncv from bibtex but did not work, apparently it leaves the section empty. Here is a MWE:               \documentclass[11pt,a4paper]{moderncv}     \moderncvstyle{classic}     \moderncvcolor{grey}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}          \end{filecontents}     \renewcommand{\familydefault}{\sfdefault}     \nopagenumbers{}          \usepackage[utf8]{inputenc}     \firstname{E}     \familyname{Xample}     \begin{document}          \section{Publications}     \nocite{*}     \bibliographystyle{moderncv}     \bibliography{\jobname}     \end{document}      Even when I don't use the `.bib` and work just like in the first answer of the above link, having:               \documentclass{moderncv}     \moderncvstyle{classic}       \moderncvcolor{blue}                 \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @article{A01,       author = {Author, A.},       journal = {Good Journal},       year = {2001},       title = {Alpha},     }          \end{filecontents}          \firstname{E}     \familyname{Xample}     \begin{document}          \section{Publications}     \nocite{*}     \bibliographystyle{plainyrrev}     \bibliography{\jobname}          \end{document}      In the pdf file, I get just printed the section "Publications" and nothing is included in that. However, a `.bib` file is created that has the entry of the article. Any idea?


title: cross-reference with second level items

text: In the following situation               \begin{enumerate}          \item           \begin{enumerate}          \item \label{ii}          \item          \end{enumerate}          \item          \end{enumerate}          Item \ref{ii}      I obtain in the output   1. (a) (b) 2. Item 1a I want, however, to obtain "Item (a)" (the reference should contain only the second-level item number, not the first level). How can I do it?


title: is it possible to add line numbers to input files read using \verbatiminput?

text: I know one can use `\usepackage{listings}` which supports line numbers. And I use that for pdf files. But I also generate HTML using `Latex2html`, and `l2h` does not support this package. It only supports `\verbatiminput`. Therefore in my latex file (which generates both pdf and html from the same source), I have the following               \documentclass[]{book}%     \usepackage{html}     \usepackage{verbatim}     \usepackage{listings}     \begin{htmlonly}        \providecommand{\lstinputlisting}[2][]{\verbatiminput{#2}}     \end{htmlonly}     \lstset{numbers=left}     \begin{document}       \lstinputlisting{source.txt}     \end{document}      So when I type `pdflatex foo.tex` I get line numbers, but when I type `latex2html foo.tex` I only get the source, but no line numbers there. I have to use latex2html on this file. I know `tex4ht` supports this package, but for other reasons, I need to use `l2h` here. Is there a trick to do this inside Latex? I know I can generate the source.txt with line numbers externally, and then include that file again using `\verbatiminput` but wanted to see first if possible to do inside Latex using `\verbatiminput` directly. references: http://www.ctan.org/pkg/verbatim http://tug.org/pipermail/texhax/2005-March/003659.html Fyi, In the above post by Dr Moore he refers to the file `verbatimfiles.perl` in the `l2h` distribution to edit to add this support for line numbers in l2h. I do not know any Perl (l2h is written in Perl) and do not know how to start to change this file to do this. It is a small file. I'll paste here in the hope someone here who might know Perl can spot as easy one line change to to add a line number to the left. Here is the file `/usr/share/latex2html/styles/verbatimfiles.perl`               # $Id: verbatimfiles.perl,v 1.6 1999/04/09 18:16:51 JCL Exp $     # verbatimfiles.perl     #   Jens Lippmann <lippmann@rbg.informatik.tu-darmstadt.de> 6-FEB-96     #     # Extension to LaTeX2HTML to support verbatim.sty/verbatimfiles.sty.          package main;          &do_require_package("verbatim");          sub do_cmd_verbatimfile {         &do_cmd_verbatiminput;     }          sub do_cmd_verbatimlisting {         local($_,$outer);         local($counter) = 0;              # Read in file, get markup ready.         $outer = &do_cmd_verbatiminput;              # Postprocess verbatim content.         $_ = $verbatim{$global{'verbatim_counter'}};              #insert numbers for every line         #but not the first line if it's empty (LaTeX'ism?)         local($firstemptyline);         $firstemptyline = $1 if s/^([ \t]+\n)//;              #and not the last end of line         s/\n$//;         s/(^|\n)/$1.sprintf("%4d ",++$counter)/ge;              #add the stuff from the first(if empty) and last line also         $verbatim{$global{'verbatim_counter'}} = $first.$_;         $outer;     }          &process_commands_wrap_deferred (<<_RAW_ARG_DEFERRED_CMDS_);     verbatimfile # {}     verbatimlisting # {}     _RAW_ARG_DEFERRED_CMDS_          1;              # Must be last line      btw, I tried to use `do_cmd_verbatimlisting` mentioned above in Latex like this:               \verbatimlisting{source.txt}      but nothing happened. l2h did not understand the command. So I am not sure if the support for line numbers is there in l2h based on the above source code, but need to figure how to use it or not.


title: missing inserted endgroup

text: I'm typing this equation:               \eta=\frac{82\cdot4\cdot1.44 \textrm{MeV}\cdot10$^-15$\textrm{m}}{2\cdot6.582\cdot 10$^-10$ \textrm{MeV}\cdot\textrm{s}\cdot0.0774\cdot2.998\cdot10$^8$\textrm{ms$^-1$}}      And I'm not able to find the mistake. Can anybody help me?


title: Brace-mismatch error recognition in Texstudio?

text: I've been trying to find in Texstudio the ability in Texlipse in recognizing brace matching errors, but no success so far. In Texlipse whenever a single brace is in your document a red line is drawn underneath it which decreases error handling time. Take this little code for example               \documentclass{article}     \usepackage{amsmath}          \begin{document}          \begin{align}       a &= 1\frac{3}{2}}\\ % "}" after {2} is extra       b &= 2\frac{3}{4}     \end{align}          \end{document}      In Texstudio you can only become aware of the error, if the cursor is placed after or befor the brace. Is there such an option in it? Is it manually possible to add this capability to it?


title: two columns of footnotes in beamer?

text: I have a beamer frame with six fairly short footnotes on it. This takes up a fair bit of vertical space and not much horizontal space, so I'd like to put the footnotes into a two-column layout (even though the frame content itself is one column). I tried `dblfnote` package (had no discernible effect) and the `eledmac` advice seen in this post, but I couldn't even get the document to compile with `eledmac` package included (something about `\lemma` being already defined). How can I get Beamer to use a two-column environment for footnotes? Ideally I would like to be able to switch this on or off for different frames, but I'd settle for a document-wide solution. PS: I know footnotes are discouraged in Beamer, but I'm not asking for presentation design advice here.


title: Floats: Figure labels matching the section they are in

text: When I label my figures, they are labelled Figure 1, Figure 2, ... How can I have the labelling match the section it comes from? That is, if Figure 2 is in section 3, it will be labelled Figure 3.1.               \documentclass{article}     \usepackage{floats}     \usepackage[demo]{graphicx}     \usepackage[caption = false}{subfig}     \begin{document}     \section{A}     \begin{figure}[H]     \includegraphics[width = 2in]{something}     \caption{figure}     \label{fig}     \end{figure}     \end{document}


title: Page number intersects text when using fancyhdr

text: As i mentioned in title, i can't manage fancyhdr to work. I can't remove page numbers. And page numbering is not stable. And this is the result. As you can see one iii is at the bottom but iv is at the heading and intersecting with text.![undesired result](http://i.stack.imgur.com/RpGSz.png) Sorry for bad english. This is mwe(i think) Because of the document is too long i did not dump the all code. But i can if it is needed.               \documentclass[12pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[turkish]{babel}     \usepackage[left=3.50cm, right=2.50cm, top=3.00cm, bottom=3.00cm,nohead,nofoot]{geometry}     \usepackage[overload]{textcase}      \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{pslatex}     \usepackage{setspace}     \setlength{\parindent}{0pt}     \renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}     \setlength{\parskip}{\baselineskip}          \addto\extrasturkish{\uccode`i=\string"9D \lccode`I=\string"19 }     \addto\noextrasturkish{\uccode`i=`I \lccode`I=`i }               \setlength{\footskip}{20pt}     \setlength{\marginparwidth}{0 pt}               \raggedbottom     \usepackage{chngcntr}     \setcounter{secnumdepth}{6}          \counterwithin{paragraph}{subsubsection}     \counterwithin{subparagraph}{paragraph}     \makeatother               %\usepackage{graphicx,epstopdf}     %\epstopdfsetup{update}     %\DeclareGraphicsExtensions{.ps}          \usepackage{url}          \usepackage{tocloft}     \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}          \usepackage{titlesec}          \titlespacing{\section}         {0pt}         {-12 pt plus 4pt minus 2pt}         {-10 pt plus 2pt minus 2pt}          \titlespacing{\subsection}         {0pt}            {-12pt plus 4pt minus 2pt}         {-10pt plus 2pt minus 2pt}          \titlespacing{\subsubsection}         {0pt}         {-12pt plus 4pt minus 2pt}         {-10pt plus 2pt minus 2pt}          \titlespacing\paragraph         {0pt}         {-12pt plus 4pt minus 2pt}         {-10pt plus 2pt minus 2pt}          \titleformat{\section}         {\normalfont\normalsize\bfseries\MakeTextUppercase}         {\thesection.}         {1em}         {}           \titleformat{\subsection}         {\normalfont\normalsize\bfseries}         {\thesubsection.}         {1em}         {}          \titleformat{\subsubsection}         {\normalfont\normalsize\bfseries\itshape}         {\thesubsubsection.}         {1em }         {}          \titleformat{\paragraph}         {\itshape\normalsize}         {\theparagraph.}         {1em}         {}          \usepackage{fancyhdr}     \renewcommand{\headrulewidth}{0pt}     \fancyhf{}     \chead{{\thepage}}     \renewcommand{\footrulewidth}{0pt}     \pagestyle{fancy}     \setlength{\headheight}{ 0 cm}           \usepackage{enumitem}     \setlist{nolistsep}     %\raggedbottom     \setitemize{topsep=-12pt}     \setenumerate{topsep=-12pt}     \setenumerate[2]{label=\alph*.}     \let\stdsection\section     \renewcommand{\section}{\newpage\stdsection}          \begin{document}          \shorthandoff{=}          (...)          (...)          \begin{spacing}{1.0}     \setlength{\parskip}{0.245\baselineskip}          \tableofcontents     \setlength{\parskip}{\baselineskip}     \end{spacing}          (...)          (...)          \end{document}


title: How to align equations

text: I am trying to write a set of equations similar to some found in a book I am reading. Below is how the book has formatted the equations: ![book equations](http://i.stack.imgur.com/NMB1o.jpg) and here is what I have so far: ![my equations](http://i.stack.imgur.com/q1OXZ.jpg) How can I align my equations so that "maximize" and "subject to" are aligned, while also aligning the sums? I do not want to display "(KP)" or any equation numbers on the side. Here is the code I wrote:               \begin{equation*}     \begin{aligned}         \text{maximize} \sum_{j=1}^{n}p_j x_j \\         \text{subject to} \sum_{j=1}^{n}w_j x_j \leq c, \\         x_j \in \{0,1\}, j = 1, \ldots, n.     \end{aligned}     \end{equation*}


title: Suftesi font in book class

text: How can i have the series of font of suftesi in a normal book class of LaTeX ?


title: How to install latex on Redhat 6?

text: I am working on latex and R. Now i need to deploy my application on server for that i need to install on RHEL 6. Where can i find complete source. I cannot install online since my server is not connected to Internet.


title: PDF Layers (OCG) using xelatex

text: I am switching from pdflatex to xelatex and have trouble finding an alternative on how to do layers in the pdf. So far I have been using ocg.sty to separate relevant content from eye-candy content (background images, illustrations), so the reader can hide the latter for printing. However, ocg.sty does not work with xelatex due lack of pdfobj support. The newer CTAN ocgtools package also has this issue and will work with pdflatex, but not xelatex. Is there currently any way to produce ocg layers using xelatex? Or is there another approach for hiding/disabling some parts (not necessarily only images) in a PDF before printing?


title: Set Table height to fixed height

text: I found the `\resizebox` command but I don't want to scale my table. I want to be able to set it to X height and have it stay there. Is there a way to set the height of a table and leave it there no matter how many rows? I ask since the table in the middle of my document will always vary and sometimes have one row and sometimes have 4 rows. When I set it up to one row with measurements and then add more rows it moves my items below it. I want that when I add more rows to the table in the middle it doesn't move the content below it. So I was figuring that setting the height to begin with will solve that, I just can't find how to set that height parameter. This is my table:               \begin{tabular}{ @{} p{0.5in} p{3.25in} p{0.5in} @{} }     \textbf{date} & \textbf{date} & \textbf{date} \\     \end{tabular}


title: Problem with layout after including pictures

text: I can't resolve the problem with including pictures. When I add a picture by using `\includegraphics` my text doesn't flush to the bottom (as it should) but it move up. It happens especially when I add `\wrapfigure` to the next side and footnote. Here you can see the text on the even page move a bit up. When I add \footnote it move up more. So, lines on the even and odd side don't match. ![enter image description here](http://i.stack.imgur.com/ijiTN.png). ![enter image description here](http://i.stack.imgur.com/bWWKN.png) And here is my minimal working preamble:               \documentclass{book}          \usepackage{wrapfig}          \usepackage[     centering,     showframe,     papersize={160mm,235mm},     text={125mm,190.5mm},     ]{geometry}          \setlength{\parskip}{0pt}     \setlength{\parindent}{14pt}           \clubpenalty10000      \widowpenalty10000           \sloppy           \frenchspacing          \usepackage[demo]{graphicx}      I thought maybe `\flushbottom` would help but didn't (maybe because of `\parskip{0pt}`). I tried `\vspace` inside `{figure}` environment but it didn't work too. I found maybe this would help                \setlength\floatsep{12pt plus 12pt minus 2pt}       but wouldn't. Do you know what to do? Thanks for any help. Sorry for long post but I don't know how to use wrapfigure with lipsum. It is why I showed you only my preamble. I don't know how to put a picture at the top of the page (like on the odd page in my example). In this example text move up with wrapfigure on the next page and move a bit down without it whereas I need it exactly on the bottom line of the frame (When I don't include graphic the text is exactly on the line). Martin, I use {figure} as you can see below.               \documentclass{book}          \usepackage[T1]{fontenc}     \usepackage{venturis}          \usepackage{wrapfig}          \usepackage[     centering,     showframe,     papersize={160mm,235mm},     text={125mm,190.5mm},     ]{geometry}          \setlength{\parskip}{0pt}     \setlength{\parindent}{14pt}           \clubpenalty10000      \widowpenalty10000           \sloppy           \frenchspacing          \usepackage[demo]{graphicx}          \begin{document}           \begin{figure}[!ht]         \centering         \hspace{3pt}\fbox{\includegraphics[width=118mm]{photo.jpg}}         %\vspace{-10pt}         \caption*{\footnotesize\centering{lorem}}      \end{figure}     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam fermentum, purus eget ultrices consectetur, odio magna commodo metus, sed blandit ipsum nisl at mi. Maecenas et sapien sapien. Proin quis arcu vel nulla commodo elementum. Fusce id ultrices enim. Aenean quis suscipit quam. Etiam egestas, felis et lobortis auctor, felis felis porttitor nibh, quis placerat quam est hendrerit purus. Nam luctus tincidunt turpis, at bibendum risus semper vitae. Praesent quis tortor sit amet massa aliquam sollicitudin. Curabitur venenatis tempus ligula elementum semper. Maecenas vehicula urna in lectus varius non dignissim felis elementum. Praesent dignissim ultricies massa at faucibus. Nam sed libero enim. Sed euismod mollis tortor, sit amet elementum nulla lacinia ut.          Nullam congue turpis sed arcu mollis sit amet vulputate sapien iaculis. Aliquam eget nulla enim. Praesent pulvinar felis ut risus laoreet suscipit. Nulla id velit purus. In nec est ut ligula pulvinar congue eu id massa. Donec id porta est. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce a dapibus tellus. Phasellus auctor nisi arcu. Proin libero quam, fringilla vitae hendrerit ut, fermentum in lectus. Nulla tempus sem dolor, posuere aliquet velit. In lacus nisl, porttitor euismod lobortis id, blandit id nulla. Vestibulum tristique nunc et eros fringilla pretium. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce dignissim, sapien ac feugiat aliquam, nunc nisl imperdiet dui, quis volutpat massa nisl sed lectus.          Suspendisse imperdiet feugiat tempor. Vivamus tincidunt justo laoreet urna vestibulum aliquet. Mauris sed varius dui. Donec tempus ipsum non dolor euismod id molestie ante condimentum. Nulla vehicula, erat quis accumsan luctus, lorem ligula viverra sem, sit amet laoreet mi mauris non diam. Maecenas augue dui, tincidunt non lacinia vitae, lacinia at quam. Donec dapibus auctor nunc. Proin aliquet sollicitudin luctus. Maecenas sed mi odio. Sed elementum massa sed nisl pulvinar eu iaculis ligula ornare. Sed at pulvinar lorem. Curabitur ac quam sit amet erat ullamcorper ornare. Vestibulum eu tempor lacus. Donec ultrices, sapien vel gravida hendrerit, lorem lacus eleifend ipsum, in tristique justo velit ac tellus. Quisque vestibulum fringilla arcu posuere ultricies. In placerat imperdiet scelerisque. Morbi quis dui vitae neque cursus rutrum vel semper ante. Donec at orci sed nisl iaculis cursus non tempor lorem. Duis eget risus augue, eget viverra felis.          Nulla justo diam, posuere ut egestas non, varius facilisis enim. Donec suscipit, dolor nec lobortis ornare, velit erat interdum tellus, ac elementum orci mauris vitae magna. \begin{wrapfigure}{r}{0.5\textwidth}     %\vspace{-10pt}     \fbox{\includegraphics[width=0.48\textwidth]{photo.jpg}}     \vspace{-22pt}      \caption*{\footnotesize\centering{lorem}}     \end{wrapfigure}Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam faucibus dui dolor. Quisque ut felis dolor. Aliquam aliquam venenatis leo sed vehicula. Praesent neque justo, facilisis non gravida et, feugiat nec ante. Donec tincidunt, sem sit amet elementum commodo, felis tellus volutpat metus, quis ultrices mi urna et tellus. Ut sit amet scelerisque elit. Aliquam ac magna id lacus accumsan consequat et eu nunc. Nam lorem leo, mattis aliquet congue ultrices, pharetra in nisl. Curabitur cursus neque nec eros pulvinar aliquet.          Pellentesque vestibulum adipiscing dapibus. Donec auctor, dolor a viverra auctor, tellus urna cursus nulla, et imperdiet mauris mauris in arcu. Quisque condimentum, quam eu mollis bibendum, erat augue viverra augue, eu viverra magna sapien in felis. Aliquam scelerisque tempus quam, adipiscing posuere lectus dictum et. Integer feugiat viverra egestas. Cras malesuada dictum felis, eu aliquam erat bibendum vitae. Curabitur ac metus non lorem hendrerit ornare eget eget nisl. Vestibulum ante ante, lobortis eu congue sed, euismod in risus. Sed viverra ornare dui, et condimentum libero pellentesque at. Sed congue est ut purus ornare euismod. Vivamus venenatis dui sit amet magna dignissim suscipit. Nunc eu nunc eu nulla semper auctor. Mauris lacus felis, facilisis tincidunt fermentum a, cursus nec enim. Proin eu placerat libero. Praesent sagittis, lectus ac ultricies ultrices, nulla ante imperdiet risus, molestie porta erat mauris a dui. Quisque consequat lorem ut sem faucibus rutrum.               \end{document}


title: Override default equation numbering in Beamer?

text: I need to override the default equation numbering behavior. I want the numbers next to equations in my Beamer slide presentation to match with the numbers of the same equations in my paper. so instead of equations 1,2,3,4,... it would be equations 2.2, 5.1, 7.1, 7.2 ...


title: Arrange Bibliography in table

text: I am using the code as suggested by Audrey in this post in order to produce a tabular bibliography and adapted it as follows. Naturally, the authors' names should be printed in the first column and everything else in the second, yet the names are repeated in the second column. The second modification that I wish to make, is to add some text between the heading and the table.               \documentclass[12pt,a4paper,oneside]{memoir}     \usepackage[backend=biber,style=biblatex-swiss-legal-general]{biblatex}     \usepackage{etoolbox}     \usepackage{chngcntr}     \usepackage{csquotes}     \usepackage{array}     \usepackage{ragged2e}     \newcolumntype{P}[1]{>{\raggedright\hspace{0pt}}p{#1}}     \usepackage{multicol}     \usepackage{etoolbox}          \renewcommand{\mkbibnamefirst}[1]{\textsc{#1}}     \renewcommand{\mkbibnamelast}[1]{\textsc{#1}}     \renewcommand{\mkbibnameprefix}[1]{\textsc{#1}}     \renewcommand{\mkbibnameaffix}[1]{\textsc{#1}}          \makeatletter          % user-level command for printing tabular bibliography     \let\printbibtabular\printbibliography     \patchcmd{\printbibtabular}{\blx@printbibliography}{\bbx@printbibtabular}{}{}     \patchcmd{\printbibtabular}{\blx@printbibliography}{\bbx@printbibtabular}{}{}     \let\bbx@printbibtabular\blx@printbibliography     \patchcmd{\bbx@printbibtabular}{\blx@bibliography}{\bbx@bibtabular}{}{}     \patchcmd{\bbx@printbibtabular}       {\def\blx@theenv{bibliography}}{\def\blx@theenv{bibtabular}}{}{}          % underlying macros     \def\bbx@bibtabular#1{%       \blx@bibheading\blx@theheading\blx@thetitle       \blx@bibnote\blx@theprenote       \begingroup       \blx@bibinit       \let\@noitemerr\@empty       \let\blx@noitem\blx@warn@bibempty       \ifnum\bibinitsep=\z@         \let\blx@initsep\relax       \fi       \ifnum\bibnamesep=\z@         \let\blx@namesep\relax       \fi       \csuse{blx@hook@bibinit}%            % copy filtered list of entries to internal list macro       \def\blx@do##1{%         \blx@ifdata{##1}{%           \begingroup           \blx@getdata{##1}           \blx@bibcheck           \iftoggle{blx@skipentry}{}{%             \global\let\blx@noitem\@empty             \listadd\blx@tempa{##1}}%           \endgroup}{}}       \let\blx@done\relax       \blx@listloop{#1}            % tabular output for each item in list macro       \def\do##1{\bbx@tab@label{##1} & \bbx@tab@item{##1} \\}       \def\do##1{\bbx@tab@label{##1} & \bbx@tab@item{##1} \\}       \csuse{blx@env@\blx@theenv}%       \dolistloop{\blx@tempa}       \csuse{blx@endenv@\blx@theenv}%       \blx@bibnote\blx@thepostnote       \endgroup}          \def\bbx@tab@label#1{%       \begingroup       \blx@getdata{#1}%       \blx@setoptions@type\abx@field@entrytype       \blx@setoptions@entry       \blx@thelabelnumber       \blx@addprefixnumber       \addtocounter{instcount}\@ne       \csuse{bbx@tabenv@\blx@theenv}\relax       \endgroup}          \def\bbx@tab@item#1{%       \begingroup       \blx@getdata{#1}%       \blx@setoptions@type\abx@field@entrytype       \blx@setoptions@entry       \csuse{blx@item@\blx@theenv}\relax       \blx@initsep       \blx@namesep       \csuse{blx@hook@bibitem}%       \blx@execute       \blx@initunit       \blx@anchor       \blx@beglang       \bibsentence       \blx@pagetracker       \blx@driver\abx@field@entrytype       \blx@postpunct       \blx@endlang       \endgroup}          % user-level command for defining tabular bibliography format     \newrobustcmd*{\defbibtabular}[5]{%       \long\csdef{blx@env@#1}{#2}%       \long\csdef{blx@endenv@#1}{#3}%       \long\csdef{bbx@tabenv@#1}{#4}%       \long\csdef{blx@item@#1}{#5}}          % user-level access to some entry options     \def\useeditorfalse{\togglefalse{blx@useeditor}}     \def\usetranslatorfalse{\togglefalse{blx@usetranslator}}          \makeatother          % sortname labels (a robust style should add provision for missing labelnames)     \newbibmacro*{sortname}{%       \renewcommand*{\multinamedelim}{\addslash\break}%       \let\finalnamedelim\multinamedelim       \printtext{\printnames[last-first]{labelname}}}          % bibitem hook to suppress redundant sortname list     \newbibmacro*{omitsortname}{%       \ifnameundef{labelname}{}{%         \ifnameundef{author}           {\ifnameundef{editor}              {\ifusetranslator{\clearname{translator}}{}}}              {\clearname{editor}}           {\clearname{author}}%         \useeditorfalse%         \usetranslatorfalse}}          % demo new tabular bibliography format     \defbibtabular{bibtabular}      {\setlength{\tabcolsep}{8pt}\begin{tabular}{@{}P{5.5cm} >{\raggedright\arraybackslash}p{9cm}}}      {\end{tabular}}      {\usebibmacro{sortname}}      {\usebibmacro{omitsortname}}          % add multiline labels in default bibliography format     \defbibenvironment{bibliography}       {\list          {\usebibmacro{sortname}}          {\setlength{\labelwidth}{0.3\textwidth}%           \setlength{\leftmargin}{\labelwidth}%           \setlength{\labelsep}{\biblabelsep}%           \addtolength{\leftmargin}{\labelsep}%           \setlength{\itemsep}{\bibitemsep}%           \setlength{\parsep}{\bibparsep}}%          \renewcommand*{\makelabel}[1]{%            \nobreak\strut\smash{\parbox[t]\labelwidth{\raggedright##1}}}}       {\endlist}       {\item\usebibmacro{omitsortname}}          \addbibresource{biblatex-examples.bib}          \renewcommand{\cmd}[1]{\texttt{\textbackslash #1}}          \begin{document}          \printbibtabular          \cite{vangennep:trans,companion,bertram}          \end{document}      Thank you for your help.


title: Acronyms in Bibtex

text: Is it possible to add acronyms to a bibTeX file? I have a bibTeX entry that looks like the following when printed with `natbib`:![enter image description here](http://i.stack.imgur.com/TVH9U.png) And when used within the text it looks like: ![enter image description here](http://i.stack.imgur.com/GP7pJ.png) I would like it to show IBM [2011] and it could look the same in the references print or something like International Business Machines (IBM). etc... My current entry looks like:               @webpage{International-Business-Machines:2011aa,         Author = {{International Business Machines}},         Month = {February},         Title = {{Common Public License}},         Url = {http://www.ibm.com/developerworks/library/os-cpl.html},         Year = {2011}}


title: How to change the height of just one nodepart in TikZ?

text: I want to change the height of one part of the node to the minimum possible. How can I do this?               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes}     \begin{document}       \begin{tikzpicture}         \node[rectangle split,rectangle split parts=3] {           first           \nodepart{second}           \nodepart{third}           third         };       \end{tikzpicture}     \end{document}      I want the second part (which is empty) to be 0.1cm in height.


title: Problem with footer positioning on first TOC page (originated on fancyhdr header)

text: the footer on my first TOC page is not showing in the right position. My code (very simplified, I made a copy of the class and document used, made cuts until I found out the problem and generated this code snipet) is below:               \documentclass[10.5pt,twoside]{report}          \usepackage{fancyhdr}     \usepackage[a4paper,vmargin={3cm,3.2cm},hmargin={3cm,3cm}]{geometry}     \usepackage[demo]{graphicx}           \pagestyle{fancyplain}     \fancyhead{}     \renewcommand{\headrulewidth}{0pt}          %if I comment the line below it works     \fancyhead[C]{\includegraphics[height=38pt]{sampleimage.png}}          \fancyfoot{}     \fancyfoot[LE,RO]{\thepage}     \cfoot{\includegraphics[height=28pt]{anyimage.png}}     \renewcommand{\footrulewidth}{0pt}          \begin{document}          \tableofcontents     \cleardoublepage          \part{First Part}     \cleardoublepage     \chapter{firstchapter}          \end{document}      If I comment the mentioned line it works, but the header won't show as I wish. Anyone know why this is happening? How can I fix it (maintaining the header the way I want)? Thanks in advance.


title: How to temporarily suppress image insertion when compiling?

text: There are some big images in my document and compiling is taking substantial amount of time. When compiling a tex file to a dvi (and subsequently ps and pdf), is there any way I can temporarily suppress insertion of eps files?


title: How to use BIG sizes of fonts?

text: I'm making a presentation, but I don't want to complicate me learning `beamer`, so I use `article` in `landscape` mode. How can I use a bigger font in all the document as default size? 24 pt, 36 pt, or any similar size????               \documentclass[12pt,a4paper,x11names,landscape]{article}     \usepackage[top=2.5cm, left=3.5cm, bottom=2.5cm, right=2.5cm]{geometry}  % Margenes de la normativa TFG     \usepackage{incgraph,mwe}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[spanish]{babel}     \begin{document}     \incgraph[paper=document][width=\paperwidth,height=\paperheight]{example-image-a.eps}               \Large{jei     dfddd          fd\begin{itemize}         \item fdfs         \item fdfdfddd         \item fdsfs       \end{itemize}               }     \end{document}


title: Exam Class: how to avoid question going beyond margin

text: I'm able to create question paper using LaTeX code mentioned below:               \documentclass{exam}     \usepackage[margin=0.7in,headheight=3.5\baselineskip,headsep=1\baselineskip,includehead]{geometry}     \usepackage{multicol}     \usepackage{amsmath}     \setlength\columnsep{46pt}     \begin{document}     \begin{multicols}{2}     \begin{questions}     \question Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question.Let This be the test question. Let This be the test question.      \begin{choices}     \choice 1     \choice 2     \choice 3     \choice 4     \end{choices}     \question Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question.Let This be the test question. Let This be the test question.      \begin{choices}     \choice 1     \choice 2     \choice 3     \choice 4     \end{choices}     \question Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question.Let This be the test question. Let This be the test question.      \begin{choices}     \choice 1     \choice 2     \choice 3     \choice 4     \end{choices}     \question Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question.Let This be the test question. Let This be the test question.      \begin{choices}     \choice 1     \choice 2     \choice 3     \choice 4     \end{choices}     \question Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question.Let This be the test question. Let This be the test question.      \begin{choices}     \choice 1     \choice 2     \choice 3     \choice 4     \end{choices}     \question Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question.Let This be the test question. Let This be the test question.      \begin{choices}     \choice 1     \choice 2     \choice 3     \choice 4     \end{choices}     \question Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question.Let This be the test question. Let This be the test question.      \begin{choices}     \choice 1     \choice 2     \choice 3     \choice 4     \end{choices}     \question Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question. Let This be the test question.Let This be the test question. Let This be the test question.      \begin{choices}     \choice 1     \choice 2     \choice 3     \choice 4     \end{choices}     \question The points with position vectors\ $\displaystyle \boldsymbol{61i + 2j,\,10i-9j,\,ai-12j }$ \ are collinear, if\ $\displaystyle \boldsymbol{a =  }$     \begin{choices}     \choice 1     \choice 2     \choice 3     \choice 4     \end{choices}     \end{questions}     \end{multicols}     \end{document}      It generates output as mentioned below: ![enter image description here](http://i.stack.imgur.com/0meY4.png) If you notice Question 9, it's going out of the page margin. This happens very frequently when i add maths symbols, is there any way to avoid this error ?


title: Citations with no date, e.g. (Aristotle n.d.)

text: I need to cite a work from antiquity that has no known date, using natbib and author-year citations. The best suggestion I've found is to write the citation using "n.d." (no date) for the year of publication, but putting that into by bibtex file renders an ugly citation without periods:               (Author nd)      when what I'd like is:               (Author n.d.)      Wrapping it in curly braces ("{n.d.}") doesn't seem to help with the in-line citation (though it works in the bibliography). How can I force BibTex to render the date in an in-line citation with punctuation? * * * ### Example .bib               @book{aristotle,         Author = {Aristotle},         Booktitle = {Works of Aristotle},         Title = {Categoriae},         Year = {{n.d.}}}      ### Example LaTeX               \documentclass{article}          \usepackage[authoryear]{natbib}     \bibliographystyle{apalike}          \begin{document}     Lorem ipsum dolor sit amet \citep{aristotle}, consectetur adipiscing elit.          \bibliography{file.bib}     \end{document}      ### (Ugly, incorrect) output               Lorem ipsum dolor (Aristotle, nd) sit amet.          REFERENCES     Aristotle (n.d.). Categoriae.


title: Tikz to html, characters in picture, svg error

text: This fails to produce working file with `htlatex`:               \documentclass{article}          \def\pgfsysdriver{pgfsys-tex4ht.def}     \usepackage{tikz}          \begin{document}          \begin{figure}     \tikz \node (foobar) {$\cong$};     \end{figure}          \end{document}      Changing `\node` to `\node[tex4ht node/escape=true]` does not help. Is there easy way to correct this, or should I forget this and try with `\usetikzlibrary{external}`? (Putting, for example, `\subset` instead of `\cong` to tikz picture works.)


title: Do system font (TTF/OTF) forms of the Kepler Project fonts (kpfonts) exist?

text: I have recently fallen in love with the `kpfonts` package. Whilst it looks great in both body text and TikZ pictures, my current issue is that I cannot create images in external programs containing this typeface and must resort to Pagella or similar (I don't appear to have Palatino). I imagine that the fonts as defined in the `kpfonts` LaTeX package have lots of extra metrics information that would be lost in a TTF/OTF file, but do TTF and/or OTF versions of at least `kp serif` regular exist?


title: How to control the fading size in TikZ?

text: I am trying to create a fading using `tikzfadingfrompicture`, but I cannot understand how TikZ computes the size of the fading. I assumed that TikZ calculates the bounding box of the image to fade, and then stretches the fading-picture to match its bounding box with the bounding box of the image, but the following code snippet proves I am wrong.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{patterns,fadings}          \begin{document}          \begin{tikzfadingfrompicture}[name=fade frame]       \draw[transparent!0,step=0.2cm] (-1,-1) grid (1,1);     \end{tikzfadingfrompicture}          \begin{tikzpicture}       \fill [black!20] (-2,-2) rectangle (7,7);       \pattern [pattern=checkerboard, pattern color=black!30] (-2,-2)       rectangle (7,7);       \draw[step=0.5cm,very thin] (-2,-2) grid (7,7);       \fill [path fading=fade frame,red] (-2,-2) rectangle (7,7);     \end{tikzpicture}          \end{document}      The picture I get has 9 squares, and not 10 as I would expect (because the original grid in the fading is 2cm wide and has a step=0.2cm). Am I doing something wrong? How can I have TikZ use the whole fading-picture?


title: Plus equal are separated

text: I have the following inline code: `$\texttt{TEST}(v *= 2, v += 2, v = 4)$` But when it is rendered, the plus is very far away from the equal sign. How can I overcome this problem and make LaTeX consider += as a single operator? ![rendered](http://i.stack.imgur.com/PW4lf.gif)


title: Palatino italics relatively small in body text?

text: I'm using Palatino (`\usepackage[sc]{mathpazo}`) as the main font for my thesis, and it occurred to me that italic (and possibly also bold) body texts are somewhat smaller than the '`\normalsize\normalfont`' texts. Here is an image to illustrate the phenomenon: ![image illustrating the phenomenon](http://i.stack.imgur.com/ZkpVd.png) Is this default Palatino behavior? Is there a way to particularly change the size of the italic and bold parts of the body text?


title: How to make \tfrac work in >{}?

text: When I used `>{$\sqrt\bgroup\tfrac}c<{\egroup$}`, I got the following output. The weird part happened at the last column. How to fix it? ![enter image description here](http://i.stack.imgur.com/aCg6Q.png)               \documentclass[border=3pt]{standalone}     \usepackage{booktabs}     \usepackage{array}     \usepackage{amsmath}          \begin{document}          \begin{tabular}     {         >{$}c<{^\circ$}         >{$\tfrac1 2\sqrt\bgroup}c<{\egroup$}         >{$\tfrac1 2\sqrt\bgroup}c<{\egroup$}         >{$\sqrt\bgroup\tfrac}c<{\egroup$}     }     \toprule     \multicolumn{1}{c}{$\theta$}&         \multicolumn{1}{c}{$\sin\theta$}&             \multicolumn{1}{c}{$\cos\theta$}&                 \multicolumn{1}{c}{$\tan\theta$}\\     \midrule     0&         0&             4&                 0 4\\     30&         1&             3&                 1 3\\     45&         2&             2&                 2 2\\     60&         3&             1&                 3 1\\     90&         4&             0&                 4 0\\     \bottomrule     \end{tabular}          \end{document}      Bonus: Please make the rows a bit taller. And if it is possible, can we extract the second and third column to be used for the fourth column?


title: Define an "escape underscore" environment

text: I am writing a text document in LaTeX where I need a lot a words with underscores: `foo_bar_1`, `more_bar_2_long_expression_3`. I know about the `underscore` package, but for some reason the `[strings]` option doesn't work for me (I get e.g. `Extra \endcsname. ...oncluding Chapter~\ref{ch:summary_outlook}`). So my idea would be to define a new command or environment               \newcommand{escunderscore}[1]{...}      in which basically `_` would be replaced by `\\_`, so that I then can write `\escunderscore{foo_bar_1}` in my text whenever I need underscores. Is this possible and how do I do this?


title: Concurrently interleaving execution of Lua and TeX in LuaTeX

text: The usual way to interleave Lua and TeX in generating documents is by invoking Lua from Tex through the `\directlua` facility and generate Tex from Lua using `tex.print()`. For example, consider the Plain LuaTeX:               \directlua{         es=""; someluatex = function () tex.everypar="PAR!" end         tex.print("one", es, "two")         someluatex()         tex.print("three", es, "four")     }     five\bye      Looking at the document LuaTeX generates for that input, we see that `someluatex()` is run _before_ the Tex backend does anything with the output: the PAR!s will be inserted before "one" and "two", as well as after "three". Is there best practice for ensuring that TeX code issued by some Lua code is issued before some other LuaTeX code? There are several ways to do this: with some code I am working with I am trying the following scheme:   1. Wrap the code executed by the `\directlua` in a coroutine, call it `myco`;   2. At the point we want to ensure the Tex so far tex.print-ed is executed, use:              tex.print("\\directlua{coroutine.resume(myco)}")     coroutine.yield()        3. If everything is in order, the Lua will resume after the Tex is processed. This is not ideal, however: we must ensure that the TeX backend is in the right state to understand the `\directlua` command, which may not always be the case. Is there a better way to achieve this?


title: Make index entries refer to something other than the page numbers

text: For a given book which is a daily devotional, I have no page numbers at all, but each section corresponds to a day in the year, with one day per page. I generate an index of Bible references in the end of the book, and I link the Bible references to the page where they are quoted. But since there are no page numbers in the book, the index must contain the day (i.e. the secion, e.g. "13 Mai" instead of 151) instead of the page number. So far, my (ugly) solution was to output the section name and page in the logs with:                \typeout{Date on page \thepage:\thesection:\chaphead}%      and then use a shell script to parse the logs and modify the generated index (.ind file) with sed:               #!/bin/bash                                                                               NAME="$1"                                                                                while read -r page day month; do                                                        bsmonth=$(sed -e 's@\\@\\\\@g' <<<$month)                                            sed -i "s@textrm{\([^,]*, \)\?$page\(, [^,]*\)\?}@textrm{\1\\\\hyperlink{page.$page}{\\\\mbox{\\\\scshape\\\\makedate{$day}~$bsmonth}}\2}@g" $NAME.ind     done < <(sed -n 's@Date on page \([0-9]\+\):\([0-9]\+\):\(.*\)@\1 \2 \3@p' $NAME.log)      I would call LaTeX this way:               %.pdf: %.tex                     TEXINPUTS=$(TEXINPUTS) pdflatex -shell-escape -interaction=batchmode $<          # Modify index to use dates instead of pages                                     ./index_dates.sh $*                                                              # No -shell-escape to prevent re-creation of index                               TEXINPUTS=$(TEXINPUTS) pdflatex -interaction=batchmode $<         I'm using `imakeidx` so the index is automatically regenerated when I compile the document. In TeXLive 2009, not passing `-shell-escape` prevented `imakeidx` from rebuilding the index, and thus from erasing the changes made by `index_dates.sh`, so it worked fine (although still ugly). Now in TeXLive 2010, the `-shell-escape` trick doesn't work, and before I switch to another ugly trick, I'd like to think of rewriting this piece of code in proper TeX. Can you give me some hint as to how to do it properly?   * Should I generate dynamic macros such as:              \def\pagemonth@\csname \thepage{\thesection~\chaphead}      and then modify the index? If so, how do I modify the index?   * Should I write these macros to a separate file and import it later on (and how to do that)?   * Should I hook into `imakeidx` (and how)?   * Should I replace `imakeidx` with another package that would allow this more easily?   * Should I switch to another index builder (such as `xindy`) and what parameters would I pass it?   * Should I add a "style" for page numbers in the index which would actually be a call to a macro replacing with my content?


title: Difference between \footcite and \cite in BibLaTeX

text: Since recently, I am having some trouble with the short/ibidem and full citations in BibLaTeX. When I use a \cite command inside a footnote, it behaves differently than \footcite: it seems each keeps its own track of whether a citation has been used before. This simple example shows the ibid tracker works differently inside and outside a footnote: * * *               \documentclass[a4paper]{memoir}          \usepackage[russian, english, UKenglish]{babel}     \usepackage[style=british,english=british]{csquotes}     \selectlanguage{UKenglish}          \usepackage[backend=biber,style=verbose-ibid]{biblatex}     \bibliography{test}          \begin{document}          Check.\footcite{Book1}     Check.\footcite{Book1}          Check.\footnote{\cite{Book1}.}     Check.\footcite{Book1}          Check.\footcite{Book2}     Check.\footnote{\cite{Book2}.}          \end{document}      * * * This produces the following output:   * footnote 1: full citation 1   * footnote 2: ibid.   * footnote 3: full citation 1   * footnote 4: ibid.   * footnote 5: full citation 2   * footnote 6: full citation 2 I should think footnotes 3 and 6 should also be ibid., right? Or at least I would want them to be. Another example more likely to occur in my writing practice is the following, in which I use cite and parencite in short footnote comments:               \documentclass[a4paper]{memoir}          \usepackage[english, UKenglish]{babel}     \usepackage[style=british,english=british]{csquotes}     \selectlanguage{UKenglish}          \usepackage[backend=biber,style=verbose-ibid]{biblatex}     \bibliography{test}          \begin{document}          Check 1.\footcite{Book1}     Check 2.\footcite{Book2}     Check 3.\footcite{Book1}          Check 4.%     \footnote{As the above author put it, `life is just a box of chocolates'        \parencite{Book1}. This is pure nonsense, of course.}          Check 5.%     \footnote{There are various opinions on this matter. A very silly one is given               by author number one \parencite{Book1}. A much more clever approach has               recently been suggested in \cite{Book3}. I propose to follow this second               course.}          Check 6.\footcite{Book1}.     Check 7.\footcite{Book3}.          \end{document}      The first results are:   * footnote 1: full citation Book1   * footnote 2: full citation Book2   * footnote 3: short citation Book1 This is exactly how it should be. But then, when I use citation Book1 as a parencite within footnote 4, it is again a full citation, which is not what I want, since the full citation has appeared above. Likewise, in footnote 7, I get a full citation of Book3, which has already appeared in full in footnote 5. Finally, footnote 6 says Ibid., which is confusing, since it refers to the footcite command of footnote 3, not to what happened in footnote 5. The last problem, with the ididtracker can be solved manually; I other ones I find more difficult. The situation as a whole, I'm afraid, is a mess. How to improve it? Am I doing something wrong here? I am now using Biber 0.9.2, MikTeX 2.9, and BibLaTeX 1.4.


title: How to trim horizontal line ends in table with vertical lines?

text: How to obtain something like this ? ![enter image description here](http://i.stack.imgur.com/3ZGmk.jpg) The only way for trimming horizontal line in table that I found is using booktabs. The problem with booktabs is that it doesn't manage good vertical lines. I tried this code:               \documentclass{article}      \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{xcolor}     \usepackage{colortbl}     \usepackage{booktabs}          \begin{document}          \arrayrulecolor{gray}     \begin{tabular}{!{\color{gray}\vline}ll!{\color{gray}\vline}}       a & b \\       c & d \\       \cmidrule(rl){1-2}       e & f     \end{tabular}          \end{document}      But it leads to this results: ![enter image description here](http://i.stack.imgur.com/aSwUU.jpg)


title: \cite with large number of citekeys

text: I have a .sty file for my latex document where I create bibliography category (see[1] below). I have these lines in my document and it worked:               \addtocategory{papers}{sushil}         But in this way I have to add citekey by hand for a large number of articles. So I have been suggested to use this:               \AtEveryCitekey{%        \ifentrytype{article}{%          \iffieldundef{journaltitle}{%            \addtocategory{subpapers}{\thefield{entrykey}}%            }{%              \addtocategory{papers}{\thefield{entrykey}}%            }{%                }%            }        }            Which I guess is same thing but does things automatically. But this case does not work if I do not use `\cite{sushil}` which again brings me to the same point that I have to add citekeys by hand for a large number of articles. I thought that `\nocite{*}` could work but I already have `\nocite{*}` in my `.sty` file. Does anyone knows how to solve this? I do not want to add so many citekeys by hand as its quite time taking. * * * [1] From my .sty file:               % Bibliography categories     \def\makebibcategory#1#2{\DeclareBibliographyCategory{#1}\defbibheading{#1}{\section*{#2}}}     \makebibcategory{papers}{Refereed Research Papers}     \makebibcategory{subpapers}{Submitted Papers to Journals and arXiv}               \setlength{\bibitemsep}{2.65pt}     \setlength{\bibhang}{.8cm}     \renewcommand{\bibfont}{\small}          \renewcommand*{\bibitem}{\addtocounter{papers}{1}\item \mbox{}\hskip-0.85cm\hbox to 0.85cm{\hfill\arabic{papers}.~~}}     \defbibenvironment{bibliography}     {\list{}       {\setlength{\leftmargin}{\bibhang}%        \setlength{\itemsep}{\bibitemsep}%        \setlength{\parsep}{\bibparsep}}}     {\endlist}     {\bibitem}          \newenvironment{publications}{\section{\LARGE Publications}\label{papersstart}\vspace*{0.2cm}\small     \titlespacing{\section}{0pt}{1.5ex}{1ex}\itemsep=0.00cm     }{\label{papersend}\addtocounter{sumpapers}{-1}\refstepcounter{sumpapers}\label{sumpapers}}          \def\printbib#1{\printbibliography[category=#1,heading=#1]\lastref{sumpapers}}


title: Problems with biblatex authoryear style

text: I am writing my Bachelor Thesis and am facing some problems with the `biblatex` package. I have the following line in my text:               \citet{Lerner.2002} look at this issue [...]      I want this to show like this: > Lerner and Tirole (2002) look at this issue [...] However, when I use               \usepackage[style=authoryear-icomp,natbib=true,sortcites=true,block=space]{biblatex}      (which I think is the right option?) I get the title: > Lerner and Tirole ("Some simple economics of open source") look at this > issue [...] I am really confused about this, can anybody help? I am using Texmaker and MiKTeX 2.9, if that makes any difference. EDIT: The .bib entry looks like this:                @article{Lerner.2002,      author = {Lerner, Josh and Tirole, Jean},      year = {2002},      title = {Some Simple Economics of Open Source},      pages = {197--234},      volume = {50},      number = {2},      issn = {00221821},      journal = {The Journal of Industrial Economics}     }


title: Displaying & highlighting glossary entries that are not defined yet?

text: In my document I use the `glossaries`package. When referencing terms, that do not exist in the glossary (yet) the term is simply not displayed. Which IMHO forces a quite complex workflow. Is there any possibility of **displaying** non-defined terms, but in a different color? for example: `\gls{DefinedTerm}` would be displayed in my default link-color and `\gls{UndedinfedTerm}` would be displayed in another style, like red, underlined. ---- **UPDATE** ----- The following does exactly what i was looking for:               \newcommand{\mygls}[1]{\ifglsentryexists{#1}{\gls{#1}}{\textcolor{red}{\underline{#1}}}}      put this in your preamble and simply use `\mygls{Term}`. Undefined terms will then be highlighted, while defined terms will be displayed using `\gls{}` (see JMs answer)


title: Bibliography in Texmaker

text: I'm having some problems with my bibliography in Texmaker. My code is:               \documentclass[11pt, a4paper]{article}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{natbib}     \usepackage[utf8]{inputenc}         \usepackage{natbib}     \usepackage[usenames,dvipsnames]{xcolor}     \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \begin{document}          ....          \cite{Johnson}     \bibliographystyle{plain}     \bibliography{mybib}          \end{document}      I also created a new file (File > New) that I saved as `mybib.bib`:               @Article{Johnson,     author = {Edgar G. Johnson and Alfred O. Nier},     title = {Angular Aberrations in Sector Shaped Electromagnetic Lenses for Focusing Beams of      Charged Particles},     journal = {Physical Review},     year = {1953},     volume = {91},     number = {1},     }          @phdthesis{Zoran,     author = {Zoran Racic},     title = {\'Etude et essais du spectromÃ¨tre Ã  plasma {DYMIO} de la  mission {MARS 96}},     publisher = {UniversitÃ© Pierre et Marie Curie},     year = {1996}     }      When I compile my `.tex` file, I only have a `[?]` appearing. Could you tell me what my mistake is?


title: BibTeX in Texmaker

text: I am trying to create my own BibTeX file and use it in my TeX file. I am using Texmaker as the editor. This is the content of my BibTeX file as of for now:               @ARTICLE{introtobiorec,     author = {Anil K. Jain and Arun Ross and Salil Prabhakar},     title = {An introduction to biometric recognition},     journal = {IEEE Trans. on Circuits and Systems for Video Technology},     year = {2004},     volume = {14},     pages = {4--20}     }      I have included               \usepackage{cite}      I also tried using               \usepackage{natbib}      I include the BibTeX file (`MyBibFile.bib`) as follows:               \bibliographystyle{style}     \bibliography{MyBibFile}      It does not really throw any error but it does not work. Any help would be appreciated.


title: Change style of chapters using KOMA-Script

text: I would like to change the chapter style so that chapters start at the top of the page. With               \renewcommand\chapter{\@startsection{chapter}{0}{\z@}%     {-2em}%     {6pt}%     {\LARGE\bfseries}}      this works fine for numbered chapters. How can I do this for unnumbered chapters such as TOC, LOF etc?