title: Stereographic Projections

text: Take the unit sphere in the three dimensional space. A plane through the half of the sphere perpendicular to the vertical axis. Pick a point in the plane and draw the line which joins it with the north pole of the sphere. The intersection of this line with the sphere is the stereographic image of that point of the plane (this identifies each point in the plane with each point of the sphere except the north pole. "Stereographic image" is used in both directions. Context allow us to deduce if we go from the plane to the sphere or the other way around, at least as far as I've seen). Just as in the figure: ![Riemann Sphere](http://i.stack.imgur.com/6zeHc.jpg) Thinking in the plane as the complex plane, I'll refer to its points as ordered pairs (x,y). It will be nice to have some useful way to put images related with stereographic projections in our documents. Particularly, I'm interested in:   * Given the coordinates (x,y) of a point in the plane, get the stereographic image on that point in the sphere, i.e. draw the point in the plane, draw the corresponding point in the sphere and optionally draw the line which joins (x,y) with the north pole.   * Given a circle in the plane (i.e. its center and its radius) get its stereographic image in the sphere, and optionally perhaps the lines which joins the north pole with two diametrically opposite points of the circle in the plane. This in order to "appreciate" the projection. The last one can be hard, because depending on the point of view and of the circle, its spherical image might be seen as a segment which makes littles sense. This is used in technical drawing, however I'm not aware of any package or TeX (that is tikz, pstricks, metapost,...) way of achieve this. So my question is: **How can we achieve this?**


title: Is there a both bold and slanted Computer Modern typeface?

text: Note: the font has to be loaded in plain TeX with `\font\bs=<nome_font>`


title: Folding file-specific macros in AUCTeX

text: What is the best way to have AUCTeX fold some math macros specifically for one file? For example in this very trivial example:               \documentclass{minimal}     \newcommand{\foo}{\lambda}     \begin{document}     $\foo$     \end{document}      I would like to tell AUCTeX that in this document and this document only, the fold commands (`C-c C-o C-b` and the such) should fold the macro \foo in math mode to the string "λ". I tried adding the following to the file:               % Local Variables:     % eval: (add-to-list 'LaTeX-fold-math-spec-list '("λ" ("foo")))     % End:      But it didn't work. First the change was permanent, ie. not local to this file, and second the code was evaluated after the fold-mode was activated, and therefore I needed to reload the file to see the effect.


title: How to get the relative node distance from a node to another?

text: I want to draw a big block with several small blocks, which is outside but adhere to the big one, as my picture showed below. I have no idea how to set "node distance" relatively based on big block's width and height. please help on that. my output: ![enter image description here](http://i.stack.imgur.com/L7jrR.png) my expectation: I would like the two blocks in same horizon level, and the small one will adhere to big one. ![enter image description here](http://i.stack.imgur.com/9b6bq.png)               \documentclass{article}     \usepackage[a4paper,landscape]{geometry}     \usepackage{fontspec}     \setmainfont[Scale=0.9]{Verdana}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}     \begin{document}     \pagestyle{empty}          \tikzstyle{big} = [rectangle,draw,fill=blue!20,text width = 5em,text centered,minimum width=6em,minimum height=8em]     \tikzstyle{small} = [rectangle,draw,fill=green!40,text width=0.8em, text centered,minimum height = 1em]          \begin{tikzpicture}       \node [big] (in1) {1st instance};       \node [small, above right of=in1] (port1) {1};     \end{tikzpicture}          \end{document}


title: Produce 2 side-by-side tables from tables as external files (source: xtable in R)

text: Is it possible to put two tables next to each other, which are in separate .tex files, and added to the document via `\input`? If it's not, I could also create just the 'raw' contents of the tables, i.e. just the rows and columns by using the `content.only` command of xtable. Assume I got the following table **TWO times** , saved as two separate tex files:               \begin{table}     \begin{tabular}{lYY}     \toprule      & \multicolumn{1}{c}{$N_1$} &      \multicolumn{1}{c}{$N_2$} \\     \midrule      \multicolumn{1}{l}{$S_1$} &  0.14 & -1.243 \\      \multicolumn{1}{l}{$S_2$} &  0.217 &  4.132 \\      \multicolumn{1}{l}{$S_3$} &  7.350 & -9.913 \\      \multicolumn{1}{l}{$S_4$} & 0.132 & 6.664 \\      \bottomrule      \end{tabular}     \end{table}      Can I put these next to each other by using `input`? I know you need to utilize the `minipage` environment somehow, but I don't know if this works in combination with include. I could not make it work in some tests. If include doesn't work, I might create just the content to put it inside the minipage environment at the right positions. Either way, please help me with the code. Thanks!


title: Why does \let\oldindex not work in this code?

text: > This is a follow-up question to: How to make indexed words clickable in the > text? I'm having two problems with the code given by @Stephen.   1. If I use the following code to redefine the `\index` command, the link to the entry in the Index, will not work with **`xindy`**              \let\oldindex\index     \renewcommand*{\index}[1]{\oldindex{#1@\protect\hypertarget{#1.ind}{}#1}\href{\##1.ind}{#1}}        2. My index entries with subentries (e.g. `\index{foo!bar}`) could not be used this way.  BTW, my document is in Persian which is an RTL language. **Edit:**   Here is the code which I'm having problem with it:               \documentclass{article}     \usepackage{makeidx}     \makeindex     \usepackage{hyperref}          \let\oldindex\index     \renewcommand*{\index}[1]{\oldindex{#1@\protect\hypertarget{#1.ind}{}#1}\href{\##1.ind}{#1}}          \begin{document}     test \index{test}% problem 1     \index{foo!bar}% problem 2          \printindex     \end{document}


title: Adding units to pgfplotstable header

text: I am plotting a table using a semicolon separated `.csv` file and `pgfplotstable`. The table shows up fine, but i need to have units within the head of the table. like this: ![enter image description here](http://i.stack.imgur.com/IsjNc.png) what I have looks like this: ![enter image description here](http://i.stack.imgur.com/iuJaS.png) How can i add those mesurments to my header? MWE               \documentclass[a5paper]{article}     \usepackage{pgfplotstable}      \usepackage{booktabs}      \usepackage{filecontents}     \usepackage{longtable}     \usepackage[allowlitunits]{siunitx}     \begin{filecontents}{test.dat}             Zeit;100;90;80;70;60;50;40;30;20;10             0;0.195;0.156;0.13;0.155;0.107;0.94;0.74;0.43;0.46;0.03             15;0.219;0.171;0.157;0.147;0.125;0.106;0.96;0.09;0.64;0.45             30;0.237;0.189;0.177;0.168;0.138;0.12;0.113;0.108;0.75;0.57             45;0.265;0.208;0.197;0.192;0.16;0.141;0.132;0.126;0.95;0.75             60;0.296;0.228;0.217;0.221;0.182;0.16;0.151;0.148;0.108;0.82             75;0.317;0.249;0.239;0.248;0.206;0.177;0.171;0.164;0.125;0.95             90;0.344;0.271;0.265;0.271;0.232;0.197;0.192;0.185;0.142;0.108             105;0.404;0.293;0.286;0.297;0.259;0.217;0.214;0.206;0.165;0.122             120;0.433;0.316;0.304;0.323;0.281;0.241;0.236;0.237;0.181;0.136             135;0.447;0.339;0.326;0.354;0.312;0.268;0.264;0.255;0.2;0.151             150;0.473;0.363;0.352;0.383;0.334;0.285;0.283;0.273;0.219;0.166             165;0.489;0.387;0.376;0.411;0.365;0.308;0.307;0.296;0.24;0.181             180;0.526;0.412;0.401;0.443;0.386;0.331;0.331;0.32;0.267;0.193             195;0.59;0.438;0.425;0.48;0.414;0.353;0.357;0.344;0.284;0.212             210;0.634;0.464;0.45;0.504;0.443;0.375;0.382;0.368;0.305;0.225             225;0.684;0.49;0.476;0.537;0.476;0.405;0.408;0.383;0.327;0.237             240;0.704;0.517;0.505;0.57;0.499;0.438;0.435;0.418;0.35;0.26             255;0.739;0.544;0.534;0.604;0.527;0.465;0.461;0.444;0.377;0.277             270;0.758;0.577;0.558;0.638;0.557;0.493;0.489;0.472;0.395;0.294             285;0.809;0.599;0.586;0.671;0.588;0.527;0.51;0.505;0.424;0.31             300;0.858;0.627;0.615;0.703;0.618;0.557;0.543;0.538;0.442;0.327                  \end{filecontents}     \begin{document}                   \pgfplotstableset{             begin table=\begin{longtable},                 end table=\end{longtable},         }              \pgfplotstabletypeset[col sep=semicolon,         header=true,             columns/Zeit/.style={fixed,fixed ,column type=r},         columns/100/.style={fixed,fixed zerofill,precision=3,column type=c},         columns/90/.style={fixed,fixed zerofill,precision=3,column type=c},         columns/80/.style={fixed,fixed zerofill,precision=3,column type=c},         columns/70/.style={fixed,fixed zerofill,precision=3,column type=c},         columns/60/.style={fixed,fixed zerofill,precision=3,column type=c},         columns/50/.style={fixed,fixed zerofill,precision=3,column type=c},          columns/40/.style={fixed,fixed zerofill,precision=3,column type=c},         columns/30/.style={fixed,fixed zerofill,precision=3,column type=c},         columns/20/.style={fixed,fixed zerofill,precision=3,column type=c},          columns/10/.style={fixed,fixed zerofill,precision=3,column type=c},              every head row/.style={before row=\toprule, after row=\midrule\endhead},          every last row/.style={after row=\bottomrule}         ]{test.dat}          \end{document}


title: Setting camera projection angle in tikz to enhance the depth perception when drawing 3D figures

text: First please see the following example using MATLAB drawing command                >>surf(membrane);      We can adjust the camera angle using MATLAB's built-in command `camproj`, the effects are as follows: ![ortho](http://i.stack.imgur.com/AYFLf.png) ![persp2](http://i.stack.imgur.com/5ePHQ.png) It is like the effect of adjusting the camera angle in Paraview, not just adjust the viewpoint's polar angle and azimuthal angle. This is more like human's visual perception whereas the farther the object is from our viewpoint, the smaller that object appears. For example, for the following figure:               \documentclass{minimal}     \usepackage{tikz,tikz-3dplot}         \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}     \setlength\PreviewBorder{2mm}          \begin{document}     \tdplotsetmaincoords{70}{200}     \begin{tikzpicture}[scale = 2.5,thick,tdplot_main_coords]     \coordinate (A1) at (0,0,0);     \coordinate (A2) at (2,0,0);     \coordinate (A3) at (2,2,0);     \coordinate (A4) at (0,2,0);          \coordinate (S) at (0.5,0.5,0);     \coordinate (E) at (0.5,3,1.5);     \coordinate (P) at (1.15,1.15,0);     \fill[fill=blue!20] (A1) -- (A2) -- (A3)  -- (A4) -- cycle;     \draw[black, -latex] (S) -- (E);     \draw[black!80, -latex] (S) -- (P);     \draw[black!50,dashed] (E) -- (P);     \node[above] at (E) {$\mathbf{v}$};     \node[below] at (P) {$\mathrm{Proj}_H\mathbf{v}$};          \draw[red!70] (2,2.3,1.2) node[above]       {Projection using inner product} to [out=-90,in=180] ($0.5*($(E)+(P)$)$);           \draw[red!70] (2.3,2.3,0.4) node[above]       {Hilbert space H} to [out=-90,in=90] ($(A3)+(-0.2,-0.2,0)$);      \end{tikzpicture}           \end{document}      Above is a figure I drew sometime ago for a presentation: ![proj](http://i.stack.imgur.com/4gRG3.png) Despite the fact that `\tdplotsetmaincoords` being used to set the camera viewing angle, the picture still does not look like that it is in a real 3d space. It does not have any depth perspective effect like the first staircase picture in the Wikipedia entry of perspective, the parallelogram above should not appear as a parallelogram to our visual perception. I looked in the documents of `tikz-3dplot`, `\tdplotsetmaincoords` is rather a trick of setting camera angle using coordinate transformation, not a real camera angle setting. So my question is: Is there any trick or tweaking to set the camera projection in tikz so that the 3d figure looks we are observing it in a real perspective?


title: Change caption in table from Table 2 to Table 1A

text: I have this code:               \documentclass[12pt]{article}          \begin {document}          \begin{table}[h!b!p!]     \caption{This caption describes contents of Table 1, gives the big picture.}     \caption {Describe contents of Table 1.A}     \begin{tabular}{|c|c|c|c|c|c|}          \hline     Recom Strength & Highest Idos Risk & 2nd Highest & Middle & 2nd Lowest & Lowest\\     \hline     1 & -0.41 & -0.07 & 1.27 & -0.78 & 0.73\\     \hline     2 & -0.85 & -1.88 & 0.01 & 0.75 & 2.32\\     \hline     3 & -0.48 & -1.0 & -0.56 & 0.47 & 1.01\\     \hline     4 & 0.04 & 0.76 & 1.34 & 1.78 & -1.27\\     \hline     5 & -1.35 & -1.52 & 0.04 & 1.23 & 0.51\\     \hline     \end{tabular}          \caption{Describe contents of Table 1.B}          \begin{tabular}{|c|c|c|c|c|c|}           \hline     Recom Strength & Highest Idos Risk & 2nd Highest & Middle & 2nd Lowest & Lowest\\     \hline     1 & -0.41 & -0.07 & 1.27 & -0.78 & 0.73\\     \hline     2 & -0.85 & -1.88 & 0.01 & 0.75 & 2.32\\     \hline     3 & -0.48 & -1.0 & -0.56 & 0.47 & 1.01\\     \hline     4 & 0.04 & 0.76 & 1.34 & 1.78 & -1.27\\     \hline     5 & -1.35 & -1.52 & 0.04 & 1.23 & 0.51\\     \hline     \end{tabular}               \label{Test Table}     \end{table}               \end {document}      And it produces the following output: ![screenshot](http://i.stack.imgur.com/LmO8D.png) I would like the lines that say: > Table 2: Describe contents of Table 1.A to say: > Table 1.A: Describe contents of Table 1.A and similarly, I want > Table 3: Describe contents of Table 1.B to say > Table 1.B: Describe contents of Table 1.B Essentially, if I could get rid of Latex automatically inserting "Table 1" or "Table 2" in every caption that I create, I would solve my problem. It would also be nice if I could have my captions for Table 1.A and Table 1.B left aligned, like caption for Table 1 is. How can I do this? Thank You in Advance


title: How to fix to force text to split in table?

text: I have a simple table in LibreOffice calc and I tried to convert it to latex using the Calc2Latex macro. Then using Latex I tried to improve it. However I cannot get the text correctly ! This is what I want the text to be like in the table: ![enter image description here](http://i.stack.imgur.com/eXKgu.png) For example, in the first column, "Message per minute per source" is divided. However, in my latex generated table, that does not happen! It is all a big mess: ![enter image description here](http://i.stack.imgur.com/ZV4AZ.png) I tried fixing the problem using `tabularx` and I read somewhere that I should not use `multicolumn`, but I am still a newbie and I do not know how to fix this! Here is my MWE:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{microtype}     \usepackage[margin=2.54cm]{geometry}     \usepackage{graphicx,booktabs,tabularx}     \usepackage[table]{xcolor}     \usepackage{array}          %define some nice colors     \definecolor{middleware_green}{RGB}{82, 119, 17}     \definecolor{middleware_white}{RGB}{255, 255, 255}     \definecolor{middleware_light_gray}{RGB}{239, 239, 239}     \definecolor{middleware_dark_gray}{RGB}{153, 153, 153}          \renewcommand{\tabularxcolumn}[1]{>{\small}m{#1}}     \newcolumntype{F}{|>{\leavevmode\ignorespaces\raggedright\sffamily\bfseries}p{2.5cm}}%     \newcolumntype{R}{|>{\leavevmode\ignorespaces\raggedright\arraybackslash\sffamily}X}%     \newcolumntype{L}{|>{\leavevmode\ignorespaces\raggedleft\arraybackslash\sffamily}X}%     \newcolumntype{C}{|>{\leavevmode\ignorespaces\centering\arraybackslash\sffamily}X|}%     \rowcolors{2}{middleware_white}{middleware_light_gray}          \begin{document}          \begin{table}[htbp]          \begin{tabularx}{\textwidth}{|R|L|L|L|}     \hline\rowcolor{middleware_green}     \multicolumn{ 4}{|c|}{\textcolor{white}{\textbf{1 Source, 1 Session, 1 Client, Exp0}}} \\ \hline     \multicolumn{1}{|c|}{\textbf{Messages per minute per source}} & \multicolumn{1}{c|}{\textbf{Middleware Exec Time (s)}} & \multicolumn{1}{c|}{\textbf{Delay (s)}} & \multicolumn{1}{c|}{\textbf{Average Delay (s)}} \\ \hline     \multicolumn{ 1}{|r|}{60} & 60 & 0 & \multicolumn{ 1}{r|}{0.00} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 60 & 0 & \multicolumn{ 1}{l|}{} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 60 & 0 & \multicolumn{ 1}{l|}{} \\ \hline     \multicolumn{ 1}{|r|}{120} & 60 & 0 & \multicolumn{ 1}{r|}{0.00} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 60 & 0 & \multicolumn{ 1}{l|}{} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 60 & 0 & \multicolumn{ 1}{l|}{} \\ \hline     \multicolumn{ 1}{|r|}{240} & 60 & 0 & \multicolumn{ 1}{r|}{0.00} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 60 & 0 & \multicolumn{ 1}{l|}{} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 60 & 0 & \multicolumn{ 1}{l|}{} \\ \hline     \multicolumn{ 1}{|r|}{480} & 69 & 9 & \multicolumn{ 1}{r|}{16.67} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 69 & 9 & \multicolumn{ 1}{l|}{} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 92 & 32 & \multicolumn{ 1}{l|}{} \\ \hline     \multicolumn{ 1}{|r|}{1000} & 159 & 99 & \multicolumn{ 1}{r|}{109.67} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 173 & 113 & \multicolumn{ 1}{l|}{} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 177 & 117 & \multicolumn{ 1}{l|}{} \\ \hline     \multicolumn{ 1}{|r|}{2000} & 391 & 331 & \multicolumn{ 1}{r|}{311.00} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 383 & 323 & \multicolumn{ 1}{l|}{} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 339 & 279 & \multicolumn{ 1}{l|}{} \\ \hline     \multicolumn{ 1}{|r|}{4000} & 561 & 501 & \multicolumn{ 1}{r|}{512.33} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 631 & 501 & \multicolumn{ 1}{l|}{} \\ \cline{ 2- 3}     \multicolumn{ 1}{|l|}{} & 595 & 535 & \multicolumn{ 1}{l|}{} \\ \hline     \end{tabularx}          \label{}     \caption{}     \end{table}               \end{document}      The main reason i want to make the columns smaller is so they can take less space and so hopefully I can put some text next to them or put 2 tables one next to another !


title: TXC compiles document and opens PDF and hangs

text: Editor : TXC 2.0 b2 sumatra 2.3.2 I can compile the document without any errors. but after compilation, the TXC opens the sumatra and gets stuck. I have to force terminate the programs. But the PDF file generated is correct and found in the folder. I just am not able to do build and view it in sumatra.               \documentclass{article}     \usepackage{graphicx}          \begin{document}          \title{Introduction to \LaTeX{}}     \author{Author's Name}          \maketitle          \begin{abstract}     The abstract text goes here.     \end{abstract}          \section{Introduction}     Here is the text of your introduction.          \begin{equation}     \label{simple_equation}     \alpha = \sqrt{ \beta }     \end{equation}          \subsection{Subsection Heading Here}     Write your subsection text here.               \section{Conclusion}     Write your conclusion here.          \end{document}


title: Footer for fancy report format

text: Currently, I am preparing a document where my song lyrics are written on. I found a nice chapter style after some search on the internet. However, it needs some modification. I want to add a footer (a box to write the date of songs which is different for each song) to the most bottom left corner of my document, but only for the chapter pages. Here is my minimal example:               \documentclass[12pt]{report}       %Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup       \usepackage[Bjornstrup]{fncychap}       \usepackage[utf8x]{inputenc}       \usepackage[turkish]{babel}              \begin{document}       \title{Hayatım...}      % type title between braces       \author{Rıza Bayoğlu}   % type author(s) between braces       \date{-}    % type date between braces       \maketitle       \tableofcontents            \chapter{Bekleyiş}            Yine uzun bir bekleyiş\\       Sonsuzluğa doğru\\       Kanat açmış uçarken\\       Yine sabah oldu.     \end{document}      By the way, how can I change page number location to the bottom right side instead of placing it at the middle with a font size greater than the text?


title: LuaLaTeX: german special character ß with `newpxtext`

text: I use the font Palatino from the package `newpxtext` in combination with LuaLaTeX. With this package it is not possible to set the german special character `ß` directly:               % Magic comments for TeXstudio     % !TeX spellcheck = de_DE     % !TeX program = lualatex          \documentclass{scrartcl}          %\usepackage{fontspec}     % Font: Palatino     \usepackage{newpxtext}          \begin{document}          Draußen währt am längsten.          Drau\ss en währt am längsten.          \end{document}      The result from the MWE is: `DrauSSen währt am längsten.`. It works when I switch to `fontspec`. How is it possible to use the sign `ß` instead of `\ss` to set a text?


title: Is there likely to be an xpsTeX?

text: The 2007 TUG April Fools' announcement was pretty funny, but does this idea have any traction whatsoever? From a design point of view, XPS may be the starting point for future document formats beyond PDF (XML-based instead of binary, to my understanding), and is also internationally standardized. I understand XPS itself may not have enough traction as a document format and may not warrant the effort of creating such an engine, but perhaps someone has already written one out of curiosity (or at least something of a dvi2xps). * * * I keep thinking to myself that this may be too soft a question as it stands, so here's a stab at a more concrete one: > Is the document format of XPS robust enough to handle everything that TeX > can offer, especially considering the features we've come to know and love > with pdfTeX?   >  Does TeX as an open source project still have the developmental masochism > required to write a compiler to XPS? (As for an 'xpsTeX', I would be satisfied with a `dvips ps2pdf`-like workflow, but obviously direct compilation would be cooler.)


title: ConTeXt: How to change the background color and border of a Pandoc-generated blockquote?

text: Consider the following minimum working example containing a `blockquote` as defined in a Pandoc-generated document:               \setuppapersize [A4][A4]     \setuplayout    [width=middle,  backspace=1.5in, cutspace=1.5in,                      height=middle, topspace=0.75in, bottomspace=0.75in]          \setuppagenumbering[location={footer,center}]          \setupdelimitedtext       [blockquote]       [before={\blank[medium]},        after={\blank[medium]},        indentnext=no,       ]          \starttext     \input tufte     \startblockquote     \input zapf     \stopblockquote     \input knuth     \stoptext      ## Question How could I obtain a light gray background for the `blockquote` with a dark red 1em-thick left vertical borderline only by changing the preamble? Other borders should be 0pt.


title: How to remove the caption and the figure x in the figure but to add the caption in the list of figures?

text: I would like to remove figure 1 from the caption under my figure but to have it in my list of figures. Is it possible? With `\caption[Entry for the List of Figures (LoF)]{}\label{fig:without}` I can have the caption in my list of figures but I still have "Figure 1" under my figure and I would like to remove that.


title: How to create this image (graphing)

text: I want to create a graph with only the first quadrant. The values of x can only go from 0 to 9 and the values of y can only go from 0 to 9. In this graph, I want dots for (2,5), (3,3), (5,2) and (7,1). Above each pair specified I want dots above it. For example, the dots above (2,5) are (2,6), (2,7), (2,8) and (2,9). Does anyone know how to do this?


title: Aligning margin note with line spacing different from main text

text: I have a main text column with margin a line separation of 1.05 (`\setstretch{1.05}`), and margin texts generated with a tighter line separation with the following macro:               \newcommand{\mnote}[1]{\marginpar{\raggedright\textsf{\footnotesize{%     \textsf{\footnotesize{%     \begin{spacing}{1.025}%     #1%     \end{spacing}%     }}}}}}%      This results in the following output, where the margin paragraph is not properly algined with the first line of the paragraph of the adjacent main text: ![misaligned margin note](http://dl.dropbox.com/u/19252957/mnote.png) This is kind of a tough problem to solve. Does someone have any suggestions?


title: Common label for a groupplot

text: This can be considered a combination of the following questions How can a title be placed for a group of pgfplots? Align ylabels of grouped plots at a common line The following piece of code renders two plots, one above the other, and attaches a common ylabel to both.               \documentclass[tikz]{standalone}     \usepackage[T1]{fontenc}     \usepackage{cmbright}     %% Just some font that has serifs for maths                                               %% Yes; this particular combination is horrible                                           \usepackage{euler}     \usepackage{pgfplots}     \usepgfplotslibrary{units}     \pgfplotsset{compat=newest}     \usepgfplotslibrary{groupplots}     \begin{document}     \begin{tikzpicture}       \begin{groupplot}[group style={group size=1 by 2}]         \nextgroupplot[ylabel = ylabel, y unit = m/s]         \addplot coordinates {(0,0) (1,1) (2,2)};         \nextgroupplot         \addplot coordinates {(0,2) (1,1000) (2,0)};       \end{groupplot}            \node at ($(group c1r1.west)!0.5!(group c1r2.west)$)       [xshift=-1.5cm] % Problem #1: estimated distance                                          {\rotatebox{90}{ylabel [$\mathrm{m/s}$]}};       % Problem #2: Copying pgfplots internals,                                                 % i.e. /pgfplots/unit code/.code 2 args={\mathrm{#1#2}}                                 \end{tikzpicture}     \end{document}      ![Rendering](http://i.stack.imgur.com/QN9Yb.png) There are two problems: It would be nice if the `near ticks` mechanics worked for this case, too, i.e. the optimal distance from both plots were determined automatically; on top of that, if units are used, the ylabel isn't just a bit of text anymore, but something more complicated; and I'd rather not reinvent that machinery. Is there a better way to handle this?


title: Problem with generating table?

text: I am using the array package and have a problem with generating the following table:               \begin{table}     \renewcommand{\arraystretch}{1.5}     \centering      \caption{Design values of thermal properties of typical building materials}     \label{t:material_prop}     \begin{tabular}{l@{\hskip 1.5cm} >{\centering}p{1.5cm} >{\centering}p{1.5cm} >{\centering}p{1.5cm}}     \toprule[3pt] \toprule     \textbf{Material} & \textbf{Thermal conductivity (W/m.K)} & \textbf{Density (kg/m\textsuperscript{3})} & \textbf{Specific heat (kJ/kg.K)} \\ \midrule     Acoustic tile & 0.061 & 481 & 0.84 \\     Clay tile & 0.571 & 1121 & 0.84 \\     Common brick & 0.727 & 1922 & 0.84 \\     Dense insulation & 0.043 & 91 & 0.84 \\     Face brick & 1.333 & 2002 & 0.92 \\     Felt and membrane & 0.19 & 1121 & 1.67 \\     Finish & 0.415 & 1249 & 1.09 \\     heavy-weight concrete & 1.731 & 2243 & 0.84 \\     heavy-weight concrete block & 0.813 & 977 & 0.84 \\     Light insulation & 0.043 & 32 & 0.84 \\     light-weight concrete & 0.173 & 641 & 0.84 \\     light-weight concrete block & 0.381 & 609 & 0.84 \\     Plaster or gypsum & 0.727 & 1602 & 0.84 \\     Slag & 0.19 & 1121 & 1.67 \\     Steel siding & 44.998 & 7689 & 0.42 \\     Stone & 1.436 & 881 & 1.67 \\     Stucco & 0.692 & 1858 & 0.84 \\     Wood & 0.121 & 593 & 2.51 \\     \bottomrule \bottomrule[3pt]     \end{tabular}     \end{table}


title: Comma delimiter in pmatrix environment (for row vectors)

text: Is there a way to have a `pmatrix` environment from `amsmath` use non- whitespace delimiters such as a comma? I am mainly asking, because I would like to make a row vector this way. I take it, there are essentially two ways of doing something like that:               \documentclass{standalone}     \usepackage{mathtools}          \begin{document}     \begin{gather*}         a = \left(1,2,3\right) \\         b = \begin{pmatrix} 1, & 2, & 3 \end{pmatrix}     \end{gather*}     \end{document}      Now, especially the second part does not look too pretty: ![enter image description here](http://i.stack.imgur.com/E22rx.png)


title: C preprocessor commands in listings package

text: I am using the `listings` package, which is mostly formatting things nicely. However, it fails to syntax highlight indented preprocessor commands correctly. For example,               \documentclass{article}     \usepackage{listings}     \begin{document}     \lstset{language=C}     \begin{lstlisting}     #if SYSTEM == SYSV     #    define HDR "sysv.h"     #if SYSTEM == SYSV         #define HDR "sysv.h"     \end{lstlisting}     \end{document}      The first `#define` keyword is highlighted properly, but the second `#define` keyword is not highlighted at all. For old compilers, the `#` symbol had to the be first character of preprocessor commands, but modern style prefers the latter system for indentation. So, I would prefer to indent the `#` symbol. ![enter image description here](http://i.stack.imgur.com/tpwmi.png) Are there any ways I can indent this symbol and have the syntax highlighting come out correctly in the `listings` package?


title: TeXnicCenter - Forward search issue

text: I have been facing this intermittent problem with TeXnicCenter [TC] forward search. ![error window](http://i.stack.imgur.com/1rRJd.png) I have gone through many posts in TeX.SX and I have followed what is to be done. It works at times and at times NOT. I am not able to figure out the root cause of the problem. **My configuration for build in [TXC] is as follows:**   * Exec path `C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe -inverse-search "\"C:\Program Files\TeXnicCenter\TeXnicCenter.exe\" /ddecmd \"[goto('%f','%l')]'\""`   * View project output `DDE Command[sumatra, control]` \- `[Open("%bm.pdf",0,1,1)]`   * Fwd search `DDE command[sumatra, control]` \- `[ForwardSearch("%bm.pdf","%Wc",%l,0,0,1)]`   * close document before running LaTeX Do not close. **Screenshot** : ![profile window](http://i.stack.imgur.com/svPId.png)


title: How to set a fixed size for a shape

text: I want to draw a circle of 4mm with minus sign inside it. I have set the `m` style:               \tikzstyle{m}=[circle, thin, draw=red, fill=red, minimum size=4mm]      however the minus sign extends the circle. I want the sign to almost fill the circle. I tried to change the line to be:               \tikzstyle{m}=[circle, thin, draw=red, fill=red, size=4mm]      but it didn't work. How can I set the circle size to be fixed?


title: How to compare two dvi files?

text: Is there any tool that compares two dvi files. I would like to check if they are identical after I make some changes with source tex file.


title: Creating an invitation printable matrix

text: I'd like to create an 'invitation matrix' which will be printed on both sides of A2 or A3 paper and looks like this:               |front_11|front_12|...|front_1n|    |back_11|back_12|...|back_1n|     |front_21|front_22|...|front_2n|    |back_21|back_22|...|back_2n|                    ...                               ...     |front_m1|front_m2|...|front_mn|    |back_m1|back_m2|...|back_mn|      i.e., there are m*n identical invitations (n and m are integers, of course), each of them has two sides with some text plus images. For the paper format I suppose the `geometry` package will suite my needs. What about the rest? How to automate this work in order to create just one front side text and images plus one back side text and images and fill all the cells in the above matrices automatically? Additionally, I'd like to have cell's borders printed on the paper for convenient cutting, so, maybe `tikz` package is worth considering.


title: Using listings package without installing it

text: I am finishing writing a paper that uses the `listings` package. Sadly, the submission system I have to use for submitting my paper does not come with this package. Is there any way to use the features available in this package without installing it?


title: pdf/a: Width information for rendered glyphs is inconsistent

text: Have there been any advances to create a valid pdf/a-1b from LaTeX including math fonts? I get the following error from preflight in Adobe Acrobat Pro: _Width information for rendered glyphs is inconsistent_ for the document (TeXLive 2011 and pdflatex):               \documentclass{article}          \usepackage{MnSymbol}     %\usepackage{mdsymbol}     \usepackage[a-1b]{pdfx}          \begin{document}          \begin{equation}       \sum     \end{equation}          \end{document}      For this to run, a sRGB profile is needed which can be downloaded here. Rename it to sRGBIEC1966-2.1.icm. Next to fixable errors (eg no metadata supplied), I get the error for either MnSymbol or mdsymbol. Is there something to be done in the mf source code? Any other advice? Unfortunately, Acrobat cannot fix this issue.


title: Algorithmic noun plural

text: I'm looking for an (implementation of) a command (here `\plural`) that computes the plural of a noun. The algorithm should work as follows:   * for most cases, simply add `s` at the end (example: `bag` -> `bags`).   * If the word ends with `ss`, `es` must be added (example: `class` -> `classes`).   * If the word ends with `y` and the one but last letter is not a vowal, `y` is replaced by `ies` (example `story` -> `stories`)   * ... Is there a package for this, if not, how does one implement this?


title: How to split optimisation problem over two lines?

text: I have this expression involving minimisation. How do I split it over two lines? The problem is \min seems to be separated from the objective function. **breqn** does not seem to work, as this is not an _equation_.               $$\min_{\substack{A,B,\\ 0\le A\le T \\ D+X+W-S\ge 0}}\bigg(I+X+W-E,-(X+k(A-B))\bigg)$$


title: A question on tikz/pgf externalization, standalone, and includeonly for compiling large document

text: I have a goal to build an efficient compiling environment to build large documents. The requirements are these:   1. Use tikz/pgf to draw many figures;   2. Use \includeonly to build only a portion of the large document at a time.   3. Make the compilation to only rebuild the modified tikz/pgf figures. I know how to make tikz/pgf figures to be built using the externalized mode. However, the externalized mode does not work with \includeonly. Moreover, I have seen some posts on rebuilding the modified tikz/pgf figures using the standalone package. Some posts even said that it is better not to use tikz/pgf externalized mode and the standalone package together. I am quite confused on this claim. Can anyone do a clarification on the joint use of tikz/pgf externalized mode and the standalone package? I would like to ask the experts for existing tutorials or examples on making tikz/pgf externalized mode to work with \includeonly. Below is a minimal working example. main.tex               \documentclass[\myopts]{article}          \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{tikzscale}          \usetikzlibrary{external}     \tikzexternalize     %\tikzset{external/mode=list and make}     %\tikzset{external/check=diff}     \tikzset{external/force remake}     %\tikzsetexternalprefix{figure-build/, up to date check=md5, force remake}          \pgfplotsset{compat=1.8}     %\pgfplotsset{compat=newest} % necessary for new features          \usepackage{ifpdf}          \ifpdf       \tikzset{external/system call={%         pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode           -jobname "\image" "\string\def\string\myopts{\myopts}\texsource"}}     \else         \tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\string\def\string\myopts{\myopts}\texsource"; dvips -E -o "\image".eps "\image".dvi; ps2pdf "\image".eps "\image".pdf;}}     \fi          \usepackage{import}     \usepackage{filecontents}          \begin{filecontents}{datafile}     -0.000632     0.004692     0.001407     0.005768     0.003117     0.001605     0.001742     -0.000874     -0.000973     -0.000436     -0.001578     -0.001953     -0.004275     -0.001585     -0.000957     -0.000819     -0.000924     -0.003559     0.001949     -0.000300     -0.003085     -0.002050     -0.000493     -0.001378     -0.000970     0.000912     0.001667     -0.000974     -0.000592     -0.000865     -0.000933     0.000435     -0.001278     0.001508     -0.000566     -0.003608     0.002768     0.005676     0.000331     -0.000527     -0.000589     -0.000751     -0.000503     -0.000718     -0.000950     -0.005616     -0.004347     -0.001818     -0.000503     0.001063     0.002109     -0.004156     -0.002612     -0.000773     -0.000635     -0.000218     -0.001041     -0.001247     -0.000283     -0.004434     -0.000370     0.002669     0.001302     0.001351     0.001618     0.002028     0.001291     0.004341     0.001141     0.001058     -0.004537     -0.000123     -0.000052     0.000010     -0.000643     0.001403     -0.000751     -0.000201     -0.001639     -0.000316     -0.000757     -0.000872     0.000530     -0.000969     -0.000826     -0.001076     -0.000808     0.001687     0.001356     0.001870     0.001016     0.002165     0.005372     0.001128     0.002269     0.001878     0.000839     -0.000798     -0.000846     0.000146     \end{filecontents}          \begin{filecontents}{histogram.tikz}     \tikzsetnextfilename{Fig-Histogram}     \begin{tikzpicture}         \begin{axis}[             xmode=linear,             ymode=linear,             axis x line*=bottom,             axis y line*=left,             tick label style={font=\small},             grid=both,             tick align=outside,              tickpos=left,             xlabel=Bins,             ylabel=Count,             width=0.45\textwidth,             height=0.4\textwidth,         ]         \addplot+[raw gnuplot, ybar, bar width=0.002, color=red] gnuplot {             binwidth=0.005;             bin(x,bw)=bw*floor(x/bw);             plot "datafile.tex" using (bin($1,binwidth)):(1.0) smooth freq with boxes;         };         \end{axis}     \end{tikzpicture}     \end{filecontents}          \begin{filecontents}{mainbody.tex}     \begin{figure}[bth]         \begin{tabular}{p{3in}}             \includegraphics[]{histogram}         \end{tabular}         \caption{\small{Histogram.}}     \end{figure}     \end{filecontents}          \begin{filecontents}{doc1.tex}     \begin{figure}[bth]         \begin{tabular}{p{3in}}             \includegraphics[]{histogram}         \end{tabular}         \caption{\small{Histogram.}}     \end{figure}     \end{filecontents}          \begin{filecontents}{doc2.tex}     \begin{figure}[bth]         \begin{tabular}{p{3in}}             \includegraphics[]{histogram}         \end{tabular}         \caption{\small{Histogram.}}     \end{figure}     \end{filecontents}          \includeonly{\myfilename}          \begin{document}     \setcounter{page}{1}     \subincludefrom{./}{mainbody}     \setcounter{page}{1}     \subincludefrom{./}{doc1}     \setcounter{page}{1}     \subincludefrom{./}{doc2}     \end{document}      I created a `Makefile` as below.               allinone:         pdflatex -shell-escape "\def\myopts{11pt}\def\myfilename{mainbody,doc1,doc2}\input{main}"          doc1:         pdflatex -shell-escape "\def\myopts{11pt}\def\myfilename{doc1}\input{main}"          doc2:         pdflatex -shell-escape "\def\myopts{11pt}\def\myfilename{doc2}\input{main}"          mainbody:         pdflatex -shell-escape "\def\myopts{11pt}\def\myfilename{mainbody}\input{main}"      If all components are compiled, then run               make allinone      If only a single component is compiled, the run               make doc1     make doc2     make maninbody      I can not make a correct compile. Please help.


title: How to draw a series of paths in a TikZ chronology diagram?

text: I am a beginner in LaTeX, trying to use it (and now to promote its use...) for industrial documents. I want to provide diagram relating the chronology of introducing LaTeX in an engineering group. I had tried the `chronology` package, but could not change the distance between ticks from year to months. I have tried to mimic a chronology diagram in the following code. However i find myself unable to nicely link with the points of the x axis to the nodes describing the steps. I have tentatively added stars (with the idea to make them invisible afterwards) in an attempt to locate where vertical lines drawn from the x axis would be angled to meet the nodes, but could not make this work. Any help appreciated as well as tips on how to improve the diagram.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings,}     \begin{document}     \begin{figure}[h]     \begin{tikzpicture}[scale=1]     \small \sf      \tikzset{label/.style={draw=gray, ultra thin, rounded corners=.25ex, fill=gray!20,text width=4cm, text badly centered,  inner sep=.5ex, above = 2em, anchor=west,rotate=45}}     \tikzset{tick/.style={below=3pt}}     \tikzset{thinline/.style={ultra thin}}     \draw (0,0) -- (10,0);     %draw arrow      \draw (0,0)[->, -latex] -- (13,0);     %draw      \draw (0,0)[->, -latex] -- (13,0);     %draw vertical lines     \foreach \x in {1.2,2.2,4.2,5.2,6.2,8.2,9.2,10.2}                     \draw (\x cm,2ex) node (\x) {*};     %draw nodes     \draw (0,0) node(A0) [tick] {0} node(B0)[] {};     \draw (1.2,0) node(A1) [tick] {1} node(B1) [label]  {end of initial investigations};     \draw (2.2,0) node (A2) [tick] {2} node(B2) [label]  {start of \LaTeX{} spare time investigations};     \draw (3.2,0) node[tick] { 3} node [] {};     \draw (4.2,0) node[tick]  {4} node[label]  {installation of \LaTeX{} on one office computer};     \draw (5.2,0) node[tick] {5} node [label] {second \LaTeX{} user};     \draw (6.2,0) node[tick] {6} node [label] {first \LaTeX{} document moved to remote server};     \draw (7.2,0) node[tick] {7} node []  {};     \draw (8.2,0) node[tick]{8} node [label]  {third \LaTeX{} user};     \draw (9.2,0) node[tick]{9} node [label]  {several documents moved on remote server};     \draw (10.2,0) node[tick] {10} node [label] {fourth \LaTeX{} user};     \end{tikzpicture}     \caption{chronology of events (time in months)}     \end{figure}     \end{document}


title: What does the # symbol do in LaTeX?

text: I know most of the effects of the special characters in LaTeX, like `\` is used for most commands, or `$` is used for opening or closing the math ambience, but I don't know what the symbol `#` does, and I have seen it in some lines at commands for the creation of personalized packages... here is an example of it:               \newcommand{\mytitle}[2][]%       {\newcommand\@mytitle{#2}        \ifthenelse{\not\equal{#1}{}}                   {\newcommand\@shortmytitle{#1\ \ldots}}                   {\newcommand\@shortmytitle{\@mytitle}}       }      but I still don't understand what the `#` symbol does... so if anyone could explain it... also what does the `\@` command do?


title: Is there a nice color scheme generator for beamer(poster)?

text: There are plenty of palette generators for the web, e.g., Color Scheme Designer . Among other stuff it can export schemes in XML. Is there a nice XSLT to convert it into STY file that I'd use with beamerposter? The caveat here is also that that generator uses RGB and not CMYK model. I understand I can manually code all the stuff as I want like               \setbeamercolor*{normal text}{fg=tachameleon, bg=ta3gray}      Or are there other **easy** ways to create pleasantly looking themes? I have a feeling that most of the themes are crafted by hands? Am I wrong?


title: Incorrect target of \label link produced by hyperref

text: In the following code, the command `\label{my}` appears on page 4, as well `\pageref{my}` says "4", but the hyperlink points to the page one. Why is that?               \documentclass{book}     \usepackage{hyperref}     \usepackage{lipsum}          \begin{document}            % Four pages of text.       \lipsum[1-20]             % The label is on fourth page.       \label{my}                % Buggy pageref. It produces the number 4, but the link leads to the first page.       \pageref{my}           \end{document}


title: How do I associate a label with a non-section document element?

text: > **Possible Duplicate:**   >  Incorrect target of \label link produced by hyperref Labeling and linking in LaTeX confuses me. I have something like the following:               \section{main section}     \label{sec:mainsection}      %lots of text     \label{SomethingDescribedButNotDocumentElement}     %more text      I want to be able to link to the second label, but it seems those labels are associated with the previous document element (in this case a main section) So something like:               \hyperref[SomethingDescribedButNotDocumentElement]{link to 2nd label}      But this jumps up to the `sec:mainsection` label.   * How do I link to an arbitrary section of my document (which may be not described by `section` or `figure` etc)?


title: roman numbers are not correctly cross-referenced, conflict between hyperref and other packages?

text: This problem only occurs in my whole PhD thesis, and not in a MWE (shown here). Would the problem be the other packages I use besides the hyperref package? MWE code (works well, see attached image):               \documentclass[12pt,twoside]{report}          \usepackage[left=2.0cm,right=2.0cm,top=2.25cm,bottom=2.25cm,bindingoffset=6mm]{geometry}    % document format geometry     \usepackage{setspace}                                                                       % set line spacing     \usepackage[T1]{fontenc}                                                                    % font encoding     \usepackage[utf8]{inputenc}                                                                 % characters     \usepackage[hidelinks=true]{hyperref}                                                       % hyperlink for cross-references (images, references, lof, toc, etc)          \begin{document}              \pagenumbering{roman}              \chapter*{A}         \addcontentsline{toc}{chapter}{A}              \chapter*{B}         \addcontentsline{toc}{chapter}{B}              \chapter*{C}         \addcontentsline{toc}{chapter}{C}              \chapter*{D}         \addcontentsline{toc}{chapter}{D}              \newpage         \addcontentsline{toc}{chapter}{Table of Contents}         \begin{onehalfspace}             \tableofcontents         \end{onehalfspace}              \clearpage         \pagenumbering{arabic}              \chapter*{Introduction}         \addcontentsline{toc}{chapter}{Introduction}          \end{document}      Preamble of thesis (doesn't work correctly, see attached image):               \documentclass[12pt,twoside]{report}          % Packages     \usepackage[left=2.0cm,right=2.0cm,top=2.25cm,bottom=2.25cm,bindingoffset=6mm]{geometry}    % document format geometry     \usepackage{setspace}                                                                       % set line spacing     \usepackage[T1]{fontenc}                                                                    % font encoding     \usepackage[utf8]{inputenc}                                                                 % characters     \usepackage[bitstream-charter]{mathdesign}                                                  % Elsevier journal pseudo-font type     \usepackage{textcomp}                                                                       % font and symbols     \usepackage{textgreek}                                                                      % greek letters in text     \usepackage{fixltx2e}                                                                       % use subscript     \usepackage[font=small]{caption}                                                            % figure font size     \usepackage[hypcap]{caption}                                                                % link to top of image/table     \usepackage[hidelinks=true]{hyperref}                                                       % hyperlink for cross-references (images, references, lof, toc, etc)     \usepackage[md]{titlesec}                                                                   % remove bold of titles     \usepackage{graphicx}                                                                       % include graphics     \usepackage{subfigure}                                                                      % subfigures     \usepackage{epstopdf}                                                                       % incluir EPS     \usepackage[subfigure]{tocloft}                                                             % dots in ToC, font type, subfigure to avoid conflicts, etc     \usepackage[Lenny]{fncychap}                                                                % change font type of titles in chapters, etc     \usepackage{pdfpages}                                                                       % include pdf     \usepackage[square,authoryear]{natbib}                                                      % references     \usepackage{etoolbox}                                                                       % italics for citation     \makeatletter                                                                               % italics for citation     \patchcmd{\NAT@test}{\else\NAT@nm}{\else\NAT@nmfmt{\NAT@nm}}{}{}                            % italics for citation     \let\NAT@up\itshape                                                                         % italics for citation     \makeatother                                                                                % italics for citation     \usepackage{multirow}                                                                       % multirow in table     \usepackage{multicol}                                                                       % multicolumns in lists (eg. abbreviations)     \usepackage{wallpaper}                                                                      % background image for front/back cover     \addtolength{\wpXoffset}{-11.0cm}                                                                % offset in x for wallpaper only for \ThisCenterWallPaper     \setlength\cftbeforefigskip{15pt}                                                           % line spacing between figures in LoF     \renewcommand\cfttoctitlefont{\huge}                                                        % remove bold from ToC title     \renewcommand\cftloftitlefont{\huge}                                                        % remove bold from LoF title     \renewcommand{\cftchapfont}{\mdseries}                                                      % remove bold in ToC contents     \renewcommand\contentsname{Table of Contents}                                               % replace 'Contents' by 'Table of Contents'     \renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}                                      % add dots     \renewcommand{\cftchappresnum}{Chapter }                                                    % prefix 'Chapter' to chapter number in 'Table of Contents'     \cftsetindents{chapter}{0em}{6em}                                                           % indentation of chapters     \addtocontents{toc}{~\hfill\textmd{Page}\par}                                               % add 'Page' to ToC     \AtBeginDocument{\renewcommand{\bibname}{References}}                                       % replace 'Bibliography' with 'References'     \renewcommand\thesection{\arabic{section}}                                                  % change the 0.1 to 1 in sections      Any pointers are very welcomed, ![enter image description here](http://i.stack.imgur.com/9zHVz.png) ![enter image description here](http://i.stack.imgur.com/xd4ST.png)


title: Make a reference to a page containing a certain sentence?

text: > **Possible Duplicate:**   >  When do I need invoke \phantomsection?   >  Incorrect link produced by hyperref I want to reference a page containing a certain sentence. If I add a label to the sentence and use `\pageref{ref}`, then this refers/links to the page containing the section title. Is there anyway to force the reference to stay near the sentence in which it is placed?


title: When do I need to invoke \phantomsection?

text: Inspired by question When do I need invoke \clearpage manually?: When do I need to invoke `\phantomsection`? In what condition is invoking `\phantomsection` necessary?


title: Table fixed width

text: > **Possible Duplicate:**   >  How to obtain width of longtable? I have many tables that I create with `longtable` or `ltablex`. How can I make all tables the same width?


title: Augmented matrices in ConTeXt?

text: In LaTeX, I could use:               \[     \left[\,\begin{array}{rr|r}2&-3&6\\ 3&4&-9\end{array}\,\right]     \]      However, in ConTeXt, especially if I want right-alignments of columns, I seem to have to use:               \startformula       \left[\,\startmathmatrix[n=2,align={right,right}]         \NC 2 \NC -3 \NR         \NC 3 \NC 4 \NR       \stopmathmatrix\;\right|       \left.\startmathmatrix[n=2,align={right}]         \NC 6 \NR         \NC 9 \NR       \stopmathmatrix\,\right]     \stopformula      which is extremely wordy and clumsy-looking (especially compared with the neat and succinct LaTeX). So - what is the best way of typesetting augmented matrices in ConTeXt? Thanks!


title: How do I put a side brace around several lines in the align* environment?

text: I would like to put a side brace around several lines in the `align*` environment, as shown in the comments in the code below:               \begin{align*}         left side & = right side \\         left side & = right side \\  %   }         left side & = right side \\  %   }-  these three lines are important         left side & = right side \\  %   }         left side & = right side \\     \end{align*}


title: How are big operators defined?

text: I would like to create a new "big operator", by which I mean something like the Σ character used for summations. ![enter image description here](http://i.stack.imgur.com/TmUwR.png) I know about the `\DeclareMathOperator*` command, which creates an operator whose superscripts and subscripts are written directly above and below the operator. Here is an example of that.               \documentclass{article}     \usepackage{amsmath}     \usepackage{amsfonts}     \DeclareMathOperator*{\foo}{\maltese}          \begin{document}     \[     \foo_{i=3}^{6}(f^2(i))     \]     \end{document}      ![enter image description here](http://i.stack.imgur.com/vHAzv.png) However, I would like to make my operator "big". I tried this:               \DeclareMathOperator*{\foo}{\text{\Large $\maltese$}}      ![enter image description here](http://i.stack.imgur.com/0Ic5W.png) but that feels like a bit of a hack. Besides, the operator is too high, and needs moving down a tad to align it properly with its operand. So, what's the _proper_ way to do this? How, for instance, is the `\sum` operator defined?


title: Displaystyle/limits for custom operators

text: I want to write this:               $ {\text{\huge N}}\limits_{i<k} $      and have it produce output comparable to this:               $ \sum\limits_{i<k} $      That is, I want a sum with limits underneath it, but I want it with a capital nu instead of a capital sigma. My proposed approach doesn't work though. How does one get \limits on a custom operator?


title: How do I adjust the height of a superscript?

text: I have an operation that I call `\conv`, that I defined as follows:               \newcommand\conv{{}^{\scriptstyle\smile}}      Sometimes I use it in this situation:               $a\conv$      and sometimes I use it in this situation:               $$\big(\prod a\big)\conv$$      In both cases, the superscript `\conv` is at the same level. However, in the second case, the `\sum` is so big, that the `\conv` seems to hit it at mid- level. I want it to somehow adjust to the larger size of the `\sum` so that it is up at the top of the `\big`), not so far down. Please let me know how I can clarify my question.


title: special characters not showing (mathexam+babel)

text: I am trying to edit a exam using a template I found on internet (article using `mathexam` package) but since I have to use special characters of Brazilian portuguese (like á, à, ç, ã, õ, ô, â, ê) my final `.pdf` was not showing how I intended. The characters do not appear on the output, after compiling, by simply typing them on the code like I do in most of my other .tex documents (using babel and inputec packages). But when I created a new .tex and was editing it to add on the current question, it finally worked. I think it must have something to do with codification of the file, but I have no idea how to change that option on the files. What was actually happening? In my documents I always use `\usepackage[latin1]{inputenc}`. How can I know if some file has different codification, and how to change it properly? ***I work on TeXnicCenter under WIN7 system. Below is the example:               \documentclass{article}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage[latin1]{inputenc}      \usepackage[brazil]{babel}      \usepackage[left=1in, right=1in, top=1in, bottom=1in]{geometry}     \usepackage{mathexam}          \ExamClass{Instituição}     \ExamName{Simplificação de Raízes}     \ExamHead{\today}          \let\ds\displaystyle          \begin{document}     \ExamInstrBox{     Coment with á é ã ç, ....}     \ExamNameLine     \begin{enumerate}        \item Calc something1.             \begin{enumerate}          \item $\frac{\sqrt{x+1} - 2}{x-3}$\answer          \item $\frac{\sin(4x)}{8x}$\answer[1in plus 1fill]           \end{enumerate}        \item Calc something2            \[\lim_{x\rightarrow 2} x^5  -2x^2 + 4x + -7 = 0\]\noanswer[2.5in]        \item Find...              \answer*{$f(x)=$}\addanswer*{$g(x)=$}     \end{enumerate}     \end{document}


title: How do I set up my config file to have latexmk default to making a pdf?

text: I can't see any situation where I would want to compile a dvi file. Therefore I'd like to have latexmk default to giving me a pdf via pdflatex, so I don't have to type -pdf every time. I've tried adding the following to my latexmkrc file without success:               $print='pdf';          $pdflatex = 'pdflatex --shell-escape %O %S';      and even               $pdf=1      I'm on windows, so I can't just add it to my alias file. Is there a way to set up latexmk to make me a pdf unless I specify otherwise?


title: Use of \foreach and \csname<macro name>\endcsname together

text: When I compile this minimum LaTeX file:               \documentclass{report}          \def\defMacro#1#2{\expandafter\def\csname#1\endcsname{#2}}     \def\useMacro#1{\csname#1\endcsname}          \usepackage{pgffor}          \begin{document}     \foreach \n in {0,1,...,10}{     \defMacro{number:\n}{\n}     }               \useMacro{number:8}     \end{document}      I obtain no PDF output. What do I mistake?


title: How can the margins around a table set to 0pt?

text: I need to put a table inside another table, and would like to set the outside margins of the inner table to 0pt. How can I do this (in particular for tabularx, but hopefully this would be the same for any table environment)?


title: Macro to close all open environments, groups and argument delimiters

text: ## Initial Request I am in search for a macro that would close all curly brackets and all open environments. Ideally, I could write something of the following sort:               \Open\begin{minipage}\begin{quote}\texttt{           \textbf{Something     \Close % will close all open environments and curly brackets opened            % since the most recent \Open      If such a beast can be created, I would map `\Open` to a thick curly brackets of Unicode and `\close` to a thick curly brackets, i.e., `❴❵` U+2773 and U+2774. (Yes, I know some people thought this is an abomination, but then so did people think of curly brackets in BCPL, especially when forced to use a digraph or trigraph for these) With this macro, one can even remove more LaTeX textual "clutter" by writing               \Open\begin{minipage}\begin{quote}\texttt{           \textbf{Something     \Close % will close all open environments and curly brackets opened            % since the most recent \Open      or even               ❴\minipage{\quote{\texttt{           \textbf{Something     ❵      % will close all open environments and curly brackets opened            % since the most recent ❵      (and, yes, I realize that this would drive some LaTeX IDE's crazy) With `\Open` opening a context, one could even write:               ❴\minipage\quote\texttt{           \textbf{Something     ❵      i.e., removing the opening curly brackets of environments. For macros taking an arguments, the code has to be rewritten as               ❴\minipage\quote\ttfamily\bfseries        Something     ❵          which is not only neat. It is also more IDE friendly. Strangely enough, it would also work with ordinary curly brackets. Here is another use case, should anyone be interested: Instead of typing               \newcommand\kk[1]{\textcolor{RoyalBlue}{\text{\textup{\textbf{\texttt{#1}}}}}}      and carefully counting the closing parenthesis, we shall have code that is much easier to check visually:               \newcommand\kk[1]❴\textcolor{RoyalBlue}{\text{\textup{\textbf{\texttt{#1❵       ## Analysis Based on the comment below, I understand that this question calls for up to four components of an answer:   * A macro to close all pending environment which begun by `\begin{env}`   * A macro to close all groups opened since the last drop of an anchor. The term group refers here to the use of `{` and `}` for delimiting scope, as in `{\em something }`   * A macro to close all pending open argument delimiters. Argument delimiters refer to the use of `{` and `}` to collect tokens together, making them one for the purpose of macro application, as in `\emph{something}`   * A macro to close all open `{` in the context of `\def`, in which it used for delimiting the macro body, but not name, as in `\def\EM{\em}` I learn that the fourth is impossible without replacing TeX's lexical analyzer, and I presume that the third is equally difficult. IMHO, the original sin is that TeX overloaded '{' for three distinct purposes: argument passing and for defining scope. Compare with the classical               main() {       printf("Hello, World!\n");     }      in which C uses `()` for function calling and `{}` for grouping or scoping. The round brackets in C are used for two similar purposes:   1. **Defining functions* as in `main()`, which in TeX terms is `\def\main{}`   2. **Calling functions** as in `printf("Hello, World!\n");`which in TeX could be written as `emph{Hello, World!}` So, if messing with the `{}` for macro calling and definition is so difficult, then I would be very happy with answer that would support the original simple use case               \Open\begin{minipage}\begin{quote}\texttt{           \textbf{Something     \Close % will close all open environments and curly brackets opened            % since the most recent \Open      wtth the fist two requests only:   * A macro to close all pending environment which begun by `\begin{env}`   * A macro to close all groups opened since the last drop of an anchor. The term group refers here to the use of `{` and `}` for delimiting scope, as in `{\em something }` ## Reflection Without me intending to do so, the question highlighted the fact that `{}` are used for three different purposes: grouping, macro definition and macro invocation. In my mind, this overloading is a barrier for beginners who come to LaTeX from the programming world. ## Motivation and Context This question was _not_ asked with the purpose of serving as an intellectual challenge. There is a particular need that a solution should serve. I am engaged in writing many slides with `beamer`. By now, I believe I have over a thousand of these. The slides are not too complicated, but they do involve using a lot of environments. A slide with 10 lines or so will contain environments such as   * `\begin{frame}` ... `\end{frame}`   * `\begin{quote}` ... `\end{quote}`   * `\begin{block}` ... `\end{block}`   * `\begin{columns}` ... `\end{columns}`   * `\begin{column}` ... `\end{column}`   * `\begin{definition}` ... `\end{definition}`   * `\begin{uncoverenv}` ... `\end{uncoverenv}`   * `\begin{itemize}` ... `\end{itemize}`   * `\begin{lstlisting}` ... `\end{lstlisting}`   * `\begin{centering}` ... `\end{centering}` The ratio of macros and environments to actual text is very high with input designed to make presentations. In a count I just did, I found that on overage I use four environments per slide, other than the obvious `\begin{frame}`. Opening these environments may create some "clutter", but closing them can be a real pain. It is often the case that you open many environments, all of which end at the end of the `frame`. Being able to close all these at once, is not for saving typing. In making presentations, typing is the least concern. The majority of work is in experimenting with numerous combinations of the visual layout components to create the desired visual effect. In doing that, it is convenient that the actual layout of the text, including indentation, makes it easy to grasp immediately the current slide design, with minimal need to mentally compile and understand commands and other "clutter" which are required to make the input legal for `beamer`. I believe that a macro to close all open environments, and more generally, open groups would be useful. BTW, the idea is not new. Many years ago, I used to program in Lisp. I remember that it was possible to set an anchor by type '[' and then typing ']' to close all parenthesis opened since the anchor. This was a great help then. These days I do not use Lisp anymore, and I cannot find reference to this ancient trick. ## Some Statistical Data Just to get an initial idea of the potential use of this feature, I measured a presentation I just made, which was not overly complex, and without me being aware that such a macro could be made. I only examined the `\end{frame}` command. Overall, there were 43 frames. In 6 of these (14%) the frame ended with a single `\end{env}`. In 26 frames (60%), there were two `\end` at the end, and in 11 frames (26%), there were three such commands. Seems as if such a feature would be useful in at least 86% of all frames. And, it is highly unlikely that `\Close` at the end of frames would lead to many strange errors. ## `\Open`/`\Close` and the Python Metaphor It occurred to me that these two macros are similar, but not identical to the way the Python programming language manages bracketing. In Python, indenting a line creates indentation/de-indentation tokens as explained by this quote: > Before the first line of the file is read, a single zero is pushed on the > stack; this will never be popped off again. The numbers pushed on the stack > will always be strictly increasing from bottom to top. At the beginning of > each logical line, the line's indentation level is compared to the top of > the stack. If it is equal, nothing happens. If it is larger, it is pushed on > the stack, and one INDENT token is generated. If it is smaller, it must be > one of the numbers occurring on the stack; all numbers on the stack that are > larger are popped off, and for each number popped off a DEDENT token is > generated. At the end of the file, a DEDENT token is generated for each > number remaining on the stack that is larger than zero. (Source is here: https://docs.python.org/release/2.5.1/ref/indentation.html) The nice property of Python is that you do not really need to insert an `\Open` token. All you do is un-indent to the desired level.


title: problem in using some fonts

text: I have soem problems with doing `malayalam` fonts in LaTeX. Some fonts of `CDAC-ILDC` are installed but they cannot be used with `malayalam` or `omega malayalam`. I am using Ubuntu 12.04. the same problem occurs for my friends using the same Ubuntu. There was no problem with previous editons and Mandriva linux. While compiling the .tex file produced by the pre-processor of `malayalam` I got the following error message.               /usr/local/texlive/2012/texmf-dist/tex/lambda/malayalam/umlgistrevathi.fd)     (/usr/local/texlive/2012/texmf-dist/tex/lambda/malayalam/umlgistchippi.fd)     (/usr/local/texlive/2012/texmf-dist/tex/latex/psnfss/t1ptm.fd) [1] [2]     (./holyweek-mod.aux)     kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+57/600 --dpi 657 MLTTRevathiN     mktexpk: don't know how to create bitmap font for MLTTRevathiN.     mktexpk: perhaps MLTTRevathiN is missing from the map file.     kpathsea: Appending font creation commands to missfont.log.      )     !pdfTeX error: pdflatex (file MLTTRevathiN): Font MLTTRevathiN at 657 not found           ==> Fatal error occurred, no output PDF file produced!


title: Aligning a row of explanations for equation

text: I was advised to repost the question. I try and give as much input as possible. Currently I use this code               \begin{flalign*}     \noindent \tab \rho \textsubscript{KOH} & = \num{2.04}\,\si{\g\per\cubic\cm} &\\[-1pt]     \text{M}\textsubscript{KOH} & =  \num{56.10}\,\si{\g\per\mol} &\\[-1pt]     \text{c}\textsubscript{KOH} & =  \num{0.05}\,\si{\mol\per\L}\\     \end{flalign*}      This results in this ![enter image description here](http://i.stack.imgur.com/t8zeh.jpg) I want the = and fractions to be aligned. Svend gave me in my older question the following code               \begin{alignat*}{2}     \rho_{\ch{KOH}} &=  &  \num{2.04}\,&\si{\g\per\cubic\cm} \\     M_{\ch{KOH}} &={}& \num{56.10}\,&\si{\g\per\mol}      \\     c_{\ch{KOH}} &=  &  \num{0.05}\,&\si{\mol\per\L}     \end{alignat*}      Works like a charme for the units and alignment. However the explanations is centered then. Fleqn will left align all my equations, right? Equations should stay centered. I just would like to add the explanations with a little indent and left aligned. Also is it possible to make the fractions smaller to avoid those big spaces? If anyone knows what I mean by adding explanations and has a even cooler theme for it I'm open to it. I just want it to look neat in my papers/lab reports. PS: I am aware that the equation is wrong.


title: Run Latexian output with latexcalc

text: I'm using Latexian to typeset my documents, and also another tool called latexcalc(check it out, its really useful!) , which automatically evaluates the result of typeset calculations. Is there some way I can hook the `latexcalc` binary into `pdflatex` so they both work seamlessly through Latexian? The command Latexian uses is:               /usr/texbin/pdflatex --interaction nonstopmode --shell-escape --file-line-error /Users/ankit/Documents/Classes/10601/hw2/TSWLatexianTemp_hw2.tex      and the command for `latexcalc` is:               latexcalc --pdflatex ~/Documents/Classes/10601/hw2/hw2.tex      I suppose I could configure Latexian to use the `latexcalc` binary directly, but the logging output (among other things?) might not work correctly.


title: How do i vertically align a tikz picture inside a beamer frame

text: The beamer frames optinal argument `[c]` seems to be ignored in the following example:               \begin{frame}[c, fragile, shrink] %seems to be ignored, not aligning vertically          \makebox[\textwidth][c]{ % works, aligning horizontally             \begin{tikzpicture}                 \node[draw]{Center Me};             \end{tikzpicture}         }     \end{frame}      How do i need to modify the example to center the node vertically?


title: how to draw this ? Square blank BlackSquare in unicode

text: I would like to draw this : ■■■□□ But it's not easy i would like the square to have the same size. And it's difficult to search about it with google. regards


title: MiKTeX order of precedence for duplicate files

text: I am using MiKTeX under a single-user installation. My MiKTeX Options dialogue shows me, if I click on the "Show MiKTeX-maintained root directories" checkbox, directories in the following order (from top to bottom):   * `C:\Users\<my_username>\AppData\Roaming\MiKTeX\2.9`   * `C:\Users\<my_username>\AppData\Local\MiKTeX\2.9`   * `C:\Users\<my_username>\user_software\localtexmf`   * `C:\Users\<my_username>\user_software\miktex`   * `C:\Program Data\MiKTeX\2.9`   * `C:\Program Files\MiKTeX\2.9` I do not have the option to move anything using the "Up" or "Down" button. Something in the way the precedence order for duplicate filenames is processed is not working. Here is what's specifically causing me trouble: * * * I put the latest version of the `glyphtounicode.tex` file (from LCDF Type Software) into the folder `C:\Users\<my_username>\user_software\localtexmf\tex\plain\lcdf-typetools`. However because an older version of this same file was put (by MiKTeX) into the folder `C:\Users\<my_username>\user_software\miktex\tex\generic\pdftex`, the version that `pdflatex` reads is always that older one, not the one in my `localtexmf` folder. For now, I have resorted to renaming the newer version to `glyphtounicodeupdated.tex` and using `\input{glyphtounicodeupdated}` instead of `\input{glyphtounicode}`, but there should be a way of using `\input{glyphtounicode}` with `pdflatex` using that correct, newer version. How can I achieve this? (I always refresh the filename database. So that shouldn't be an issue.)


title: Unicode characters changing order in listings (XeTeX)

text: I am trying to input code listings with unicode characters and everything seems to work (more or less) except some unicode characters being displayed out of order. For example instead of > służąca do obsługi I get > łżąsuca do łobsugi How can I fix that? **EDIT:** I was asked for providing some code, but unfortunately I doubt it will be any helpful. Basically code like this:               \documentclass[11pt,polish]{article}          \usepackage{fontspec}     \usepackage{listings}     \usepackage{xunicode}     \usepackage{xltxtra}     \usepackage{babel}          \setmainfont{Charis SIL} % Some font with good unicode support          \begin{document}     \begin{lstlisting}     służący     \end{lstlisting}     \end{document}      will output this: > łżą > > sucy (yes there is a line break, I don't know where it came from, when I input code in form of a file there are characters out of order, but no line breaks).


title: Tikz and Beamer: How to fix coordinate system to be the same on each slide?

text: Is it possible to make the coordinate system to be fixed on several slides in a beamer presentation? So that each point with the same coordinates in different `tikzpicture` environments on different slides is in exactly the same position in the resulting PDF? Example:               \documentclass{beamer}     \usepackage{tikz}          \begin{document}     \begin{frame}     \begin{tikzpicture}     \draw (0,0) circle (1cm);     \end{tikzpicture}     \end{frame}          \begin{frame}     \begin{tikzpicture}     \draw (0,0) circle (1cm);     \draw (2,2) circle (2cm);     \end{tikzpicture}     \end{frame}          \end{document}      How to modify this example, such that on both slides the circle at position (0,0) overlays?


title: How do I sort two glossaries differently? list of acronyms(sort=standard) and list of symbols(sort=use)

text: I'm using the glossaries package to create a list of acronyms and a list of symbols. I have to do a list of acronyms sorted alphabetically(sort=standard) and a list of symbols ordered by appearance(sort=use). Both lists have to be displayed before the toc. I read the User Manual for glossaries.sty v4.02 where there is a similiar example in which acronyms are ordered alphabetically and notations are sorted in the order in which they were defined but; I could not adapt it to my needs. Is it possible to do? because according with some readings, I have to define the entries before print the glossaries, which means, before I use then in the text. For now I'm cheating and forcing the correct order by putting sort={001}, sort={002}, ...,sort={XXX} at the glossary entries and setting the glossaries option sort=standard so both acronyms and the main glossary are being ordered alphabetically.               \documentclass[12pt,openright,twoside,a4paper,english,french,spanish,brazil]{abntex2}     \usepackage[subentrycounter,seeautonumberlist,acronym,style=long3colheaderborder]{glossaries}     \makeglossaries     \newglossaryentry{pi}{                 name={\ensuremath{\pi}},                 description={ratio of circumference of circle to its diameter},                 sort={003} }     \newglossaryentry{real number}{                 name={\ensuremath{\mathbb{R}}},                 description={include both rational numbers and irrational numbers,                     a real number can be given by an infinite decimal                     representation, the real numbers may be thought of as points on an infinitely                     long number line},                 sort={002} }     \newglossaryentry{sigma}{                 name={\ensuremath{\sigma}},                 description={greek symbol},                 sort={001} }     \renewcommand*{\glsseeformat}[3][\seename]{\textit{#1} \glsseelist{#2}}


title: How can I replicate the syntax-highlighting style of the Kate editor?

text: I am trying to add a `java` and `c++` code in a `LaTeX` document. I am using `listings` package and I will define a different style for each language using `\lstdefinestyle{myStyle}{<options>}`. What I am trying to achieve is the colouring and the emphasis that the editor `Kate` uses, as shown in the next image ![enter image description here](http://i.stack.imgur.com/bjDpA.png) Look for instance the different styles for comments. When a comment starts with `//` it's gray, while when it's enclosed between `/**comment*/` it's green. Or perhaps the different colors for keywords : `int` is dark blue while `static final int` is brighter. Also take a look at the numbers: They are yellow. Or for instance the strings are red. I've tried to reproduce those but I wasn't able to do this(the numbers) or the purple methods that are used. For instance I can't define different coloring for different comments or key words. I can't color at all the numbers and the `get***` methods. MY code is               \documentclass{article}     \usepackage{listings}     \usepackage{textcomp}     \usepackage{xcolor}     \definecolor{listinggray}{gray}{0.9}     \definecolor{lbcolor}{rgb}{0.9,0.9,0.9}          \lstdefinestyle{JavaStyle}{             backgroundcolor=\color{lbcolor},         tabsize=4,     %   rulecolor=,         language=Java,      % choose the language of the code             basicstyle=\scriptsize,     % the size of the fonts that are used for the code             upquote=true,             aboveskip={1.5\baselineskip},             columns=fixed,             showstringspaces=false,             extendedchars=false,             breaklines=true,             prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},             frame=single,             numbers=left,             showtabs=false,             showspaces=false,             showstringspaces=false,             identifierstyle=\ttfamily,             keywordstyle=\color[rgb]{0,0,1},             %commentstyle=\color[rgb]{0.026,0.112,0.095},             commentstyle=\itshape\color{green!40!black},             stringstyle=\itshape\color{red!90!black},             numberstyle=\itshape\color{yellow!50!black}     }          \begin{document}      \begin{lstlisting}[style=JavaStyle]       int[] ones = {1,1};         int points = 10;         int[] region = new int[points];         int timeTicks;         int totalTime;         int LiveTime = 0;         int totcount;         int evType = 1; //The Type ID for these kinds of events         SimpleDateFormat today = new SimpleDateFormat("dd/MM/yyyy");         SimpleDateFormat now = new SimpleDateFormat("HH:mm:ss:SSS");              Map<String,KmaxHist> histograms = new HashMap<String,KmaxHist>();              static final int evSize = 6;//The num of parameters per event of this type         static final int BUF_SIZE = evSize*1000;// Buffer size           static final int LP_MEM_TOP = 0xFFFF00;//Memory size 16MB            static final int READ_START = LP_MEM_TOP  -  BUF_SIZE;//We start the read/write pointer 1 buffer before the end              int[] blkData = new int[BUF_SIZE];           /**         * The 'init' method is executed at compile time.         */         public void init(KmaxToolsheet toolsheet) {             tlsh = toolsheet;//Save this reference for use in the toolsheet                  dev = tlsh.getKmaxDevice("DEV1");             dataField = tlsh.getKmaxWidget("$R_DATA");             countField = tlsh.getKmaxWidget("$R_COUNT");             liveTime = tlsh.getKmaxWidget("LIVE_TIME");//Live Time             realTime = tlsh.getKmaxWidget("REAL_TIME");//Real Time             deadTime = tlsh.getKmaxWidget("DEAD_TIME");//Dead Time             hist1 = tlsh.getKmaxHist("DATA1");             hist2 = tlsh.getKmaxHist("DATA2");             hist3 = tlsh.getKmaxHist("DATA3");             hist4 = tlsh.getKmaxHist("DATA4");             hist5 = tlsh.getKmaxHist("DATA5");             hist6 = tlsh.getKmaxHist("DATA6");             histoLowX = tlsh.getKmaxHist("HIST_LOW_X");             histoLowY = tlsh.getKmaxHist("HIST_LOW_Y");                  histograms.put("DATA1", hist1);                     histograms.put("DATA2", hist2);             histograms.put("DATA3", hist3);      \end{lstlisting}     \end{document}      and the output is ![enter image description here](http://i.stack.imgur.com/HCDth.png) Any idea on how to reproduce the code in the first image?


title: Fill and draw option

text: Is there a single option to set both the draw and the fill color of a TikZ node? Something like:               \node[rectangle,drawandfill=red]{test};      The actual problem is the following: I have many adiacent rectangles node with different filling colors. Each rectangle has a different filling color. Now I need to remove the tiny white border around each rectangle and I want that each rectangle has a drawing color equal to its filling color. Since it would be a pain to rewrite `draw=<color name>` for every rectangle, I was hoping for a command like `fillanddrawn=<color name>` so that I could use some search and replace feature to add all the drawing colors at once.


title: Table of Figures

text: Is there a nice way to include multiple figures in the format of a table? I want it to look something like the following mock-up (pardon my terrible MS Paint skills), and am willing to `include` any necessary packages. I would love it if there were a nice way to label the columns as rows as I did (`a` and `b`, and `1`, `2`, and `3`). ![enter image description here](http://i.stack.imgur.com/y08Y3.png)


title: Graphing each trigonometric function and its inverse

text: May I have the code for graphing each trigonometric function and its inverse on the same Cartesian plane? I have the following code for only graphing the sine function, and I got the following error: sorry, the supplied plot command is unknown by `pgfplots`. Please give me a web site for the syntax for the `\begin{axis}` command.               \documentclass{amsart}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}[grid=both,domain=-2*pi:2*pi,samples=200,no marks,     xticklabels={-2$\pi$,-1.5$\pi$,...$\pi$,2$\pi$},x post scale=1.5]     \addplot {sin(deg(x))};     \end{axis}     \end{tikzpicture}     \end{document}


title: How to make a clean and grouped nomenclature list?

text: The nomenclature groups are: `Acronyms`: two columns (abbrev. - description) `Roman symbols`: three columns (symbol - description - unit) `Greek symbols`: three columns (symbol - description - unit) ... The symbols should be sorted alphabetically. ![An example](http://i.stack.imgur.com/dJmNu.jpg) My current nomenclature settings:               %----------------------------------------------------------     %                        Nomenclature     %----------------------------------------------------------     %\renewcommand{\nomname}{List of Symbols and Abbrev.}     \renewcommand\nomgroup[1]{%       \ifthenelse{\equal{#1}{A}}{%        \item[\textbf{Acronyms}] }{%                  A - Acronyms         \ifthenelse{\equal{#1}{R}}{%          \item[\textbf{Roman Symbols}]}{%            R - Roman           \ifthenelse{\equal{#1}{G}}{%             \item[\textbf{Symbols}]}{%          G - Greek               \ifthenelse{\equal{#1}{S}}{%                \item[\textbf{Superscripts  }]}{{%          S - Superscripts             \ifthenelse{\equal{#1}{U}}{%              \item[\textbf{Subscripts }]}{{%                 U - Subscripts             \ifthenelse{\equal{#1}{X}}{%              \item[\textbf{Other Symbols }]}%            X - Other Symbols                         {{}}}}}}}}}}     %\ifpdf     \renewcommand{\nomlabel}[1]{\hspace{1 em}#1}%{\hspace{1.5 em}#1}     \renewcommand*{\nompreamble}{\markboth{\nomname}{\nomname}}      **Edit1** : After using the modified settings, the nomenclature looks like: ![enter image description here](http://i.stack.imgur.com/B98iP.jpg) Well, the description should be aligned in the mid-column, while Units aligns like symbols at the same line. How to figure this out?


title: Strange Cross Symbol in LaTeX

text: I can't draw a particular cross symbol in LaTeX. I tried drawing it in Dextify, but that didn't recognize the symbol. I don't even know what it is called. Any help with the name or the code is appreciated. An image is below. ![enter image description here](http://i.stack.imgur.com/YXPjS.png)


title: Insert a character in the beginning of each line in a special verbatim environment

text: How can I insert a special character or a symbol in the beginning of each line in a verbatim environment? In particular, there is a constraint that applies to the verbatim environment: it must be of a special type (given below); it cannot be any of the standard `verbatim` environments, e.g. from packages `fancyvrb` or `listings`.. I am working on developing an environment to format email correspondence. It is based on a modification of the standard `verbatim` environment without the `\obeylines` part, see "Format a verbatim paragraph" As the code has mainly been developed by Frank Mittelbach I am not sure what would be the minimal working example.. So I think I have to include the whole environment. Here is an example:               \documentclass{article}     \usepackage{xstring}     \makeatletter     \newdimen\outerparindent     \def\myverbatim#1{%       \IfStrEq{#1}{c}{\renewcommand{\verbatim@font}{\slshape\ttfamily}}       {\renewcommand{\verbatim@font}{\upshape\ttfamily}}%       \def\do@noligs##1{%          \catcode`##1\active          \begingroup            \lccode`\~`##1\relax            \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`##1 }}}%        \outerparindent\parindent        \def\obeylines{\rightskip=0pt plus 1fil                       \parindent=\outerparindent                       \let\par\@@par                       \leavevmode\indent}%        \def\@xobeysp{\penalty\z@\mbox{}\space\penalty\z@}%         \@verbatim       \@myverbatimescape\@myverbatimnewline       \frenchspacing\@vobeyspaces\@xmyverbatim}     \let\endmyverbatim\endverbatim     \begingroup     \catcode`\^^M=\active%     \gdef\@myverbatimnewline{\catcode`\^^M=\active \let^^M\@xmyverbatimnewline}%     \gdef\@xmyverbatimnewline{\@ifnextchar ^^M{\@myverbatimpar}{\@xobeysp}}%     \gdef\@ymyverbatimnewline{\@ifnextchar ^^M{\@myverbatimpar}{}}%     \gdef\@myverbatimpar ^^M{\par%                              \vskip\baselineskip%                              \@ymyverbatimnewline}%     \gdef\@zmyverbatimnewline{\@ifnextchar ^^M{\@zmyverbatimpar}{}}%     \gdef\@zmyverbatimpar^^M{\@ifnextchar ^^M{\@myverbatimpar}{}}%     \endgroup     \begingroup \catcode `|=0 \catcode `[= 1     \catcode`]=2 \catcode `\{=12 \catcode `\}=12     \catcode`\\=13     |gdef|@myverbatimescape[|catcode`|\|active|let\|@myverbatimbslash]     |gdef|@myverbatimbslash[|@ifnextchar\[|@xmyverbatimbslash][|string\]]     |gdef|@xmyverbatimbslash\[|\]     |catcode`|^^M=|active     |long|gdef|@xmyverbatim#1\end{myverbatim}[|@zmyverbatimnewline#1^^M|vskip-|lastskip|vskip|z@skip|end[myverbatim]]%     |endgroup     \makeatother     \begin{document}     \begin{myverbatim}{c}     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sed orci quis urna volutpat tincidunt. Praesent ultrices commodo auctor. Nunc vel nulla sed arcu aliquet faucibus quis nec ante. Nam elementum neque vitae sem fringilla a euismod eros malesuada. Duis orci eros, tincidunt et venenatis at, tristique in tortor     \end{myverbatim}     \begin{myverbatim}{n}     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sed orci quis urna volutpat tincidunt. Praesent ultrices commodo auctor. Nunc vel nulla sed arcu aliquet faucibus quis nec ante. Nam elementum neque vitae sem fringilla a euismod eros malesuada. Duis orci eros, tincidunt et venenatis at, tristique in tortor     \end{myverbatim}     \end{document}      The current output: ![enter image description here](http://i.stack.imgur.com/UVYmQ.png) (Goal: I would like to insert a special symbol like `>` or `|` in the beginning of each line of the first paragraph (i.e. in the beginning of each line with slanted text)) More specifically: How can I modify the environment such that if the parameter to the `myverbatim` environment is, say, the character `c`, then each line is preceded by a symbol, say `>`, if the parameter is not `c` then no symbol is inserted in the beginning of the line.. I have studied David's answer to this post "Environment prints same character at beginning of each output line" but I could not get it to work for my case.. Maybe there is a simpler solution? (See also: How to format an email conversation?)


title: Mark in word and margin in paragraph

text: Anyone knows how to put a mark on a word? (1) Text: (1) will be slightly raised as if an exponent. Also, how could shorten margins in a paragraph? Clip 10 mm left and 10 mm right?


title: Using pgfplots in beamer

text: I want to plot the following data in one slide               %-----------------------     \documentclass{beamer}          \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{filecontents}          \begin{document}          \begin{frame}[t]     \frametitle{Numerical Results}     \begin{filecontents}{Sp.dat}     n   r     a        k      1          100          100          100     2       95.721       98.645       98.738     4        82.31       93.497       93.295     8       56.667       63.901       63.838     16       46.536       52.572        53.31     32       45.399       53.421       53.318     \end{filecontents}          \pgfplotstableread{Sp.dat}{\Sp}     \pgfplotsset{tick label style={font=\tiny\bfseries},     label style={font=\small},     legend style={font=\tiny}     }     \begin{tikzpicture}[scale=1.0]     \begin{axis}[ymajorgrids=true,      xmin=0,xmax=32,ymin=40,ymax=105,     xtick={1,2,4,8,16,32},     ytick={45,50,60,70,80,90,100},     xlabel= Number of processors,     ylabel=Efficiency]     \addplot [black,very thick] table [x={n}, y={r}] {\Sp};     \addlegendentry{$20\rightarrow 15$}     \addplot [dashed,red,very thick] table [x={n}, y={n}] {\Sp};     \addlegendentry{$20\rightarrow 10$}     \addplot [dotted,blue,very thick] table [x={n}, y={k}] {\Sp};     \addlegendentry{$20\rightarrow 5$}     \end{axis}     \end{tikzpicture}     \end{figure}     \end{frame}     %---------------------          \end{document}      but the error is               ! Package pgfplots Error: Sorry, could not retrieve column 'n' from table 'Sp.d     at'. Please check spelling (or introduce name aliases)..          See the pgfplots package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.1718 \end{frame}


title: Symbol: "maps isomorphically"

text: I want to make a symbol for "maps isomorphically" which consists of a relatively large tilde above a right arrow. Overset doesn't work (besides, the tilde would be too small). MWE:               \documentclass{article}     \usepackage{amsmath}          \begin{document}     Thus $X$ is isomorphic to $Y$ via $f$:      \[f : X \overset{\tilde}{\to} Y.\]     \end{document}      I also tried using `array` but that didn't work either. MWE:               \documentclass{article}     \usepackage{amsmath}          \begin{document}     Thus $X$ is isomorphic to $Y$ via $f$:      \[f: X \begin{array}{c}\tilde \\ \to \end{array} Y\]      If I could get this to work, the spacing would need to be adjusted significantly.


title: Test whether last letter of a string is upper case or not

text: I would like to define a command that will behave according to the nature of the last character fed it. But I'm having difficulty just getting the components of my command to work. I thought I could grab the last letter of the _string_ that I'm passing the command and use `expl` magic to make it upper case. Then I would test whether the last letter and its upper case version are the same. But I can't even get that far. In this MWE, I've defined two commands. The first command is just supposed to grab the first _token_ and change it to upper case. It fails to do this. the second is supposed to reverse the string and return only the first token. That too is failing.               \documentclass{article}     \usepackage{xparse}     \ExplSyntaxOn          \tl_new:N \l_ae_lasttoken_tl     \tl_new:N \l_ae_upper_lasttoken_tl     \NewDocumentCommand{\aeupcasefirstelement}{ m }         {             \tl_set:Nn  \l_ae_lasttoken_tl        { \tl_head:n { #1 } }             \tl_set:Nn  \l_ae_upper_lasttoken_tl  { \tl_to_uppercase:n {  \l_ae_lasttoken_tl } }             %% show results of these actions             \textbf{ \l_ae_lasttoken_tl {~   vs.  ~} \l_ae_upper_lasttoken_tl }         }          \NewDocumentCommand{\aelastelement}{ m }         {             \tl_set:Nn \l_ae_lasttoken_tl { \tl_head:V { \tl_reverse:V #1 } }             %% show results of these actions             \textbf{ \l_ae_lasttoken_tl }         }          \ExplSyntaxOff     \pagestyle{empty}     \setlength{\parindent}{0pt}     \begin{document}          \begin{tabular}{ll}     Expecting to see & Getting \\     \textbf{T vs. T} & \aeupcasefirstelement{This is a test of my command} \\     \textbf{t vs. T} & \aeupcasefirstelement{this is a test of my command} \\     \textbf{d}       & \aelastelement{This is a test of my command}     \end{tabular}          \end{document}


title: bmatrix - buggy? Alternating Color and not completely drawn

text: ![enter image description here](http://i.stack.imgur.com/c79xX.png) As you can see, my `bmatrix` is a little bit bugged and I don't know why... This is the sourcecode:               \begin{equation}     \begin{bmatrix}     \mathbf{d}_x \\     \mathbf{d}_y \\     \mathbf{d}_z \\     \end{bmatrix}=\begin{bmatrix}        1 & 0 & 0  \\        0 & {\cos \mathbf{\theta}_x } & { - \sin \mathbf{\theta}_x }  \\        0 & { \sin \mathbf{\theta}_x } & { \cos \mathbf{\theta}_x }  \\     \end{bmatrix}\begin{bmatrix}        { \cos \mathbf{\theta}_y } & 0 & { \sin \mathbf{\theta}_y }  \\        0 & 1 & 0  \\        { - \sin \mathbf{\theta}_y } & 0 & { \cos \mathbf{\theta}_y }  \\     \end{bmatrix}\begin{bmatrix}        { \cos \mathbf{\theta}_z } & { - \sin \mathbf{\theta}_z } & 0  \\        { \sin \mathbf{\theta}_z } & { \cos \mathbf{\theta}_z } & 0  \\        0 & 0 & 1  \\     \end{bmatrix}\left( {\begin{bmatrix}        \mathbf{a}_x  \\        \mathbf{a}_y  \\        \mathbf{a}_z  \\     \end{bmatrix} - \begin{bmatrix}        \mathbf{c}_x  \\        \mathbf{c}_y  \\     \mathbf{c}_z  \\     \end{bmatrix}} \right)     \end{equation}      Nothing magic inside of my equation. A simple example with `\begin{bmatrix} 1 // 2 // 3 \end{bmatrix}` has the same result and problem... I'm importing this:               \RequirePackage{amsmath}     \RequirePackage{amsfonts}      Has anyone seen this problem before? What can I do to solve it?