title: pst-abspos and afterpage not producing the effect I want: is there an aftereverypage?

text: I'm trying to create a document which looks like it's been printed on a ruled page. I know I can probably do this in `tikZ`, but I would like to be able to do this in `pstricks`. The option `absolute` for the package `pst-abspos` only works correctly when the first command on a given page is `\pstSetAbsoluteOrigin`. If LaTeX is making the page breaks for me then I need a way to automatically call this. To remedy this, I thought I could use `afterpage` to issue the `\pstSetAbosluteOrigin` at the beginning of each page. However, `afterpage` only seems to take effect on the second page of my document. Here's my MWE:               \documentclass{article}     %--------------------------------------------------------------------------------%     \usepackage{multido}     \usepackage[absolute]{pst-abspos}     \psset{unit=1cm}%     \newcommand{\myrules}{%         \pstSetAbsoluteOrigin%         \pstPutAbs[](0.0,0.0){%         \begin{pspicture}(0,0)(0,0)             \multido{\rx=-2.5+-0.50}{50}{\psline[linecolor=blue!20](0,\rx)(\paperwidth,\rx)}%             \psline[linecolor=red](2.5,0)(2.5,-\paperheight)         \end{pspicture}}}     %--------------------------------------------------------------------------------%     \usepackage{lipsum}     \usepackage{afterpage}     \afterpage{\myrules}     \begin{document}          \lipsum[1-114]          \end{document}      I can duplicate this unexpected behavior of `\afterpage` with or without `pst- abspos` such as with `\afterpage{Hello World}`. But, I was worried that I'd get solutions that would work with something so minimal but not cooperate with the `pst-abspos` tricks I'm trying. **EDIT** After reading the documentation for `afterpage` for the umpteenth time now, I see that it only take effect after the current page. So, I guess what I want is something more like `aftereverypage`. I know there's an `everypage` package, but when I use `\AddEverypageHook{\myrule}`, the formatting of the rules is completely wrong. When I use the `everyshi` package, I'm getting extra space at the top of everypage (or so it seems to me). Here's a slightly more complicated MWE which illustrates this:               \documentclass{article}     \usepackage[margin=1in]{geometry}     %--------------------------------------------------------------------------------%     \usepackage{multido}     \usepackage[absolute]{pst-abspos}     \psset{unit=1cm}%     \newcommand{\myrules}{%         \pstSetAbsoluteOrigin%         \pstPutAbs(0.0,0.0){%         \begin{pspicture}(0,0)(0,0)%             \multido{\dx=-2.5+-\baselineskip}{58}{\psline[linecolor=blue!20](0,\dx)(\paperwidth,\dx)}%             \psline[linecolor=red](2.5,0)(2.5,-\paperheight)%         \end{pspicture}}}     %--------------------------------------------------------------------------------%     \usepackage{lipsum}     \usepackage{everyshi}     \EveryShipout{\myrules}     \begin{document}\myrules%     \lipsum[1-50]     \end{document}      Notice how on page one the spacing at the top of the page is correct, but not on the subsequent pages. The space between the rules is much smaller than I actually want. But, I chose this spacing for this last MWE to help show the unwanted space appearing at the top of the pages after page one.


title: Missing header in aastex package

text: I'm using the `aastex` package `(v5.2)`, and trying to make a header appear using the `\shorttitle` and `\shortauthors` commands (which take the place of `\leftheader` `\rightheader`), but they aren't working for me. Here is my code:               \documentclass[12pt,preprint]{aastex}     \usepackage[left=1in,top=1in,right=1in,bottom=1in]{geometry}          \shorttitle{short title}     \shortauthors{short author}     \begin{document}     \title{Long Title}     \author{Long Author}     \bibliographystyle{plainnat}          \begin{abstract}     Test     \end{abstract}          \maketitle          \section{Introduction}     Text     \newpage     New page test     \end{document}        Anybody have any ideas?


title: How to autowrap text in latex?

