title: No space present after ensuremath

text: When I insert a short maths section in a sentence, it renders fine with a space each side as expected:               ...returned $\mathcal{P}$ from...      If I define a command to do the same thing, it also renders with a space each side:               \newcommand{\pc}{\mathcal{P}}     ...     ...returned $\pc$ from...      However, if I define a function with `ensuremath`, the space following the expression disappears:               \newcommand{\pc}{\ensuremath{\mathcal{P}}}     ...     ...returned \pc from...      Why does `ensuremath` do this? Is there a way to make it more analogous to manually entering math mode? Thanks!


title: How to link to sibling PDF when using pdfpages and hyperref

text: I am using `pdfpages` to tie several PDF documents together (yes, they must be separate documents) into a portfolio. My problem is that I need to place many, many links within one child document that link to the first page of other child documents (which are bookmarked in the outer document). Here is an MWE: _**_**ChildOne.tex: _*_ ***               \documentclass{article}          \usepackage[bookmarksopenlevel=1,%          pdfpagemode=UseOutlines]{hyperref}     \hypersetup{         pdfinfo={             Title={Child One},             Author={Me}         }     }          \author{Me}     \title{Child One}          \begin{document}     \maketitle     Here is where I want to refer to Child Two.          I can do it by \href[page=3]{OuterDoc.pdf}{absolute page reference},     but the zoom level changes, and I don't always know the absolute     page number ahead of time (because there are so many child documents     of varying lengths).          My preference would be to refer to Child Two automatically, and     \href{OuterDoc.pdf#nameddest=ChildTwo}{a named destination} doesn't     seem to work.          \end{document}      _**_**ChildTwo.tex: _*_ ***               \documentclass{article}          \usepackage{lipsum}          \usepackage[bookmarksopenlevel=1,%          pdfpagemode=UseOutlines]{hyperref}     \hypersetup{         pdfinfo={             Title={Child Two},             Author={Me}         }     }          \author{Me}     \title{Child Two}          \begin{document}     \maketitle     \lipsum[1-5]     \end{document}      After compiling `ChildOne.tex` and `ChildTwo.tex`, I run `pax` on `ChildOne.pdf` (using the information in this question), and then compile `OuterDoc.tex`. _**_**OuterDoc.tex: _*_ ***               \documentclass{article}          \author{Me}     \title{Big Title}          \usepackage{pdfpages}          \newcommand{\singlepageinpdf}{1}     \newcommand{\pagesinpdf}{1}          \newcounter{includepdfpage}     \newcounter{currentpagecounter}     \newcommand{\addlabelstoallincludedpages}[1]{%        \refstepcounter{includepdfpage}%        \stepcounter{currentpagecounter}%        \label{#1.\thecurrentpagecounter}}     \newcommand{\modifiedincludepdf}[4]{%         \setcounter{currentpagecounter}{0}%         \includepdf[pages=1,pagecommand={\pdfbookmark[#1]{#2}{#3}\addlabelstoallincludedpages{#3}}]{#4}%         \pdfximage{#4}%         \renewcommand{\pagesinpdf}{\the\pdflastximagepages}%         \if\pagesinpdf\singlepageinpdf%           \relax%         \else%             \includepdf[pages=2-,pagecommand=\addlabelstoallincludedpages{#3}]{#4}%         \fi%     }          \usepackage{pax}          \usepackage[bookmarksopenlevel=1,%          pdfpagemode=UseOutlines,%          pdfpagelayout=OneColumn,%          pdfnewwindow=false,%          pdfstartview=FitH]{hyperref}     \hypersetup{         pdfinfo={%             Title={Outer Doc},%             Author={Me}%         }%     }          \usepackage{bookmark}          \begin{document}     \bookmark[page=1, level=0]{Title Page}     {\begin{center}     \Huge \textbf{My Big Document}     \end{center}     }          \modifiedincludepdf{0}{First Child}{ChildOne}{ChildOne.pdf}     \modifiedincludepdf{0}{Second Child}{ChildTwo}{ChildTwo.pdf}          \end{document}      Because my `\href[page=3]{OuterDoc.pdf}{absolute page reference}` link works correctly, it looks to me like the linking system, including `pax`, is working as expected. However, `\href{OuterDoc.pdf#nameddest=ChildTwo}{a named destination}` doesn't give me any joy. Am I possibly out of luck because a bookmark is not a valid destination?? (And if so, what brilliant person out there can think of a workaround?) An additional (but small) problem is that the `pdfstartview=FitH` option of `hyperref` (2012/11/06 v6.83m) doesn't load the page in fitted width (for the `[page=3]` link) -- it zooms to the whole-page view.


title: tikz gives null character in \document

text: Please why does               \begin{document}     \begin{tikzpicture}     \foreach \x [remember=\x as \lastx (initially A)] in {B,...,H}{%       $\overrightarrow{\lastx\x}$,     }     \end{tikzpicture}     \end{document}      give               Missing character: There is no , in font nullfont!      in the log file while in document body? Removing the comma (,) after `$` relieves the warning.


title: MikTex 2.9 64-bit not loading sans serif font for moderncv

text: I just got a new computer and installed MikTex 2.9 for Windows7 64-bit. When I compiled my resume for the first time (`moderncv`, theme `casual`), it compiled in roman vs. sans serif fonts. I did not specify the `roman` argument, so the document should default to sans serif fonts. Why can't I get sans serif fonts? I hate roman. Example of file:               \documentclass[10pt,letter]{moderncv}          \moderncvtheme[green]{casual}                     \usepackage[utf8]{inputenc}          \usepackage{fontenc}     \usepackage[scale=0.835]{geometry}          \AtBeginDocument{\recomputelengths}            \firstname{Fname}     \familyname{Lnmae}          \address{123 Main St.}{city, state 00000}     \mobile{999 999 9999}          \email{person@email.com}          \nopagenumbers{}      \hyphenpenalty=100000          \begin{document}          \maketitle     \vspace{-.5in}          \section{Objective}     \cvline{}{Hire Me!}          \section{Experience}          \cventry{Summer 2009}{Trading Post Manager}{Company Name}{Somewhere, NC}{}{Implemented ECR system to manage and report inventory of 350+ items; managed daily operations.}          \end{document}       Excerpt from `\listfiles`:               *File List*     moderncv.cls    2012/10/31 v1.2.0 modern curriculum vitae and letter document c     lass       size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)         [...]      fontenc.sty        t1enc.def    2005/09/27 v1.99g Standard LaTeX file      lmodern.sty    2009/10/30 v1.6 Latin Modern Fonts         [...]       ot1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern       omllmm.fd    2009/10/30 v1.6 Font defs for Latin Modern      omslmsy.fd    2009/10/30 v1.6 Font defs for Latin Modern      omxlmex.fd    2009/10/30 v1.6 Font defs for Latin Modern


title: includegraphics - Problem with compiling

text: I am actually writing a latex file in which I would like to insert pictures. I have the following preambule:               \documentclass[a4paper, french]{book}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[french]{babel}     \usepackage{graphicx}     \usepackage{xspace}      In my text, I tried to insert a picture with the following code:               \begin{figure}      \begin{picture}       \includegraphics[scale=0.5]{Deltoidalicositetrahedron.jpg}      \end{picture}     \end{figure}      I am using TexShop version 2.38 and I tried to compile with LaTeX. It worked on the computer of a friend using the same TexShop version. However on my computer it doesn't work. Here is what the console complains about:               ./bio mol adn.tex:57: Use of \pictur@ doesn't match its definition.     <argument> \includegraphics           l.57   \includegraphics                            [scale=0.5]{Deltoidalicositetrahedron.jpg}          ?       Has anyone ever encounter the same problem? As usual, thanks in advance.


title: xymatrix: Arrows badly placed when used with large nodes

text: I find that using `xymatrix` with large nodes results in awkwardly placed arrows: ![enter image description here](http://i.stack.imgur.com/RDcQr.png) MWE:               \documentclass{book}     \usepackage{xypic}     \begin{document}     \xymatrix{     \textbf{Natural Numbers}     \ar@/_/[r]  &\textbf{Integers} \ar@/_/[l]     }     \end{document}       Suggestions on placing these more elegantly would be gratefully received. (If at all possible, I would prefer solutions that used `xymatrix`. I have a number of diagrams using `xymatrix`, most of which are unproblematic, and I would prefer not to have to convert them all to e.g. `tikz`.) Note that the `xymatrix` manual has information on changing the target of an arrow, but not the source... and here it is the source ends that are problematic.


title: Define TikZ macro for hatched rectangles in local coordinate system

text: I would like to define macros for functions defined on beams in structural mechanics course: ![beams with forces and stresses](http://i.stack.imgur.com/7wKTj.png) I am trying to cook up some macro which would draw each segment where the function is constant (perhaps later, where it is linear or similar). Ideally, they result would be used like this inside TikZ:               \beamFunc{AB={(0,0),(0,2)},func value=-500,label pos=.5,show label=true,show sign=false}; % this would be the first segment lower left      where the hatches are automatically perpendicular to `(A)--(B)`. Below is my initial attempt, but I end with               ! Incomplete \iffalse; all text was ignored after line 43.     <inserted text>                      \fi       without much idea about what is going on:               \documentclass{article}     \usepackage{tikz}     \begin{document}        % define keys for the next command        \pgfkeys{           /prpe/beam/.cd,           % endpoints of the beam (segment)           AB/.value required,           AB/.code n args={2}{              \def\beamA{#1}              \def\beamB{#2}              \def\beamLen{\pgfmathparse{veclen($\beamB-\beamA$)}}           },           % constant function value along the beam (segment)           func value/.value required,           func value/.get=\beamF,           % scaling of the function value to coordinates           func scale/.get=\beamFuncScale,           func scale/.initial=1.,        }        % define command for drawing the beam        \newcommand{\prpeBeamConstFunc}[1]{           \pgfkeys{/prpe/beam/.cd,#1}           % find out how is the beam axis rotated           \pgfmathanglebetweenpoints{(1,0)}{$\beamB-\beamA$};           \let\beamAngle=\pgfmathresult           % do the rest in beam-local coordinates           \begin[rotate=\beamAngle,shift={\beamA}]{scope}              % rectangle in local coordinates              \coordinate (A) at (0,0);              \coordinate (B) (\beamLen,0);              \coordinate (Af) at (0,\beamFuncScale*\beamF);              \coordinate (Bf) at (\beamLen,\beamFuncScale*\beamF);              % beam itself              \draw[thick] (A) -- (B);              % hatched rectangle, with lines locally in the vertical direction              \fill[pattern=north lines] (A)--(B)--(Bf)--(Af)--cycle;           \end{scope}        }        % try it out here        \begin{tikzpicture}              \prpeBeamConstFunc{AB={(0,0),(0,5)},func value=100,func scale=.01};        \end{tikzpicture}     \end{document}      Can I get help in discovering the error? Since it is my first TikZ macro, any other suggestions are also welcome.


title: braces marks with \framed & \tikz

text: I'm trying to mark some paragraphs with boxes, braces, brackets or parentheses coupled with notes in margin… My first test was using `\makebox` & `minipage` according to this discussion as you can see here & after in my code: `\accoladedroite` & `\crochetdroit` commands. But, you know, it makes problems to split across pages. So, I want to use `\mdframed`, better for this job. I'm now learning `\mdframed` & `\tikz` (my teachers are `\mdframed` manuals & exemples, & reference discussions with @Peter_Grill here & there and @Gonzalo_Medina here). My questions :   * How to put a beautiful typographic curly brace all the distance of the box, like in musical score, for example `\}` in the innerline right of `\mdframed` ?   * How to add some texte or title in front of the brace center, in margin ?    * How to repeat these titles, why not, with dots in the first… - …middle… & …second box (see here) ? Thats my code :               % !TEX encoding = UTF-8 Unicode     % !TEX TS-program = arara     \documentclass{scrbook}     \usepackage[framemethod=tikz]{mdframed}     \usepackage{lipsum}          \newmdenv[hidealllines=true,         singleextra={             \draw;             \draw([xshift=-0.1cm]P) -- (P) -- (P|-O) -- ([xshift=-0.1cm]P|-O);},         firstextra={             \draw;             \draw([xshift=-0.1cm]P) -- (P) -- (P|-O);},         middleextra={             \draw;             \draw(P) -- (P|-O);},         secondextra={             \draw;             \draw(P) -- (P|-O) -- ([xshift=-0.1cm]P|-O);},         ]{mybox}          \newcommand\accoladedroite[3]         {\par         \smallskip         \makebox[\textwidth][c]             {$\left.             \begin{minipage}{\textwidth}#3\end{minipage}             \right\}             \rotatebox[origin=c]{-90}{\color{gray}#2}             \rotatebox[origin=c]{-90}{ }             \rotatebox[origin=c]{-90}{#1}$}         \par         \smallskip}          \newcommand\crochetdroit[3]         {\par         \smallskip         \makebox[\textwidth][c]             {$\left.             \begin{minipage}{\textwidth}#3\end{minipage}             \right]             \rotatebox[origin=c]{-90}{\color{gray}#2}             \rotatebox[origin=c]{-90}{#1}$}         \par         \smallskip}          \begin{document}     \lipsum[1]     \accoladedroite{Titre 1}{Titre 1.1}{\lipsum[2]}     \crochetdroit{Titre 2}{Titre 2.1}{\lipsum[3]}     \begin{mybox}     \begin{mybox}     \lipsum[4]     \end{mybox}     \lipsum[5-7]     \end{mybox}     \end{document}     % arara: xelatex      And the result : ![screenshot](http://i.stack.imgur.com/PwMgo.png) Thank you for your help.


title: Plotting area in the plane where two inequalities in two variables hold

text: I would like to plot the area in the plane where two inequalities hold, both involving two variables. I would like to do it the way Wolfram Alpha does it, but within a LaTeX document. I have looked into the documentation of pgfplots, but I cannot figure out if and how this is possible. Maybe I need a different package, but I have had little success with google.


title: latexmk -pvc doesn't recompile if included files change

text: My current project layout looks like this: `Mainfile.tex` with `\begin{document}` including   * preamble (`\documentclass`, packages, newcommands, etc) and   * chapters, split into separate subfiles. I'm using the following `.latexmkrc` to compile with `latexmk -pvc -pdf Mainfile.tex`:               $pdflatex = "xelatex -src-specials -synctex=1 -interaction=nonstopmode %O %S";     $pdf_previewer = "evince %O %S";     $pdf_update_method = 0;     $sleep_time = 1;          push @cus_dep_list, "nlo nls 0 nlo2nls";     sub nlo2nls {         system("makeindex $_[0].nlo -s nomencl.ist -o $_[0].nls -t $_[0].nlg");     }      The document compiles perfectly without errors, but `latexmk` never recompiles it no matter whether I change the main file or one of the included subfiles. Any ideas? Edit: John Collins' right. Not using "start" was the culprit here.


title: Need to change citation format from [1] to (a)

text: I need to change the format of citations for my bibliography items to look like: > "See Reference (a)" instead of "See Reference (1)" I have used code like: `\renewcommand\@cite[1]{Reference~(#1)}` in my style file. Then, in my actual document I would have: "`See \cite{somebibitem}`" which results in "See Reference (1)". But how do I get my bibliography list to use alpha characters instead of numeric (which I assume would change the citation to use alpha as well)?


title: Write Procedure Name correctly formated in algorithm enviroment

text: I want to call a function in an algorithm enviroment.               \documentclass{article}     \usepackage{algorithm}     \usepackage{algpseudocode}          \begin{document}          \begin{algorithm}     \caption{Recursion}          \begin{algorithmic}[1]     \Procedure{Recursion}{$a$}         \State $a\gets Recursion(a)$ \Comment{Call Recursion again}         \State \textbf{return} $a$      \EndProcedure     \end{algorithmic}     \end{algorithm}          \end{document}      What do i have to do to get the "correct" style for the word "Recursion" in the line `\State $r\gets Recursion(a)$` I tried something like `\State $r\gets \Procedure{Recursion}{a}$`, but only received errors. The official documentation has no exmple regarding this problem.


title: Circled equal with same size as \oplus/\otimes with pdflatex

text: # My question I am trying to make an equal circled of the same size as `\oplus` or `\otimes`, etc. I tried to use the solution provided here : > How do I put a circle around an operator? However, the size of the operators are not the same. I used as preamble :               \makeatletter     \newcommand\incircbin     {%       \mathpalette\@incircbin     }     \newcommand\@incircbin[2]     {%       \mathbin%       {%         \ooalign{\hidewidth$#1#2$\hidewidth\crcr$#1\bigcirc$}%       }%     }     \newcommand{\oeq}{\incircbin{=}}     \makeatother      And, inside the document itself :                 $\oeq$, $\oplus$, $\otimes$      Which is displayed as follow : ![enter image description here](http://i.stack.imgur.com/RREyM.png) As you can notice, the operator `\oeq` is bigger than the others. Is there a way to get the exact size used by `$\oplus$` or `$\otimes$` ? Please note that I would rather keep the compilation with `pdflatex`. Thank you in advance for any help you may provide. * * * # Minimal working example               \documentclass[10pt,a4paper]{article}          \makeatletter     \newcommand\incircbin     {%       \mathpalette\@incircbin     }     \newcommand\@incircbin[2]     {%       \mathbin%       {%         \ooalign{\hidewidth$#1#2$\hidewidth\crcr$#1\bigcirc$}%       }%     }     \newcommand{\oeq}{\incircbin{=}}     \makeatother          \begin{document}     \Huge   $\oeq$, $\oplus$, $\otimes$     \end{document}


title: Loading otf font as mathfont range using unicode-math

text: I'm trying to replace the letters in the math font so that it matches the main font. Curiously, this works for the italic version, yet not for bold and roman. Why is that?               \documentclass{article}          \usepackage{unicode-math}          \defaultfontfeatures{Extension = .otf}     \setmainfont[ItalicFont = *-Italic,                   BoldFont = *-Bold]{BemboStd}     \setmathfont{latinmodern-math}     \setmathfont[range=\mathrm]{BemboStd}     \setmathfont[range=\mathit]{BemboStd-Italic}     \setmathfont[range=\mathbf]{BemboStd-Bold}          \begin{document}          \noindent     abc \textit{abc} \textbf{abc} \\     $ \mathrm{abc} \ abc \ \mathbf{abc} $          \end{document}      ![enter image description here](http://i.stack.imgur.com/Bha7w.jpg) **Edit:** Just in case it might be helpful to the next person, I'm now using               \setmathfont[range=\mathup/{latin,Latin}]{BemboStd}     \setmathfont[range=\mathit/{latin,Latin}]{BemboStd-Italic}     \setmathfont[range=\mathbfup/{latin,Latin}]{BemboStd-Bold}      as to only substitute the normal letters, and leave all the greek and `\partial` glyphs alone.


title: Specify x and y in different coordinate systems in pgfplots similar to gnuplot

text: In gnuplot you can specify positions in several coordinate systems: `First, Second, Graph, Screen, Character`. What are the equivalents in pgfplots? I know the following:   * `First` : `axis cs:`   * `Second` : `axis cs:` (manual suggests using two axis on top of each other)   * `Graph` : `rel axis cs:`   * `Screen` : can be done with the help of `barycentric cs:`   `\begin{axis}[name=s]`   `\end{axis}`   `\coordinate (topright) at (s.outer north east);`   `\coordinate (bottomleft) at (s.outer south west);`   `\node at (barycentric cs:bottomleft=0.5,topright=0.5) {CENTER};`   (possibly not the most convenient way and only available outside of `\begin{axis}\end{axis}`) How can one give x and y coordinate in different systems? Example:               \documentclass{standalone}          \usepackage{pgfplots}     \usepackage{pgfplotstable} % For \pgfplotstableread     \pgfplotsset{compat=1.10}          \pgfplotstableread{     0.01    1.00     0.02    2.00     0.03    3.00     0.04    4.00     0.05    5.00     }\datatable          \begin{document}     \begin{tikzpicture}     \begin{axis}[ymin=0, ymax=6]     \addplot table  {\datatable};     \node at (axis cs:0.02,3) {A};     \node at (rel axis cs:0.66,0.5){B};     % \node at (rel axis cs:0.66, axis cs:1){C}; % HOW CAN I DO THIS?     \end{axis}     \end{tikzpicture}     \end{document}      **Update** I figured out that there are many ways to specify coordinates using   * different coordinate systems ( **default** (i.e. without specifying): `axis description cs`),   * predefined nodes,   * predefined anchors, or   * computed values. Example using the predefined node `current axis`:               \usetikzlibrary{calc}     \coordinate (topleft) at ($(current axis.north west) + (-1.3cm,0.3cm)$);      These are described in following chapters of the `pgfplots` manual:   * **4.9.1 Placement of Axis Descriptions**   coordinate systems: `axis description cs`, `ticklabel cs`   * **4.9.2 Alignment of Axis Descriptions**   anchors `near ticklabel`, `near ticklabel opposite`   * **4.14.2 Accessing Computed Limit Ranges**   `\pgfkeysvalueof{/pgfplots/xmin}`   * **4.17.1 Accessing Axis Coordinates in Graphical Elements**   coordinate systems `axis cs`, `axis direction cs` and `rel axis cs`   nodes `current plot begin` `current plot end`   * **4.17.2 Placing Nodes on Coordinates of a Plot**   `\tikz\pos={<fraction>}`   * **4.19 Alignment Options**   anchor `center`, `outer center`, `outer north west`, `north west`, `left of north west`, `origin`, `left of origin` node `current axis`   * **4.20 The Picture’s Size: Bounding Box and Clipping**   `\pgfresetboundingbox`, `trim`   * **4.24 Transforming Coordinate Systems**   coordinate system `data cs`   * **5.7 Grouping plots**   anchor `c<x>r<x>.center/left/right` Relevant sections of the pgf manual:   * **17.5.1 Positioning Nodes Using Anchors** \- `center, north west, north, north east, east, south east, south, south west, west, base, mid`   * **17.5.2 Basic Placement Options** \- `above/below/right/left, above left/right, below left/right`   * **17.5.3 Advanced Placement Options** \- `\usetikzlibrary{positioning}`


title: How to prevent extra yticks within a Tikz Grid?

text: I created a nice scatter diagram based on the example at http://www.dgsiegel.net/news/2011_12_05-creating_beautiful_graphics_with_pgfplots. The problem I have now is that in order to show all the _y_ -ticks the size of Y has to be increased. Doing this yiels 2 extra _y_ -ticks with the last known value. As illustrated in the below image: ![Bad y ticks](http://i.stack.imgur.com/j0Dux.png) The code for this diagram is as follows:               \begin{tikzpicture}     \begin{axis}[       grid=major,       point meta=explicit,       xmin=0,       xmax=10,       xlabel=Cijfer,       scatter/@pre marker code/.code={%         \pgfmathparse{\pgfplotspointmetatransformed/1000*50+50}%         \let\opacity=\pgfmathresult         \pgfmathparse{\pgfplotspointmetatransformed/1000*7.5+1}%         \def\markopts{mark=*, color=skyblue1!\opacity,%         fill=skyblue1!\opacity, mark size=\pgfmathresult}%         \expandafter\scope\expandafter[\markopts]       },       scatter/@post marker code/.code={\endscope},       symbolic y coords={         AlgemeneTevredenheid,         Toegankelijkheid,         TelBereikbaarheid,         BereikbaarheidHelp,         GebruiksvriendelijkheidHelp,         Klantvriendelijkheid,         ProbleemoplossendVermogen,         Deskundigheid,         Professionaliteit,         Terugkoppeling,         GebodenOplossing,         ToepasbaarheidOplossing,         NakomenAfspraken       },       xtick = {1,...,10},       x=0.59cm,       y=0.8545cm,     ]     \addplot[only marks,scatter]       table[x index=0, y index=1, meta index=2] {CijferDistributie.dat};     \end{axis}     \end{tikzpicture}      Changing `y=0.8545cm` controls the height of each line, decreasing it too much will not show each y-tick, increasing it will add extra lines. I would like to show each _y_ -tick, but not have the extra lines included. Anybody have an idea on this subject? For completeness, the `CijferDistributie.dat` file looks like this:               Cijfer  Vraag   Aantal     1   AlgemeneTevredenheid    0     2   AlgemeneTevredenheid    0     3   AlgemeneTevredenheid    0      Arjen


title: How to draw a solid colored circle?

text: I am working on some book writing. For that I need to draw circle filled with red color. I tried `\circle` but it generate black circle only. How can I fill it with color?


title: Grid to facilitate positioning of objects with \put in beamer

text: In presentations with the `beamer`package I use `\put` a lot to place graphic objects like this:               \newcommand{\putat}[3]{\begin{picture}(0,0)(0,0)\put(#1,#2){#3}\end{picture}} % just a shorthand     \putat{123}{45}{stuff}      Now I was thinking about writing a small macro to facilitate finding the x and y coordinate by just writing a grid of positions onto the slide from which I can read off which values to use as arguments to `put`:               \newcounter{xpos}     \newcounter{ypos}     \forLoop[20]{20}{200}{xpos}{%       \forLoop[10]{20}{100}{ypos}{%         \putat{\value{xpos}}{\value{ypos}}{(\arabic{xpos},\arabic{ypos})}      }     }      (This uses the `forloop` package.) The problem is that I forgot that `put` uses relative positions (apparently). Can I somehow return to the same origin in every pass of the loop? Or is there a simpler way to generate this grid?


title: How can I repeat some commands before each paragraph?

text: I have to use EasyBib to make my bibliography, and I've put it into my LaTeX document by copying/pasting. But I need to have a hanging indent for each item. I've been able to get the effect I want by putting this before each item:               \hangindent=2.5em     \noindent      However, I have to write this out for every item. Is there a way to automate doing this?


title: Aligning long table captions in the list of tables using tocloft

text: I am using the `tocloft` package so that the word Table shows up before the number in the list of tables. When I do this, the tables with long captions wrap to the next line but are not aligned. This is the code that I am using.               \documentclass [12pt] {article}     \usepackage{times, url}     \usepackage[left=1.5in,top=1in,bottom=1in,right=1in,footskip=0.5in]{geometry}     \usepackage{float}     \usepackage{booktabs,threeparttable}     \usepackage[subfigure]{tocloft}     \usepackage{subfigure}     \usepackage[justification=centering]{caption}      \renewcommand{\cfttabfont}{Table }               \begin{document}           \listoftables            \begin{table}[htbp]     \begin{threeparttable}     \captionsetup{font=normalsize}     \caption{Summary Statistics for Structural Housing Characteristics.  Central Kentucky Data, 2000-2011. N=142,164.}     \centering     \footnotesize     \label{table:sumstatsfull}     \begin{tabular}{lcccc} \hline     Variable & Mean & Std. Dev. & Min & Max \\ \hline     \end{tabular}     \end{threeparttable}     \end{table}          \end{document}     `          I want the Table to precede the table number but I want the caption to be aligned like it is when the code below is used          `     \documentclass [12pt] {article}     \usepackage{times, url}     \usepackage[left=1.5in,top=1in,bottom=1in,right=1in,footskip=0.5in]{geometry}     \usepackage{float}     \usepackage{booktabs,threeparttable}     \usepackage[subfigure]{tocloft}     \usepackage{subfigure}     \usepackage[justification=centering]{caption}      %\renewcommand{\cfttabfont}{Table }               \begin{document}           \listoftables            \begin{table}[htbp]     \begin{threeparttable}     \captionsetup{font=normalsize}     \caption{Summary Statistics for Structural Housing Characteristics.  Central Kentucky Data, 2000-2011. N=142,164.}     \centering     \footnotesize     \label{table:sumstatsfull}     \begin{tabular}{lcccc} \hline     Variable & Mean & Std. Dev. & Min & Max \\ \hline     \end{tabular}     \end{threeparttable}     \end{table}          \end{document}


title: problems with ellipse TikZ

text: I'm working on a mac, I use the package TikZ and it works. But I have problems when I want use ellipse or diamond ex :               \documentclass{article}     \usepackage{graphicx}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \node[ellipse] {Ellipse};     \end{tikzpicture}     \end{document}      If somebody could help me thank you !


title: Custom format file: How to automate the generation of the "precompiled preamble" whenever one of the files that are used there are changed

text: I would like to speed up compilation of my LaTeX documents using the precompiled preamble approach, and I was wondering whether any of the Tools for automating document compilation have support for this. The main idea is:   * split the document into a "static" and a "dynamic" part, `preamble.tex` and `main.tex`   * create a custom format file `main.fmt` from the static part using              pdflatex -ini -jobname=main "&pdflatex preamble.tex\dump"        * compile your document using              pdflatex -fmt main main      As a consequence, only the contents of `main.tex` are processed on "regular" compilation, thus accelerating the build. However, if `preamble.tex` _or any of the files used there_ changes, the format file will have to be rebuilt. I would like to automate this: Rebuild `main.fmt` if and only if necessary. Of course, `main.tex` would also be recompiled if the static part (=the format file) has changed _and/or_ if the contents or includes of the dynamic part have changed. I have tried latexmk and scons, both excellent tools otherwise, but no luck so far. **EDIT** : Philipp's answer reminded me that portability between platforms cannot be taken for granted. I'm running Linux, but I'd be most interested in fully portable solutions. ## MWE `preamble.tex`:               \documentclass{article}     \usepackage{lipsum}      `main.tex`:               \begin{document}       \lipsum     \end{document}


title: How to change the default ':' in subsection to paren ')'?

text: In latex, when I write ,               \subsubsection*{a}      it produces _a:_ but I want to write _a)_ How should I do this.


title: How to split bibliography into Online references and Offline references

text: I would like to split bibliography list into a list with @misc tags, where all url's references are and all other tags for offline reference list. How is it possible to do it? I have snippet of a template that should make it possible:                 \ifdefined\bibheadingonline       \defbibheading{online}{\section*{\bibheadingonline}}       \else       \defbibheading{online}{\section*{Online References}}       \fi       \ifdefined\bibheadingoffline        \defbibheading{offline}{\section*{\bibheadingoffline}}       \else        \defbibheading{offline}{\section*{Printed References}}       \fi            \defbibfilter{online}{%         \( \type{online} \)}            \defbibfilter{offline}{%         \( \not \type{online} \)}      but it doesn't work for me. I am new in Latex so I am using a template which was defined not by myself.. I will be glad for any help. If needed, I can upload a part of my thesis for test purposes on a server. Btw. I am using MikeTex 2.9 with TeXnicCenter 2.0 Alpha 3


title: bigfoot, paragraph-style footnotes, and premature page breaks

text: When using the `bigfoot` package and its paragraph-style footnotes, sometimes page breaks are inserted in the main text although there's room for another line. I've nailed down the problem in the following MWE -- uncommenting the third (and rather short) footnote will move one line of the main text to page 2. I'd like to know what causes this behaviour and would be glad about a solution (preamble or in-text workaround for individual pages).               \documentclass{article}          \usepackage[english]{babel}     \usepackage{blindtext}          \usepackage[scale=0.635]{geometry}          \usepackage{bigfoot}     \DeclareNewFootnote[para]{default}          \begin{document}          This is the first paragraph. It only encompasses two lines. Some more text     without a meaning so that the former statement becomes true.     \footnote{A footnote.}          \blindtext     \footnote{Another one.}          \blindtext     % \footnote{A crucial footnote.}% uncommenting this will move one line     %     of the main text to page 2          \blindtext          \blindtext          \blindtext          \end{document}      Example output -- bottom of page 1: ![enter image description here](http://i.stack.imgur.com/q3SNI.jpg) Output after uncommenting the "crucial" footnote: ![enter image description here](http://i.stack.imgur.com/yv7Mx.jpg) A crude workaround is to use `\enlargethispage` for problematic pages (in my MWE, any value between 1.7pt and 1.75pt for page 1 will do). (See this answer for details about `\enlargethispage`.) However, I'd very much prefer a solution that doesn't change the margins of individual pages.


title: Which commands consisting of a non-letter eat spaces afterwards?

text: Command names consist of a sequence of letters (until and excluding the first non-letter) or of a single non-letter. Command names ending in a letter (including of course those consisting of a single letter, such as `\S` and `\P`) eat all spaces after them. (Compile for example `\P␣␣,H`.) **What about command names consisting of a single non-letter: which of these eat subsequent spaces?** `H\$H` and `H\$␣H` produce different output (and that's true for e.g. `%` and `&` too). While the space-producing command `\,` does not eat spaces, the space-producing command `\␣` does seem to eat all subsequent spaces. (`H\␣H` and `H\␣␣H` and `H\␣␣␣H` all produce the same output. `H \␣H` is different; see next paragraph.) Knowledge of TeX's behavior will explain why for example `A\,B`, `A␣\,B`/`A\,␣B`, `A␣\,␣B` produce different results (in text mode); if a user is not aware of what happens and naively (but understandably) assumes that such spacing commands eat all spaces around them, he or she might run into surprises. (Actually only few commands seem to eat preceding spaces, though such behavior is possible: have your macro start with `\unskip`.) * * * **Guide to the answers:**   * most concise summary (≈ "only `\␣`"): Joseph Wright's answer [if it weren't for Heiko's answer, I would have accepted this one]   * all the details (with an interesting detail about empty (!) command names): Heiko Oberdiek's answer   * apparent exceptions (the 7 standard one-letter, accent-producing commands and `\\`): Mico's answer


title: How can I align numbers in equations?

text: What is the best way to produce the following: (Image shows a typo) ![enter image description here](http://i.stack.imgur.com/CuJhB.png)


title: dvipdfm horizontally crops image

text: On windows 7 64bits with Miktex 2.9 `latex` compile correctly my document and DVI shows all images correctly. Then `dvipdfm` produces a correct PDF except for one image that is cropped horizontally. To reproduce download the example and then:               latex test.tex     yap test.dvi           # correct     dvipdfm test.dvi     AcroRd32.exe test.pdf  # cropped      Question: how to prevent this behavior?


title: Lyx : After Changing numbering, Part appears in regular text in pdf

text: Lyx. Document class : article (paper) I wanted numbering for the TOC but without the "Part I" before it. So I went to Document -> Settings -> Numbering & TOC and changed the numbering column to "no" for all (Part , Section etc.) . Now when I define some text as `Part` it doesn't show up next to Part I as desired. The problem is that in the PDF the text appears as regular text not big bolded text as normal. What is strange is that if I define some text as `section` it does appear in its usual big bolded text. Any ideas?


title: \overline outside of math mode

text: If I want to draw an overline over some text, not an equation, how can I do it? `\overline` seems to only work in math mode, and when used outside of math mode, it automatically says "Missing $ inserted".


title: remove blank space before image

text: When I insert a figure, there is some blank space before it that Latex adds it. How do I remove it?               \headerbox{Poster Box 1}{name=box1,column=1, below=box2}{       \begin{minipage}{20em}         \includegraphics[width=18.6em]{images/img.png}         \end{minipage}        \vspace{0.3em}     }      It looks like if I increase the width of the image, it just goes to the right, while there still remains the same little horizontal white space between the left edge of the image and the box. (I'm using `baposter` here). I tried `\hspace*{-11em}`, but nothing happened.


title: Uppercase accented characters displayed as "?"

text: The header is               \documentclass[12pt,twoside]{report}     \usepackage[a4paper,left=4cm,right=3cm]{geometry}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[francais]{babel}          \begin{document}     MÈRE     \end{document}      In the TeX file, for example when I write `é` it is well displayed in the pdf output file, but `É` is displayed as "?". Why? Yet the character `É` is well supported by the encoding T1 (for fontenc). The problem seems to be only with uppercase accented characters. The problem also seems to be from `latin1` of the package `inputenc`. I tried `utf8` instead of `latin1` but it does not match. NB: I know the alternative `\'E` and it work well, but I want to write the character directly as `É`. **EDIT:** with the above header everything works fine on my Windows 7 PC, the problem only on my Windows XP one.


title: What is the template for this paper?

text: I find those latex document really nice and would like to know if anyone knows how to obtain a similar look and feel ? http://zll22.user.srcf.net/EtaleCohomology.pdf http://www.math.mcgill.ca/candelori/ThesisFinal.pdf


title: How can the following TeX file be run without errors?

text: I get an error :               ! I can't find file `xdvipdfmx.cfg'.          l.6 \input xdvipdfmx.cfg          Please type another input file name      and               ! Emergency stop.          l.6 \input xdvipdfmx.cfg      I really wish to know what this LaTeX message means! and how I can solve or ignore it? TexStudio shows the line number of the error where I use the `\package{fmultico}`, but I know it does not cause the problem because by erasing the line the problem remains in that empty line! I even downlod a lot files and place them where the file exists but only this error was changed into 100! another errors that are not correct, because by clearing their lines they remains at their place. I think without the LaTeX code nobody can solve the problem so I put it here,               \documentclass[12pt,a4paper]{article}          \usepackage{setspace}     \usepackage{makeidx}     \makeindex     \usepackage{fmultico}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{pdfsync}     \usepackage{fancyhdr}     \usepackage{pstricks}     %\usepackage{tocbibind}     % بسته‌ای برای ظاهر شدن «مراجع» و «نمایه» در فهرست مطالب     \usepackage[nottoc]{tocbibind}     %\usepackage[notbib]{tocbibind}     \usepackage{animate}     \usepackage{pstricks-add}     \usepackage{multido}     \usepackage{color}     \usepackage{fancybox}     \usepackage{fancyvrb}     \usepackage{setspace}     %\usepackage{persianpoem}     %\usepackage[perpage]{footmisc}     \usepackage{graphicx}     \usepackage{xy}     \usepackage{amsthm}     \usepackage[left=2cm,top=4cm,bottom=2.8cm,right=2.5cm,head=1cm,foot=1cm]{geometry}          \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{makeidx}     \usepackage{xepersian}     \settextfont{XB Zar}     \newtheorem{preproof}{{\bf اثبات }\hspace{-.15cm}}     \renewcommand{\thepreproof}{}     \newenvironment{prf}[1]{\begin{preproof}{\rm                #1}\hfill{$\blacksquare$}}{\end{preproof}}          \newtheorem{preexample}{{\bf مثال }\hspace{-.15cm}}     \renewcommand{\thepreexample}{}     \newenvironment{example}[1]{\begin{preexample}{\rm                #1}\hfill{$\clubsuit$}}{\end{preexample}}               \theoremstyle{plain}% default     \newtheorem{thm}{قضیه}[section]     \newtheorem{lem}[thm]{لم}     \newtheorem{prop}[thm]{گزاره}     \newtheorem{conj}[thm]{حدس}     \newtheorem{corollary}[thm]{نتیجه}     \newtheorem{question}[thm]{پرسش}     \newtheorem{defin}[thm]{تعریف}     \begin{document}     \title{اینجا نام مقاله مورد نظر خود را بنویسید}     \author{اسم و مشخصات خود رااینجا بنویسید}     \maketitle     \abstract     اینجا چکیده متن خود را بنویسید. اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.     اینجا چکیده متن خود را بنویسید.          \section{اینجا نام بخش اول را بنویسید}     اینجا  شروع به نوشتن متن خود کنید.     اینجا  متن خود را بنویسید. اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.      اینجا  متن خود را بنویسید.      اینجا  متن خود را بنویسید.      اینجا  متن خود را بنویسید.      اینجا  متن خود را بنویسید.      اینجا  متن خود را بنویسید.           \begin{defin}      اینجا  تعریف  را بنویسید.          \end{defin}     \begin{thm}     اینجا  قضیه خود را بنویسید.          \end{thm}     \begin{lem}     اینجا  لم  را بنویسید.           \end{lem}      \begin{prop}      اینجا  گزاره  را بنویسید.           \end{prop}      \begin{question}     اینجا  سوال خود را بنویسید.          \end{question}     \begin{conj}     اینجا  حدس خود را بنویسید.          \end{conj}     \begin{prf}{     اینجا اثبات  را بنویسید.          }     \end{prf}          \begin{lem}\label{pr1}     در این لم نحوه برچسب گذاری نمایش داده شده است.          \end{lem}          با توجه به لم \ref{pr1} داریم          در اینجا به مقاله \cite{MR1722215}  ارجاع داده شده است.     اینجا نام بخش اول را بنویسید          \chapter{اینجا نام فصل دوم را بنویسید}     \section{اینجا نام بخش دوم را بنویسید}     اینجا  شروع به نوشتن متن خود کنید.     اینجا  متن خود را بنویسید. اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.     اینجا  متن خود را بنویسید.          \begin{defin}     اینجا  تعریف  را بنویسید.          \end{defin}     \begin{thm}     اینجا  قضیه خود را بنویسید.          \end{thm}     \begin{lem}     اینجا  لم  را بنویسید.          \end{lem}     \begin{prop}     اینجا  گزاره  را بنویسید.          \end{prop}     \begin{question}     اینجا  سوال خود را بنویسید.          \end{question}     \begin{conj}     اینجا  حدس خود را بنویسید.          \end{conj}     \begin{prf}{     اینجا اثبات  را بنویسید.          }     \end{prf}          \begin{thm}\label{abc}     در این قضیه نحوه برچسب گذاری نمایش داده شده است.          \end{thm}          با توجه به قضیه \ref{abc} و لم \ref{pr1} داریم          در اینجا به مقاله \cite{MR1722215}  ارجاع داده شده است.          در اینجا به مقاله \cite{MR1475894}  ارجاع داده شده است.               \begin{latin}          \bibliographystyle{plain}     \renewcommand\refname{{\rightline{\rl{مراجع}}}}          \bibliography{MyReferences}     \end{latin}           \end{document}      The new errors are here:               ! Undefined control sequence.     l.70 \ExplSyntaxOn     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.     ! Undefined control sequence.     l.71 \bool     _set_false:N \g_fontspec_math_bool     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.     ! Missing $ inserted.     <inserted text>     $     l.71 \bool_     set_false:N \g_fontspec_math_bool     I've inserted a begin-math/end-math symbol since I think     you left one out. Proceed, with fingers crossed.     ! LaTeX Error: Missing \begin{document}.     See the LaTeX manual or LaTeX Companion for explanation.     Type H <return> for immediate help.     ...     l.71 \bool_     set_false:N \g_fontspec_math_bool     You're in trouble here. Try typing <return> to proceed.     If that doesn't work, type X <return> to quit.     LaTeX Font Info: Try loading font information for U+msa on input line 71.     ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\amsfonts\umsa.fd"     File: umsa.fd 2009/06/22 v3.00 AMS symbols A     )          ...          Here is how much of TeX's memory you used:     9619 strings out of 430430     144279 string characters out of 3189573     343545 words of memory out of 3000000     12645 multiletter control sequences out of 15000+200000     12829 words of font info for 42 fonts, out of 3000000 for 9000     14 hyphenation exceptions out of 8191     44i,32n,53p,586b,323s stack positions out of 5000i,500n,10000p,200000b,50000s     No pages of output.


title: Aligned numerator and denominator in \frac or any other variant

text: Is there a way to align the numerator and the denominator of a fraction? Consider two fractions (from a SIAM paper) ![enter image description here](http://i.stack.imgur.com/c8Gp5.png) The denominator (k!) is nicely centred in the first fraction. However in the second fraction the brackets in the numerator and the denominator are not aligned. As the exponent of the numerator gets bigger, the misalignment gets worse. In general, the strategy of centring numerator and denominator is correct. However, it would be good to have the option of aligning brackets in specific instances like this. **MWE:**               \documentclass[preview]{standalone}     \usepackage{amsmath}     \begin{document}        $\dfrac{(x_i - x)^{N+1}}{(N+1)!}$     \end{document}


title: difficulties getting lrbox to cooperate with Verbatim environment

text: This is a follow up to an earlier question of mine: local commands are not recognized when trying to define a wrapper lrbox If I write               \documentclass{article}     \usepackage{fancyvrb}     \usepackage{multicol}     \usepackage{pgfkeys}          \makeatletter     \newif\if@ae@nfig@verb@     \pgfkeys       {%%'       /ae/nfigverb/.is family,       /ae/nfigverb,         usegobble/.initial=,         gobble/.style = { usegobble={gobble=#1,}},         width/.initial=3in,       }          \newsavebox{\ae@titlebox}     \newsavebox{\aetitlebox}     \newenvironment{nfigverb}[1][]       {%%'         \global\@ae@nfig@verb@true         \lrbox\aetitlebox         \pgfqkeys{/ae/nfigverb}{#1}%%'         \edef\ae@begin@minipage{%%'           \noexpand\minipage{\pgfkeysvalueof{/ae/nfigverb/width}}}%%'         \edef\ae@vbegin@verbatim{%%'           \noexpand\Verbatim[\pgfkeysvalueof{/ae/nfigverb/usegobble}]}%%'           \ae@begin@minipage             \ae@vbegin@verbatim       }       {%%'             \endVerbatim           \endminipage         \endlrbox       }          \def\aetest{\if@ae@nfig@verb@ Ciao\else Hello\fi}          \makeatother     \begin{document}          \begin{multicols}{2}          \aetest          \begin{nfigverb}[width=5in]       as;lfk slfjksd flsk fls dfls     \end{nfigverb}          \fbox{\usebox{\aetitlebox}}          \aetest          \end{multicols}     \end{document}      I get a document that compiles without complaint. If I follow @egreg 's suggestion to the question mentioned above, I would redefine the environment as:               \newenvironment{nfigverb}[1][]       {%%'         \global\@ae@nfig@verb@true         \begin{lrbox}{\ae@titlebox}         \pgfqkeys{/ae/nfigverb}{#1}%%'         \edef\ae@begin@minipage{%%'           \noexpand\minipage{\pgfkeysvalueof{/ae/nfigverb/width}}}%%'         \edef\ae@vbegin@verbatim{%%'           \noexpand\Verbatim[\pgfkeysvalueof{/ae/nfigverb/usegobble}]}%%'           \ae@begin@minipage             \ae@vbegin@verbatim       }       {%%'             \endVerbatim           \endminipage         \end{lrbox}         \global\setbox\aetitlebox=\box\ae@titlebox       }      But when I do this, I get the error:               Runaway argument?     ! File ended while scanning use of \FancyVerbGetLine.     <inserted text>                      \par      <*> mwe_02.tex          ?


title: Insert a background picture in beamercolorbox?

text: As the title states. Is there a way to insert a background picture for a beamercolorbox. I mean I can make two of them overlap or something, but can I insert a background picture somehow? Thanks.


title: Documentation of LaTeX2e source

text: **Where are the best places to look if one would like to understand the LaTeX2e _source code_?** Related:   * Comprehensive online manual for LaTeX2e user macros and environments   * Are there guidelines on how to read commented sources of LaTeX packages?


title: Example title in outer margins

text: If I have large outer margins (even and odd pages) how I can put Example (and Solution) in both pages in the outer margins?


title: Subfigure float - caption above, and how to break figure over two pages

text: Firstly, thanks a lot in advance for your help with this problem. I've looked long and hard but not found a solution anywhere. I am writing my PhD thesis in Lyx and love how it makes the formatting so smart and easy, but I am having real trouble with some of my figures. I have three things I would like to achieve: 1) I would like to make figures with several subfloats (to show the same combination of an image and a graph in each. (I'll attach an example to this email). It really is valuable to have all three subfloats under the same single figure heading. The problem is that only two of my three floats fit on a page and the third one is started but gets lost off the bottom. I don't want to make the figures smaller so they fit. Can I persuade Lyx to split the figure over two pages (a bit like it does with long tables)? 2) I would like the captions of the subfigures ABOVE the figures. 3) I would like the gap between the subfigure legends and the images to be bigger (you can see how squashed up they are). I'm using the following in my document preamble to justify the labels on the left.               \usepackage{caption}     \captionsetup{labelfont=bf,format=plain,indention=0cm,     justification=raggedright,singlelinecheck=false}       I tried to upload a pdf of what happens to the figure but it took too long so perhaps you can take it on trust that the bottom of the figure and main figure legend disappears off the end of the page.


title: Do I really have to initialize xkeyval’s key manually?

text: If I define some (many) keys with `xkeyval` do I really have to initialize them to use them if the key is not set explicitly?               \documentclass{article}          \usepackage{xkeyval}          \makeatletter     \define@cmdkeys{fam}[my@]{%        fonta,        fontb,        % ...        % fontn     }[]          %\presetkeys{fam}{keya,keyb}{}          %\setkeys{fam}{     %   fonta,     %   fontb,     %   % ...     %   % fontn     %}               \newcommand{\mymacro}[2]{%        {\my@fonta #1} and {\my@fontb #2}     }     \makeatother                    \begin{document}     \mymacro{Font A}{Font B}     \end{document}      This code shall become part of a new package. Many of my keys should set a font, which is empty per default (i.i. if the user doesn’t sets a key-value pair for it). I want to use these font’s in macro definitions but I have to initialize all fonts manually as empty. As a result of this behavior I need to take care of two lists (`\define@cmdkeys` and `\setkeys`) in case of adding a new font. In my understanding the above example should compile as it is but I need to uncomment the `\setkeys` lines to initialize the macros. Certainly there are keys that must have a preset value and i must initialize them. For example `savemode` well be a boolean that is `false` in preset but should default to `true` if the user set the key without a value. * * * **Extra** What does `\presetkeys` do? I don’t understand the manual in this section. Is it better to post this as a new question?


title: Creation of Column

text: I am making a table of made up of two columns, but the problem is that in the last row I have multiple column with in a single row, I don't know how to do this. I applied `\multicolumn` but it did not produce the desired result. Here is an image of the desired table. ![enter image description here](http://i.stack.imgur.com/YIlGD.jpg) Help me in this regard


title: Latex - Segoe font - font spec package

text: I am trying to create a presentation using latex (texmaker) - `Beamer` I was wondering how to use `segoe` font in latex. I searched the forums like crazy to install the `fontspec` package but I had no luck. Here is one link I have found. But, I could not get enough information. > If you really want to dive into using a variety of fonts with LaTeX, I > strongly recommend you use the awesome fontspec package in combination with > either XeTeX or LuaTeX. fontspec allows you to select any open type font > (OTF) that you have installed on your machine using a command like: >   >   >     \newfontfamily{\Segoe}{Segoe Script} >   > > You can find lots of handwriting or calligraphy fonts on sites like > FontSquirrel, e.g. here or here. > > I also recommend you check out the documentation of the fontspec package > because it demonstrates advanced uses of open type features (e.g. stylistic > variants), especially with the Zapfino font. All Credits to `ilpssun`. Could some one please tell me how to install the fontspec package on Linux and texmaker Thanks. I see that we have to use XeTex package. But the style is not valid anymoroe in that case MWE:               \documentclass{beamer}     \usepackage[latin1]{inputenc}     \usetheme{CambridgeUS}     \usepackage[british,UKenglish,USenglish,english,american]{babel}     \usepackage{pifont}     \usepackage{fontspec}      \newcommand{\tick}{\ding{52}}


title: Twocolumn part in document

text: I'd like to stretch long lists into two or more columns. Like: > Some single-column text. > >   1. Lorem 4. Sit >   2. Ipsum 5. Amet >   3. Dolor > > > Another single-column text. Or: > Some single-column text. > > 1) Lorem 2) Ipsum   >  3) Dolor 4) Sit   >  5) Amet > > Another single-column text. for input file containing:               Some single-column text.     \begin{foo}{2}     \begin{itemize}      \item Lorem      \item Ipsum      \item Dolor      \item Sit      \item Amet      \end{itemize}     \end{foo}     Another single-column text.      Thanks for any idea that can help.


title: A5 booklet printing -- Title page and TOC are missing

text: I have a file _bookletdemo.tex_ with the following code               \documentclass[12pt]{article}     \usepackage[a5paper]{geometry}     \usepackage{lipsum}  % this package is for creating filler text               \author{N.~N}     \title{The booklet}          % \usepackage[print,1to1]{booklet} \nofiles      % \target{\magstep0}{297mm}{210mm}               \begin{document}          \maketitle          \tableofcontents          \section{Europe}     \subsection{Berlin}     \lipsum[4]     \subsection{Paris}     \lipsum[1-3]     \subsection{Vienna}     \lipsum[10]     \subsection{Rome}     \lipsum[15]     \section{Africa}     \lipsum[1-4]     \subsection{Accra}     \lipsum[5-8]     \subsection{Johannesburg}     \lipsum[9-11]     \subsection{Casablanca}     \lipsum[11-12]     \lipsum[5-6]     \section{Asia}     \lipsum[1-4]     \subsection{Tokyo}     \lipsum[5-8]     \subsection{Beijing}     \lipsum[9-11]     \subsection{Mumbai}     \lipsum[11-12]     \lipsum[5-6]          \end{document}      Fist I run               latex bookletdemo.tex       two times. The pdf formatting of the document with A5 pages is fine. Then I uncomment               \usepackage[print,1to1]{booklet} \nofiles      \target{\magstep0}{297mm}{210mm}      and run                   latex bookletdemo.tex       to create a booklet. It produces something which resembles a booklet but the title page and the TOC are missing. How does an example which does this properly look like? ## Reference http://mirror.isoc.org.il/pub/ctan/macros/latex/contrib/booklet/booklet.pdf


title: Cut last word from sentence one by one

text: I want to execute particular command for some space separated list as argument. And then execute the same command for the same list without last element and do it until list is empty. As extra point store cutted out element to the separate list. What I have so far:               \documentclass{standalone}          \makeatletter          \def\split#1{       \typeout{split:#1}       \def\init{}       \def\last{}       \@split#1 \@empty     }          \def\@split#1 #2{%       \typeout{1:#1}       \typeout{2:#2}       \ifx #2\@empty         \def\last{#1}       \else         \ifx\init\@empty           \expandafter\expandafter\expandafter\def           \expandafter\expandafter\expandafter\init           \expandafter\expandafter\expandafter{\expandafter\init#1}         \else           \expandafter\expandafter\expandafter\def           \expandafter\expandafter\expandafter\init           \expandafter\expandafter\expandafter{\expandafter\init\space#1}         \fi         \expandafter\@split       \fi       #2%     }          \def\writer#1{%       \typeout{writer:#1}       \split{#1}       \typeout{writer-init:\init}       \typeout{writer-last:\last}       \ifx \init\@empty\else\writer{\init}\fi     }          \makeatother          \begin{document}          \writer{Takes several words as argument}          \end{document}      The problem is that on the second iteration `@split` receive empty arguments. I use `\typeout{}` command to see what arguments every command receives. Console output is follow:               writer:Takes several words as argument     split:Takes several words as argument     1:Takes     2:s     1:several     2:w     1:words     2:a     1:as     2:a     1:argument     2:     writer-init:Takes several words as     writer-last:argument     writer:Takes several words as     split:Takes several words as     1:     2:     writer-init:     writer-last:      As you can see `\split` itself receive correct data, but `\@split` command can't parse arguments. I am sure I made mistake in the passing data to the `\@split`, but have no idea how to fix it. I'm very appreciate for any suggestions.


title: Page a day calendar problems

text: I am really new to the whole LaTeX thing, but it really interests me, so I'd like to learn more about it. I am also looking mostly to do just words, maybe a picture here and there but i just want words on the pages. I found http://blog.mattj.me/latex-page-a-day-calendar# this tutorial type thing on how to do so, I copied the LaTeX file onto the back page, and i finally got that working, a PDF with just the outline of a page-a-day sized calendar. But it is blank, the website says that the next thing needed is a Python script to run and generate the \daypages, but that doesn't make any sense to me, how will doing a python program(if i even knew how) even be inputted into LaTeX? So i guess i have 2 questions, does anyone know how to write up this python program, and how am i supposed to use it in LaTeX? thanks so much.


title: Automatically link bibliography entry to Google Scholar when no url field is present

text: Something I thought would be absolutely amazing but is way beyond my BibLaTeX skills: whenever there is no url field, generate a link that searches for the title, authors and year on Google Scholar. So for a paper named "Rocket Science", written by J. Doe in 1999 the link `http://scholar.google.com/scholar?q=%22Rocket+Science%22+author%3Adoe&as_ylo=1999&as_yhi=1999` would be generated and put on the paper name of the bibliography entry or where ever it would be convenient. I think exact title, year and author should be almost always unambiguous and available. This is how the cryptic query above would look when entered: ![screen capture of the result of the search query](http://i.stack.imgur.com/seBBZ.png) So if somebody liked the idea _and_ had the biblatex-fu to implement it, I'd be totally jazzed :)


title: How to define macros in a foreach loop with effects between iterations and after the loop without using global?

text: Without using `\global`, the following code:               \documentclass{minimal}     \usepackage[T1]{fontenc}     \usepackage{tikz}     \usepackage{etextools}          \newcommand\appendbyforeach[2]{%       \AfterGroup*{\noexpand\AfterGroup{\noexpand\edef\noexpand#1{\noexpand#1#2}}}     }          \newcommand\defincbyforeach[2]{%       \AfterGroup*{\noexpand\def\noexpand#1{#2}}       \AfterGroup*{\noexpand\AfterGroup{\noexpand\def\noexpand#1{#2}}}     }          \newcommand\meaningwithname[1]{\textbackslash#1: \expandafter\meaning\csname #1\endcsname}          \newcommand\mymacro{       \begingroup       \def\myarray{init}       \def\valmax{0}       \foreach \i in {1,8,-3}{         \appendbyforeach{\myarray}{,\i}         \pgfmathsetmacro{\max}{\valmax < \i ? \i : \valmax}         \defincbyforeach\valmax{\max}         %%% print state of \myarray and \valmax         foreach \i\\\meaningwithname{myarray}\\\meaningwithname{valmax}\par       }       inside\\\meaningwithname{myarray}\\\meaningwithname{valmax}\par       \endgroup       outside\\\meaningwithname{myarray}\\\meaningwithname{valmax}\par     }          \begin{document}\mymacro\end{document}      produces a document containing:                   foreach 1     \myarray: macro:->init     \valmax: macro:->0         foreach 8     \myarray: macro:->init     \valmax: macro:->1.0         foreach -3     \myarray: macro:->init     \valmax: macro:->8.0         inside     \myarray: macro:->init,1,8,-3     \valmax: macro:->8.0         outside     \myarray: \relax     \valmax: \relax      This result suits me well! But is there a better way to define macros `\appendbyforeach` and `\defincbyforeach` while achieving the same effects? Does `etextools` package is really practical here?


title: Tune space around section headings

text: I am using `\Huge` centered section headings but the space generated around the heading is too big currently: ![enter image description here](http://i.stack.imgur.com/ccIjE.png) I would like to reduce the space around the heading (The "Créé à son image" text) to make it more compact. Here is my current definition:               \renewcommand\thesection{\arabic{section}}     \titleformat{\section}[display]       {\newpage\scshape\Huge} % format       {\large\makedate{\thesection}~\chaphead} % label       {10pt} %sep       {\begin{center}} %before       [\end{center}] %after      For the record, `makedate` a macro that puts the `\up{er}` on the number in "1er janvier", and `\chaphead` is a reference to the chapter name, "Janvier" in this case. I have tried reducing the size from `\Huge` to `\huge` or even `\LARGE`. The font is reduced, but it still takes the same amount of space in the page.


title: listings: closing parenthesis as delimiter not matched when linebreaks=true

text: I want code in parentheses and in brackets to appear in different colors. In the following document, the words **brackets again** appear in green as intended, and **outside again** is black as intended, but stretches into the margin of the page. If I uncomment the line `,breaklines=true`, the line is broken between **brackets** and **again** , however, these words and the following are red, i.e. as if a `(`-`)`-delimited section was detected but then the closing `)` was ignored. What is going on here? **Addition:** The problem occurs also if there is no line break present, e.g. if I shorten all words in the text to their first letter. The problem goes away in any case if I pick any other kind of delimiter instead of `()`, e.g. `{}`.               \documentclass{article}     \usepackage{color}     \usepackage{listings}          \lstdefinelanguage{new}{         moredelim=*[s][\color{red}]{(}{)},         moredelim=*[s][\color{green}]{[}{]},       }     \lstset{       language=new       %,breaklines=true       }          \begin{document}          \begin{figure}     \begin{lstlisting}     outside(in paren) [in brackets (paren+brackets) brackets again] outside again     \end{lstlisting}     \end{figure}          \end{document}


title: \hline does only go half the way I want it to go

text: If I compile the following code, I get a table that is placed very oddly since LaTeX centers it around the double vertical line between the first and second column. My \hline also goes only to right after the first column. The text 'Position' also centers wrongly because of this. I tried to compile in different environments, but this doesn't seem to help. The code:               \begin{table}     \begin{center}     \begin{tabular}{ r||cccccccc }     \hline     \multirow{2}{*}{Steps} & \multicolumn{8}{c}{Position}\\     \cline{2-8}      & $-3$ & $-2$ & $-1$ & $0$ & $1$ & $2$ & $3$\\     \hline     \hline     $0$ & & & & $1$ & & & \\     $1$ & & & $|b|^{2}$ & & $|a|^{2}$ & &\\     $2$ & & $|a|^{2}|b|^{2}$ & & $|b|^{2}$ & & $|a|^{4}$ &\\     $3$ & $|a|^{4}|b|^{2}$ & & $\left(|b|^{4}-|a|^{2}|b|^{2}+|a|^{4}\right)|b|^{2}$ & & $|a|^{2}|b|^{2}\left(1+3|b|^{2}\right)$ & & $|a|^{6}$\\     $4$ & & \ldots & & \ldots & & \ldots &     \end{tabular}     \end{center}     \end{table}      Anybody any idea?


title: How to use \def or similar command to store an arbitrary number of variables for later processing?

text: I'm trying to create a package for drawing simple sequence diagrams using PGF/TikZ. Here is the basic idea I'm stuck at (not the whole idea to make it short): Let's say we have 1 environment (say **myseqdiag** ) & 1 command (say **createobject** ) in this package. The user would use these as follows:               \begin{myseqdiag}     \createobject{my name is A}      \createobject{my name is B}       %<here, other calls to createobject>     \end{myseqdiag}      Calling the command createobject causes a counter **objcounter** to be incremented, and would store **#1** (hopefully) in a variable called obja (if there is such thing as "variable" in TeX/LaTeX). At the environment end, the code should use the final count and use the stored "variables" ("my name is A", "my name is B"....) in drawing the objects (lifelines). The problem is that I'm not able to store these parameters. I tried               \def\obj\alph{objcounter}{#1}      inside the code of createobject, hoping that it would define obja, objb, ..., but it's not working. I also tried other variations that did not work. I'm newbie to LaTeX, and I'm missing the concept of variables & arrays as in programming languages. So is there a solution to my problem? Thanks in advance for any help.


title: Change XeTeX fonts automatically depending on Unicode blocks

text: I would like to move from p(La)TeX (which was a TeX system specifically tailored to Japanese in a pre-Unicode era) to Xe(La)TeX, and I'm having a problem. In p(La)TeX, Japanese fonts are only used for non-ASCII characters, and ASCII characters are typeset in Computer Modern, or Times, etc just as in the standard TeX. I would like to have something similar in Xe(La)TeX. In other words, I would like to have Xe(La)TeX to use different fonts depending on Unicode blocks, say CJK Unified Ideographs or Ethiopic or Cuneiform, see the list here. Is it possible with XeLaTeX and fontspec? Or do I have to hack the source code of XeTeX to do this? (A very similar question is asked here, but let me ask it here again, hoping that the situation changed in the last six months.)


title: How to change Appendix chapter name

text: I have a long appendix which includes a lot of equations and figures. My document class is report. In order to have a separate appendix section, I used:               \appendix     \chapter{The first appendix}       The outcome shows like this > Chapter A > > The first appendix How can I change it to: > Appendix A > > The first appendix I also tried               \chapter*{Appendix: The First Appendix}     \addcontentsline{toc}{chapter}{Appendix: The First Appendix}      But in this way, my equation number does not start with A.1. This will not work for me.


title: Typeset in TextMate has a PATH error

text: I downloaded Textmate (1.5.10) on a new MacBookPro (MacOSX 10.6.7) after using it to typeset LaTeX on my old MacBook. I saved my document folders on my new computer in the same document folder structure and was unable to typeset the `.tex` documents. I got the response: The current PATH is:               /usr/bin     /bin     /usr/sbin     /sbin      Please add the directory containing “kpsewhich” to PATH in TextMate's Shell Variables preferences. In my TextMate preferences, Advanced>Shell Variables> - I have four categories checked off: `PATH /usr/local/bin:/usr/X11/bin`, `PATH /usr/bin:/bin:/usr/sbin:/sbin`, `_MyCompanyName__ TM_ORGANIZATION__NAME`, & (I tried adding) `MY_VARIABLE /usr/texbin` When I click on the Terminal link to "Set PATH and Relaunch", this is what I get:               Last login: Fri Jun 17 16:06:39 on console     defaults write com.macromates.textmate OakShellVariables -array-add "{ enabled = 1; variable = PATH; value = '$PATH'; }" && open "/Users/annlmontgomery/Downloads/TextMate.app"     Ann-Montgomerys-MacBook-Pro:~ annlmontgomery$ defaults write com.macromates.textmate OakShellVariables -array-add "{ enabled = 1; variable = PATH; value = '$PATH'; }" && open "/Users/annlmontgomery/Downloads/TextMate.app"     Ann-Montgomerys-MacBook-Pro:~ annlmontgomery$       But I don't know what to do this step - I'm just learning LaTeX and have no programming experience. additional note:   I do have MacTex and I included "/usr/texbin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin" in the Shell Variables preferences and when I typeset, now I get "env: ruby: No such file or directory" ...any ideas? – additional note: I have TexShop 2.41 installed additional note: in Preferences>Shell Variables - I now have               PATH /usr/texbin:/usr/local/bin:/usr/X11/bin          PATH /usr/bin:/bin:/usr/sbin:/sbin/          PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin          PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/texbin          PATH /usr/texbin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin          PATH /usr/bin/usr/texbin:/usr/local/bin:/usr/X11/bin      and when I Typeset - I get "env: ruby: No such file or directory" BTW thanks for everyone's efforts


title: AucTeX extension for TikZ

text: Is there an AucTeX extension which supports the TikZ syntax and that one of the tkz-collection as well? In particular I want thinks like:   * syntax highlighting   * proper indentation   * that TeX-insert-macro knows the TikZ (tkz)-commands and options (perhaps it would be better to have a new emacs macro like tikz-insert-macro, since TikZ commands don't have a leading backslash)


title: How to move figure title to caption when using \subfig

text: This is my first time using \subfig because I have a figure (Figure 8) that contains two parts, and it was better to put them each on separate pages but one after the other, since they are related (hence, part a and part b) and each figure is as large as the page. The captions for each part of the figure appear correctly under the figure, but the title "Figure 8" appears centered under the caption. Something like this * * * (a) Here is the caption of the first part of the figure.                Figure 8      * * * I would like the caption to beggin as: Figure 8(a): Here is the caption.... [or Figure 8.a: ] How can I make the title of the figure to appear together with the caption? Thank you very much in advance! Here is the code I used:               \usepackage[caption=true]{caption,subfig}          ....          \begin{figure}          \centering          \subfloat[Here is the caption of the first part of the figure (a)]{\includegraphics[scale=0.6]{Figures/Profile_a.jpg}}          \caption{}          \label{fig:Prof_a}          \end{figure}          \begin{figure}          \ContinuedFloat          \centering          \subfloat[Here is the caption of the second part of the figure (b)]{\includegraphics[scale=0.6]{Figures/Profile_b.jpg}}          \caption{}          \label{fig:Prof_b}          \end{figure}


title: IEEE Conference style citation

text: I am starting to need to some help with references. I'm writing a paper using IEEE citation style and I'm trying to refer to a conference paper. These citations should follow this style: http://libguides.murdoch.edu.au/content.php?pid=144623&sid=1229936 The paper I'm trying to cite: http://dl.acm.org/citation.cfm?id=2347587 I used the sites tool to get the BibTeX citation (three lines removed though):               @inproceedings{Valtchanov:2012:EDC:2347583.2347587,      author = {Valtchanov, Valtchan and Brown, Joseph Alexander},      title = {Evolving Dungeon Crawler Levels with Relative Placement},      booktitle = {Proceedings of the Fifth International C* Conference on Computer Science and     Software Engineering},      series = {C3S2E '12},      year = {2012},      isbn = {978-1-4503-1084-0},      location = {Montreal, Quebec, Canada},      pages = {27--35},      numpages = {9},      publisher = {ACM},      address = {New York, NY, USA},      keywords = {evolutionary computation, level generation, procedural content generation},     }       And on writelatex.com I use:               \bibliography{references.bib}     \bibliographystyle{IEEEtran}      It creates a reference that looks like this: V. Valtchanov and J. A. Brown, "Evolving dungeon crawler levels with relative placement," in Proceedings of the Fifth International C* Conference on Computer Science and Software Engineering, ser. C3S2E '12. New York, NY, USA: ACM, 2012, pp. 27-35. Which is really nice, but it's not completely correct. Notice how it doesn't mention the publication location and date, not the conference location. (Or it's possible that I'm missunderstanding the whole thing)


title: KOMA Script footer line height

text: How to increase footer text distance from the separator line so that it looks like header? You can see the distance from footer text to line is less than header.... ![enter image description here](http://i.stack.imgur.com/XcK7N.png)


title: How to put fixed-height shading around text (inline)?

text: I have a chunk of code in an alltt environment and I want to highlight elements that are auto-generated (two colours for different methods):               \newcommand{\gen}[1]{\colorbox{DGray}{#1}}     \newcommand{\tpl}[1]{\colorbox{Gray}{#1}}          \begin{alltt}     \gen{class }\tpl{Something}...     \end{alltt}      My problem is that the frame around 'Something' is taller than the one around 'class ' and reaches lower due to the letter 'g', so the two frames aren't aligned. Is there a way to make a shading frame with a fixed height and position? Basically, I want shading the OpenOffice/MS Office way.


title: Tikz tree drawing with comments to each level

text: I have problem with drawing trees with tikz. The tree is correct, but 'rightarrows' wrongly indicate to text, which is related to each tree-level (it doesn't look good). Of course, the text should by shown also without circles. Could anyone can help with that? I wrote the tree, based on this example: http://www.texample.net/tikz/examples/merge-sort-recursion-tree My code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{trees}          \begin{document}     \begin{tikzpicture}[level distance=1.5cm,     level 1/.style={sibling distance=3.5cm},     level 2/.style={sibling distance=1cm}]     \tikzstyle{every node}=[circle,draw]         \node [red] {1}             child [red] {             node {3}             child { node {4} }             child [black] { node {5} }             child [black] { node {5} }         }         child {             node {3}             child { node {4} }             child { node {5} }             child { node {5} }         }         child {             node {3}             child { node {4} }             child { node {5} }             child { node {5}               child [grow=right] { node (q) {$\Rightarrow$} edge from parent [draw=none]                 child [grow=right] {node (q) {$\textrm{2nd level arrow indicates here}$} edge from parent[draw=none]                   child [grow=up] {node (q) {$\Rightarrow$} edge from parent[draw=none]                     child [grow=right] {node (r) {$\textrm{1st level arrow indicates here}$} edge from parent[draw=none]                       child [grow=up] {node (s) {$\Rightarrow$} edge from parent[draw=none]                                     child [grow=right] {node (r) {$\textrm{1st level arrow indicates here}$} edge from parent[draw=none]                         }                       }                     }                   }                 }               }             }            };          \end{tikzpicture}     \end{document}


title: Bad interaction between fontspec and some lua code that performs string-related search and replace operations

text: **Update 2013/05/28** : The selnolig package is now on the CTAN. Comments and critiques always welcome! If you wish to contact me about any aspects of the package, please use the email address that's given at the bottom of the title page of the package's user guide. (Relative to the state of the package described in the question below, I've managed to squash at least one bug, and I suggest better work-arounds for the remaining bugs -- at least the ones I'm aware of!) * * * I'm in the process of readying a LuaLaTeX package for "official" release to the CTAN, but I need to squash a few remaining bugs first. The bug described in this question concerns incorrect behavior of my package that occurs _if_ the `fontspec` package is loaded; if `fontspec` is not loaded, none of the problems described here occur. Obviously, asking potential users of my package _not_ to load `fontspec` is not an option. Incidentally, the identifier string of the LuaTeX version on my system is "`beta-0.70.2-2012062819`", distributed with MacTeX2012. For much more information about the full `selnolig` package, which does automated, selective suppression of typographic ligatures, please see New package, selnolig, that automates suppression of typographic ligatures. The MWE (see image below, and code provided below image) illustrates several instances of failure to perform ligature suppression if -- and apparently also _only if_ \-- `fontspec` is loaded. Specifically, ligature suppression fails for:   * a word that's followed immediately by a comment (`%`) sign   * the last word in the argument of a command such as `\footnote` and `\section`   * a word that immediately precedes the start of an environment such as `enumerate` and `itemize`   * the final word of an `\item` statement, i.e, the final word before the next `\item` statement and/or the environment's closing `\end{enumerate/itemize}` directive A common theme of these problems is that they occur if the word in question (plus any trailing punctuation characters) is at the very end of some environment, group, or argument to some macro. In all cases, a "remedy" of sorts is to insert either a space, a blank line, or a space plus something like `\vphantom{x}` [!]. Clearly, these remedies are _not_ real solutions but merely kludgy hacks, and I certainly wouldn't contemplate asking users of my package to do implement these hacks. **My questions** are, then:   * How can I make my lua code more robust to whatever is being done by the `fontspec` pacakge (or some package that's loaded by `fontspec`)?   * Is there a way to load either `fontspec` (or some of the packages called by `fontspec`) to suppress the interference with my lua code?   * Or, have I discovered a bug in `fontspec` (or one or more of the packages loaded by `fontspec`) that needs to be fixed anyway? ![enter image description here](http://i.stack.imgur.com/78WVR.png)               % !TEX TS-program = lualatex     \documentclass{article}     % If the next line is commented out, everything works fine!     \usepackage{fontspec}             \RequirePackage{luatexbase,luacode,expl3}       % Load lua code       \directlua{  require("ld-orig.lua")  }  % see below for contents of ld-orig.lua       % Define the user macro "nolig"       \providecommand\nolig[2]{ \directlua{             suppress_liga( "\luatexluaescapestring{#1}",                            "\luatexluaescapestring{#2}" )}}       % Provide a ligature suppression rule       %  (the full package obviously provides many more such macros)       \nolig{lfful}{lf|ful} % shelfful -> shelf|ful          % Just for this MWE:        \usepackage[textheight=8cm]{geometry}        \setlength\parindent{0pt}        \pagestyle{empty}           \begin{document}         Two shelffuls of \TeX-related books: it works!          \bigskip     % word to be de-ligated is followed immediately by % (comment character)     Ligature suppression doesn't work here: shelfful%           % leaving a space between word and % makes it work even if fontspec is loaded     But it does work in this case: shelfful %           \bigskip     bad\footnote{This doesn't work: shelfful.} % w/o space      good\footnote{But this does work: shelfful. \vphantom{x}} % w/ space and \vphantom directive          \bigskip     % Two more problem cases: (i) last word before start of an     % itemize/enumerate environment, (ii) last word of an \item     one shelfful, two shelffuls % no ligature suppression for "shelffuls"     \begin{itemize}     \item shelfful              % no ligature suppression here either     \item shelfful \vphantom{x} % inserting space and \vphantom does the trick...     \end{itemize}          % problem also occurs in arguments of sectioning commands     \section*{sad shelfful}         % again no ligature suppression     \subsection*{happy shelfful }   % adding space at end of argument makes it work!     \end{document}      * * * Contents of ld-orig.lua:               --- Credits to Patrick Gundlach, Taco Hoekwater, and Steffen Hildebrandt!     local glyph = node.id('glyph')     local glue = node.id("glue")     local whatsit = node.id("whatsit")     local userdefined          for n,v in pairs(node.whatsits()) do       if v == 'user_defined' then userdefined = n end     end          local identifier = 123456  -- any unique identifier      local noliga={}     debug=false  -- default: don't write debugging info to log file          function debug_info(s)       if debug then         texio.write_nl(s)       end     end          local blocknode = node.new(whatsit, userdefined)     blocknode.type = 100     blocknode.user_id = identifier          function process_ligatures(nodes,tail)       local s={}       local current_node=nodes       local build_liga_table =  function(strlen,t)         local p={}         for i = 1, strlen do           p[i]=0         end         for k,v in pairs(t) do           -- debug_info("Match: "..v[3])           local c= string.find(noliga[v[3]],"|")           local correction=1           while c~=nil do              -- debug_info("Position "..(v[1]+c))              p[v[1]+c-correction] = 1              c = string.find(noliga[v[3]],"|",c+1)                correction=correction+1           end            end         -- debug_info("Liga table: "..table.concat(p, ""))         return p       end       local apply_ligatures=function(head,ligatures)          local i=1          local hh=head          local last=node.tail(head)          for curr in node.traverse_id(glyph,head) do            if ligatures[i]==1 then              -- debug_info("Current glyph: "..unicode.utf8.char(curr.char))              node.insert_before(hh,curr, node.copy(blocknode))              hh=curr            end             last=curr            if i==#ligatures then               -- debug_info("Leave node list on position: "..i)              break             end            i=i+1          end          if(last~=nil) then            -- debug_info("Last char: "..unicode.utf8.char(last.char))          end--]]       end       for t in node.traverse(nodes) do         if t.id==glyph then                s[#s+1]=string.lower(unicode.utf8.char(t.char))         elseif t.id== glue then           local f=string.gsub(table.concat(s,""),"[\\?!,\\.]+","") -- add all interpunction           local throwliga={}               for k, v in pairs(noliga) do             local count=1             local match= string.find(f,k)             while match do               count=match               -- debug_info("pattern match: "..f .." - "..k)                 local n = match + string.len(k)-1               table.insert(throwliga,{match,n,k})               match= string.find(f,k,count+1)             end           end           if #throwliga==0 then              -- debug_info("No ligature substitution for: "..f)             else             -- debug_info("Do ligature substitution for: "..f)               local ligabreaks=build_liga_table(f:len(),throwliga)             apply_ligatures(current_node,ligabreaks)           end           s={}           current_node=t         end           end     end          function suppress_liga(s,t)       noliga[s]=t     end          function drop_special_nodes (nodes,tail)       for t in node.traverse(nodes) do          if t.id == whatsit and t.subtype == userdefined and t.user_id == identifier then             node.remove(nodes,t)             node.free(t)          end       end     end          luatexbase.add_to_callback("ligaturing", process_ligatures,"Filter ligatures", 1)       * * * **Postscript** : The solution to the bug described in this posting. The key sequence in the lua code given above is that caused the bug was:                 for t in node.traverse(nodes) do          if t.id==glyph then             s[#s+1]=string.lower(unicode.utf8.char(t.char))          elseif t.id==glue then             ...      All that was required to fix the bug is to change this code snippet to:                 for t in node.traverse(nodes) do          if t.id==glyph then             s[#s+1]=string.lower(unicode.utf8.char(t.char))          end          if ( t.id==glue or t.next==nil or t.id==kern or t.id==rule ) then             ...      The point is that the sequence of characters that needs to be processed by selnolig can end in ways other than just with some amount of (TeX) "glue" (e.g., whitespace). Another way for the sequence to end if the word is the very last item being processed, e.g., if it's the last word in the argument of a command such as `\section{}`; if that's the case, the variable `t.next` will be equal to `nil`. Finally, the two remaining `if` conditions -- `t.id==kern` and `t.id==rule` \-- are provided in case a user has inserted a "kern" or "rule" item manually. The bug fix is incorporated in version 0.220 of the package.


title: How to make the matrix in this image

text: How to make the matrix in this image? I need to achieve it with LaTeX. ![Matrix](http://i.stack.imgur.com/X9A3c.jpg)


title: Including a subfigure and table inside a figure environment

text: I want to include a table and an image as two subfigures in a macro figure environment. Apparently the code compiles but it isn't placing the elements how I want: The table and the image **side by side** (instead of one on top of the other) in a single figure environment at the top of the page. Here is the code:               \begin{figure*}[!t]     %\begin{table*}[!t]     \centering      \scriptsize{     \begin{tabular}[H]{|c||c|c|c|c|c|}     \cline{1-3}     \Xhline{2\arrayrulewidth} % $k$      & 1 & 2 & 3 & 4 & 5 \\ \cline{1-6}     \Xhline{2\arrayrulewidth}     Attribute1 & $\uparrow$ p1 & $\uparrow$ p2 & $\downarrow$ p3 & $\uparrow$ p4 & $\downarrow$ p5 \\ \cline{1-6}     Accuracy & 60.22\% & 65.24\% & 68.66\% & 70.21\% & 71.87\% \\ \cline{1-6}     \Xhline{3\arrayrulewidth}     Attribute2 & $\uparrow$ p1 & $\uparrow$ p2 & $\uparrow$ p3 & $\downarrow$ p4 & $\uparrow$ p5 \\ \cline{1-6}     Accuracy & 45.70\% & 54.53\% & 59.49\% & 62.91\% & 65.56\% \\ \cline{1-6}     \Xhline{3\arrayrulewidth}      Attribute3 & $\uparrow$ p1 & $\uparrow$ p2 & $\uparrow$ p3 & $\uparrow$ p4 & $\downarrow$ p5 \\ \cline{1-6}      Accuracy & 50.08\% & 60.37\% & 64.84\% & 68.02\% & 69.32\% \\ \cline{1-6}     \Xhline{2\arrayrulewidth}     \end{tabular}     }     \label{fig:AttributeComb}     %\vspace{-7pt}     \captionof{table}{Table1}     \label{table:AttributeCombT}     %\vspace{-25pt}     \subfigure[Title2]     {\includegraphics[scale=0.295,clip=true,draft=false,]{Performance.pdf}     \label{fig:performance}     }     \vspace{-25pt}          %\end{table*}     \end{figure*}


title: Error in a math expression

text: I have a problem with this expression:               $$n \geq \Bigg\lvert \bigcup_{l \leq |A_{i}| \leq 2l} |A_{i}| \Bigg\rvert \geq \sum_{i = 1}^{N_{l}}\Bigg\lvert A_{i} \Biggl \bigcup_{j =1}^{i-1} A_{j}\Biggr \Bigg\rvert$$      The report is: > `* Local config file bblopts.cfg used * ("C:\Program Files\MiKTeX > 2.9\tex\latex\00miktex\bblopts.cfg") ("C:\Program Files\MiKTeX > 2.9\tex\generic\babel\italian.ldf" ("C:\Program Files\MiKTeX > 2.9\tex\generic\babel\babel.def"))) > (C:\Users\Stefano1\Desktop\Seminario\Seminario.aux) ("C:\Program > Files\MiKTeX 2.9\tex\latex\amsfonts\umsa.fd") ("C:\Program Files\MiKTeX > 2.9\tex\latex\amsfonts\umsb.fd") ("C:\Program Files\MiKTeX > 2.9\tex\latex\base\omscmr.fd") [1{C:/ProgramData/MiKT > eX/2.9/pdftex/config/pdftex.map}] [2] [3] [4] [5] [6] [7] [8] [9] ! Missing > delimiter (. inserted). \bigcup@ l.296 ...}^{N_{l}}\Bigg\lvert A_{i} \Biggl > \bigcup _{j =1}^{i-1} A_ {j}\Biggr ... > > ? ` I don't understand where is the error.


title: align with equal sign centered

text: > **Possible Duplicate:**   >  Align to center I want to align some equations to the equal signs, so I wrote this:               \begin{align}                 -3z &= -9\\                    z &=  3\\             -3y-3*3 &=  3\\                    y &= -4\\       2x+8*(-4)+4*3 &=  2\\                    x &= 11     \end{align}      However, because one equation is much longer than the others, all the equations appear somewhat at the right of the page. ![Screenshot](http://i.stack.imgur.com/Mr7so.png) How can I make the equal signs appear in the middle of the page, while still aligning all the equations to them?


title: What do \@mkboth and \markboth do?

text: What do the toc related commands `\@mkboth` and `\markboth` do?


title: Replace and add a/to a specific sequence of tokens

text: Is there a way to find a specific sequence of tokens and add after it a command? Or is there a way to find a specific sequence of tokens and replace it with another one? And do it only if the sequence of tokens is in the input file, otherwise don't leave any error message. For example the command `\AtBeginDocument{\bfseries}` finds the string `\begin{document}` and add to it `\bfseries`. Is there a way to get a more general command that find any kind of string and add to it another one? Something like this:               \if@tokensequenceisgivenadd{<String to find>}% or more shortly \if@tokenadd          <Add after it this string>          \fi      and I would another command like the following:               \if@tokensequenceisgivenreplace{<String to find>}% or more shortly \if@tokenreplace          <Replace it with this string>          \fi


title: Inconsolata missing after MiKTeX update

text: I just ran the MiKTeX Updater and there was an update for Inconsolata. I also refreshed the FNDB and it is listed as installed in the Package Manager, but when I try to compile my documents that have `\usepackage{inconsolata}` I only get the error that `File 'inconsolata.sty' not found`. How to fix this?


title: Page Numbering in "Exam" Document Class

text: When using the "exam" document class, LaTeX prints "1" for the page number at the bottom of the first page but prints "Page n" for all successive pages where n is the page number. Anyone know how to fix this? I just want the page number to appear at the bottom of each page.


title: noframenumbering option with maketitle

text: I would like to set the option `noframenumbering` on the title page but I don't know how to set it... I've tried this :               \maketitle[noframenumbering]      but it didn't worked And this :               \setbeamertemplate{title page}[noframenumbering]{         \inserttitle     }      but it didn't work either... For information this is the normal use of the `noframenumbering` option :               \begin{frame}[noframenumbering]          content      \end{frame}


title: Empty author field in BibTeX

text: I need to add a reference with an empty author field to my bibliography list. I have this bibitem :               @misc{impl,         title="Abc Def",         howpublished = {2}     }      When I do this I see a colon in front of the reference in my generated pdf file. I.e, the reference looks like               :Abc Def. 2      The colon is inserted because it should separate author's name from the title. Is there any way to get rid of the colon? I tried to change title to author in my bibitem:               @misc{impl,         author="Abc Def",         howpublished = {2}     }      Unfortunately it shortens the Abc Def to A.Def automatically in the pdf file. (Ie., it considers Abc as somebody's first name). I'm using a special bibliography style called `splncs`.


title: Why isn't diagrams.sty compatible with LuaTeX

text: I am trying to debug the problem with Paul Taylor's `diagrams.sty` (not in TeX Live or MiKTeX, but available from CTAN). Minimal example:               \documentclass{article}     \usepackage{diagrams}     \begin{document}     \fboxsep=0pt     \tracingmacros=2\tracingcommands=2     \fbox{\begin{diagram}     a     \end{diagram}}     \tracingmacros=0\tracingcommands=0     \end{document}      The problem is that pdfTeX draws diagrams correct, but LuaTeX adds big vertical spaces. From macro level tracing shows that both engines does exactly the same. Runing TL2012:               This is LuaTeX, Version beta-0.70.2-2012080612 (TeX Live 2012/W32TeX)         (format=lualatex 2012.7.19)  19 JUN 2013 12:06  restricted \write18 enabled.     **test.tex     (./test.tex     LaTeX2e <2011/06/27>     LuaTeX adaptation of babel <v3.8m-luatex-1.5> and hyphenation patterns for english, dumylang, nohyphenation, loaded.     (x:/texroot/texlive2012/texmf-dist/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (x:/texroot/texlive2012/texmf-dist/tex/latex/base/size10.clo     File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     ....      ....      *File List*      article.cls    2007/10/19 v1.4h Standard LaTeX document class      size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)      diagrams.sty    2011/04/19 v3.94 Paul Taylor's commutative diagrams      Any hints?


title: How to set frame options inside a beamertemplate?

text: Is there a command like `\thispagestyle` in order to set in a beamer template the `plain` option (for example). I need this in order to design a section page template were I would like to remove sidebar head/footline. Thus I would like to be able to say in the beamertemplate : `this frame is plain`. Actually this is done for the `title page` but looking at the default theme I do not find how.


title: Two-column beamer ToC with control over the breaking point and without balancing

text: I'm using the solution provided by lockstep in https://tex.stackexchange.com/questions/26929/two-column-beamer-toc-with- control-over-the-breaking-point to spread the TOC over two columns. However, this gives some strange balancing problem which looks like this:               1.) Bla      4.) Blabla          2.) Blabla             3.) bla      5.) Blabla      But I would like to have it like:               1.) Bla      4.) Blabla          2.) Blabla   5.) Blabla          3.) bla            Since lockstep's solution used the mutlicol package I tried to use the non- balancing enviroment `multicols*`. But this seems to fail. Are there any other possibilities?


title: TikZ node positioning on edge parameter/label

text: I wonder if there exists a trick to position a graph node (relative), based on a parameter (label?) of an edge leading to it? I mean a kind of time diagram, i.e. for example I have a timed automat, where both the node processing and the change of state along the edge needs time. I would like to place automatically the next node on the graph at the correct time position on the time axis, corresponding to the position of the previous node+processing time in the previous node+transition time to the next node. (much like in networking : processing time in a router plus delivery time to the next router) Thanks for any idea in advance Janos


title: How to disable color gradient between block title and block body in Beamer?

text: I'm using the "Warsaw theme" in my beamer slides, so how could I   1. Disable color gradient between block title and block body;   2. Disable the block's shade;   3. I don't want to use the "Berkeley theme" which has no a block with "Rounded Corner Rectangle". thanks.