text: i m writing one paragraph in which i need to wrap text in a paragraph. ![enter image description here](http://i.stack.imgur.com/K1mqr.png) How can i wrap text "hemorrahagic" to next line or use hyphen two split it into multiline.


title: Configuring paths to TeX Live for TeXShop

text: I recently installed TeXShop, and proceeded to write some code and tried to preview it. Unfortunately, I got an error message:                  Can't find required tool.         /usr/texbin/simpdftex does not exist.     Perhaps TeXLive as not installed or was removed during a system upgrade.     If so, go to the TeXShop website and follow the instructions to (re)install TexLive.     Another possibility is that a tool path is incorrectly configured in TeXShop preferences.     This can happen if you are using the fink teTeX distribution.      I proceeded to install the complete version of TeX Live. After restarting TeXShop, I find that I get the exact same error above. I checked my `/usr/texbin` directory and found no such directory! Furthermore, I looked at my preferences and noticed under my path settings were set as follows:               (pdf)TeX: /usr/texbin     Distiller (ghostscript): /usr/local/bin      Should I change either of these paths? Should I reinstall TeXShop?   Any advice would be greatly appreciated.


title: How to read value from table, assign to variable and use it in x expr=\thisrow{}

text: How can I read the first value from the first column of a table, assign it to a variable and the use it in some math expression with x expr=\thisrow{}? The code would be something like this, but in my example I'm manually typing the first value of the first column (3 in this example, as in `x expr=\thisrow{time}-3`) and I would like it to be done automatically. UPDATE: My real table has between 5 and 6 columns and some thousands of rows. Please, this should be taken into account for the solution.               \documentclass{article}     \usepackage{pgfplots,tikz}     \usepackage{filecontents}          \begin{filecontents}{data.dat}     time speed     3 5     4 3     5 6     6 4     7 0     8 1     \end{filecontents}          \begin{document}          \begin{tikzpicture}     \begin{axis}[xlabel=time,ylabel=speed]     \addplot table[x expr=\thisrow{time}-3, y={speed}] {data.dat};     \end{axis}     \end{tikzpicture}          \end{document}


title: Windows API error 32

text: I'm brand new to LaTeX; any idea how to overcome this error message?               "texify.exe: Windows API error 32: The process cannot access the file because it is     being used by another process.     texify.exe: Data: untitled-1.log"


title: Section and subsection colors using titlesec

text: Im trying to alter the colors on my section, subsection and subsubsection. I do so using the titlesec page:               \titleformat*{\section}{\Large\bfseries\sffamily\color{red}}     \titleformat*{\subsection}{\large\bfseries\sffamily\color{red}}      But the problem is i have to enter the font and font size also. I am using the fontenc package:               \usepackage[T1]{fontenc}      But i cant seem to find out what font and size is being used for the section, subsection and subsubsection. These 2 values i mean: `\Large\bfseries\sffamily` I tried to look in the .sty but that wasent very helpful.


title: Horizontally align the dots in two dotted lines

text: I'm trying to draw two `loosely dotted` lines, one with slope 0 (i.e. a horizontal line), the other upward sloping. Is there a way to horizontally align the dots in these two lines? Here's a MWE. Basically what I want is to have the n-th dot on each line be aligned in such a way that you could draw a vertical straight line that passes through them. This is my attempt to draw two functions whose domain is a discrete set.               \documentclass[english,12pt]{article}          \usepackage{tikz}          \begin{document}          \begin{tikzpicture}       \draw[loosely dotted,very thick](0,2)--(5,2);       \draw[loosely dotted,very thick](0,0)--(5,5);       \draw[<->,>=latex](0,6)node[left]{$y$}--(0,0)--(6,0)node[below]{$x$};     \end{tikzpicture}          \end{document}


title: Odd-even margin

text: I am writing a book and I need to set the odd/even margin on the binding side.               \usepackage[top=2cm, bottom=2cm, left=1cm, right=1cm, headsep=14pt]{geometry}      I need `left = 2.1cm` for odd pages and for even one `left = 1.0cm`. I found               \oddsidemargin     \evensidemargin      but those change all four sides. How can I set two different margins on odd/even pages?


title: Forward search from input file using TeXNicCenter

text: I'm using TeXnicCenter 2 Beta 1 (on a Windows Vista machine) and I am trying to use the forward search. It is configured with SumatraPDF so that when I press `F5` to `View Output`, SumatraPDF comes to the front and highlights the section where my cursor lives. However this only works correctly when I execute `View Output` from the main file; if I try to execute `View Output` from an input file in the project, I get an error saying Forward Search cannot execute, and Sumatra appears saying that there is an error loading the nonexistent `.pdf` file. Is there any way to get forward search to work from included files using TeXnicCenter?


title: Using A-B style page numbering in beamer+pdf

text: My question is in a sense the reverse of this question on overlays. Here's what I'd like to do. I have a beamer presentation that includes two frames, each with some overlays. Each frame looks like               \begin{frame}     \includegraphics<1>{fig1}     \includegraphics<2>{fig2}     ....     \end{frame}      Suppose I have 3 overlays in each frame. Then my output PDF has 6 pages and even if I don't render page numbers in my style, I can see the page numbers in the viewer. What I'd like instead to have happen is that the pages are numbered X-Y in the final PDF, so that in my PDF viewer, I see "1-1, 1-2, 1-3, 2-1, 2-2, 2-3" instead of 1-6. Note that this may be independent of whether I choose to render the page numbers in a beamer style (I'm not sure if it is). My reason is that I want a better way to calibrate the "number of slides" that my talk has, and overlays shouldn't really count (because they animate quickly) **Update** : Here's an example of what I'd see in the viewer: ![enter image description here](http://i.stack.imgur.com/aRqiJ.png)


title: Biblatex \autocite in case of would-be nested footnotes

text: I have the same situation as the following user: biblatex: Enhancing \autocite in case of would-be nested footnotes I want to use `\autocite` within a `\footnote`. This results in the citation being wrapped in parenthesis. I want to change the behavior of `\autocite` used within `\footnote` to print the citation without the parenthesis like a simple call of `\cite` would do. How can I change the behavior of `\autocite` within the `\footnote`?


title: Custom footer without number of pages

text: I use `fancyhdr` to create a custom footer in the left,I refer to this answer so I use               \makeatletter     % new style {footmark}     \fancypagestyle{footmark}{       \ps@@fancy % use {fancy} style as a base of {footmark}       \fancyfoot[L]{\footmark}     }     % sets value of \footmark and sets the correct style for this page only     \newcommand\markfoot[1]{\gdef\footmark{#1}\thispagestyle{footmark}}     \makeatother      And in the document, in a text that is on the page:               \markfoot{Mon texte.}      This should print `Mon texte.` left in the footer of the current page. But it display number of page too. how can I do to hide it. Thanks in advance


title: My phd supervisor wants me to use Word because they can't edit LaTeX. What to do?

text: How do I make it possible for my supervisor to edit my thesis while using LaTeX? I submit a pdf document but they want to edit it.... how do I do this without switching to MS Word?


title: Editable document in LaTeX

text: I'm writing Engineer Thesis in LaTeX and my leading professor asked me to give him editable document with my thesis. Can I create editable document from `.tex` file? Or maybe there is a simple way to convert it to `.doc` or `.docx`? Please Help. I'm creating in TexStudio.


title: Align in nested node

text: I want to create nested node in `tikz` but meet difficult to align Here is the code               \documentclass[12pt, a4paper, oneside]{standalone}      \usepackage{algorithm2e}     \usepackage{pdfpages}     \usepackage{listings}     \usepackage{parcolumns}     \usepackage{enumerate}               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % DRAWING PETRI NETS & DIAGRAMS     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \usepackage{pgf}     \usepackage{tikz}     \usepackage{makecell}     \usetikzlibrary{arrows,shapes,automata,petri,positioning,calc,fit,backgrounds,shapes.arrows,shapes.geometric,chains,matrix}     \tikzset{         data/.style={             ellipse,             thick,             draw=black,             minimum width = 2cm,         },         place/.style={             circle,             thick,             draw=blue,             fill=blue!20,             minimum size=6mm,         },         transition/.style={             rectangle,             thick,             draw=black,             fill=black!50,             minimum size=6mm         },         transitionH/.style={             rectangle,             thick,             fill=black,             minimum width=6mm,             minimum height=2mm         },         transitionHW/.style={             rectangle,             thick,             draw=black,             minimum width=6mm,             minimum height=2mm         },         transitionV/.style={             rectangle,             thick,             fill=black,             minimum width=2mm,             minimum height=6mm         },         transitionVW/.style={             rectangle,             thick,             draw=black,             minimum width=2mm,             minimum height=6mm         },         terminal/.style={             rounded rectangle,             thick,             draw=black         },         status/.style={             circle,             thick,             draw=black,             minimum size=15mm         },         decision/.style={             diamond,             aspect = 2,             thick,             draw=black         },         block/.style={             rectangle,             thick,             draw=black,             minimum width = 2cm,             rounded corners         },         borderE/.style={             ellipse,             thick,             draw=black         },         borderRd/.style={             rectangle,             thick,             draw=gray,             dashed,             rounded corners= 5mm         },         %double arrow         arrowD/.style={             double arrow,             fill = black,             double arrow head extend=1mm,             double arrow head indent =.5mm,             minimum width=3mm,             minimum height=7mm,             inner ysep=0.5mm         }     }               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % VIETNAMESE MACROS     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %\usepackage[vietnam]{babel}     \usepackage[utf8]{vietnam}          \begin{document}             %if need link to inside, use ``remember picture''         \begin{tikzpicture}[node distance=1cm,>=stealth',bend angle=25,auto,initial text={}]             \node [data,initial] (M0) {                 \begin{tikzpicture}[auto]                     \node (m0) {\begin{tabular}{c} $M_0$ \\ \_ \\ \_ \end{tabular}};                     \node [data, right= of m0] (A1B1C1) {$A_1B_1C_1$};                 \end{tikzpicture}             };                        \node [data, below= of M0] (M1) {                 \begin{tikzpicture}[auto]                     \node (m1) {\begin{tabular}{c} $M_1$ \\ loop \\ \_ \end{tabular}};                     \node [data,initial, right=of m1] (A2B2C1) {$A_2B_2C_1$}                         edge[in=-5,out=5,loop right] node {$t_B$} ();                                         \node [data, below=of A2B2C1] (A3B2C1) {$A_3B_2C_1$}                         edge[loop right] node {$t_B$} ()                         edge[pre] node {$t_A$} (A2B2C1);                 \end{tikzpicture}             }                   edge [pre]  node {$F_1$} (M0);         \end{tikzpicture}            \end{document}      With result as below ![enter image description here](http://i.stack.imgur.com/F7ZJq.png) As you see that:   1. Inside the second node, the `M1 \\ loop \\ _` does not in center veritcally, or, at least, align at top. I know I can use `yshift=-a cm`. But I hate the hardcode like that. Is there another way?   2. Can we align the drawing inside 2 nodes vertically?   3. Label `tA` and `tB` is a little bit faraway while label `F1` distance is acceptable Basically, in my diagram, each node has 2 separate modules: Attributes on the left, A small automata on the right. Big Nodes are also linked each others I was confused about the right way to draw this. Do you have other solutions for this.


title: Displaying Latex files on tablets

text: I need to display short mathematical formulae on mainstream tablets. Presently, I type the equations in LaTeX, convert the LaTeX document to PDF, and then to SVG before displaying it. I'm sure there is a more efficient way to do this. I presently use LaTeXiT (for Mac) and there are some problems converting it to SVG (pdf2svg path not found), which is why I need to go through the entire process.


title: Geometry Drawings: Coloring Arcs

text: I need to color in arc BC red and make my points D and C darker. Does anyone know how to do this?               \documentclass[10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows}     \pagestyle{empty}     \begin{document}     \definecolor{qqttzz}{rgb}{0,0.2,0.6}     \definecolor{ttqqqq}{rgb}{0.2,0,0}     \definecolor{xdxdff}{rgb}{0.49,0.49,1}     \definecolor{qqqqff}{rgb}{0,0,1}     \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]     \clip(-4.3,-5.28) rectangle (22.8,6.3);     \draw(2.64,1.26) circle (3.73cm);     \draw [color=ttqqqq] (0.28,-1.63)-- (6.26,2.16);     \draw [color=qqttzz] (2.64,1.26)-- (0.28,-1.63);     \draw (2.16,4.96)-- (0.28,-1.63);     \draw [color=qqttzz] (2.64,1.26)-- (2.16,4.96);     \draw [color=qqttzz] (2.64,1.26)-- (6.26,2.16);     \begin{scriptsize}     \fill [color=qqqqff] (2.64,1.26) circle (1.5pt);     \draw[color=qqqqff] (2.78,1.54) node {$A$};     \fill [color=qqqqff] (2.16,4.96) circle (1.5pt);     \draw[color=qqqqff] (2.32,5.24) node {$B$};     \fill [color=xdxdff] (6.26,2.16) circle (1.5pt);     \draw[color=xdxdff] (6.42,2.44) node {$C$};     \fill [color=xdxdff] (0.28,-1.63) circle (1.5pt);     \draw[color=xdxdff] (0.44,-1.34) node {$D$};     \end{scriptsize}     \end{tikzpicture}          \begin{center}       $\displaystyle\angle BDC = \frac{1}{2} \widehat{BC} $       \end{center}           \end{document}      Also how do I make midpoint hashmarks for segments BA, DA and AC? I want my drawings to look something like this, but with midpoint hashmarks for the radii: ![enter image description here](http://i.stack.imgur.com/jezeD.png)


title: Using minted and tabs

text: I just started using the `minted` package. When I insert tabs as indentation, it gives me a bunch of characters instead: ![enter image description here](http://i.stack.imgur.com/oar29.png) However, when I copy the example from the documentation it seems to work fine. I tried experimenting with the `obeytabs` and `showtabs` options but I can't get rid of the characters. I'm using `xelatex` with TexLive 2011 in TexShop. All files are up to date. Here's a MWE (please note as pointed out in the comments that the indentation in the code is supposed to be tabs and not spaces):               \documentclass{article}          \usepackage{minted}     \newminted{python}{linenos}          \begin{document}          \begin{minted}[linenos]{python}     def all(iterable):         for i in iterable:             if not i:                 return False         return True     \end{minted}          \end{document}      **Edit** : I noticed something strange: When I change the typesetting engine back to `pdflatex`, it seems to be working, but then I can't load the `fontspec` package. So I guess this is related to `xelatex`? I'm using `xelatex --file-line-error --shell-escape --synctex=1`


title: cleveref, hyperref and algorithm2e package produce wrong hyperlink (though correct page reference)

text: I'm using the packages as stated above in their latest version (also oberdiek- package is up-to-date). The following code produces the wrong pdf-link to a float environment (refers to the same page as the reference, not to the referred algorithm), although the pageref command reflects the correct page.                [...] depends upon \cref{alg:algorithm2} which is on page      \pageref{alg:algorithm2}.      produces ![referring to algorithm 2](http://i.stack.imgur.com/dlKL0.png)


title: Change page margin

text: I have used `showframe` package and I noticed that my page contains allot of margin and possible two unwanted placeholders, one for page title and one for comments. How can I remove those margins or change it's geometry?               \documentclass[a5paper,pagesize,10pt,bibtotoc,pointlessnumbers,     normalheadings,DIV=9,twoside=false]{scrbook}          \usepackage[nohead,nofoot]{geometry}     % twoside, openright     \KOMAoptions{DIV=last}          \usepackage{showframe}          \title{A book title}        \author{Temouri Sisaouri}      \date{\today}           \begin{document}          %=========================================     \begin{titlepage}             \centering{                 {\fontsize{40}{48}\selectfont                  A book title}             }\\                  \vspace{10mm}             \centering{\Large{Temouri Sisaouri}}\\             \vspace{\fill}             \centering \large{2014}     \end{titlepage}     \end{document}      ![enter image description here](http://i.stack.imgur.com/6J1qv.png)


title: How to put my academic roll no in latex beamer title slide

text: I am making a slides on latex beamer for my academic exam..I need to put my class roll number on the title side but how to do so... I am using command               `\usetheme{Darmstadt}     \setbeamertemplate{footline}{\hspace*{.2cm}\scriptsize{\insertauthor     \hspace*{30pt} \hfill\insertframenumber\hspace*{.5cm}}}           \title {my topics title}          \author{my name}     %% I need my roll no to show here          \institute[CU]{      my institute\\[\medskipamount]           \includegraphics[width=.23\textwidth,height=.31\textheight]{cu1.jpg}%      }          \date{23 rd February, 2013}`


title: Is it possible to define a command that can be used where literal <comma-separated-list> is normally required?

text: I suspect I'm asking for magic, but I'll go ahead anyway. Suppose I have a command that accepts an arbitrary-sized list of comma-separated terms. One that we're all familiar with is `\usepackage` although of course we could all come up with dozens more. In the case of `\usepackage`, we can write: `\usepackage[opta,optb,optc]{pkgx,pkgy,pkgz}` I.e., `\usepackage[ <comma-separated-options> ]{ <comma-separated-pkg-names> }` More generally, we might be given a command to be used like this: `\command{ <comma-separated-list> }` My question is, is there any TeX\LaTeX wizardry for constructing commands such as:               \newcommand\mylist{       ... possible wizardry ...       a,b,c       ... possibly more wizardry ...     }      so that the effect of writing `\command{\mylist}` and `\command{a,b,c}` or `\command{ ...code... \mylist ...code... }` and `\command{a,b,c}` would be the same? In other words, is it possible to construct a TeX\LaTeX command that can stand, be expanded and accepted in the compile where `<comma-separated-list>` would normally be accepted? Motivation: (apart from the immense pleasure of learning new TeX-related things :) ) On multiple occasions, I have to pass a large non-fixed-sized list to several places, some being to packaged commands that, due to their complexity and the maintenance burden it would impose, I'm rather reluctant to dive into and redefine. **Edit:** While some very good ideas have been suggested (thanks esp. TH and Will!), these solutions don't completely fit the bill. So, to ground my question somewhat, here are the specifics of the case I'm trying to solve. As background, my code consumes the same long list of values in multiple locations. While I could hard-code the list literally in all the places that consume it, for good and practical reasons, the idea of doing so is not at all appealing. I would really like to pass it as an argument, as I can for any other normal value. One of the (let's say) two places consuming the list is a command, `\command`, for which TH's and then Will's repeat, perfectly solve the problem. The other case where I'm struggling, however, is in my reusing the list in `xkeyval` command `\define@choicekey`, although the same problem would exist in the case of any other commands sharing the same type template. (FYI, I've tried hacking TH's nice solution to fit, but got nowhere particularly fast.) Here's an example list of values and the situations where I access them:               \newcommand*\mylist{a,b,c,...,l,m,n}          \define@choicekey{myfamily}{mykey}[]       \mylist%             <-- how can I consume \mylist here?       [a]       {\renewcommand*\mynewkey{#1}}          \newcommand\anothercmd{       ...       \command{\mylist}%   <-- this problem is easily fixed with TH's nice solution       ...     }


title: Non rectangular page geometry

text: I am interested in using non-rectangular page geometries for my flipbook idea (in fancyhdr with image and flowing text). The page geometry that I'm after is that the text has a little rectangle missing from the bottom right (excised rectangle) on every odd page. In my previous question we figured out a way to make change the text height on every page, but not have the right geometry:               \documentclass[twoside]{article}     \usepackage[textheight=15cm]{geometry}     \usepackage{lipsum}     \usepackage[demo]{graphicx}         \usepackage{fancyhdr}     \usepackage{everyshi}     \usepackage{xifthen}               \newcounter{flipbookcount}     \setcounter{flipbookcount}{1}          \fancyfoot[RO]{\setlength{\unitlength}{1mm}     \begin{picture}(0,10)     \put(-24,-34){\includegraphics[width=5cm]{mypic\theflipbookcount.png}}     \end{picture}     \stepcounter{flipbookcount}     }               \EveryShipout{%     \ifthenelse{\isodd{\value{page}}}%             {\global\textheight=20cm}% Next page is even             {\global\textheight=15cm}% Next page is odd             }          \begin{document}     \pagestyle{fancy}     \lipsum     \lipsum     \lipsum     \lipsum     \lipsum          \end{document}      Is there a way to make that work? I can add a picture as an example if its unclear what I mean.


title: Rubber margins in chapters

text: I couldn't find a Google hit with what I need (try: `LaTeX rubber margins`). So, is it possible to stretch left/right margins, within defined acceptable limits, so that pages are filled optimally? I'm using pdfLaTeX. E.g., chapter of 3 pages, last one has only a few lines: Means expanding margins of that chapter so text is in 2 pages. I would like to keep page margins within chapters identical, only allowing differences between chapters. An option to exclude certain chapters is also desireable. Shrinking margins to maximize filling will not be needed, the goal is to eliminate pages with alot of blank space, typically at the end of a chapter. And by possible I mean doable by a novice without needing to code for days. Maybe there are better options? I am also using the `microtype` package.


title: Square edges in forest package

text: I can easily do trees with horizontal (square) edges in `tikz-qtree` (see MWE). The `forest` package is however a far superior alternative for my purposes. However, every attempt to do either horizontal or vertical trees with square edges in forest is either ignored, or leads to compilation failure (for example inserting the `\tikzset` line into the forest tree). Is this possible? A helping hand would be very much appreciated here.                \documentclass[10pt,twoside,a4paper]{memoir}      \usepackage{graphicx}      \usepackage{forest}      \usepackage{tikz-qtree}           \begin{document}           \begin{tikzpicture}      \tikzset{edge from parent/.style={draw,edge from parent path={(\tikzparentnode.south)-- +(0,-8pt)-| (\tikzchildnode)}}}      \Tree [.ZZ      [.Bax      [.X      [.Y [.A ] [.B ] ]      [.Z [.C ] [.D ] ] ]      [.F      [.M [.E ] [.F ] ]      [.G [.G ] [.H ] ] ] ]      [.A      [.B      [.S  [.I P R T V U ] [.J ] ]      [.I  [.K ] [.L ] ] ]      [.M      [.L  [.M ] [.N ] ]      [.A  [.O ] [.P ] ] ] ] ] ]      \end{tikzpicture}                \begin{forest}      [ZZ      [Bax      [X      [Y [A ] [B ] ]      [Z [C ] [D ] ] ]      [F      [M [E ] [F ] ]      [G [G ] [H ] ] ] ]      [A      [B      [S  [I [P][R][T][V][U]] [J ] ]      [I  [K ] [L ] ] ]      [M      [L  [M ] [.N ] ]      [A  [O ] [P ] ] ] ] ] ]      \end{forest}           \end{document}      ![MWE Output](http://i.stack.imgur.com/CwoyX.jpg)


title: Align decimal marker with thousands separator using siunitx

text: My table consists of two groups of rows. The first group contains large values (X,XXX). The second groups contains smaller values (0.XXX). Siunitx aligns all numbers based on the position of the decimal marker. The result isn't beautiful: some numbers are aligned very much the left, while others are very much to the right. Is it possible to align the numbers so that the decimal markers (from the small values) are aligned with the thousands separators (from the large values)? Here's an example of the table. The second and third column show the current situation. The last two columns are an example of how I'd like the data to appear (edited using Photoshop). ![Example](http://i.stack.imgur.com/002yA.png) If a neat solution doesn't exist, a hacky solution would be welcome as well. I already thought of a way to change the decimal marker within the table: if I could have a comma as decimal marker for the first group of rows, everything would be fine. However, I couldn't get that to work (with my little knowledge of LaTeX). Code used for the table:               \documentclass{article}          \usepackage{booktabs}     \usepackage{siunitx}          \sisetup{group-separator={,},group-minimum-digits={3},output-decimal-marker={.}}          \begin{document}     \begin{tabular}{@{}p{2.3cm}SSp{0.3cm}SS@{}}          \toprule     & \multicolumn{2}{c}{Without Threshold Selector} && \multicolumn{2}{c}{With Threshold Selector}\\     \cmidrule{2-3} \cmidrule{5-6}     & \multicolumn{1}{p{2.3cm}}{\centering{Naive Bayes}} & \multicolumn{1}{p{2.3cm}}{\centering{Logistic}} && \multicolumn{1}{p{2.3cm}}{\centering{Naive Bayes}} & \multicolumn{1}{p{2.3cm}}{\centering{Logistic}}\\     \midrule          True positives  & 2791  & 1831  && 3126     & 3547\\     False positives & 2924  & 995   && 3853     & 3483\\     True negatives  & 36998 & 38927 && 36069    & 36439\\     False negatives & 2498  & 3458  && 2163     & 1742\\          \addlinespace          Sensitivity     & 0.528 & 0.346 && 0.591    & 0.671\\     Precision       & 0.488 & 0.648 && 0.448    & 0.505\\          \bottomrule          \end{tabular}     \end{document}


title: Obtain all different values of a specific column in a datatool database

text: how can I get all different values of a specific column in a `datatool` database? Example is the following table read into a `datatool` database:               Name,Town,Age     Adam,Xcity,20     Berta,Ytown,30     Cesar,Ztington,40     Dora,Ztington,20     Emil,Ytown,30     Franz,Ytown,20      Now I'd like to get a list of all towns (`Xcity, Ytown,Ztington`) in that database and of all ages (`20,30,40`) in that database without duplicates, that I can store in macro/whatever to reuse later with `datatool` or `pgffor`.


title: Non-uniform indentation with enumerate

text: I am using an `enumerate` environment to enumerate over a set of equations. Everything works fine but, if there is a page break when generating the pdf while the enumerate is not complete, the indentation at the next page appears to be centered rather than the usual left aligned. Can anyone tell me why this happening? The code is as follows: EDIT:               \documentclass[10pt,twoside,a4paper]{article}     \usepackage{mathtools}          \begin{document}          Lot of contents and equation go here.......          \vspace{15cm}          The different equation obtained using KKT conditions are:          \noindent X\dotfill X          \begin{enumerate}         \item Primal feasibility constraints are:             \begin{equation} -(Bw^{(1)} + e_2b^{(1)}) + q \geq e_2, q \geq 0 \end{equation}         \item Complementary Slackness conditions are:             \begin{equation} \alpha^T(-(Bw^{(1)} + e_2b^{(1)}) + q - e_2) = 0, \beta^Tq = 0 \end{equation}         \item Multiplier Positivity constraints are:             \begin{equation} \alpha\geq 0, \beta \geq 0 \end{equation}         \item Gradient conditions with respect to $w^{(1)}$, $b^{(1)}$ and $q$ are:             \begin{equation} A^T(Aw^{(1)} + e_1b^{(1)}) + B^T\alpha = 0 \end{equation}             \begin{equation} e_1^T(Aw^{(1)} + e_1b^{(1)}) + e_2^T\alpha = 0 \end{equation}             \begin{equation} c_1e_2 - \alpha - \beta = 0 \end{equation}     \end{enumerate}          \noindent X\dotfill X          \end{document}      After the second point, a page break occurs and the indentation goes haywire. Any help would be great. One more thing: I haven't imported any package besides `mathtools`.


title: No indent in modified \maketitle in article

text: I am looking to have the title left justified along with the name of the author and teacher and the date. I have managed to get it left justified but the name is being indented, this is not what I want. Here is a MWE.               \documentclass[12pt,letterpaper]{article}     \usepackage{lipsum}     \title{TITLE}          \author{     Name \textsc{Last name} \\      Mr. \textsc{Name}     \hspace*{-\tabcolsep}}          \begin{document}          \begingroup     \let\center\flushleft     \let\endcenter\endflushleft     \maketitle     \endgroup          \lipsum[1-10]     \end{document}


title: Cite Command with a Customised Field for Biblatex

text: I am writing a PhD and my mentor wants me to use a specific short form of citation in the footnotes and long one in the bibliography at the end of the work. So basically I need to have three short fields instead of classical two (`shorttitle` and `shortauthor`). I need to find a way to add `shortseries` which I would use in footnotes. This is what I use so far for the two fields:               \DeclareBibliographyDriver{myshort}{%         \usebibmacro{begentry}%         \ifboolexpr{ test{\ifnameundef{shortauthor}}                      or test {\iffieldundef{shorttitle}}}           {\usedriver{}{\thefield{entrytype}}}           {\printnames{shortauthor}%            \setunit{\addcomma\space}%            \printfield{shorttitle}\isdot}%            \usebibmacro{finentry}%         }     \DeclareCiteCommand{\mycite}[\mkbibfootnote]       {\usebibmacro{prenote}}       {\usedriver{}{myshort}}       {\multicitedelim}       {\usebibmacro{postnote}}      This is what this produces: > See Iust., De Triph. S. 11. I need to either find a way to introduce another bibliography field which would be called `shortseries` or I need to find a way to use some of the optional fields in the incollection like `note` which I never use to take over this function. Here is my MWE:                   \documentclass[a4paper,11pt]{scrartcl}         \usepackage[latin1]{inputenc}         \usepackage{csquotes}         \usepackage{blindtext}         \usepackage{filecontents}         \begin{filecontents}{\jobname.bib}           @incollection{iustinus1997,                 Address = {Berlin/New York},                 Author = {{Iustinus Martyr}},                 Title = {Iustini Martyris dialogus cum Tryphone},                 Editor = {Miroslav Marcovich},                 Publisher = {Walter de Gruyter},                 Series = {Patrologiae cursus completus: Series Graeca},                 Shortauthor = {Iust.},                 Shorttitle = {De Tryph.},                 Shortseries = {PG},                 Volume = {47},                 Year = {1997}}         \end{filecontents}          \usepackage[ngerman]{babel}     \usepackage[style=historische-zeitschrift, maxnames=2, hyperref=true, backref=true, backrefstyle=none, backend=bibtex,idemtracker=true]{biblatex}         \bibliography{\jobname}         \DeclareBibliographyDriver{myshort}{%             \usebibmacro{begentry}%             \ifboolexpr{ test{\ifnameundef{shortauthor}}                         or test {\iffieldundef{shorttitle}}}               {\usedriver{}{\thefield{entrytype}}}               {\printnames{shortauthor}%                \setunit{\addcomma\space}%                \printfield{shorttitle}\isdot}%                \usebibmacro{finentry}%             }         \DeclareCiteCommand{\mycite}[\mkbibfootnote]           {\usebibmacro{prenote}}           {\usedriver{}{myshort}}           {\multicitedelim}           {\usebibmacro{postnote}}         \begin{document}         \blindtext \mycite[See][S. 11]{iustinus1997}         \blindtext         \printbibliography              \end{document}      and when i use: `\mycite[See][11]{iustinus1997}` this is what I need to get as an end-result: > See _Iust._ , De Tryph., in: PG 47, S. 11. Anyone got the idea how I can achieve this? Thanks in advance for your answers!


title: How to insert a column vector using transpose of row vector in LaTeX

text: I want to write `A=[Xtk Ytk .Xtk .Ytk]^T` in LaTeX. `^T` means that I want the transpose symbol "T" to come as superscript of the matrix. `Xtk` should appear as the variable `X` with subscript `t` and subsubscript `k`. Similarly for `Ytk`. Third entry, `.Xtk`, means that I want the `.` (dot) to come on top of `Xtk`, denoting velocity. I want to know how these can be expressed in desired forms in LaTeX.


title: How to use UNC path

text: I struggle a bit with UNC paths in latex. My paths looks something like > \\\server\folder\folder I found this. Which recommends to change \ to /. Thats not really a solution. I put the path in a verbatim block which work but ignores the text flow. My other 'solution' is to replace every \ with `\textbackslash{}` The question I have is: Is there any recommended or best practices way to deal with UNC paths?


title: biblatex & TeX4HT: citations in footnotes = missing \begin{document}

text: the following code, which I'm trying to run through `TeX4HT` and `biber` in order to create an .odt file, results in a »missing \begin{document}« error, pointing to the aux file. Something about the citation in the footnote seems to cause trouble. No trouble occurs when   * I'm creating a pdf using ordinary `pdflatex` or `lualatex,` or   * [which is the most interesting part] a `biblatex` style _other than ›authoryear‹, like ›numeric‹,_ or   * I remove the citation from the footnote Unfortunately, I can't do without any of these three in this case, so I'd appreciate any thoughts on this issue. Thanks a lot! It might have to do with the biblatex adaption of tex4ht, so maybe what'S required here is a manual definition of a missing command, similar to what Ulrike replied to a different but related question. PS: same problem occurs with \footcite{BoS99}; it also occurs when creating an .html rather than an .odt (option `xhlatex`). PPS: I'm using   mk4ht oolatex [filename]   biber [filename]   mk4ht oolatex [filename]               \begin{filecontents}{testbib.bib}     @BOOK{BoS99,       author = {Bowker, Geoffrey and Star, Susan Leigh},       year = {1999},       title = {Sorting Things Out: Classification and its Consequences},       address = {Cambridge, MA},       publisher = {MIT Press}     }     \end{filecontents}          \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[backend=biber,style=authoryear]{biblatex}     \bibliography{testbib.bib}     \begin{document}     hat einer und gemacht zu werden%     \footnote{um von Buch wollen \cite{BoS99}}     \end{document}      * * * **error message:**               ! LaTeX Error: Missing \begin{document} in `'.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...          l.3 \abx@aux@fnpage{1}{1}      * * * **contents of the aux file:**               \relax     \ifx\rEfLiNK\UnDef\gdef \rEfLiNK#1#2{#2}\fi     \abx@aux@fnpage{1}{1}


title: Organization of two graphs

text: How it is possible to represent two graphs created with TikZ in the same figure? The source code for a graph is as follows:               \documentclass{beamer}     \usepackage{tikz}     \usetikzlibrary{trees}     \usetheme{Frankfurt}          \begin{document}     \begin{frame}{TITLE}              \begin{figure}[H]         \begin{center}                   \begin{tikzpicture} [sibling distance=1.5cm]              %          \node [size=0.3cm](topnode) at (0,5) {\{1,2,3\}}                \node (topnode) at (0,5) {\{1,2,3\}}                    child { node[size=0.3cm] {\{1,2\}\{3\}}}                   child { node[size=0.3cm] {\{1,3\}\{2\}}}                   child { node[size=0.3cm] {\{1\}\{2,3\}}}                   ;                   \node [size=0.3cm](topnode) {\{1\}\{2\}\{3\}}         %         \node[minimum width=3cm]  at (0,5) {\{\{1,2,3\}\}}                   ;                   \foreach \x in {-3}{                   \draw  (topnode-1) -- (bottomnode-\x);                   \draw  (topnode-3) -- (bottomnode-\x);                   \draw  (topnode-2) -- (bottomnode-\x);                   }                        \end{tikzpicture}         \end{center}               \end{frame}          \end{document}      like that ![enter image description here](http://i.stack.imgur.com/oaRYF.jpg)


title: How to use a \pstVerb constant as the angle arguments of \uput?

text: How to use `alpha` as the angle arguments of `\uput`? ![enter image description here](http://i.stack.imgur.com/N8OF7.png)               \documentclass[border=0pt]{standalone}     \usepackage{pstricks-add}          \pstVerb{         /theta 45 def         /alpha theta 90 sub def         /weight 1.5 def     }          \begin{document}     \begin{pspicture}(-2.2,-2.2)(2.5,2.5)         \psaxes[ticks=none,labels=none,linestyle=dashed]{->}(0,0)(-2,-2)(2,2)[$x$,0][$y$,90]       \psframe*[linecolor=gray,opacity=0.5](-1,-0.5)(1,0.5)       \psline{->}(!alpha dup cos weight mul exch sin weight mul)       %---------------------------------------------------------       \uput[(!1 -1)]{(!1 dup)}% how to use alpha here?         (!alpha dup cos weight mul exch sin weight mul){$\vec{w}$}      \end{pspicture}     \end{document}


title: Poor leading in titles

text: Here's an example of terrible (and non-constant) leading in titles that is causing me trouble:               \documentclass[a4paper, 12pt]{memoir}     \usepackage{fontspec}     \setmainfont[Mapping=tex-text,Numbers=OldStyle]{Cardo}          \begin{document}          \begin{titlingpage}     \begin{center}      { \fontsize{36pt}{72pt}\selectfont \bfseries A Title To Show Off The Poor Leading In Titles and How the aaaaaaaaaaaaaaaaaaaaa Skip in Fontsize is Ignored }     \end{center}     \end{titlingpage}          \end{document}      Note how the second argument in `\fontsize` is completely ignored. I've tried various things to fix this, to no avail. Firstly, why does it do this and, secondly, what can I do to fix it? NOTE: I would post an example image, but I don't have enough reputation yet. Sorry.


title: How do I know that w must not be used?

text: I have a project to draw something that is more complicated than the following. Apparently I cannot use `w` after invoking `\psaxes` with `[$x$,0][$y$,90]`. I found it after struggling for 1 hour. ![enter image description here](http://i.stack.imgur.com/wrdMF.png)               \documentclass{standalone}     \usepackage{pstricks-add}          \begin{document}     \begin{pspicture}(-4,-4)(4,4)         \pstVerb{/w 1 def}%         \psaxes{->}(0,0)(-2,-2)(2,2)%         [$x$,0][$y$,90]%<=== source of problem!       \psline{-*}(!w w)     \end{pspicture}     \end{document}      Can you see the strange output? The radius of the point should be the square root of 2 cm. How do I know that `w` must not be used if there is no warning/error message? **Edit:** Another example where a single letter identifier produces a weird output!               \documentclass[pstricks,border=0pt]{standalone}     \usepackage{pstricks-add}          \begin{document}     \multido{\i=0+30}{12}{%     \begin{pspicture}(4,4)         \pstVerb{/a 1 def}         \uput{5mm}[0](2,2){$\i^\circ$}     \end{pspicture}}     \end{document}


title: How to get pgfonlayer to work correctly inside onslide?

text: I am trying to use onslide to group different picture elements together and control when and how long they appear on the slide. At the same time I am trying to use pgfonlayer to make sure some things are drawn "underneath" other things to ensure the right occlusion. I think they should be completely independent of each other, but I am finding that when I put elements into the pgfonlayer environment (which is inside the onslide), it seems to put all the items in the same pgf background layer into something equivalent to onslide<1->. Almost like the pgfonlayer cancels the effect of the onslide. To be more precise I can have something like this (this is a sketch of the problem -- A,B,C,D are real graphics, not just letters):               \onslide<1>{     B     \begin{pgfonlayer}{bg}     A % A should be occluded by B     \end{pgfonlayer}     }          \onslide<2>{     D     \begin{pgfonlayer}{bg}     C % C should be occluded by D     \end{pgfonlayer}     }      and I get the effect that A and C are always visible. Is there an easy way to fix this? Any help would be greatly appreciated. Thanks, Ambrose ps. Here is a full source code example:               \documentclass[10pt]{beamer}     \title{onslide vs pgfonlayer}     \author[My Team]{My Name}     \date{\today}     \usepackage{tikz}     \begin{document}          \begin{frame}[t]       \frametitle{First using pgfonlayer only -- works.}            On this first slide the light colors are on top, even though they are       drawn before the darker colors.  {\bf pgfonlayer} is used to achieve       this.            \pgfdeclarelayer{bg}       \pgfsetlayers{bg,main}            \begin{figure}         \begin{tikzpicture}           \draw[fill=blue!10] (0,1) circle (1cm);           \begin{pgfonlayer}{bg}             \draw[fill=blue] (0,0) circle (1cm);           \end{pgfonlayer}           \draw[fill=red!10] (3,1) circle (1cm);           \begin{pgfonlayer}{bg}             \draw[fill=red] (3,0) circle (1cm);           \end{pgfonlayer}         \end{tikzpicture}       \end{figure}          \end{frame}               \begin{frame}[t]       \frametitle{Next, adding onslide -- fails.}       On this second slide I attempt to use {\bf onslide} to show only one       side at a time.  First the blues then the reds.       \pgfdeclarelayer{bg}       \pgfsetlayers{bg,main}            \begin{figure}         \begin{tikzpicture}           \onslide<1>{             \draw[fill=blue!10] (0,1) circle (1cm);             \begin{pgfonlayer}{bg}               \draw[fill=blue] (0,0) circle (1cm);             \end{pgfonlayer}           }           \onslide<2>{             \draw[fill=red!10] (3,1) circle (1cm);             \begin{pgfonlayer}{bg}               \draw[fill=red] (3,0) circle (1cm);             \end{pgfonlayer}           }              \end{tikzpicture}       \end{figure}            First we see light blue with both dark colors, ...\pause and then we       see light red with both dark colors.  It seems that because I put the       darker colors into the bg layer, the onslide groupings I put around       each basic color do not work          \end{frame}     \end{document}


title: Move periods inside quotes in bibliography

text: I'm writing an article in Norwegian, and the guidelines specify that articles should be quoted in the bibliography as follows: > John Doe. 2005. "My article." _A Cool Journal_ 16. My impression is that this is the default style in Norway. Abstracting away from other issues (which I can fix) I'm not able to replicate the quote style with `csquotes`. Using `style = norwegian` will use bottom quotes and put the period after the quotes. Using `style = american` gets me somewhat closer, but the period is still after the quotes. There's something in the `biblatex` manual under §3.10.1 about moving the periods inside the quotes, but I don't understand the documentation on this point. With `style = norwegian`:               \documentclass{article}     \usepackage{filecontents}     \usepackage[nynorsk]{babel}     \usepackage[style = norwegian, norwegian = quotes]{csquotes}     \usepackage[style = authoryear-comp, language = nynorsk]{biblatex}          \begin{filecontents}{\jobname.bib}     @article{myarticle,         AUTHOR = "John Doe",         TITLE = "My article",         JOURNALTITLE = "A Cool Journal",         VOLUME = "16",         YEAR = "2005"}     \end{filecontents}     \addbibresource{\jobname.bib}     \begin{document}     \nocite{myarticle}     \printbibliography     \end{document}      ![enter image description here](http://i.stack.imgur.com/dJDsQ.png) With `style = american`:               \documentclass{article}     \usepackage{filecontents}     \usepackage[nynorsk]{babel}     \usepackage[style = american, norwegian = quotes]{csquotes}     \usepackage[style = authoryear-comp, language = nynorsk]{biblatex}          \begin{filecontents}{\jobname.bib}     @article{myarticle,         AUTHOR = "John Doe",         TITLE = "My article",         JOURNALTITLE = "A Cool Journal",         VOLUME = "16",         YEAR = "2005"}     \end{filecontents}     \addbibresource{\jobname.bib}     \begin{document}     \nocite{myarticle}     \printbibliography     \end{document}      ![enter image description here](http://i.stack.imgur.com/gcoXo.png)


title: Add vita at the end of dissertation

text: I am writing my dissertation in LaTeX and I need to add my Vita at the end. Can you please help in defining the structure. My requirements are:   1. 'Vita' needs to appear in the 'table of contents' as other chapters.    2. On vita page there is no chapter number and starts as usual page.  If I want to include the following statement in main text file, How to I need to define `\printvita`?               \addcontentsline{toc}{chapter}{Vita}     \printvita


title: stops become blank squares in cjhebrew

text: The following code:               \documentclass[12pt,a4paper]{book}     \usepackage{cjhebrew}     \begin{document}     \begin{cjhebrew}     hd .     \end{cjhebrew}     \end{document}      Generates the correct hebrew letters, but the stop (dot) becomes a blank square: `� הד`. Any ideas what am I doing wrong?


title: Adding box filled with color and placing large text inside it

text: I am trying to prepare a class for my college magazine and articles. I would like to know how to place a black box on the top margin of the first page and write some huge text inside it in white color. Present style of the document looks like this,               % DOCUMENT LAYOUT     \documentclass[10pt, a4paper]{article}     \usepackage[left=5cm,right=2.5cm,top=5cm,bottom=3cm]{geometry}     \usepackage{fontspec}     \usepackage{marvosym}     \usepackage{wasysym}     % DOCUMENT LAYOUT     \setlength\parindent{0cm}     \usepackage[libertine={Ligatures=TeX,Numbers=OldStyle}]{libertineotf}     \setsansfont{Segoe UI}     % FONTS     \usepackage[usenames,dvipsnames]{color}     \usepackage{xunicode}     \usepackage{xltxtra}     \defaultfontfeatures{Mapping=tex-text}     \usepackage{pgfplots}     \usepackage{xcolor}     \usepackage{eso-pic}          % ---- CUSTOM COMMANDS     \chardef\&="E050     \newcommand{\html}[1]{\href{#1}{\scriptsize\textsc{[html]}}}     \newcommand{\pdf}[1]{\href{#1}{\scriptsize\textsc{[pdf]}}}     \newcommand{\doi}[1]{\href{#1}{\scriptsize\textsc{[doi]}}}     % ---- MARGIN YEARS     \usepackage{marginnote}     \newcommand{\amper{}}{\chardef\amper="E0BD }     \newcommand{\sides}[1]{\marginnote{\color{MidnightBlue}\sffamily #1}}     %\newcommand{\years}[1]{\marginnote{\footnotesize #1}}     %\renewcommand*{\raggedleftmarginnote}{}     \setlength{\marginparsep}{0.5cm}     \reversemarginpar          % HEADINGS     \usepackage{sectsty}      \usepackage[normalem]{ulem}      \sectionfont{\mdseries\upshape\Large}     \subsectionfont{\mdseries\scshape\normalsize}      \subsubsectionfont{\mdseries\upshape\large}     \usepackage{lipsum}     \usepackage{tikz}     % PDF SETUP     \usepackage[bookmarks, colorlinks, breaklinks,          pdftitle={Here there},         pdfauthor={My name},         pdfproducer={}     ]{hyperref}       \hypersetup{linkcolor=blue,citecolor=blue,filecolor=black,urlcolor=MidnightBlue}     % DOCUMENT     \begin{document}     {\LARGE Effect of aspect ratio and others on others and ourselves}\\[3pt]     \textit{Me myself \& You}. Corr. author : \href{mailto:s.sssss@gmail.com}{\textit{s.sssss@gmail.com}}\\     \textit{Department of Mechanical Engineering.}\\[0.5cm]     {\large \bf Abstract}\\[4pt]     \lipsum[25]     {\section*{Introduction}}     \sides{I am hoping to create some proper paper using this template when i do my masters.}     \lipsum     \sides{How does a para look with this on sides. For a moment i thought it is gone}     \lipsum          %\vspace{1cm}     \vfill{}     %\hrulefill          \end{document}      Can some one suggest how to do this? I want something like the one on the right. ![enter image description here](http://i.stack.imgur.com/uwkuM.jpg)


title: TikZ: Draw a line up to a curve

text: > Is it possible to draw a line upto a curve. Something like extend... I do not know to get the pont on the curve to stop the line.               \documentclass{standalone}     \usepackage{tikz}          \begin{document}     %     \begin{tikzpicture}     %grid     \draw [step=1.0,thin,gray!40]             (0,0) grid (6,5);     \coordinate (C) at (1.5,1.5);     \coordinate (D) at (1.2,3);     \fill[blue] (C) circle (2pt);     \fill[blue] (D) circle (2pt);     \draw (C)--(D);     \draw [red,thick](C)--++(3,0);     \draw [blue,thick](D)--++(3,0);     %     \coordinate (A2) at (5,1);     \coordinate (B2) at (3.0,4);     %     \draw (A2) to [bend left=20] (B2);     %     \end{tikzpicture}     %     \end{document}       ![enter image description here](http://i.stack.imgur.com/OdaSM.png) Red and blue lines must stop exactly on the curve.


title: How to make a figure leave less space from top?

text: I have 2 columns in a beamer frame. The first one on the left contains a picture while the second, on the right, an enumerate.                   \begin{column}{0.5\textwidth}                     \begin{figure}                     \centering                     \includegraphics[width=4cm]{java5.pdf}                     \caption{Our own test of downsampling}                     \label{fig:3}                     \end{figure}             \end{column}      the figure looks akwardly to start 5% of frame size below the same level enumerate starts in neighboring column. How to get them to same level?


title: Symbols for four and five vertical dots

text: I am very new to latex, but have spent hours trying without success to figure this out. I need symbols for both 4 and 5 vertically stacked dots. I know the commands for 1 dot (`\cdot`), and 3 dots (`\vdots`). It seems like one methods that I've read about here is to combine symbols, for example combining 4 single dots to create a 4 vertical dot symbol. But, I can't figure it out. Any help would be much appreciated.


title: Eqnarray nested matrices produces alignment error

text: I wrote the following equation array.               \begin{eqnarray}       w_{0}     & < & 1 \\            w^{m}_{i}     & = & \left \{           \begin{matrix}         w_{0}           & i = 0 \\         \frac{1-w_{0}}{2L}  & i > 0           \end{matrix} \right. \\            w^{c}_{ij}    & = & \left \{           \begin{matrix}         0           & i \neq 0 \\          \frac{1-w_{0}}{2L}  & i = 0            \end{matrix} \right. \\            \zeta     & = & \sqrt{\frac{L}{1-w_{0}}}     \end{eqnarray}      This produces the following Error messages when compiled with pdflatex. I triple checked the alignment characters. Please Help me!               ! Missing $ inserted.     <inserted text>                      $     l.286           ?      ! Missing } inserted.     <inserted text>                      }     l.286           ?      ! Missing } inserted.     <inserted text>                      }     l.286           ?      ! Missing \cr inserted.     <inserted text>                      \cr      l.286           ?      ! Missing { inserted.     <inserted text>                      {     l.286           ?      ! Missing $ inserted.     <inserted text>                      $     l.286           ?      ! Missing $$ inserted.     <to be read again>                         \par      l.286           ?      ! Missing $ inserted.     <inserted text>                      $     l.287   w^               {m}_{i}       & = & \left \{     ?      ! Misplaced alignment tab character &.     l.287   w^{m}_{i}       &                          = & \left \{     ?      ! Misplaced alignment tab character &.     l.287   w^{m}_{i}       & = &                              \left \{     ?      ! Misplaced alignment tab character &.     \reserved@a ->&                     & &     l.292           ?      ! Misplaced alignment tab character &.     \reserved@a ->& &                       &     l.292           ?      ! Misplaced alignment tab character &.     \reserved@a ->& & &          l.292           ?      ! Misplaced \cr.     \@@eqncr ...l \@eqnswtrue \global \@eqcnt \z@ \cr           l.292           ?      ! Misplaced \noalign.     \@xeqncr [#1]->\ifnum 0=`{\fi }\@@eqncr \noalign                                                       {\penalty \@eqpen \vskip \j...     l.292           ?      ! Missing $ inserted.     <inserted text>                      $     l.292           ?      ! Missing } inserted.     <inserted text>                      }     l.292           ?      ! Extra }, or forgotten \endgroup.     \@xeqncr ... \@eqpen \vskip \jot \vskip #1\relax }          l.292           ?      ! Missing $ inserted.     <inserted text>                      $     l.293   w^               {c}_{ij}      & = & \left \{     ?      ! Misplaced alignment tab character &.     l.293   w^{c}_{ij}      &                           = & \left \{     ?      ! Misplaced alignment tab character &.     l.293   w^{c}_{ij}      & = &                               \left \{     ?      ! Misplaced alignment tab character &.     \reserved@a ->&                     & &     l.298           ?      ! Misplaced alignment tab character &.     \reserved@a ->& &                       &     l.298           ?      ! Misplaced alignment tab character &.     \reserved@a ->& & &          l.298           ?      ! Misplaced \cr.     \@@eqncr ...l \@eqnswtrue \global \@eqcnt \z@ \cr           l.298           ?      ! Misplaced \noalign.     \@xeqncr [#1]->\ifnum 0=`{\fi }\@@eqncr \noalign                                                       {\penalty \@eqpen \vskip \j...     l.298           ?      ! Missing $ inserted.     <inserted text>                      $     l.298           ?      ! Missing } inserted.     <inserted text>                      }     l.298           ?      ! Extra }, or forgotten \endgroup.     \@xeqncr ... \@eqpen \vskip \jot \vskip #1\relax }          l.298           ?      ! Missing $ inserted.     <inserted text>                      $     l.299   \zeta                     & = & \sqrt{\frac{L}{1-w_{0}}}     ?      ! Misplaced alignment tab character &.     l.299   \zeta   &                      = & \sqrt{\frac{L}{1-w_{0}}}     ?      ! Misplaced alignment tab character &.     l.299   \zeta   & = &                          \sqrt{\frac{L}{1-w_{0}}}     ?      ! Misplaced alignment tab character &.     \reserved@a ->&                     & &     l.300 \end{eqnarray}          ?      ! Misplaced alignment tab character &.     \reserved@a ->& &                       &     l.300 \end{eqnarray}          ?      ! Misplaced alignment tab character &.     \reserved@a ->& & &          l.300 \end{eqnarray}          ?      ! Misplaced \cr.     \@@eqncr ...l \@eqnswtrue \global \@eqcnt \z@ \cr           l.300 \end{eqnarray}          ?      ! Extra }, or forgotten $.     \H@endeqnarray ->\@@eqncr \egroup                                        \global \advance \c@equation \m@ne $$\@ign...     l.300 \end{eqnarray}          ?      ! Missing $ inserted.     <inserted text>                      $     l.300 \end{eqnarray}


title: Is Texmate obsolete?

text: What is the status of the `texmate` package? Is it considered obsolete? Looking for samples I find only 2; one is the Manual, the other a 2-page example also by the author, Frederico Garcia. Neither compiles without error on a recent Miktex installation. I can compile both by commenting out offending code, however there seems to be a serious bug having to do with nested variations, first Level. On the other hand, the package seems to have nice features... `skak` seems to work. So should I stick to `skak`?


title: Figure location in the bottom of the document

text: In my paper the last page should contain reference only, but my figures keep popping in the last page. How can I force them not to appear in the last page / force the last page to consist of reference only?


title: Change language preference in TeXworks?

text: I have installed the MikTeX 64 bit version for Windows, but the interface of the TeXworks editor uses some foreign language. During installation, it did not ask me my language preference. Is there an option to get back to English, I cant find any option regarding the same.


title: No caption but entry in list of figures

text: Now, there are many 'solutions' for this problem on the internet, but they all seem a bit messy to me. Like for e.g. this one: Link to ' Community' Is there a proper solution for this? As this is something very common to do (for example if you have an image on your titlepage and you need it to show up in the list of figures, but you don't want a caption for aesthetical reasons), I think this question is not just pointless. Thanks for your help in advance.


title: Problem in alignment of equation using \begin{align} and \begin{split}

text: I was trying to align these equation but they are stretching out of the document. Even though I used \begin{split} it didn't work. I don't know why this is so?               \documentclass{article}     \usepackage{amsmath,amssymb}     \begin{document}     \begin{align}     \prod_1^{k + 1} (s - s_i)=(s - s_{k + 1}) (s^k - (\sum_1^k s_i)s^{k - 1} + (\sum_{1 \le i   < j \le k} s_i s_j) s^{k - 2} + r(s))      = s^{k + 1} - (\sum_1^k s_i)s^k + (\sum_{1 \le i < j \le k} s_i s_j) s^{k - 1} + s r(s)-  s_{k + 1} s^k+(\sum_1^k s_i s_{k + 1})s^{k - 1} - (\sum_{1 \le i < j \le k} s_i s_j s_{k + 1})  s^{k - 2} - s_{k + 1}r(s)     =s^{k + 1} -(\sum_1^{k + 1} s_i) s^k +  (\sum_{1 \le < j \le k + 1} s_i s_j) s^{k - 1}- (\sum_{1 \le i < j \le k} s_i s_j s_{k + 1}) s^{k - 2} + s r(s) - s_{k + 1} r(s).     \end{align}     \end{document}


title: Adding a list inside of a table

text: Basically i'm trying to add create this table : ![enter image description here](http://i.stack.imgur.com/h7c4P.jpg) But I'm stuck with the listing inside of a table! Here's my try even though it's nothing like this:               \begin{center}     \begin{tabular}{ |l|l|l|l| }     \hline     \multicolumn{4}{ |c| }{Résumé de l'identification} \\     \hline     Nom du cas  & \multicolumn{3}{|c|}{Ajouter un nouvelle page} \\ \hline     Objectifs  & \multicolumn{3}{|c|}{Ça consiste  à ajouter une nouvelle page avec un contenu statiques, } \\ \hline     Résumé  & \multicolumn{3}{|c|}{L'utilisateur doit ajouter un titre et un contenu grâce à un l'outil WYSIWYG\footnote{What You See Is What You Get} } \\ \hline     Acteur  & \multicolumn{3}{|c|}{Utilisateur} \\ \hline     \multicolumn{4}{ |c| }{Description d’enchainement} \\     \hline     \multicolumn{2}{|c|}{Préconditions }  & \multicolumn{2}{|c|}{Post-Conditions} \\ \hline     \multicolumn{2}{|c|}{L'utilisateur a le droit de créer autant de page qui lui est consacré par rapport a son pack}  & \multicolumn{2}{|c|}{La nouvelle page est ajouté à la base de données} \\ \hline     \multicolumn{4}{ |c| }{Scénario Principal} \\     \hline     \multicolumn{4}{ |c| }{     \begin{itemize}[topsep=0pt]           \item L'administrateur  remplit  le formulaire  et cliquez  sur le bouton  Ajouter           \item Le système  valide  les entrées     \item  Le système  enregistre  le nouvel  utilisateur  dans la base de données     \item Le système   redirige  l'administrateur  à la page de liste  des utilisateurs            \end{itemize}           } \\     \hline     \end{tabular}     \end{center}      Any help with this?


title: Can TikZ create pixel art images?

text: Can you create images like this: ![enter image description here](http://i.stack.imgur.com/VTUsI.png) when you have something like               0 = green (#54ff00)     1 = white (#ffffff)     2 = red   (#ff0000)     3 = blue  (#0048ff)          Image (Python list of integers defined above):     [[2,0,0,0,0,0,0],      [0,3,0,0,0,0,0],      [0,3,2,1,1,0,0],      [0,3,2,2,2,1,1],      [0,3,2,0,0,1,0],      [0,0,0,0,0,1,0],      [0,0,0,0,0,1,0]]      with TikZ? ## How far I got The following MWE defines all colors, produces a grid of the correct size (though the size is determined by hand):               \documentclass[varwidth=true, border=2pt]{standalone}     \usepackage{tikz}     \usepackage{xcolor}          \begin{document}         \newcommand\n{7}         \definecolor{green}{HTML}{54FF00}         \definecolor{wite}{HTML}{FFFFFF}         \definecolor{red}{HTML}{FF0000}         \definecolor{blue}{HTML}{0048FF}         \begin{tikzpicture}             \foreach \x in {1,...,\n}{                 \foreach \y in {1,...,\n}{                     \begin{scope}[shift={(\x,\y)}]                       \draw [fill=green] (0,0) rectangle (1,1);                     \end{scope}                 }             }         \end{tikzpicture}     \end{document}      Of course, I could simpy make a lot of adjusted                               \begin{scope}[shift={(\x,\y)}]                       \draw [fill=green] (0,0) rectangle (1,1);                     \end{scope}      but I've wondered if this can (with reasonable effort) be done in TikZ / LaTeX. My problem is giving TikZ the color array. I don't have any idea how to do this. I only know two types of looks in TikZ:               \foreach \x in {0,1,2,3,4,5}{...}     \foreach \number in {1,...,\n}{...}      I have never seen a nested over a 2D-array. All I have seen so far were 1D-Arrays of tuples (with fixed tuple size).


title: Space after float with [h]

text: this is my first time here, and I have this question: I'm writing my thesis, that includes many tables and figures in a `float` environment, with the caption at the end of it. I defined the space between the end of float's caption and the next paragraph. This works fine, but when I forced to stay when I tiped (with [h]), this space (between caption and next paragraph) is bigger. Of course, one of the items that will be evaluated, is the spaces (they all must be the same). So, my question is: How can I solve this? There is an example of the code I'm using: (TexShop —Mac Os 10.6.8)               \documentclass[letterpaper,12pt,oneside]{book}     \usepackage[spanish,es-lcroman]{babel}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[font=small,format=hang,parskip=1pt]{caption}     \usepackage{ctable}     \usepackage{float}     \raggedbottom     \begin{document}     \setlength{\textfloatsep}{10pt}      \setlength{\abovecaptionskip}{10pt}     \setlength{\belowcaptionskip}{5pt}     ...     \end{document}      * * * ![Image](http://i.stack.imgur.com/K9SLa.png)


title: Is it possible to make AUCTeX preview of equations work with beamer?

text: When I generate preview images (using `C-c C-p C-p`) for the following document, the images are correctly generated but they are placed in wrong places in the buffer. Is it just me or MS Windows users?               \documentclass{beamer}          \begin{document}     \begin{frame}       The \(a^2\) is now.            The \(b^2\) is now.     \end{frame}          \begin{frame}       The \(c^2\) is now.            The \(d^2\) is now.     \end{frame}     \end{document}      Is there a way to make AUCTeX preview compatible with beamer?


title: Using pgfplots, how do I arrange my data matrix for a surface plot so that each cell in the matrix is plotted as a square?

text: I have a matrix of size MxN and I want to make a surface plot directly from above so that each cell in the matrix is drawn as a square. None of the pgfplots shaders really do what I want, since they draw squares _between_ the cells of the matrix (i.e. a 3x3 matrix ends up as 2x2 cells when plotted). The example hopefully makes it clearer:               \documentclass{article}          \usepackage{fullpage}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{pgfplotstable}          \pgfplotstableread{             0 0 0             0 1 1             0 2 2                  1 0 3             1 1 4             1 2 5                  2 0 6             2 1 7             2 2 8     }\data          \begin{document}     \foreach \shader in {interp, flat, flat corner} {     \begin{tikzpicture}     \begin{axis}[             title={\texttt{\shader}},             title style={                     at={(0.5, 1.5)},                     anchor=north,             },             width=.3\linewidth,             view={0}{90},             colormap/hot2,             colorbar horizontal,             colorbar style={                     at={(0.5, 1.02)},                     anchor=south,                     xticklabel pos=upper,             },     ]     \addplot3 [surf, shader=\shader] table {\data};     \end{axis}     \end{tikzpicture}     }     \end{document}      ![enter image description here](http://imgur.com/mZaah.png)   How do I arrange my data so that each cell in the matrix is drawn as a separate cell in the output? **EDIT** : I realised after entering the question that the answer is very simple, so I'll just answer this myself.


title: pgfPlots color plots

text: So I would like to present data using a color plot subdivided into squares. For a large data set, it is easy to use a 3D plot with `surf`, however when there is not so much information, this does not work so nicely. Take for example:               \begin{tikzpicture}     \begin{axis}[view={0}{90}]         \addplot3 [surf]             coordinates {                 (0, 0, 1) (1, 0, 9) (2, 0, 3)                      (0, 1, 4) (1, 1, 5) (2, 1, 6)                      (0, 2, 7) (1, 2, 2) (2, 2, 9)};     \end{axis}     \end{tikzpicture}      ![Naive approach](http://i.stack.imgur.com/XCIu4.jpg) I have 9 data points, and 4 squares are displayed which reduces greatly the amount of data displayed. An alternative I thought of was to use square marks               \begin{tikzpicture}     \begin{axis}[view={0}{90}, enlargelimits=.3]         \addplot3 [scatter, mark=square*, mark size=24pt]             coordinates {                 (0, 0, 1) (1, 0, 9) (2, 0, 3)                      (0, 1, 4) (1, 1, 5) (2, 1, 6)                      (0, 2, 7) (1, 2, 2) (2, 2, 9)};     \end{axis}     \end{tikzpicture}      ![Using marks](http://i.stack.imgur.com/Y4Pwi.jpg) but the result is less than pleasing, and would require a lot of mucking around with the size of the marks. The only "alternative" is to use interpolation so that at the vertices the correct color is displayed               \begin{tikzpicture}     \begin{axis}[view={0}{90}]         \addplot3 [surf, shader=interp]             coordinates {                 (0, 0, 1) (1, 0, 9) (2, 0, 3)                      (0, 1, 4) (1, 1, 5) (2, 1, 6)                      (0, 2, 7) (1, 2, 2) (2, 2, 9)};     \end{axis}     \end{tikzpicture}          \begin{tikzpicture}     \begin{axis}[view={0}{90}]         \addplot3 [surf, shader=interp, patch type=bilinear]             coordinates {                 (0, 0, 1) (1, 0, 9) (2, 0, 3)                      (0, 1, 4) (1, 1, 5) (2, 1, 6)                      (0, 2, 7) (1, 2, 2) (2, 2, 9)};     \end{axis}     \end{tikzpicture}      ![Interpolation](http://i.stack.imgur.com/p06sb.jpg) But without the correct interpolation, looks ugly. Besides, it doesn't exactly fix the problem of displaying only 9 data points. So for small data sets, is there a way of plotting exactly the same number of squares as required?


title: Creating an enumerated list manually with appropriate indentation

text: I would like to have in my LaTeX document an enumerated list, but with the numbers inserted manually rather than automatically and in a chosen order. For example, if I do the following:               \documentclass[12pt,letter]{article}     \usepackage{enumerate}          \begin{document}     \begin{enumerate}[(1)]     \item This is an item on apples.     \item This is an item on oranges.     \end{enumerate}     \end{document}      then the output looks fine, except that I would now like to also be able to move the individual items around between different lists and keep the previous numbers. Another way to ask my question is that rather than use the enumerate package, I need to begin each item with a number such as (3) or (12) that I insert myself, and the paragraph I type thereafter in this item should be indented the same way it would be indented if I had used the enumerate package.


title: Deleting page with section title

text: I am trying to make a document that has a table of contents at the beginning of each section. Each line item in the table of contents is a scanned document, and so there is no reason to include a page ahead of it with the name of the section. Is there a way to "mute" the listing of the section, and to just have the table of contents refer to the page that the scanned document is on? Here's an example that shows the problem. Insert any old PDF to see the extra page generated in front of it:               \chapter{Chapter Title} \label{Chapter 1}     Introductory narrative (outside of any section).     \minitoc           \section{Section 1} \label{sec:section 1}          \includepdf[pages={1}]{pdfs/MyDoc.pdf}          \section{Section 2} \label{sec:section 2}          \includepdf[pages={1}]{pdfs/MyDoc2.pdf}


title: Math escape in listings and surround white space

text: I want to use the double right arrow for some Scala code in listings. I thought I'd use the mathescape option and `$\Rightarrow$`. However, this "eats" whitespace around it, e.g. if I have               foo  $\Rightarrow$  bar      only one space character is used in front and after the arrow, as if it were               foo $\Rightarrow$ bar      How do I enforce the whitespace? Could I embed the unicode character `\u21D2` for the arrow instead of using mathescape? * * * **EDIT** : So with the comments I managed to produce a math escaped command that has a width of exactly three space characters in the verbatim font:               \newcommand{\ScalaRA}{{}\hspace{-0.04ex}\Rightarrow\hspace{-0.08ex}{}}      _However_ , the problem of eating the white space is still there:               \begin{lstlisting}     abc d     g     j     a   d  $\ScalaRA$g  $\ScalaRA$j     a   def$\ScalaRA$ghi$\ScalaRA$j     \end{lstlisting}      In the second line, after using `$\ScalaRA$` for the first time, _subsequent_ whitespace is contracted: After the `g` character there are two spaces but it is rendered only as one space: ![enter image description here](http://i.stack.imgur.com/aKc7Q.png) So going in an out of the math mode leaves some "garbage" behind somehow. How to clean this up so that all three lines are perfectly aligned and the two space characters after `g` in the second line are respected?


title: Negative Sign and Matrix Alignment

text: I am having trouble centering the elements of a matrix such that the negative sign is not taken into account during alignment. Additionally, I would also like the space between the left parenthesis and the left edge of the leftmost column to equal to space between the right parenthesis and the right edge of the rightmost column. How would I typeset a matrix such that these visual constraints are satisfied? Here is a link to a document that describes the problem. The source follows below:               \documentclass[11pt,a4paper]{article}     \usepackage{amsmath}     \usepackage{mathtools}          \begin{document}          \noindent This document provides some examples of matrices for which I cannot     get the elements to line up as I would like.          \bigskip          \noindent\textbf{Example.} I would like the numbers in the matrix $A$ to be     centered, but I do not want the negative sign to cause numbers to be shifted. In     other words, I am looking for something along the lines of a ``center, but     ignore the negative sign'' environment. For example, consider the matrix     \[         A = \begin{pmatrix*}         -1 & -10 & 1 \\         100 & 5 & 16 \\         13 & 7 & 7         \end{pmatrix*}.     \]     One common suggestion I have read advises to instead use the array environment,     along with the right-align option. However, there are still problems. Consider     the matrices     \[         A = \left(\begin{array}{rrr}         -1 & -2 & -3 \\         4 & 5 & 6 \\         -7 & -8 & -9         \end{array}\right), \quad\text{and}\quad         B = \left(\begin{array}{rrr}         -1 & -10 & 1 \\         100 & 5 & 16 \\         13 & 7 & 7         \end{array}\right).     \]     Since the elements of $A$ are all single digits, the alignment is satisfactory. Using the right-alignment hack does not do much good for     matrix $B$, where the elements have different digit lengths.          \bigskip          \noindent How can I center the elements of a matrix so that the negative sign     does not have any influence on alignment, and so that the space between the left     parenthesis and left edge the leftmost column of numbers equals the space     between the right parenthesis and the right edge of the rightmost column of     numbers?          \end{document}      Thanks for your help!


title: How to include bib file in Tex

text: I need to submit my TeX file to journal but they request > Do not include a separate `.bib` file or `.bbl` file with your submission and > please run BibTeX before submitting your paper, and include (read-in) the > resulting .bbl file within the reference section of your paper If I upload a TeX file but not the `.pdf` file including the `.bib` results. How should I merge my `.bib` file with my TeX file ?


title: How do I put page numbers as sidenotes?

text: > **Possible Duplicate:**   >  Page numbers vertically centered in the outer page margin I'd like to put the number on the page on the margin, but at some distance from the top margin (possibly with the rules as well). This figure shows an example (from MS Word...: ![enter image description here](http://i.stack.imgur.com/UtRpX.png)


title: Get two short subtitles out of a too long title

text: Is there a way to get n shorter strings out of a long one in Latex? Let's say I have something like `\title{A very long title}` and I want it to be broken into two pieces such that I can later use `colorbox{red}{A very}` and `\color{blue}{long title}`. The break point should be calculated through a distance provided by the user.


title: Use full acronym name in TOC

text: I am trying to use `\acf` of the glossaries package in a `\section` command. In my TOC I always get displayed the id, not the content. The generated section in the document works fine. I was trying to use `\protect` but it doesn't work for me. Is there no possibility like with a glossary entry `\glsentryfirst`? Here my mini example:               \documentclass{scrartcl}          \usepackage[pdfdisplaydoctitle=true,%                      pdfstartview={Fit},%                      bookmarksopen,%                      colorlinks=true,%                      linkcolor=blue,%                      urlcolor=red,%                      citecolor=blue]%                      {hyperref}          \usepackage[nonumberlist,%                 acronym,%                 shortcuts, %                 toc,                 numberedsection]                 {glossaries}          \makeglossaries     \newacronym{pus}{PUS}{\protect\glsadd{glos:pus}\glshyperlink[Packet Utilisation Standard]{glos:pus}}     \newglossaryentry{glos:pus}{name=PUS,description={\acl{pus} \ldots}}          \begin{document}          \tableofcontents          \section[\glsentrylong{pus}]{\acl{pus}}     text     \ac{pus}          \newpage     \printglossary[type=\acronymtype]          \end{document}


title: How to dynamically set the row height of a table based on another adjacent table?

text: I have 2 tables side by side. Table 1 is dynamic and while table 2 is static (fixed content). I need to adjust the row height of table 2 which must be equal to total height of table 1 (like multirow) but I don't want to use multirow.                \documentclass{article}      \usepackage{subcaption}      \begin{document}      \begin{minipage}{0.8\linewidth}             \begin{tabular}{ | p{5cm} | p{1cm} | p{2.5cm} | }        \hline          A clear day with lots of sunshine.However, the strong breeze will bring down the temperatures & 2 & 3 \\[2cm]         \hline        A clear day with lots of sunshine. However, the strong breeze will bring down the temperatures & 5 & 6 \\[2cm]        \hline        A clear day with lots of sunshine. However, the strong breeze will bring down the temperatures & 8 & 9 \\[1cm]        \hline       \end{tabular}           \end{minipage}      \begin{minipage}{0.2\linewidth}                \begin{tabular}{ |p{5cm}| }      \hline       For columns that will contain text whose length exceeds the column's  width, it is recommended that you use the p attribute and specify the desired  width of the column (although it may take some trial-and-error to get the result  you want). \\[5cm]      \hline      \end{tabular}      \end{minipage}      \end{document}      ![enter image description here](http://i.stack.imgur.com/pfuRJ.png) How can I implement this?


title: lstlisting: how to align highlighted code

text: I want to define a couple of new commands in order to highlight parts of my code (this is actually for a trace dump, not for a programming language). My problem is that I can't seem to make the colored text align properly with the listings text. See the "Hello worlds". I've tried adding `\ttfamily` to the new command definition but it didn't help. Also tried different font sizes and I believe both colored and non- colored text font are the same size so I don't think that is the problem.               \documentclass{article}          \usepackage{listings}     \lstset{       basicstyle=\ttfamily\large,       breakatwhitespace=false,       breaklines=true,       escapeinside={\%*}{*},     }          \usepackage{color}     \definecolor{mycolorGreenOne}{rgb}{0, 0.7, 0}     \newcommand*{\listingsHigh}[1]{\textcolor{red}{#1}}     \newcommand*{\LighthighOne}{\color{cyan}}          \begin{document}     \begin{lstlisting}     My text: %*\LighthighOne Hello world!* Goodbye!     My text: Hello world! Goodbye!     My text: %*\listingsHigh{Hello world!}* Goodbye!     \end{lstlisting}     \end{document}


title: Is it safe to place part of texmf-local under git?

text: Are there any problems with placing parts (or all) of texmf-local under Git source control? Git places a hidden directory in the folders it manages. Are there issues caused by doing this; would doing so bother any of the TeX configuration tools.


title: Retrieve length of a character

text: I'm creating a custom command which basically prints an horizontal line, a character and another horizontal line. The code would be               \newcommand{\breaknote}{\noindent\rule[.5ex]{.5\textwidth}{.4pt}\S\rule[.5ex]{.5\textwidth}{.4pt}}      Obviously, this goes further than the text margins, throwing a `Overful \hbox` error. The question is: is there a way to get the width of a **single** character and then use this number or store it in a variable like, say, `\charwidth`? What I want to achieve is something similar to               \newcommand{\breaknote}{\noindent\rule[.5ex]{.5\textwidth - .5\charwidth}{.4pt}\S\rule[.5ex]{.5\textwidth - .5\charwidth}{.4pt}}      This way it would fit like a charm. I am aware that I could look at the error string and get from there the actual text overflow (in pts) thus reading the character length but I was wondering if there's something cleaner.


title: How to reference a patent with BibTeX?

text: What is the best entity to use with BibTeX in order to reference a patent or patent application?


title: Option Clash for Hyperref Package

text: Hi friends i am beginner to Latex. when i run this code i am getting the error "! LaTeX Error: Option clash for package hyperref." Here is the code:               \documentclass[11pt,a4paper]{moderncv}     \moderncvtheme[green]{classic}              \usepackage[scale=0.8]{geometry}     \AtBeginDocument{\recomputelengths}           \firstname{Rob}     \familyname{Ward}     \mobile{mobile +64 21 0377 936}                        \phone{phone +64 6 212 0549}                           \email{contact@robward.co.nz}                           \homepage{www.robward.co.nz}                          \usepackage[pdftex,                 pdfauthor={Rob Ward},                 pdftitle={CV for Rob Ward},                 pdfsubject={Detailed CV for Rob},                                    urlcolor={blue}]{hyperref}          \begin{document}          % EDUCATION     \section{Education}     \cventry{2006--2011}{PhD physics/biophysics}{Massey University}{Palmerston North}{New Zealand}{}  % arguments 3 to 6 can be left empty     \cventry{1999--2004}{BSc (hons.) physics}{Victoria University}{Wellington}{New Zealand}{}     \cventry{1999--2002}{BSc mathematics}{Victoria University}{Wellington}{New Zealand}{}     \cventry{1988--1989}{NCEE}{Central Institute of Technology}{Wellington}{New Zealand}{}          \end{document}


title: Customizing preview-latex command to use LaTeX when in TeX-Pdf mode

text: In short: Is there a way to tell `preview-latex` to _NOT_ use `pdflatex` instead of just toggling `TeX-Pdf` mode every time I want to re-generate previews? I have a somewhat odd setup. AucTeX + GNU Emacs 24 on Mac OSX 10.6.8, operating with Skim as my pdf viewer. I am using a makefile for document compilation that calls `latex` \+ `bibtex` \+ `simpdftex` to generate a PDF with synctex enabled. (I use `psfrag` and `.eps` files which is why `latex` is used instead of `pdflatex`). When Auctex is in `TeX-Pdf` mode (`C-c C-t C-p`) I can use synctex for forward and inverse search and `C-c C-c` and a `Make` command for quick compilation. (Without being in `TeX-Pdf` mode, forward-seach (`C-c C-v`) stops with a `.dvi` not found error) So far, everything works great, as expected. However, preview-latex doesn't like this setup. When in `TeX-Pdf` mode, `preview-latex` wants to use `pdflatex` as the compilation command, but this doesn't work with my document and errors with a no images found. If I turn off `TeX-Pdf` mode, re-run `preview-latex` (`C-c C-p C-d`), PNGs are created and correctly placed in the document. The Preview LaTeX Command customization option seems to be specifically related to what is inserted into the tex document and not the external compilation tool.


title: Show output of a full LaTeX document

text: A couple of days ago, I found `showexpl`, it is wonderful and works very well. But there is one thing missing that it doesn't let me do and it is to only show the output/result of some commands. For little commands, there are no problems, a `minipage` inside an `fbox` works well, but for displaying titles and sections without affecting the number count in the document I have no idea how to do (except by embedded an image of the rendered document, which isn't that great of an idea). For an example of what I am saying, I saw this a while ago while reading this tutorial (on page 4 there is an example of a document): https://dataninja.files.wordpress.com/2008/09/texpert2.pdf


title: No symbols inside a multilevel numbered list in Lyx

text: I have some numbered lists in Lyx with 4 levels of indentation. On the first level there are numbers (1,2,3,....), on the second small letters ( (a),(b),(c),...), then Roman numbers (i, ii, iii,...) then capital letters (A,B,C,...). I would like to remove all the symbols (letters, Roman numbers...) from the 2nd level on, or to substitute them with an unique symbol, such as "-". Is it possible to do so in Lyx?


title: No room for a new \count with datatool

text: > **This question led to a new feature in a package:**   >  `datatool` * * * ## Update: 2013-1-19 The MWE worked fines with the new (v2.13) version of the `datatool` package using `\DTLnewdbonloadfalse`. But in my actual usage I am getting the message: > Runaway argument? \db@plist@elt@w \db@col@id@w 1\db@col@id@end@ \db@key@id@w > Chapter\db@key@id@end@ \ETC. > > ! File ended while scanning use of \@dtl@get@keydata. after approximately 16172 DB `\DTLloaddb` \-- approximate as I am only counting the DB's that are _repeatedly_ loaded. Will try to create a MWE for this, but in case it is obvious to someone else what the problem is I thought I'd add this information while I try to get to the bottom of this. * * * ## Background: I am generating a document which tracks the progress on components of a project consisting of a large number of files. For _each_ of these files, a tiny DB is generated and read via the `datatool` package. This DB contains a list of the related files and and where they were found, and what types of files they were. Although this is not related to the MWE below, here is a small excerpt from the output to illustrate what I am actually trying to achieve: ![enter image description here](http://i.stack.imgur.com/sSQLg.png) from which I can tell that file   * 15-4-34 has some progress (shown in blue text)   * 15-4-35 and 15-4-36 has significant progress (highlighted).   * 15-4-37 has had _no progress_ at all (shown in red) Each of these are links to the files so I can just click on them to open them to view, and I can tell which team member has made progress. At the end of the document I produce a summary report so I know how far along I am into the project. There is a bunch of other info that is captured as well, but this should be sufficient to give an idea as to the actual use case. The list of associated files is contained in two small CSV files that are generated at run time, for each component of the project. For instance, if a `.tex` file exists, I would then check that there was a corresponding PDF, and if any associated figures were completed, or if there was a `\todonote` in the `.tex` file which indicated that that this file was still not complete, etc.. ## Problem: While processing this document, I received the following error message: > >     No room for a new \count . >   >     \et@xchk ...lse \errmessage {No room for a new #2} >   As per egreg's answer at the first reference listed below, three are two potential causes for this:   1. Too many packages   2. A programming error, such as saying `\newdimen` inside the definition of a command.  After thoroughly searching my code for such _programming errors_ , I determined that the culprit is the `datatool` package which declares a `\newcount` within `\DTLnewdb`:               \newcommand*{\DTLnewdb}[1]{%       \DTLifdbexists{#1}%       {%          \PackageError{datatool}{Database `#1' already exists}{}%       }%       {%         \dtl@message{Creating database `#1'}%         \expandafter\newtoks\csname dtldb@#1\endcsname         \expandafter\newtoks\csname dtlkeys@#1\endcsname{}%         \expandafter\newcount\csname dtlrows@#1\endcsname         \expandafter\newcount\csname dtlcols@#1\endcsname       }%     }      It appears to release these in `\DTLdeletedb` as follows:                   \expandafter\let\csname dtlrows@#1\endcsname\undefined         \expandafter\let\csname dtlcols@#1\endcsname\undefined      However, it appears that this is not really having the desired effect of returning the counter back to the available list of counters for subsequent use as the MWE illustrates. ## Notes:   * The MWE needs the file `MyData.csv`. However, I commented out `\usepackage{filecontents}` to prevent overwriting of this file to prevent accidental deletion.   * The output of the MWE below is not important, just there so a PDF gets created. ## Question:   * Is there a workaround for this, or perhaps a better way of using the `datatool` pacakge for such a thing? ## References:   * No room for a new \dimen   * ! No room for a new \count . with showidx package ## Code:               \documentclass{article}     \usepackage{datatool}     \usepackage{pgffor}          %\usepackage{filecontents}% Commented to prevent overwriting MyData.csv     \begin{filecontents*}{MyData.csv}         Directory, Color         ../dirB,    red         ../dirC,    yellow     \end{filecontents*}          \begin{document}          \foreach \x in {1,...,10000} {%             Read DB numerous times         \DTLifdbexists{MyDB}{\DTLdeletedb{MyDB}}{}%         \DTLloadrawdb[keys={Directory,Color}]{MyDB}{MyData.csv}%     }%          \par\noindent\DTLdisplaydb{MyDB}%           Some output to have a PDF          \foreach \x in {1,...,10000} {%             Read DB numerous times         \typeout{count=\x}%         \DTLifdbexists{MyDB}{\DTLdeletedb{MyDB}}{}%         \DTLloadrawdb[keys={Directory,Color}]{MyDB}{MyData.csv}%     }%          \end{document}


title: lualatex keeps tex source open on error

text: I edit `LaTeX` source in emacs and invoke `lualatex` with `compile-command`. If the source contains an error the compilation stops and I see the reason in the `*compilation*` buffer. When I go to fix the error, emacs tells me I can't save the source file. It seems as if lualatex keeps it open. If I kill the compilation I can proceed. The environment is MikTex 2.9, GNU Emacs 24.2, Windows 7. This does not happen with pdflatex. Any suggestions, other than changing my workflow?


title: Where to find the documentation to beamer elements?

text: I am on the way to create/customize a beamer template. Therefore I read the relevant chapters in the beameruserguide. I think I understood the basic idea behind the theme setup and the use of the `\setbeamer***{}{}` commands. There is always spoken of `some beamer element`. Yes, there are some examples, what could be used as these elements, but I do not see a list of all relevant elements reachable by default. Also some commands seems not to be documented in the user manual (I did not find for example `\beamertemplatenavigationsymbolsempty`). Where are such things documented or is there only a learning by doing way to understand things (in dozens of years)?


title: glossaries alternative text

text: \documentclass{article}          \usepackage{hyperref}          \usepackage{glossaries}          \newglossaryentry{solve}{name={solve},description={to find an answer}}          \makeglossary     \begin{document}          You can \gls{solve} an equation if a      solution          % HERE      exists          \printglossaries          \end{document}      I need to link "solution" to `\gls{solve}` despite different spelling. I assumed `\gls[<alternate text>]{<label>}` exist but it does not.