title: Removing gap above "Chapter X" introduces problems with the text formatting

text: I am trying to get the page layout of my thesis sorted out. I am using `fancyhdr` to give me the page number in the top right and chapter name in the top left with a horizontal rule under, and `sectsty` to give me sans-serif font for all my section/subsection/etc headings. I don't like the large gap above the words "Chapter X" with the horizontal rule under the header, so I'd like to reduce this. I have implemented the answer to this question: How to decrease spacing before chapter title? but I am rather unsatisfied: as you can see from my MWE below I have to redefine all of the ToC/LoF/LoT/Bibliography commands, and `chapter*` seems to have reverted to the serif font also. In short, it seems very cumbersome. Is there really not a more elegant way? And if not, could someone with more knowhow than me explain how to get the `chapter*` heading into `sffamily`?               \documentclass[12pt, a4paper, oneside, fleqn]{report}          \headheight 28pt     \headsep 24pt          \usepackage{lmodern}       % gives bold italic font          \usepackage[toc]{glossaries} % add a glossary     \makeindex     \makeglossaries          %Sectioning and headings     %------------------------     \usepackage{fancyhdr}     \fancypagestyle{plain}{  %     \fancyhf{} %clear all header/footer fields     \rhead{\sffamily{\thepage}}}          \usepackage{appendix}               % allow formatting of appendix titles          \usepackage{sectsty}          % put section headings in sans-serif font     \allsectionsfont{\sffamily}     \chapterfont{\LARGE\sffamily}          \makeatletter                                   % remove hideous gap from above the chapter title     \def\@makechapterhead#1{%       %%%%\vspace*{50\p@}% %%% removed!       {\parindent \z@ \raggedright \normalfont         \ifnum \c@secnumdepth >\m@ne             \LARGE\sffamily\bfseries \@chapapp\space \thechapter             \par\nobreak             \vskip 20\p@         \fi         \interlinepenalty\@M         \LARGE\sffamily\bfseries #1\par\nobreak         \vskip 40\p@       }}     \def\@makeschapterhead#1{%       %%%%%\vspace*{50\p@}% %%% removed!       {\parindent \z@ \raggedright         \normalfont         \interlinepenalty\@M         \Huge \bfseries  #1\par\nobreak         \vskip 40\p@       }}     \makeatother          %reformat some of the page titles     \renewcommand{\abstractname}{\textsf{Abstract}}     \renewcommand{\appendixpagename}{\textsf{Appendices}}     \renewcommand{\bibname}{\textsf{Bibliography}}     \renewcommand{\contentsname}{\textsf{Table Of Contents}}     \renewcommand{\listfigurename}{\textsf{List of Figures}}     \renewcommand{\listtablename}{\textsf{List of Tables}}          \makeatletter     \newcommand*{\myappendixpage}{%remove page number from the Appendix page       \begingroup       \let\ps@plain\ps@empty       \appendixpage       \endgroup}     \makeatother               \begin{document}          \pagenumbering{gobble}     \pagestyle{empty}     \renewcommand{\headrulewidth}{0pt}          %title page stuff     \begin{center}     \sffamily{\Huge{\textbf{This is the full title of my Thesis}}}     \end{center}     %end title page               %This stuff at the front with roman numbering     %--------------------------------------------     \pagestyle{plain}      \pagenumbering{roman}          \newpage     Copyright statement          \begin{abstract}     here is my abstract     \end{abstract}          \chapter*{Acknowledgements}     I'd like to acknowledge some help from some people here.          \tableofcontents     \listoffigures     \listoftables     \newglossaryentry{Term}     {       name={Term},       description={Description of my term}     }     \glsaddall     \printglossary[title=\textsf{Glossary}]          %Main thesis text with arabic numbering     %--------------------------------------          \pagenumbering{arabic}     \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{\markboth{\sffamily{\MakeUppercase{\thechapter.\ #1}}}{}}     \lhead{\leftmark}     \chead{}     \rhead{\sffamily{\thepage}}     \renewcommand{\headrulewidth}{0.1pt}     \fancyfoot{}          \chapter{Introduction with some \textit{italic text}}     Here is my chapter          %Appendices and bibliography     %---------------------------          \appendix          \myappendixpage          \chapter{My appendix}     some stuff here               \end{document}


title: Position of \only within a \tabular

text: I have the following code:               \documentclass{beamer}     \usetheme{Boadilla}     \usepackage[frenchb]{babel}          \begin{document}          \begin{frame}     \begin{tabular}{ll|ll}       \only<1>{only 1}       \only<2>{only 2}     \end{tabular}     \end{frame}      It compiles, but curiously the position changes slightly between 2 slides. Does anyone know how to keep the same position while using `\only`?


title: Perspective transform

text: The following piece of eye candy: ![fancy compass figure](http://i.stack.imgur.com/qGBzm.png) was produced using the following code:               \documentclass[a4paper]{article}     \usepackage{tikz}     \usetikzlibrary{shapes.arrows}     \usetikzlibrary{shadows.blur}          \makeatletter          \def\sin@alpha{0.9}     \def\cos@alpha{0.006} % scaled with eye distance... never mind.          \def\kappa{0.551784} % control point inset for almost-circles          \def\pgf@pos@transform#1#2{%       \ifpgf@pt@identity%       \else%         \pgf@pt@temp=#1%         #1=\pgf@pt@aa#1%         \advance#1 by\pgf@pt@ba#2%         #2=\pgf@pt@bb#2%         \advance#2 by\pgf@pt@ab\pgf@pt@temp%       \fi%       \advance#1 by\pgf@pt@x%       \advance#2 by\pgf@pt@y%       \pgfmathsetmacro{\denominator}{1+\cos@alpha*#2)}%       \pgfmathparse{#1/\denominator}%       #1=\pgfmathresult pt%       #2=\sin@alpha#2%       \pgfmathparse{#2/\denominator}%       #2=\pgfmathresult pt%     }          \makeatother          \begin{document}     \begin{center}       \begin{tikzpicture}[yshift=5cm]         \draw[help lines] (-5,-5) grid (5,5);              \def\r{5}         \draw[thick,draw opacity=0.3,ball color=blue!20,blur shadow]         (\r,0) .. controls(\r,\kappa*\r) and (\kappa*\r,\r) .. (0,\r)         .. controls(-\kappa*\r,\r) and (-\r,\kappa*\r) .. (-\r,0)         .. controls(-\r,-\kappa*\r) and (-\kappa*\r,-\r) .. (0,-\r)         .. controls(\kappa*\r,-\r) and (\r,-\kappa*\r) .. (\r,0) -- cycle;              \foreach \r in {1,2,3,4} {           \draw[draw opacity=0.3] (\r,0) .. controls(\r,\kappa*\r) and (\kappa*\r,\r) .. (0,\r)           .. controls(-\kappa*\r,\r) and (-\r,\kappa*\r) .. (-\r,0)           .. controls(-\r,-\kappa*\r) and (-\kappa*\r,-\r) .. (0,-\r)           .. controls(\kappa*\r,-\r) and (\r,-\kappa*\r) .. (\r,0) -- cycle;         }              \node[arrow box,rotate=45,arrow box arrows={north:6cm,east:6cm,south:6cm,west:6cm},               draw,top color=blue!20,               arrow box shaft width=5mm,arrow box head extend=2mm,arrow box head indent=1mm,               minimum width=5mm,minimum height=5mm,blur shadow] at (0,0) {};       \end{tikzpicture}     \end{center}     \end{document}      (for the blurred shadows, you have to get the pgf-blur package from CTAN. Otherwise just change blur shadow to drop shadow) The code for the grid, ellipses, and arrows is completely independent of the perspective transform. That is handled by doing nasty things to the low level `\pgf@pos@transform` macro. So far so good. But...   * The circle has to be emulated using Bézier splines because the coordinate transform is done before circles are transformed to splines.   * the same will be true for any ellipses, arcs, rounded corners, etc.   * in this case transforming the control points gives a close enough approximation to the transformed Bézier spline, but that's just luck. In general, any curve-to might have to be decomposed into several pieces to get better approximations.   * setting up the perspective transform is really low level. Any suggestions about how to do this properly? Maybe with a decoration?


title: Cisco Icons for network diagrams

text: First of all thanks for this great site. My foray to Latex has been easier than I thought. My company are producing technical documentations of as-built network projects from Structured Cabling to Network Diagram of small office to Datacenter. We have been using MS Office suite of tools, from Word to Visio. My dilemma of producing a cohesive design from page 1 to the last page, where solve by Latex/Tex and we are using Texmaker 3.02 as tools with MiKTex 2.9 as our Latex/TEx platform and so far it has been very good. Most of our Wire and Cable test results' output were PDF and XML generated by Fluke DTX-1800. With Latex/Tex we are including PDF tests results and network diagrams now with its page numbering as if it belongs to the whole documentation design. Ive seen diagram maker tools like the one for UML and Electrical/Electronics circuits however with my short span of searching from the site I havent seen Cisco network icon type diagram. If there is one, I hope someone can point me to its location. Sorry, English is just my second language if I may not express it easily. Thanks and more power. You have one follower right here.


title: Center chapter name in the table of contents

text: I am adding chapter name for a set of sections with the following code:               \addcontentsline{toc}{section}{\protect\numberline{}Chapter I}      However, Chapter I is left-sided. What I want is something like:                       Chapter I          1. Introduction...          2. Related work          3. ...                  Chapter II          6. Section bla bla      where Chapter I and Chapter II are centered. How can I enforce that without touching my document class? I found an ugly, yet effective solution:               \addcontentsline{toc}{part}{\protect\centering{}Chapter I}      It is not really chapter, but part with the name Chapter I. I know that this is ugly solution. When I used _section_ or _chapter_ , it was kind of merging with the next line or being centered in the first half of the widthline.


title: Add vertical space into a chapter

text: I need to add extra vertical space before a particular chapter heading, for example "list of tables". I wanna do this because the space before some of the chapter headings are less than rest of the chapters. I tried adding `\vspace*{1in}` before `\listoftables` statement, but it did not work. Any help will be greatly appreciated.               \documentclass[10pt, letterpaper]{report}     \usepackage{thesis}     \renewcommand\contentsname{TABLE OF CONTENTS}     \usepackage{titlesec}     \renewcommand{\chaptername}{CHAPTER}     \titlespacing*{\chapter}{0pt}{0.45in}{0.3in}     \titleformat{\chapter}[display]             {\normalfont\Large\centering}{\chaptertitlename\ \thechapter}{0pt}{\Large\uppercase}     \titleformat{\section}{\large\bfseries}{\thesection}{1em}{}                    \begin{document}     \tableofcontents          \addcontentsline{toc}{chapter}{LIST OF TABLES}     \renewcommand{\listtablename}{LIST OF TABLES}     \listoftables          \addcontentsline{toc}{chapter}{LIST  OF FIGURES}     \renewcommand{\listfigurename}{LIST  OF FIGURES}     \listoffigures               \chapter{INTRODUCTION}     Lorem ipsum .............     \end{document}


title: Description list with item and body in separate columns

text: I try to achieve the following layout with a description list               Item1     Description of the item where wrapping aligns like this.                Should also handle itemize environment in the description body                  * itemize1                  * itemize2                  * itemize3            Item2     Another description. Another description. Another description.               Another description. Another description. Another description.       I have tried different hackish approaches, like `minipage`, `mbox` etc in the description body. Is there any nice and simple solution for this layout, google didn't help at all...


title: A comma decimal separator that is bigger than a dot

text: \documentclass{mwrep}     \usepackage{amsmath}     \begin{document}     Check:\\     with "," $0,125$\\     with "." $0.125$          with commas:     \begin{equation}     P=     \begin{bmatrix} 0,1 & 0,3 & 0,0 & 0,6 \\                     0,2 & 0,4 & 0,1 & 0,3 \\                     0,0 & 0,8 & 0,0 & 0,2 \\                     0,2 & 0,0 & 0,2 & 0,6     \end{bmatrix}     \end{equation}          with dots:     \begin{equation}     P=     \begin{bmatrix} 0.1 & 0.3 & 0.0 & 0.6 \\                     0.2 & 0.4 & 0.1 & 0.3 \\                     0.0 & 0.8 & 0.0 & 0.2 \\                     0.2 & 0.0 & 0.2 & 0.6     \end{bmatrix}     \end{equation}          \end{document}      As you can see numbers with a comma as a decimal separator are wider than those with a dot. How can I change space after a comma to be equal to space after a dot?


title: Latex rotated multi-column

text: ![enter image description here](http://i.stack.imgur.com/sXPW2.gif)Using Latex to try to reproduce the multi-column table with rotation and wrapping of text in the example shown above. It is columns 2 and 3 of the attached image that is giving me the problems. I've tried a variety things like `\begin{rotate}{90} stuff \end{90}` with no luck. I've also tried to `\begin{sideways} stuff \end{sideways}` with no luck.


title: Dashed circular arcs not created in texmaker

text: I am trying to run the following sample codes, containing PStricks codes generated by Geogebra, in Texmaker in the sequence Latex+dvips+ps2pdfviewpdf (in Ubuntu).               \documentclass[10pt,a4paper]{beamer}     \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{multimedia}     \usepackage{graphicx}     \usepackage{textpos}     \usepackage{graphicx}     \usepackage{pstricks}     \usetheme{CambridgeUS}%NICe     \usefonttheme{serif}     \setbeamercolor{normal text}{bg=white!100}%}, fg=black!100}     \begin{document}      \begin{frame}{Sample}      \begin{figure}[h]      \begin{center}      \psscalebox{0.5 0.5} % Change this value to rescale the drawing.       {      \newrgbcolor{xdxdff}{0.49 0.49 1}      \psset{xunit=0.5cm,yunit=0.5cm,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}     \begin{pspicture*}(-7.96,-11.79)(40.22,11.47)     \psline(-4,8)(-2,10)     \psline(-4,8)(-6,10)     \psline(-4,8)(-6,6)     \psline(-4,8)(-2,6)     \psline(-4,8)(-6.83,7.99)     \psline(-4,8)(-1.24,8.02)     \parametricplot[linestyle=dashed,dash=4pt 4pt]{3.145209626861558}{3.9269908169872414}{1*2.83*cos(t)+0*2.83*sin(t)+-4|0*2.83*cos(t)+1*2.83*sin(t)+8}     \parametricplot[linestyle=dashed,dash=4pt 4pt]{2.356194490192345}{3.145209626861558}{1*2.83*cos(t)+0*2.83*sin(t)+-4|0*2.83*cos(t)+1*2.83*sin(t)+8}     \parametricplot[linestyle=dashed,dash=4pt 4pt]{0.00766901039872073}{0.7853981633974483}{1*2.76*cos(t)+0*2.76*sin(t)+-4|0*2.76*cos(t)+1*2.76*sin(t)+8}     \parametricplot[linestyle=dashed,dash=4pt 4pt]{-0.7853981633974483}{0.00766901039872073}{1*2.83*cos(t)+0*2.83*sin(t)+-4|0*2.83*cos(t)+1*2.83*sin(t)+8}     \end{center}     \end{figure}     \end{frame}     \end{document}      But I get an error and the dashed circular arcs are not created. The following error comes : `Undefined control sequence \parametricplot l.510 \end{frame}`


title: Conference name and paper ref in beamer title slide

text: How can I add extra information on the title slide? in particular I'd like to put in the conference name and location as well as a reference to the paper work is based on. Thanks


title: pgfplots addplot 'domain' option overwrites/collides with axis 'domain' option

text: I have a problem with domain specification in addplot which collides with domain specification in axis. The code below plots the x axis as well as the function (expo) from 0.1 to 2. My desired behavior is that the axis is plotted from 0 to 2 and only the function from 0.1 to 2.               \begin{figure}[!ht]     \centering          \pgfmathdeclarefunction{expo}{1}{%         \pgfmathparse{1/(#1)*exp(-x/#1)}%     }          \begin{tikzpicture}         \begin{axis}[             height=5cm,width=10cm,no markers,samples=100,axis lines=left,domain=0:2,xtick={0,0.5,1,1.5},ytick={0,4,8},enlargelimits=false         ]             \addplot[domain=0.1:2,thick] {expo(0.1)} node[pos=0.7,pin=45:{$\dfrac{1}{\lambda}\approx\SI{0.1}{\meter}$}] {};         \end{axis}     \end{tikzpicture}     \end{figure}      Does anybody know, how to obtain the desired behaviour?


title: How can I add another plot to the \addplot command in PGFPlots?

text: My goal is to add another plot to the \addplot command and this small example hopefully shows what I'm trying to do:               \documentclass{standalone}     \usepackage{pgfplotstable}     \begin{document}          \pgfplotstableread[col sep=comma]{     procs, none     16, 6.079748e+03     32, 3.624823e+03     64, 1.685646e+03     128, 9.180763e+02     256, 5.977239e+02     512, 4.410280e+02     }\scalability          \begin{tikzpicture}       \begin{loglogaxis}[         ylabel={Time (sec)},         xtick=data,         xticklabels from table={\scalability}{procs},         table/x=procs,         set scaling/.code={           \edef\xcol{\pgfkeysvalueof{/pgfplots/table/x}}           \pgfplotstablegetelem{0}{\xcol}\of{\scalability}           \edef\proc{\pgfplotsretval}           \pgfplotstablegetelem{0}{\pgfkeysvalueof{/pgfplots/y}}\of{\scalability}           \edef\offset{\pgfplotsretval}           \pgfplotsset{table/y expr=\offset * \proc / \thisrowno{0}}           \pgfplotsextra{             \draw (1,1) -- (256,256);              % this is drawn             \addplot table[y=none] {\scalability}; % this is not           }         },         scaling/.style={           forget plot,           set scaling,         },         forget plot style={opacity=0.4},         ]              \addplot +[y=none,scaling] table {\scalability};         % \addplot table[y=none] {\scalability};            \end{loglogaxis}     \end{tikzpicture}          \end{document}      What I'd like to see is: ![enter image description here](http://i.stack.imgur.com/qbH3I.png) but tinkering with the .code functionality (and also `execute at end plot`) nothing seems to be able to call another `\addplot` only lower level TikZ commands (`\draw`, `\path`, etc.): ![enter image description here](http://i.stack.imgur.com/zX0fH.png) Is there any way to get another `\addplot` appended?


title: Custom Numbering in Derivation / Proof Environment

text: Just a quick background, I am writing a thesis, which has theorems (proofs and derivations) and possibly a few other 'theorem' type environments. The code in this question actually works fine, it is doing what I want however I feel that it could be tidied up / improved. In terms of equations, I have elected to have a numbering format which is local to the actual proof or derivation. So this involves storing the existing equation number, resetting it to zero, changing the style (for the proof or derivation respectively) executing the contents, and then restoring to the existing value. Furthermore, some of the derivations / proofs can be condensed by using multicol, and one of my earlier posts Shaded Multicols serves to distinguish the proof / derivation from surrounding content, however, for the purposes of this question, these formatting styles have been removed. **Here is a stripped down version of the code, which is a full MWE:**               \documentclass{article}          %------------LOAD THE PACKAGES---------------%     %Load Single Packages Together     \usepackage{amsmath,amsfonts,amssymb,amsthm,mathtools,mathpazo,calc,ifthen}     \usepackage{environ,multicol,xcolor}          %DEFINE MY THEOREM STYLE     \let\oldproof\proof\let\proof\relax     \let\oldendproof\endproof\let\endproof\relax     \newcommand{\theoremLetter}{}     \newtheoremstyle{mythm} % name         {0pt}                        % Space above         {0pt}                        % Space below         {\small}% Body font         {}                           % Indent amount         {\bf\color{blue!50!black}}% Theorem head font         {.}% Punctuation after theorem head         {.5em}                       % Space after theorem head         {}  % Theorem head spec (can be left empty, meaning ‘normal’)     \theoremstyle{mythm} %SELECT THE THEOREM     \newtheorem{derivation}{Derivation}     \newtheorem{proof}{Proof}          %Renew Formats, Equation, Figure, Table.     \renewcommand{\thederivation}{D\arabic{derivation}}     \renewcommand{\theproof}{P\arabic{proof}}          \newcounter{mytemp}%     \newenvironment{myenv}[3]{%         \def\envvar{#1}%         \def\mycols{#2}%              \par\vspace{0.5em} %add space              %Set the first letter depending on the type of environment.         %DERIVATION         \providecommand{\theoremLetter}{}%RESET         \ifthenelse{\equal{\envvar}{derivation}}{%             \renewcommand{\theoremLetter}{D}%         }{}%         %PROOF         \ifthenelse{\equal{\envvar}{proof}}{%             \renewcommand{\theoremLetter}{P}%         }{}%              \begin{\envvar}{\textbf{#3}}%             \setcounter{mytemp}{\value{equation}}%             \providecommand{\existingEquationFormat}{\theequation}%             \setcounter{equation}{0}%             \renewcommand{\theequation}{%                 \theoremLetter\arabic{\envvar}.\arabic{equation}%             }%             \setlength{\abovedisplayskip}{0pt}%Set DisplaySkip Value.             \ifthenelse{\equal{\mycols}{1}}{}{\begin{multicols}{\mycols}}%     }{%BODY CONTENT OF ENVIRONMENT               \ifthenelse{\equal{\mycols}{1}}{}{\end{multicols}}%             \setcounter{equation}{\value{mytemp}}%             \renewcommand{\theequation}{\existingEquationFormat}%             \renewcommand{\existingEquationFormat}{\relax}%         \end{\envvar}%     }      **And for a sample output:**               \begin{document}         \hrule              \section{Default Equation Format}         \begin{align}                 y &= A\\                   &= B         \end{align}              \hrule              \section{Sample Derivation and Proof (Multicolumn)}         \begin{myenv}{proof}{2}{Sample Proof}             Column 1             \begin{align}%                 y &= A\\                   &= B             \end{align}%             Column 2             \begin{align}                 y &= C\\                   &= D             \end{align}         \end{myenv}              \begin{myenv}{derivation}{2}{Sample Derivation}             Column 1             \begin{align}%                 y &= A\\                   &= B             \end{align}%             Column 2             \begin{align}                 y &= C\\                   &= D             \end{align}         \end{myenv}              \hrule              \section{Demonstrate Reset/Continuation of Format}         \begin{align}                 y &= A\\                   &= B         \end{align}              \hrule              \section{Further Derivation and Proof (Single Column)}         \begin{myenv}{proof}{1}{Another Proof}             \begin{align}%                 y &= A\\                   &= B             \end{align}%         \end{myenv}              \begin{myenv}{derivation}{1}{Another Derivation}             \begin{align}%                 y   &= A\\                     &= B             \end{align}%         \end{myenv}              \hrule          \end{document}      **The above code produces the following result:** ![Sample Output](http://i.stack.imgur.com/rHgH4.png) **In this output, it is clear to see the following features:**   1. The numbering style of the Derivation and Proofs is local to the particular Derivation and Proof, the style has been changed to be preceeded by a P or a D, which serves to clearly distinguish the numbering from the standard equation numbering as part of the rest of the document.   2. Standard equation numbering is broken and resumed either side of the thm   3. Use of Single and Multi column mode. So my question here is, how can I replace the following in the code:               %Set the first letter depending on the type of environment.     %DERIVATION     \providecommand{\theoremLetter}{}%RESET     \ifthenelse{\equal{\envvar}{derivation}}{%         \renewcommand{\theoremLetter}{D}%     }{}%     %PROOF     \ifthenelse{\equal{\envvar}{proof}}{%         \renewcommand{\theoremLetter}{P}%     }{}%      ...So that it takes the first letter (uppercase) of the particular theorem style, at the moment, the reformatting is effectively 'hard-coded', and I would like to remove this limitation. Is there a more efficient way of coding what I have done here, I am sure there is, perhaps the `\newenvironment{myenv}{...}` can be removed completely.


title: Unable to Remove Vertical Space Before and After Lists within longtable

text: All the tricks to remove vertical space before and after itemize lists (using enumitem) seem to work well in `table/tabular` environments, but not in `longtable`. The following MWE illustrates the difficulty I'm having to get the First bullet at the same level as the Left item.               \documentclass[letterpaper,12pt]{book}          \makeatletter     \newcommand*{\compress}{\@minipagetrue}     \makeatother          \usepackage{enumitem}     \usepackage{longtable}          \begin{document}          \begin{table}     \begin{center}     \begin{tabular}{lp{4cm}}     Header1  &  Header2  \\     Left item  &       \compress\begin{itemize}[leftmargin=1em,noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt]      \item First bullet      \item Second bullet      \item Third bullet     \end{itemize}  \\     \end{tabular}     \end{center}     \end{table}          \begin{longtable}[htbp]{lp{12.25cm}}     Header1  &  Header2  \\     Left item  &        \compress\begin{itemize}[leftmargin=1em,noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt]      \item First bullet      \item Second bullet      \item Third bullet     \end{itemize}  \\     \end{longtable}          \end{document}      Here, even the `\compress` command fails to remove the space in `longtable`. Note that I need `longtable`, as some of my lists will be quite long and will need to be split. (Also, I'm not sure why I need to specify a fixed width for the second column (`{lp{4cm}}`) instead of `{ll}`.) Many thanks in advance.


title: Problem in bibliography autocompletion in TeXStudio 2.5.2

text: This question is the continuation of my previous question in here. I have updated everything according to the instructions given there in the answer of @doctorate. The problem that I have is the autocpmplete list in TeXStudio 2.5.2 for bibliography entries. Unfortunately, updating did not fix the autocomplete issue. I am using `classicthesis` package and my Bibliography.tex is located in the folder named `FrontBackMatter`. I came up with a solution for autocomplete by having:               \bibliography{../Bibliography}      in the file `Bibliography.tex`. This will allow me to see the entries of the bibliography in autocomplete list (very cool). However, the problem is that the compiler does not succeed in putting the citations in the document itself by using for example `\citep{}`. When I change it back to:               \bibliography{Bibliography}      in the file `Bibliography.tex`, the citation works perfectly in the document but autocomplete fails to show me the entries. I should say that my problem is not `\citep{keylist}`. `\citep{keylist}` is shown in the autocomplete because `natbin.cwl` is already selected. Actually, I would like to see `\citep{bibitem1}`, `\citep{bibitem2}`, ..., `\citep{bibitemN}` in the autocomplete list so that I can easily select the bibliography entries by scrolling through them. Unfortunately, the autocomplete list in my `TeXStudio` only shows the commands. Could someone help me find the solution to issue?


title: Is it possible for the printed output to show the endnote boxes?

text: I have a Latex document that include endnotes. I have adapted this document to show the boxed links in black using hyperref. The PDF output is as I wanted. MWE: %               \documentclass[a4paper,twoside,10pt]{report}     \usepackage[multiple]{footmisc}     \usepackage{hyperref}     \usepackage{endnotes}     \input{hyperendnotes.sty}     \let\footnote=\endnote          \usepackage{color}          \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}          \begin{document}          \hypersetup{       linkbordercolor=Black     }          Sample Text Sample Text \footnote{This endnote shows the color frame with the corresponding footnote (endnote number)}          \begingroup     \parskip 2ex     \theendnotes     \endgroup               \end{document}      A version of hyperendnotes.sty can be found here. I have included xcolor for convenience to change the color of the frame in each endnote number to black. However, I need the printed output to show these boxes as well. In the current version, the boxes in the endnotes disapear in the printed document (which is the common behaviour !). Is there any chance to change this default behaviour such that the printed output shows these endnote boxes ? The final goal is to be able to print the PDF without the Notes section, but still be able to highlight the position of these notes in the main text (hence the black box). I have tried to change the way in which the number of each endnote is framed, but there is a clash between hyperref and endnote packages. Thank you for your help.


title: Fake bold in LuaLaTeX

text: I am sometimes using a font that has no boldface, so I am wondering whether or not there is a way to use some `fakebold`-feature in LuaLaTeX. The `fontspec` documentation explains a feature for XeLaTeX, which does not (yet?) work in LuaLaTeX.   1. Does `fakebold` already work in LuaLaTeX?   2. If not, is something like it planned?   3. If yes, is there any scheduled release date for this feature?   4. If no to all the above: is there a hack or workaround? MWE:               % !TEX TS-program = lualatexmk     \documentclass[20pt, a4paper, DIV=calc]{scrbook}          \usepackage{fontspec}          \setmainfont[AutoFakeBold=2.0]{Times New Roman}          \begin{document}          A Test. \textbf{A bold test}?          \end{document}


title: How do I tell alltt environment to wrap text?

text: I have an already formatted text (space-wise) that is also being colored etc, so I am using `alltt` environment to print it. The text is code actually, but I am not using listings because I don't want it to color my code (I am doing the coloring based on which line is important so it's different). Problem is now, I can't figure a way to tell `alltt` to wrap the text. It would eventually look ugly if the text is wrapped, but it is even more ugly if they go out of the right border of the page!! So, is there a way to wrap text with `alltt`? If no, is it possible to get text that has styles (such as `\textit{...}` etc) with the listings package? **Edit:** Here is an example: Preamble (some styling):               \newcommand{\somewhatImportantCode}[1]{\textcolor[rgb]{0.0,0.35,0.6}{#1}}     \newcommand{\veryImportantCode}[1]{\textcolor[rgb]{0.0,0.5,0.9}{#1}}      Code:               \begin{alltt}     \somewhatImportantCode{\#include <iostream>}          int main()     \{       \veryImportantCode{std::cout <<} "Hello World!" \veryImportantCode{<< std::endl};       return 0;     \}     \end{alltt}      And here is how it looks like: ![enter image description here](http://i.stack.imgur.com/Rgv4X.png) Note that that goal is to direct the user to parts of the code that are more significant and that's why its styling is different. As you can see, the `\somewhatImportantCode` and `\veryImportantCode` could cover any short or long part of the code.


title: Ferial class option of evweek does not work with fontspec

text: I am trying to produce a two page weekly calendar using package `evweek` with the class option `ferial`. The following file works fine:               \documentclass[a4paper,ferial]{evweek}     \usepackage[paperwidth=297mm,paperheight=210mm]{geometry}          \begin{document}     \begin{weekly}%     {   firstday=1,         pageheight=280mm,          pagewidth=181mm,         topspace=0.5mm,          bottomspace=0mm,          grip=0mm,          punchpoints=0,          punchcluster=0,         punchgroups=0      }%     {}     may 6 2013 to may 12 2013     \end{weekly}     \end{document}      Since I need the weekly calendar to be in Greek I used XeLaTeX which works with the previous file but does not work when `\usepackage{fontspec}` is added:               \documentclass[a4paper,ferial]{evweek}     \usepackage[paperwidth=297mm,paperheight=210mm]{geometry}          \usepackage{fontspec}          \begin{document}     \begin{weekly}%     {   firstday=1,         pageheight=280mm,          pagewidth=181mm,         topspace=0.5mm,          bottomspace=0mm,          grip=0mm,          punchpoints=0,          punchcluster=0,         punchgroups=0      }%     {}     may 6 2013 to may 12 2013     \end{weekly}     \end{document}      What happens is that the two pages collapse to one and the output of the second page is superimposed on the first (albeit it is shifted to the bottom of the page). Any ideas why this happens and how it could be fixed;


title: (Dis-)Advantages of typing (polutoniko)greek letters?

text: As fan of `teubner.sty` and `gfsporson` I've typed a long document with teubner-Glyph-macros >\~W f\ia le Fa\ic dre ktl.` By chance I found that, without changing anything, I can use the Greek letters themselves as input, which happens to be read somewhat easier. Now, does anyone guess _any_ shortcomings, pitfalls ... with the Greek input? I don't want to make anythings worse and I'm still hopeful that I will use LuaLaTeX one day. To give a MWE with the most important packages:               \documentclass{scrbook}     \usepackage{savesym, cmap}     \usepackage[LGR,T1]{fontenc}     \usepackage[utf8]{inputenc}     \input{ix-utf8enc.dfu}     \usepackage{eledmac,eledpar}     \usepackage[math=normal,main=ngerman,greek,]{babel}     \usepackage[GlyphNames,boldLipsian]{teubner}     \savesymbol{breve}\savesymbol{aa}     \usepackage[osf,sc]{mathpazo}     \restoresymbol{pplj}{breve}\restoresymbol{pplj}{aa}     \ifFamily{pplj}{porson}     \usepackage{calc,soulutf8}\usepackage[nonegthinspace,twothirds]{thinsp}\usepackage[kerning=true,tracking=true,babel=true]{microtype}\DeclareMicrotypeSet{alltext}{encoding={LGR,T1}}\usepackage{fixltx2e}     \makeatletter\let\|=\relax\addto\greek@shorthands{\declare@shorthand{greek}\/}{\textormath{\penalty\@M\discretionary{-}{}{\kern.08em}\allowhyphens}{}}  % supposed to imitate "| for German language       \declare@shorthand{greek}{\|}{\textormath{\penalty\@M\discretionary{}{}{\kern.08em}\nolinebreak}{}}  % to imitate "| but without allowing for line breaks     }     \makeatother     \begin{document}     \begin{otherlanguage}{greek}Περὶ μὲν οὖν ἀ\|θανασίας αὐτῆς ἱκανῶς· περὶ δὲ τῆς ἰδέας αὐτῆς ὧδε λεκτέον· οἷον μέν ἐστι, πάντῃ πάντως θείας εἶναι καὶ μακρᾶς δι\/ηγήσεως, ᾧ δὲ ἔοικεν, ἀνθρωπίνης τε καὶ ἐλάττονος·\end{otherlanguage}     \end{document}


title: How to reflect duplicating a tree horizontally?

text: I'm following the solution from this post to construct a tree using `tikz- qtree`. It's working very well as you can see on the image below. ![enter image description here](http://i.stack.imgur.com/P3gtz.png) The tree is to show the matches of a championship. But I'd like to **reflect (duplicating)** the tree to show the other matches, that is, to go up from `champion` to the `Finalist 2` and so on. Here is my code:               \documentclass[landscape]{article}     \usepackage[margin=1in,a3paper]{geometry}     \usepackage{tikz-qtree}     \usetikzlibrary{shadows,trees}          \begin{document}     \begin{tikzpicture}     \Tree [.Champion              [.{Finalist 1}                 [.{Semi Finalist 1}                     [.{kk}                      [. kk ]                      [. kk ]  ]                    [.{kk}                       [. kk ]                      [. kk ] ] ]                 [.{Semi finalist 2}                                 [.{kk}                                  [. kk ]                                  [. kk ]  ]                                [.{kk}                                   [. kk ]                                  [. kk ] ] ]                                   ]      ]     \end{tikzpicture}       \end{document}


title: What do \@firstoftwo and \@secondoftwo do?

text: The LaTeX kernel uses these two all over the place. For example, apparently the correct way of defining something like `\ifeq{\macro 1}{\macro 2}{true}{false}` is (note Martin's response: each case should begin with `\expandafter`)               \def\ifeq#1#2{%      \ifx#1#2\relax       \@firstoftwo      \else       \@secondoftwo      \fi     }      rather than               \def\ifeq#1#2#3#4{%      \ifx#1#2\relax       #3%      \else       #4%      \fi     }      However, they are equivalent as far as I can see:               \long\def\@firstoftwo#1#2{#1}     \long\def\@secondoftwo#1#2{#2}      There is even a `\@firstofone`! It does this:               \long\def\@firstofone#1{#1}      Clearly there is no functional difference in using these macros than simply declaring one or two more arguments. I can see two possible minor differences off the top of my head:   1. `\@firstoftwo` is a control sequence and, as such, gobbles subsequent spaces. This means we don't have to put a `%` after it if it ends a line. Of course, we have to put `%` in lots of other places, and TeX doesn't actually store the `%` in the macro's expansion text, so this is truly minor.   2. Macros defined with `\@firstoftwo` take two arguments fewer than those defined normally. Thus, TeX doesn't have to store the information that my `\ifeq` macro takes those two arguments; it just refers to the storage already used by `\@firstoftwo` and `\@secondoftwo`. I guess this cuts down a little on memory usage.       Neither of these explains the purpose of `\@firstofone`, since it could only possibly be useful when placed as the very last token of a macro, and even there it doesn't actually change the subsequent input, so it seems like it could just be eliminated. Is there some reason one would want to "set off" the next token like that? There is one more possibility:   3. These are `\long\def`'d rather than just `\def`'d. Thus, they can take multiple-paragraph arguments even if the macro using them is not `\long`. I guess this allows you to make the last one or two arguments of a macro `\long` when the others are not, but really, why not just use `\long` when you really mean it? Are there other advantages that I've missed? Do they have minor effects on speed or tricky interactions with expansion or execution that I'm missing? What is the _real_ reason for this bit of obfuscation?


title: Inlining circuit symbols

text: in a prevois question i asked if there was a good way to display electronics symbols in TeX, i was pointed towards circuitikz (which is awsome), but is there a way to inline a symbol in text? eg. bla bla bla {symbols} blaa blab bla


title: Name scoping issue (probably)

text: I'm trying to solve what is clearly a name scoping problem and don't know how to do it. (This discussion is extracted from a poorly-formed question about the same code that I posted yesterday; I've asked to have that post deleted.) I am trying to use the fp package to maintain a running total of a list that gets displayed in a table (the real application is somewhat more complicated, of course; what is below is a minimal [non-]working example.) The issue appears to be that the accumulator, \total, gets recreated as a local inside each row of the table [if I understood the comment of a poster on the previous question correctly].               \documentclass{article}     \usepackage[autolanguage]{numprint}     \usepackage{fp}          \FPset\total{0}     %     \def\item#1{%      \FPadd\total\total{#1}      $\FPprint{#1}$\\\\     }     %     \def\itotal{$\FPprint\total$}          \begin{document}     \begin{tabular}{l}       \item{17.5}       \item{12}       \itotal     \end{tabular}          \end{document}      This code produces (ignoring spacing and the like)   17.5   12   0   What I want, of course, is   17.5   12   29.5   What's going on and how can I fix it?


title: Marking axis in pgfplot

text: Welcome, I have this               \documentclass[11pt,a4paper]{article}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \newcommand\two[2]{#2*exp(#1)}     \begin{document}     \begin{tikzpicture}     \begin{axis}[      /pgf/number format/.cd,      unit vector ratio*=1 10,      width=12.5cm,      every axis plot post/.append style={      mark=none,domain=-20:20,      },      axis x line=bottom,      axis y line=center,      enlargelimits=upper      ]     \addplot{\two{2}{1}};     \end{axis}     \end{tikzpicture}     \end{document}      And what I want? I want axis Y to be marked liked {6.5, 7.0, 7.5, 8.0, 8.5} To be precise what I meant. Currently it is {6.5, 7, 7.5, 8, 8.5} But I want axis X to be untouched. Sorry for my somewhat bad English and THANKS from advance! Thank you Paul! What's strange I actually tried something very similar yesterday, but with spaces in               yticklabel      like this               y tick label


title: How do I define new environments, and why would I want to?

text: I've read about defining new, custom environments that can be used like               \begin{thisismyown}     % do some funky stuff     \end{thisismyown}      How do I define `thisismyown`, and why would I want to?


title: LaTex error: missing \endcsname inserted

text: I am one week into writing my thesis. We have a Latex template at our university. My latex was working fine and suddenly I got this error `missing \endcsname inserted`. I have even tried to disable the chapter I was working on while this error happened, but that didn't solve the problem. The error starts from the `\begin{document}` part. What should I do?               %\documentclass[croppedpdf,pagebackref,showinstructions]{adsphd}     %\documentclass[pagebackref,showinstructions,showlabels,biblatex,biber,biblatexstyle=authoryear]{adsphd}     %\documentclass[online]{adsphd}     \documentclass[print]{adsphd}     %\documentclass[pagebackref,showinstructions,showlabels,coverfontpercent=100]{adsphd}          % To use biblatex:     %\documentclass[biblatex,biblatexstyle=authoryear,showinstructions,showlabels]{adsphd}          % Preamble {{{}{          \usepackage[english,dutch]{babel}     \usepackage{epstopdf}     \usepackage{nomencl}   % For nomenclature     \usepackage[style=long,number=none]{glossary} % For list of abbreviations     \usepackage{varioref}     \usepackage{multirow}     \usepackage{graphicx}     \usepackage{caption}     \usepackage{fixltx2e}     %\usepackage{subcaption}          % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     % !!                                                               !!     % !!  WARNING: do not remove the following lines between           !!     % !!  "%%% COVER: Settings %%%" and "%%% COVER: End settings %%%"  !!     % !!                                                               !!     % !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!          %%% COVER: Settings %%%     \title{Sustainable materialisation of residues from thermal processes into construction materials}     %\subtitle{Construction materials from stainless steel slags}          \author{Muhammad}{Salman}          \supervisor{Prof.~dr.~ir.~Koen~van Balen}{}     %\cosupervisor{Prof.~dr.~ir.~R.Cools}{}     %\president{Prof.~dr.~ir.~De~Voorzitter}     \jury{Prof.~xxxxx\\           Prof.~xxxxx     }     \externaljurymember{Prof.~xxxxx~jurylid}{xxx}          \phddegree{Engineering} % "Doctor of ..."     \faculty{Faculty of Engineering}     \department{Department of Civil Engineering}     %\researchgroup{Scientific Computing Group}     \address{Kasteelpark Arenberg 40 box 2448}     % \addresscity{B-3001 Heverlee} % This is the default value. Note                                     % that 'B-3001 Leuven' is _incorrect_!!                                     % [http://www.kuleuven.be/communicatie/schrijven/taalgebruik.html]     \email{muhammad.salman@bwk.kuleuven.be} % Leave empty to hide     \website{http://www.bwk.kuleuven.be} % Leave empty to hide          \date{XXXX 2014}     %\udc{XXX.XX}            % UDC is no longer necessary.     \depot{XXXX/XXXX/XX}     % Leave out the initial D/ (it is added                              % automatically)     \isbn{XXX-XX-XXXX-XXX-X}               % Set spine width:     \setlength{\adsphdspinewidth}{9mm}          %% Set bleeds     %\setlength{\defaultlbleed}{7mm}     %\setlength{\defaultrbleed}{7mm}          % Set custom cover page     % \setcustomcoverpage{mycoverpage.tex} % mycoverpage.tex is the default          %%% COVER: End settings %%%          % for the nomenclature     \renewcommand{\nomname}{List of Symbols}     \makeatletter     \let\@printnomenclatureorig\@printnomenclature     \def\@printnomenclature[#1]{%       \cleardoublepage%       \chaptermark{\nomname}       \@printnomenclatureorig[#1]     }     \makeatother     \makenomenclature          % for the list of abbreviations.      \newcommand{\glossname}{Abbreviations}     \makeglossary          % To avoid problems, do NOT change the layout of the following two     % commands     \let\printglossaryorig\printglossary     \renewcommand{\printglossary}{%       \renewcommand{\glossaryname}{\glossname}       \cleardoublepage%       \printglossaryorig\chaptermark{\glossname}}          % Specify the .bib file     \bibliography{allpapers}     %\bibliographystyle{ieeetr}     %\bibliographystyle{plain}     % Bibtex style     %\bibstyle{abbrv}     %\bibstyle{plain}     %\bibstyle{acm}     \bibstyle{ieeetr}          % Own commands     \InputIfFileExists{defs} % defs.tex, contains own preamble settings          % }{}}}  <-- Preamble          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %\makefrontcover     \makefrontcoverXII          \maketitle          \frontmatter % to get \pagenumbering{roman}          \includepreface{acknowledgment}     \includeabstract{abstract}     \includeabstractnl{abstractnl}          % To create a list of abbreviations, there are 2 options     % 1. manual creation and inclusion of this file     %    \includeabbreviations{abbreviations}     % 2. automatic generation via the glossary package     %    \usepackage{glossary}     %    \makeglossary     %    \glossary{name=MD,description=molecular dynamics}     %    \printglossary     \printglossary          % To create a list of symbols, there are 2 options     % 1. include a manually created nomenclature as a chapter     %    \includenomenclature{nomenclaturechapter}     % 2. automatic generation via the nomencl package     %    \usepackage{nomencl}     %    \makenomenclature     %    \nomenclature[cB]{$c_B(\vec{x})$}{Characteristic function of $B$}     %    \printnomenclature[3cm]     \printnomenclature[1.5cm]          \tableofcontents     \listoffigures     \listoftables          % Show an overview of todos with page numbers...     %\listoftodos               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \mainmatter % to get \pagenumbering{arabic}          % Show instructions on a separate page     \instructionschapters\cleardoublepage          \includechapter{chapter1}     \includechapter{chapter2}     \includechapter{chapter3}     \includechapter{chapter4}     \includechapter{chapter5}     \includechapter{chapter6}     \includechapter{chapter7}     \includechapter{chapter8}     % Insert here your own chapters     % Chapters are expected to be in a tex-file with the given name dot     % tex and in a directory with the given name in the chapters     % directory.          %\includechapter{conclusion}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %\appendix          %\includeappendix{myappendix}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \backmatter          \includebibliography     \instructionsbibliography          \includecv{curriculum}          \includepublications{publications}          %\makebackcover     \makebackcoverXII          \end{document}          % vim: tw=70 nocindent expandtab foldmethod=marker foldmarker={{{}{,}{}}}


title: Scaling title text in tikzposter-class

text: I'm unable to effectively scale the size of the poster title in the `tikzposter` class (v2.0). When defining my own `titlestyle` I set the `titletextscale` key, but it does not appear to have an effect. The following MWE should illustrate what I mean:               \documentclass{tikzposter}          % Tweaking these should change the look of the title     \definetitlestyle{mystyle}{titletextscale=2.5, roundedcorners=23.2}{         \begin{scope}[line width=\titlelinewidth, rounded corners=\titleroundedcorners]             \draw[color=framecolor, fill=titlebgcolor]%                 (\titleposleft,\titleposbottom) rectangle (\titleposright,\titlepostop);         \end{scope}     }     \usetitlestyle{mystyle}          \makeatletter     \newcommand\titlesize\TP@titletextscale     \makeatother          \title{My big poster}     \author{Me}     \institute{Titletextscale = \titlesize, Titleroundedcorners = \titleroundedcorners}          \begin{document}     \maketitle     \end{document}      The output of this shows that `\titleroundedcorners` has been set correctly, but `\TP@titletextscale` has not. ![Notice that titletextscale has wrong value](http://i.stack.imgur.com/YgMlr.png) Playing around with the key values, yields no changes in font size, but changes in corner rounding as expected. Finally, if I go directly into the file `tikzposter.cls` and change line 73 to               \def\TP@titletextscale{2.5}      ![enter image description here](http://i.stack.imgur.com/VU9H6.png)


title: Conditionally use package and define command

text: I'm creating a class which should define a command if some package is available:               \IfFileExists{eforms.sty}{        \usepackage[xetex]{eforms}        \everyTextField{\textFont{GaramondNo8}\textSize{12}}        \newcommand{\dsaTextInput}[3][12]{\raisebox{-0.35ex}{\textField[\textSize{#1}]{#2}{#3}{1em}}}     }{}      However, if I try to compile this, I get:               ! Illegal parameter number in definition of \reserved@a.     <to be read again>                        1     l.7 }{}      `l.7` is the last line of the code I've shown. If I remove the conditional, it works as expected. What am I doing wrong?


title: How to put a picture at the center of a page in landscape mode

text: I have a big picture that is too wide for putting in a page, so I tried the landscape mode to rotate the page. The issue is that the picture is not located at the center. How can I make the picture to move to the center? ![enter code here](http://i.stack.imgur.com/obj8R.png)               \begin{landscape}     \begin{figure}[htpb]       \centering       \includegraphics[height=0.6\textheight, width=1.5\textwidth]{fig/decomp.pdf}       \caption{Functional Decomposed Data Structure}     \end{figure}     \end{landscape}


title: How to Use Goudy Initialen in Lettrine

text: How can I use the Goudy Initialen font with Lettrine for the first drop letter of a paragraph? I can't understand from the documentation how to use LettrineFontHook or LettrineFont to do this?


title: Uninstalling Miktex and installing TexStudio

text: I want to uninstall Miktex 2.9 and install TexStudio 2.5.2. (I'm totally a beginner user and TexStudio seems easier to use.) Should I totally uninstall Miktex (package managers and everything) then install TexStudio? Or is it better to only get rid of the Miktex program?


title: Are there any packages to create custom table of contents?

text: I understand that this is quite a broad question, but here's my use case: I'm writing a class to typeset a journal issue, and I need a (customized) ToC. There are a few "types" of articles (e.g. a usual article, a letter to the editor, an obituary, a book review, etc.), and each of these needs an entry in the ToC with specific metadata etc. Are there any packages that might help here? (Previously, I did it on my own, but now I'm redesigning the class basically from scratch, using better techniques – like `xparse` or `etoolbox` as opposed to lots of `\futurelet`s and `\expandafter`s, for instance – and I was wondering whether there might be something nice in the ToC department, too.)


title: How to make page numbers appear in Hindi numbers instead of Arabic numbers using XeLaTeX?

text: I have a document written with a majority Arabic text and few English text. The page numbers as seen in the output appeared in Arabic (1,2,3,etc) numbers instead of the desired Hindi numbers as appeared in the first sentence of the body text part in the output. **How to fix that?** **Note:**   I would be grateful also if someone would help me indent the English text inside the Arabic environment to the left instead of being on the right as seen in the output. **MWE Code**               \documentclass[oneside,18pt]{scrartcl}      \usepackage{fontspec}     \newfontfamily\arabicfont[Script=Arabic]{Amiri}      \usepackage{arabxetex}     %=====================End of Preamble ===================================     \begin{document}     \begin{arab}[voc]     \bigskip          هنا  مجمل النص باللغة العربية، ثم مجموعة ارقام باللغة العربية: 1، 2، 3، الخ. ارقام الصفحات ليست كهذه الارقام، ما الذي ينبغي عمله لكي تظهر ارقام الصفحات بهذا الشكل ايضا؟     رقم الصفحة ظهر كارقام هندي.          \noindent\textLR{1, 2, 3, etc are called Arabic numbers, while the numbers above are called Hindi numbers.}          \end{arab}     \end{document}        MWE Output [body text part]   ![enter image description here](http://i.stack.imgur.com/lIfUf.png) MWE Output [page number part]   ![enter image description here](http://i.stack.imgur.com/aM9XT.png)


title: bibtex: name field compiling

text: Several journals want the authors' initials to be punctuated, while others don't. Is there a bibliography style to set this behavior and if yes, which is the best compiling method? I mean: Evins, S. or Evins, S ? I have another doubt: do I have to contact the journal name directly in the field or there's also a style for this? Usually editors want the contacted form.


title: Biblatex (footcite) and microtype

text: Biblatex is configured so that all author names are written in small caps and microtype is set to to adjust the spacing between the small cap letters a la               \SetTracking{ encoding = *, shape = sc }{ 45 }       and this working pretty well for the document as well as the bibliography, alas it doesn't work for footcites. Is there a way to apply this spacing also for footcites? What I tried, is               \SetTracking[ context = footcite]{ encoding = *, shape = sc }{ 45 }     \SetTracking[ context = footnote]{ encoding = *, shape = sc }{ 45 }      but it had no effect.


title: How to include figure or table with number in the title of tcolorbox

text: I'm looking for a way to integrate automatically the Table x or Figure Y in the title of a tcolorbox. Any idea ?


title: fontspec/mathspec ruins my parentheses with beamer

text: My problem appears to be related to this earlier post: Parentheses differ (XeLaTeX, fontspec, newtxmath, libertine) but mine seems even simpler. My problem is that when I compile a simple beamer presentation and use the fontspec or mathspec packages, the parentheses are spaced poorly. As an MWE, when I compile the following with XeLaTeX:               \documentclass{beamer}     %\usepackage{fontspec}     \begin{document}       \frame{     Hello!  $f(x)=x^2$     }     \end{document}      I get just what I would want: ![a good picture with properly spaced parentheses](http://i.stack.imgur.com/zbCph.png) However, when I uncomment the fontspec bit,               \documentclass{beamer}     \usepackage{fontspec}     \begin{document}       \frame{     Hello!  $f(x)=x^2$     }     \end{document}      I see the following: ![a bad picture with ugly parentheses](http://i.stack.imgur.com/xGslG.png) Does anyone know what can be causing this? I don't see mention of parentheses in the documentation.


title: How to print a system of linear equations in matrix form using sweave?

text: I would like to print a system of linear equations, a right bracket, a right arrow and finally the output of the system (x). Something like Ax = b } ---> x. It is hard for me to find the right way of working with many matrices/vectors one behind the others. My code is:                   a = c(-scan(text="89 82 14"),scan(text="98 17 55"),scan(text="59 88 89"))         A = matrix(a,nrow=3,byrow=T)         b = c(-50,53,82)         x=solve(A)%*%b      The format would be something like:               \left Ax=b \} \right \Longrightarrow x=(..)      Then I would like to change b to be d=b+\Delta b_i and solve again the system so I get the format:               dia=diag(1,3,3)     x=[solve(A)%*%b]+\Delta b_1[solve(A)%*%dia[,1]]+\Delta b_3[solve(A)%*%dia[,2]]+\Delta b_3[solve(A)%*%dia[,3]].       I have plotted individual matrices using `xtable` but never have concatenated a few at the same time. Many thanks for your help.


title: How to reduce space after authors block? (ieeetran)

text: I'm using `\documentclass[10pt, conference, compsocconf, letterpaper]{IEEEtran}`. How can I reduce the space between the authors block (with their affiliations) and the text? Right now I have:               Paper Title            authors     affiliation                         col1   col2     ....   ....      But I'd like to have:               Paper Title            authors     affiliation          col1   col2     ....   ....


title: Numbering equation using eqnarray*

text: I am using eqnarray to write long equations. However when I use it instead of equation environment the equations are not numbered. Can anyone help me to solve this. This is the syntax that I am using.               \begin{eqnarray*}      f_{lin}(z) & = &  f(z_{0}) +      \frac{\partial f(z)}{\partial \ddot{\theta}}\bigg|_{z = z_{0}}\ddot{\theta} +      \frac{\partial f(z)}{\partial \ddot{\alpha}}\bigg |_{z = z_{0}}\ddot{\alpha} +      \frac{\partial f(z)}{\partial \dot{\theta}}\bigg |_{z = z_{0}}\dot{\theta} \\     & &  + \frac{\partial f(z)}{\partial \dot{\alpha}}\bigg |_{z = z_{0}}\dot{\alpha} +      \frac{\partial f(z)}{\partial \theta}\bigg |_{z = z_{0}}\theta +      \frac{\partial f(z)}{\partial \alpha}\bigg |_{z = z_{0}}\alpha     \end{eqnarray*}


title: tikz dash rectangle in nest nodes

text: I want to use dash rectangle in outer node but use solid rectangle in inner nodes. But my sample code below actually dashed all node for inner or outer nodes.               \documentclass[tikz]{standalone}          \begin{document}          \begin{tikzpicture}[       inner/.style={draw,fill=blue!5,thick,inner sep=3pt,minimum width=8em},       outer/.style={draw=gray,dashed,fill=green!1,thick,inner sep=5pt}       ]     %---------------------------------------------------%     \node[outer] (A) {         \begin{tikzpicture}[node distance=1cm,outer sep = 0pt]           \node [inner,minimum width=18em] (A1) {Mr. A};           \node [inner,anchor=south west,minimum width=8em] (A2) at ([yshift=1em]A1.north west) {Mr. A1};           \node [inner,anchor=south east,minimum width=8em] (A3) at ([yshift=1em]A1.north east) {Mr. A2};           \node (text) [anchor=north] at ([yshift=4em]A1.north) {Hello Tikz};         \end{tikzpicture}     };      \end{tikzpicture}          \end{document}       The output looks like below: ![enter image description here](http://i.stack.imgur.com/LFlcb.png) I only use dashed on outer style but actually inner nodes has got such attribute also! I don't want that!


title: Changing The Date Location On A Letter

text: I'm using the document class scrlttr2 to make a cover letter, but since it's a business letter the date needs to be left-justified and above the address. By using the work-around here I was able to left-justify it, but I can't figure out how to change the position of the date and the justification is matched up the letter's body and not the address section. Since everything else is exactly where I want it to be I would like to not switch to another class, and I was hoping that someone here could help me out. Here's my sample code:               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % Short Stylish Cover Letter     % LaTeX Template     % Version 1.0 (28/5/13)     %     % This template has been downloaded from:     % http://www.LaTeXTemplates.com     %     % Original author:     % Stefano (http://stefano.italians.nl/archives/63)     %     % License:     % CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)     %     % IMPORTANT: THIS TEMPLATE NEEDS TO BE COMPILED WITH XeLaTeX     %     % The two fonts used in this template: Adobe Garamond Pro and Gill Sans     % do not come with Windows by default. You will need to download them in     % order to get an output as in the preview PDF. Otherwise, change those      % fonts to fonts that do come with Windows or comment out the lines to use      % the default font.     %     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %--------------------------------------------------------------------------------------     --     %   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS     %--------------------------------------------------------------------------------------   --          \documentclass{scrlttr2}          \usepackage{fontspec} % Allows font customization     \usepackage{marvosym} % Allows the use of symbols     \usepackage[english]{babel} % Required to compile in Windows     \usepackage{graphicx}               \setlength\parindent{0pt} % Removes all indentation from paragraphs          \defaultfontfeatures{Mapping=tex-text}     %\setmainfont {Adobe Garamond Pro} % Main document font     \setsansfont {Cambria} % Used in the from address line above the to address          \renewcommand{\normalsize}{\fontsize{11.5}{12}\selectfont} % Sets the font size and    leading     \setkomavar{date}{\flushleft\vspace{-\baselineskip}\today\par}          %--------------------------------------------------------------------------------------  --     %  HEADER SECTION     %----------------------------------------------------------------------------------------          \firsthead{     \centering     {\addfontfeature{LetterSpace=20.0}\fontsize{36}{36}\selectfont\scshape Peter Maguire}\\   [5mm]     \fontsize{21}{21}\selectfont\scshape My Job \\ My Institution } % Your current job   title               \begin{document}          %----------------------------------------------------------------------------------------     % COVER LETTER CONTENTS     %--------------------------------------------------------------------------------------  --          \begin{letter}{ % Address of the company you are applying to     Biotech Company \\     123 Street Street \\     Washington, CA 12345      }               \opening{Biotech Company HR Manager,}          \begin{sloppypar}     Main section here      \\     \end{sloppypar}          Sincerely, \\     Peter Maguire          %--------------------------------------------------------------------------------------   --          \end{letter}     \end{document}      This is what the output looks like: ![enter image description here](http://i.stack.imgur.com/eLhr7.jpg) And this roughly what I want it to look like: ![enter image description here](http://i.stack.imgur.com/VcO0m.jpg) Anyone more skilled in this stuff have any ideas?


title: ConTeXt: Scale font for text based on maximum width

text: # Background Looking to devise a scaling factor for two fonts such that the text, when added to the final document, fits on one line. # Example In the images below, the two fonts are the first character (e.g., "M") and the title text ("My Extraordinary Title"). In the first image, the text is split across two lines: ![Large Font](http://i.stack.imgur.com/N5vur.png) While the second image, which is desired, has the font scaled to fit on one line: ![Rescaled Font](http://i.stack.imgur.com/H4pj6.png) The large M in the second image should be scaled down at the same ratio as the rest of the text, hence the desire for a scale factor that can be used against both the title text and its first character. # Problem I'd like to define a macro along the lines of the following recursive function:               Integer fitText( String text, Integer fontSize, Integer minWidth, Integer maxWidth ) {       Integer currentWidth = scratchBox( text, fontSize );            if( currentWidth > maxWidth && currentWidth > minWidth ) {         return fitText( text, fontSize - 1pt, minWidth, maxWidth );       }            return fontSize;     }      Maybe I'm going about this the wrong way, though, and am open to other approaches. For example, given a `\frame` is it possible to scale the frame such that it fits the `\textwidth`? That is:               \framed[       frame=off,       width=\textwidth * 4,     ]{%       \BookStylizedChapter{\BookTitleText}     }      Then somehow scale the framed down if its content width exceeds the `\textwidth`? # Question How would you scale a line of text (or a `framed` element) in ConTeXt such that line breaks do not occur, but the font scales down instead?


title: Multiline \text in an equation

text: There are a number of possibilities to have multiline equations, but I am looking for multiline `\text{...}` elements. For example:               \documentclass{article}     \usepackage{amsmath}     \begin{document}          \begin{equation}       a^3 + b^3 \neq c^3 \text{ I have discovered a truly marvelous proof of this,\\which this margin is too narrow to contain.}     \end{equation}          \end{document}      Is there a way to break that long text into two lines? The `\\` does not work here.


title: Suppress line numbers in front of 'repeat' and 'until' keywords in algorithmic

text: Here is my minimal example:               \documentclass{article}          \usepackage{algorithm}     \usepackage{algorithmic}          \begin{document}          \begin{algorithm}     \caption{Test}     \begin{algorithmic}[1]         \REQUIRE         \REPEAT         \STATE state         \STATE state         \STATE state         \UNTIL condition     \end{algorithmic}     \end{algorithm}          \end{document}      I get this result: ![enter image description here](http://i.stack.imgur.com/i6MGx.jpg) But I would prefer this result: ![enter image description here](http://i.stack.imgur.com/Lgdtl.jpg) How can I achive this?


title: Using biblatex-apa

text: I got biblatex working with the authoryear style in Texlipse:               \documentclass{article}      \usepackage[canadian]{babel}     \usepackage{csquotes}     \usepackage[style=authoryear,backend=biber]{biblatex}      \addbibresource{references.bib}     \begin{document}      This statement is true \parencite[5-8]{Ref}.     \printbibliography      \end{document}      references.bib:               @BOOK     {Ref,     AUTHOR = "Doe, Jane and Smith, John",     TITLE = "A Book",     PUBLISHER = "Books, Inc.",     YEAR = 1999     }      However, when I try to change the style to apa (`\usepackage[style=apa,backend=biber]{biblatex}`), an empty bibliography is produced. I have texlive 2012, which has biblatex-apa. Why doesn't it work?


title: Change the word "Table" in table captions

text: I need to have tables with their numbers, just as when I use `\caption`. My problem is that when I use the `\caption` it shows me like this: > Cuadro x.x: this is some table. The word Cuadro is because I'm using a document class as spanish. I want to change that word "Cuadro". Is it possible to do that?


title: Yes, another "Package inputenc error" question

text: I'm trying to figure out why LaTeX behaves this way. So, I have this project: https://dl.dropboxusercontent.com/u/12774331/latex.zip which is a perfectly working project, with lots of `é` and other accented letters in it. It compiles just fine. Then I've got this one: https://dl.dropboxusercontent.com/u/12774331/Thesis.zip which gives me a "Package inputenc Error" just with some accented letters. Really, it's driving me mad. I'm using TexPad on OS X (10.9) with the usual MaxTex distribution, leaving the default `pdfLatex` compiler for both projects. Actually, _every_ options is the same across the two projects. What could be the problem? (sorry for posting `.zip` archives, I just can't produce a minimal working example since I don't know where the problem comes from)


title: Automatic counter increment for bibliography statistics

text: I am trying to organize my bibliography in a tabular form, (with columns: year, Journal, topic...etc). The one thing I want to add, is to make a counter, so at the end, I will get automaticlly how many papers were written in every journal. Latex, is the best for handeling bibliography, but automatic increment, I can only do that in Excel. Can any one suggest something?


title: Modifying enumerate items in beamer - insert graphics while generating labels

text: I'm trying to make myself a beamer template with modified bullets for enumerate and itemize. I have a pdf image of the bullet point that I would like to use. I already have a working solution for itemize, but using the same approach               \newcommand{\bpebble}[0]{\includegraphics[height=1.3 ex]{./k_bluepebble.pdf}}     \setbeamertemplate{enumerate items}{\bpebble}      the numbering vanishes making the enumerate and itemize environments essentially indistinguishable. I've seen a near-satisfactory solution Use ball items in enumerate list with enumitem package in that it modifies the item in front of each enumerate list entry and superimposes a number on top of it, however this uses pgfplots and not an inserted pdf figure. So, I'm seeking a way to include a pdf graphic into the list bullets and lay a number on top of it.


title: XeTeX & Overprinting

text: My printing house asked me to set black overprint feature on for my book which includes a lot of background images. I have no idea what is overprinting and after spending a long time of googling I found this page explains what is overprinting and how to tun it on in Adobe InDesign. Then I found this command in ConTeXt               \setupcolors[rgb=no,cmyk=yes,spot=yes,state=start,overprint=yes]       I don't find the equivalent in Latex. However, I found overprint package but it doesn't work with XeTeX. Here is an example of what my book look like:               \documentclass[10pt,oneside]{book}     %\usepackage[a5paper, margin=1cm]{geometry}      \usepackage{geometry}      \geometry{      a5paper,      total={148mm,210mm},      left=20mm,      right=20mm,      top=20mm,      bottom=20mm,      bindingoffset=0mm,      driver=xetex      }          \usepackage{fontspec}     \usepackage{graphicx}     \usepackage{wrapfig}     \usepackage{fancyhdr}     \usepackage{xcolor}     \usepackage[pages=some,angle=0,opacity=1]{background}     \usepackage{tikzpagenodes}     \usepackage{polyglossia}     \setdefaultlanguage[calendar=gregorian,hijricorrection=1]{arabic}     \parindent 0pt     \newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Amiri}     \newfontfamily\chapterfont[Script=Arabic,Scale=1.2]{Tarablus}          \begin{document}          \thispagestyle{plain}     \BgThispage     \backgroundsetup{ contents={\includegraphics[width=0.09\paperwidth,height=0.09\paperheight,keepaspectratio]{7}}, position=current page.center}          \vspace*{3cm}     \begin{flushright}      \Large{أهدي هذا الكتاب إلى أفضل أصدقائي ورفيقة دربي زوجتي}     \end{flushright}                    \end{document}      The result when I use Overprint Preview in Acrobat Prof looks like this: ![the output preview in Acrobat Prof](http://i.stack.imgur.com/IZtCz.png) I am looking for help in this issue.


title: Changing default paragraph style in LyX

text: I tried for couple hours changing Chapter, Paragraph...etc styles (especially font and it's color) in LyX, I managed to do that by modifying layout files (for example `db_stdsections.inc`) by simply adding:               Font     Color Green     End Font      Inside Style Paragraph did the job, and LyX displayed the green paragraphs, but for my surprise, converting it to PDF left it unchanged! It it still Black as usual, what I'm doing wrong? P.S I don't what to use local Style, I think it silly to mark text as paragraph environment and then also styling text to give him green color manually, I want both to be applied simultaneously, like in MS Word.


title: Dynamically change images in a LyX File

text: I am using LyX and have created a document that includes numerous images. I'm wondering if it's possible to reference the path and file name to the images in LyX so that when I compile and create my PDF document, the new images with the same file name as the old file name referenced in the document will be displayed? For example, when I originally create my document I will have a reference to `myimage1.pdf`. When I compile my document I see `myimage1.pdf` just fine as I would expect. However, my LyX document contains some code that executes external program code that generates new graphics when LyX the document is compiled and the PDF generated. After generating a new PDF, I'd like my LyX document to pull in the newly created myimage1.pdf. Currently, LyX seems to be rending the document with the old image. When I generate the document a second time, it pulls in the correct images (presumably because the new `myimpage1.pdf` is available initially at run-time). Is there any way to get this to work without have the image available in advance of generating my PDF?


title: Adding a x tick but not the corresponding y tick

text: I'm generating `pgf` plots on the fly and I would like to avoid adding non integer `y ticks` on my plots, while keeping all the `x ticks`. Here is a MWE:               \documentclass[10pt]{article}     \usepackage{tikz}     \usepackage{amsmath}     \usepackage{siunitx}     \usepackage{amssymb}     \usepackage{pgfplotstable}     \usepackage[active, pdftex, tightpage]{preview}     \PreviewEnvironment[{[]}]{tikzpicture}     \setlength\PreviewBorder{2mm}     \begin{filecontents}{PJxpGrZtwos.tex.dat}     N      f             M     1024   3.407938e+01  25     1536   1.339487e+01  20     2048   1.139487e+01  19     3072   8.351236e+00  14     4049   6.466788e+00  13     6144   4.466788e+00  11     \end{filecontents}     \pgfkeys{/pgf/fpu=true}     \pgfplotstableread{PJxpGrZtwos.tex.dat}\loadedtable     \pgfplotstablegetelem{0}{N}\of{\loadedtable}     \let\relativeTo\pgfplotsretval     \pgfplotstablegetelem{0}{f}\of{\loadedtable}     \let\f\pgfplotsretval     \pgfplotstablecreatecol[create col/expr={\f / \thisrow{f}}]{f-relative}\loadedtable     \pgfkeys{/pgf/fpu=false}          \begin{document}     \begin{tikzpicture}         \begin{loglogaxis}[axis y line*=left, legend pos=south east,xlabel={N},xtick=data, xticklabels from table={\loadedtable}{N},ytick=data, yticklabel=\pgfmathparse{exp(\tick)}\pgfmathprintnumber{\pgfmathresult}, ylabel ={$\dfrac{f(\pgfmathprintnumber\relativeTo)}{f(N)}$}]     \addplot[black] table[x=N, y expr=\thisrow{N}/\relativeTo] {\loadedtable};     \addplot[blue, mark=*] table[x=N, y=f-relative] {\loadedtable};     \legend{{Linear progression},}     \end{loglogaxis}     \begin{semilogxaxis}[ymin = 5, ytick={10, 15, ..., 30}, ymax = 35, axis x line=none,ylabel={\# M}, axis x line=none, axis y line*=right, ylabel near ticks=right, yticklabel pos=right]     \addplot[red, dotted, mark=x, mark options={solid}] table[x=N, y=M] {\loadedtable};     \end{semilogxaxis}     \end{tikzpicture}     \end{document}      What I would like here is to have `\addplot[black] table[x=N, y expr=\thisrow{N}/\relativeTo] {\loadedtable};` not adding `y ticks` for non integer values of `\thisrow{N}/\relativeTo` while keeping all `x ticks`. If you have any other way to draw a linear function from (x_min, 1) to (x_max, x_max/x_min), while having the nice corresponding `y ticks` (maybe by creating another table ?), that will also do the trick. Keep in mind that this is for 'on the fly' plot generation, I don't know my value a priori, so I can't use in this case `y tick={1,...,6}`.


title: Runaway argument in algorithm

text: \begin{algorithm}     \caption{Partial Sum Update Algorithm}\label{alg:usline}     \begin{algorithmic}[1]     \State $\mathcal{N}^*\gets$ bitreverse$(\mathcal{N})$     \If{$i(s)=0$}\Comment{The $s^{th}$ LSB in the binary representation of i is $0$.}     \If{$s=\log _2N - 1$ or$ i_{(\log _{2}N - 1):(s+1)} = \mathcal{N}_{(\log _{2}N - 2):s}^*$     \Endif     \Endif          \end{algorithmic}     \end{algorithm}      The above produces "runaway argument". Any ideas why ?


title: Is there a ConTeXt command to print the path of the file in which it is evoked?

text: I would like to put a URL-link in the output PDF of a ConTeXt file. It should point to the directory in which the ConTeXt file and its output PDF reside. Currently, I am using a shell script in my Pandoc-workflow to achieve this. I am just wondering if there were a more straightforward way to do this.


title: expl3: \cs_generate_variant broke with the last update: undefined control sequence \::T

text: The last expl3 update broke my "continue" detection for the index. Here is a MWE: ( **EDIT** : I realized it is possible to reduce it even further)               \documentclass{minimal}     \usepackage{expl3,xparse}     \ExplSyntaxOn          \cs_generate_variant:Nn \tl_if_eq:nnTF { xxTF }          \def\ifevenmarkcontd#1{         \tl_if_eq:xxTF { me } { you }         {         }         {         }     }          \ExplSyntaxOff          \begin{document}     \ifevenmarkcontd{anything}     \end{document}      When running it the error message is:               ! Undefined control sequence.     <argument> \::T                     \::F     l.19          ?      If I use `\tl_if_eq:nnTF` then it compiles. But I need to expand the arguments, and it did work before the last update. How can I fix this now? What is the reason?


title: Changing the way \over is defined

text: I would like to be able to type things like `$1/2$` instead of `$\frac{1}{2}$` as this would make my code better readable. For longer equations I prefer to use `\frac{}{}`, but for things like `1/2` I don't like it. This does the trick in some sense:               \catcode`/ = 13     \def/{\over}      But I don't really like the way `\over` works. Is it possible to redefine `\over` such that `ab\over cd` is interpreted as `a\frac{b}{c}d`? And such that `{ab}\over{cd}` is interpreted as `\frac{ab}{cd}`? * * * I know it is recommended to not use `\over`, but as `\frac` is a definition based on `\over` I thought that it may be possible to write another definition based on `\over` that give less problems than `\over`, but keeps the infix notation.


title: In beamer, how to temporarily cancel the frametitle

text: I have a image in this frame and I want to show it without any other item. Just like below. ![1](http://i.stack.imgur.com/6ltcC.jpg) ![2](http://i.stack.imgur.com/kjiAY.jpg) And my MWE is               \documentclass[14pt]{beamer}% http://ctan.org/pkg/beamer     \let\Tiny\tiny% http://tex.stackexchange.com/q/58087/5764     \usetheme{Berkeley}     \makeatletter     \beamer@headheight=1.5\baselineskip     \makeatother     \setbeamercolor{normal text}{bg=black!10}     \title[Title]{My title}     \subtitle{Subtitle}     \author{Author}     \institute[Institute]{My institute}     \date[Date]{My date}     \logo{\color{blue!50}\scalebox{2}{\TeX}} % you can % it     \begin{document}          \begin{frame}       \titlepage     \end{frame}          \section{A section}     \subsection{A subsection}     \begin{frame}       \frametitle{Frame title}       \framesubtitle{frame subtitle}       Some text     \end{frame}          \begin{frame}       Some more text     \end{frame}          \section{Another section}     \subsection{Another subsection}     \begin{frame}       picture     \end{frame}     \end{document}


title: Is there a compact way to set the same default for multiple pgfkeys?

text: I want to set the same default value for multiple PGF keys, like in this case where both `a` and `b` have a default of `1`:               \documentclass{article}     \usepackage{pgfkeys}     \pgfkeys{      a/.code={a:#1},      a/.default=1,      b/.code={b:#1},      b/.default=1     }     % the rest is irrelevant, the question only concerns setting the keys     \begin{document}      \pgfkeys{a,b}     \end{document}      In my real code, which contains many more than two keys, it's pretty repetitive to be writing `keya/.default=1`, `keyb/.default=1`, etc. So is it possible to set a default for a large number of keys all at once, in some way that takes less typing than one full assignment for each such key? If there's some concept of inheritance for keys, such that I could set a default on a "base key" and then "derive" other keys from it, that would work quite well for my purposes, but from a read through the manual I don't see that. Maybe I'm missing it. Of course there's no reason I _have_ to do this; it works fine to just write a whole bunch of `key/.default=1` lines, but I'm curious about whether it could be done.


title: Compilation Error "! Missing \endcsname inserted" The control sequence marked <to be read again> should not appear between \csname and \endcsname

text: here's my thesis Latex files: http://www.mediafire.com/download/c7q8z4v6gv864rk/triet_thesis_clean.rar Please help me to fix the error, I've tried all the things I can find with Google :( :                  ! Missing \endcsname inserted.        <to be read again>        \begingroup        l.52 ...}intopreamble]Deobfuscation}{{4.1.1}{xii}}        The control sequence marked <to be read again> should        not appear between \csname and \endcsname.        (D:\DH\Luan_Van_Tot_Nghiep\Latex\triet_thesis_test\LVTN.aux


title: Error related to \spacefactor using 3rd-party macro \addmoretexcs

text: I am using the command `\addmoretexcs` for listings, which has its origin here. With the update to TeX Live 2014 (and probably an update to `listings`), the following code returns an error:               \documentclass{minimal}     \usepackage{ltxcmds}     \usepackage{listings}          \makeatletter     \newcommand{\IfPackageLoaded}[2]{\ltx@ifpackageloaded{#1}{#2}{}}     \makeatother               \IfPackageLoaded{listings}{%          \makeatletter     \newcommand*{\addmoretexcs}[2][common]{%       \lowercase{\@ifundefined{lstlang@tex$#1}}{%         \lstloadlanguages{[#1]TeX}%       }{}%       \lowercase{\expandafter\g@addto@macro\csname lstlang@tex$#1\endcsname}{%         \lstset{moretexcs={#2}}%       }%     }     \makeatother          }% End of \IfPackageLoaded          \addmoretexcs[LaTeX]{setlength}          \begin{document}     \end{document}      The error in question is               ! You can't use `\spacefactor' in vertical mode.     \@->\spacefactor      \@m      l.23 \addmoretexcs[LaTeX]{setlength}      Note that, if I substitute `\IfPackageLoaded` with `ltx@ifpackageloaded`, the error disappears. This, however, is not a solution. The actual error is likely inside the packages; I cannot debug this any further. Any hints about the origin of this error?


title: How to add the current section name to the top?

text: I'm trying to get the current section name and to add it to the header at right.               \documentclass[12pt,french]{report}     \renewcommand\chaptername{Chapitre}     \renewcommand\appendixname{Annexe}          \let\@oldmakechapterhead\@makechapterhead     \def\@makechapterhead#1{%     \vspace*{10\p@}%     {\parindent \z@     {\reset@font     \usefont{OT1}{phv}{m}{n}     \LARGE\@chapapp~\thechapter\par\nobreak}%     \par\nobreak     \vspace*{30\p@}     \interlinepenalty\@M     \usefont{OT1}{ptm}{b}{n}     {\raggedright \Huge #1}%     \par\nobreak     \vskip 20\p@     \hrule height 1pt     \par\nobreak     \vskip 45\p@     }}     \rhead{\nouppercase\rightmark}     \begin{document}          \addtocontents{toc}{\protect\thispagestyle{empty}}          \chapter{ABC}          \end{document}      How do I to get the current section name and to put it into that line without adding it to TOC, TO Tables and TO Figures, please?


title: How can I add clips above matrix?

text: \documentclass{mwrep}     \usepackage{kbordermatrix}     \usepackage{amsmath}     \begin{document}     \begin{equation}     \bar{P}=     \kbordermatrix{ \mathrm{state} &   1 &   2 &   4 &   3 &   6 &   5 &   7 \\                                  1 & 0.3 & 0.1 & 0.6 & 0.0 & 0.0 & 0.0 & 0.0 \\                                  2 & 0.2 & 0.1 & 0.7 & 0.0 & 0.0 & 0.0 & 0.0 \\                                  4 & 0.3 & 0.4 & 0.3 & 0.0 & 0.0 & 0.0 & 0.0 \\                                  3 & 0.0 & 0.0 & 0.0 & 0.2 & 0.8 & 0.0 & 0.0 \\                                  6 & 0.0 & 0.0 & 0.0 & 0.3 & 0.7 & 0.0 & 0.0 \\                                  5 & 0.0 & 0.4 & 0.1 & 0.0 & 0.0 & 0.2 & 0.3 \\                                  7 & 0.0 & 0.0 & 0.1 & 0.0 & 0.3 & 0.1 & 0.5}     \end{equation}     \end{document}      This generates a nice matrix: ![](http://i.stack.imgur.com/BRnp9.png) How can I add clips above column descriptions as shown in image below? ![](http://i.stack.imgur.com/DpEBo.png)


title: Macro to do nothing via a \def

text: I have encountered another expansion issue and have narrowed it down to this simple test case of a macro that does _nothing_ , well at least it tries to do nothing, but is not all that successful. If I declare this macro as:               \newcommand*{\DoNothingA}[1]{#1}%      This works great, no surprises there. However, if this macros is defined as follows:               \newcommand*{\DoNothingB}[1]{%          \def\Temp{#1}%         \Temp%     }%      then, this has problems where there is an attempt to use this in an `\edef`. ## Output: Note that the MWE below yields a compile error for the last step, so you need to hit ``<RETURN>`` to skip past it to see the output (or comment out the last `\edef`, but then this won't show Question 2 below). The MWE below yields the following: ![enter image description here](http://i.stack.imgur.com/lAwbx.png) The last line being especially curious as it produced `foo 4`, and was the result of:               \edef\NewTemp{\DoNothingA{foo 5}}     \NewTemp     \color{red}% Highlight problem output     \edef\NewTemp{\DoNothingB{foo 6}}     \NewTemp      \color{black}     ~-- used \verb|\edef| to store output of macro      ## Questions:   1. What is the explanation of the expansion issue here?   2. How does the final output become `foo 4` (`foo 5` would have been easier to accept), if we skip past the compile error?   3. Since David Carlisle has been quoted as saying that "a few extra `\expandafter` cure all known ills" :-), what is the sequence of `\expandafter`s needed in the last `\edef` to use macro `\DoNothinB` as defined here.   4. How can I adjust the `\DoNothingB{}` macro to use a temp variable and still work in the three cases in the MWE (preferrably without having to use any `\expandafter` trickery. ## Code:               \documentclass{article}     \usepackage{xcolor}% To highlight problem output          \newcommand*{\DoNothingA}[1]{#1}% Does everything I want in all cases          \newcommand*{\DoNothingB}[1]{% Works mostly, except if used in a \edef         \def\Temp{#1}%         \Temp%     }%          \begin{document}     % These two work great.     \DoNothingA{foo 1}     \DoNothingB{foo 2}     -- used output of macro directly          % These two also work great.     \def\NewTemp{\DoNothingA{foo 3}}     \NewTemp     \def\NewTemp{\DoNothingB{foo 4}}     \NewTemp     ~-- used \verb|\def| to store output of macro               \edef\NewTemp{\DoNothingA{foo 5}}     \NewTemp     \color{red}% Highlight problem output     \edef\NewTemp{\DoNothingB{foo 6}}     %\show\NewTemp% Excellent suggestion by David Carlisle yields: \def foo 4{foo 6}foo 4     \NewTemp      \color{black}     ~-- used \verb|\edef| to store output of macro     % Why is the last output "foo 4" (after ignoring error)??     \end{document}


title: Defining commands that are scoped to a particular environment

text: Is it possible to define commands in a separate namespace so that they only work within a particular environment? For example, can I create a package named `foo` that defines a `foo` environment and a `\newfoocommand` that works something like this:               \documentclass{article}          \newcommand{\asdf}{do something}     \newcommand{\zzz}{zzz}          \usepackage{foo}     % doesn't conflict with the above \asdf command because it's in a different     % namespace.     % this actually does \newcommand{\@foo@cmd@asdf}{do something else}     \newfoocommand{\asdf}{do something else}     \newfoocommand{\jkl}{blahblah}          \begin{document}          % expands to "do something"     \asdf     % expands to "zzz"     \zzz     % causes: ERROR: Undefined control sequence.     \jkl          \begin{foo}       % is interpreted as \@foo@cmd@asdf and expands to "do something else"       \asdf       % expands to "zzz" because \@foo@cmd@zzz isn't defined       \zzz       % is interpreted as \@foo@cmd@jkl and expands to "blahblah"       \jkl     \end{foo}          % expands to "do something"     \asdf     % expands to "zzz"     \zzz     % causes: ERROR: Undefined control sequence.     \jkl          \end{document}


title: How to align plot axis with different tick label widths?

text: I want to set `tick labels` of positive numbers to occupy the same space as negative numbers for alignment of 'ylabel'. I want to avoid `absolute` setting of location since I have other concerns not to do that. I would like to align the axis, is there any way to set a 'y tick label' to occupy same space with the case when there is a negative sign there. Can I add a hidden negative tick label ?               \documentclass[]{article}              \usepackage{tikz}         \usepackage{pgf,pgfplots}         \pgfplotsset{compat=newest}         \pgfplotsset{         compat=newest,         plot coordinates/math parser=false,         every axis/.append style={             xlabel shift=0.5em,             ylabel shift=-0.5em         }}     \begin{document}               \begin{tikzpicture}         \begin{axis}[%             xlabel={XLABEL},             ylabel={YLABEL},             axis lines*=left]             \addplot+[mark=none] plot {x};         \end{axis}     \end{tikzpicture}          \begin{tikzpicture}         \begin{axis}[%             xlabel={XLABEL},             ylabel={YLABEL},             ymin=0, ymax=6,             axis lines*=left]             \addplot+[mark=none] plot {x};         \end{axis}     \end{tikzpicture}               \end{document}       ![enter image description here](http://i.stack.imgur.com/IIEnU.png) **Edit:** I use `tikzscale` to scale the plots:               \documentclass[]{article}              \usepackage{tikz}         \usepackage{pgf,pgfplots,graphicx,subfig}         \usepackage{tikzscale}         \pgfplotsset{compat=newest}         \pgfplotsset{         compat=newest,         plot coordinates/math parser=false,         every axis/.append style={             xlabel shift=0.5em,             ylabel shift=-0.5em         }}     \begin{document}               \begin{figure}     \subfloat{\includegraphics[width=3cm,height=4cm]{plot1}}     \subfloat{\includegraphics[width=3cm,height=4cm]{plot1}}     \\     \subfloat{\includegraphics[width=3cm,height=4cm]{plot2}}     \subfloat{\includegraphics[width=3cm,height=4cm]{plot2}}     \end{figure}          \end{document}      Results in this output, where the axis are not aligned because of the negative signs of the upper plots ![enter image description here](http://i.stack.imgur.com/7M0gV.png) After adding `trim axis left` and `scale only axis` it looks like this:                  \pgfplotsset{         compat=newest,         plot coordinates/math parser=false,         trim axis left,         scale only axis,         every axis/.append style={             xlabel shift=0.5em,             ylabel shift=-0.5em         }}      ![enter image description here](http://i.stack.imgur.com/T57oq.png)


title: Change bend angle and swap node position on arrow

text: I'm trying to draw an automata as follows:               \begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=2.8cm]       \node[initial,state] (q1)      {$1$};       \node[state]         (q2) [right of=q1]  {$2$};       \node[state] (q4) [below right of=q2] {$4$};       \node[state, accepting]         (q3) [above right of=q4] {$3$};            \path[->]          (q1)  edge                 node {a} (q2);       \path[->]          (q2)  edge   [bend left]   node {b} (q3);       \path[->]          (q3)  edge   [bend left]   node {a} (q2);       \path[->]          (q2)  edge                 node {b} (q4);       \path[->]          (q4)  edge                 node {a} (q3);     \end{tikzpicture}      However, the bending seems to be "too much", and it interferes with the two arrows to/from q4. In addition, I'd like the labels on those two arrows to be on the other side of the arrow. Sadly I couldn't find how to do it online so I turned to this page.


title: Differences in spacings

text: I noticed that I can use `\` to produce a spacing in math environment that seems to me equal to the one produced by `\quad`. Where is the difference?


title: Acronyms list size

text: \appendix     \chapter{Acronyms}     \singlespace      \begin{acronym}      \acro{BLAS}{Basic Linear Algebra Subprograms}      \acro{CLR}{Common Language Runtime}      \acro{DBMS}{Data Base Management System}      \acro{DBMSs}{Data Base Management Systems}      \acro{DDL}{Data Definition Language}      \acro{VDL}{View Definition language}       ...     \end{acronym}      I am getting: ![enter image description here](http://i.stack.imgur.com/IHjqr.png) How can I reduce the size of the list? What would be the best approach to do so? Should I change the `\singlespace`?


title: format two tables inside a figure

text: I have a figure that contains two tables, I would like to give format to them. What would be the best option?               {\footnotesize\begin{figure} [h!tb]     \centering     \begin{tabular} {l }     \hline     \textcolor{sql}{double} N;\\     \textcolor{sql}{double}[] L;\\     \textcolor{sql}{double}[,] Q;\\     \textcolor{sql}{int} d;\\     \textcolor{sql}{double}[,]rho;\\     \textcolor{sql}{public} NLQ(\textcolor{sql}{int} dimension) \{ \\     ~~d    = dimension;\\     ~~N    = 0.0;\\     ~~L    = new \textcolor{sql}{double}[d];\\     ~~Q   = new \textcolor{sql}{double}[d, d];\\     \} \\     \hline     \end{tabular}     \begin{tabular} {l }     \hline     \textbf{in}:   $record$, $d$  \\     1 :$n$ += 1\\     2: \textcolor{sql}{For} i=0 to d\\     3: ~~~~$L_i$ += $record_i$\\     4: ~~~~\textcolor{sql}{For} j=0 to i\\     5: ~~~~~~~~$Q_{i,j}$=$Q_{j,i}$= $record_i$*$record_j$ \\     6:~~~~~\textcolor{sql}{End}\\     7:\textcolor{sql}{End}\\     \textbf{out:}  $n$, $L$, $Q$ \\     \hline     \end{tabular}     \caption{NLQ Definition  and Reader Function}     \label{fig:implementNLQ}     \end{figure}     }      ![enter image description here](http://i.stack.imgur.com/v910g.png) maybe something like this ![enter image description here](http://i.stack.imgur.com/Dw4Fv.png) by the way I am using:               \definecolor{sql}{rgb}{0,0,2.55}     \definecolor{sqlC}{rgb}{0,0.44,0}     \definecolor{BRICKRED}{rgb}{0.57,0.0,0.0}     \definecolor{FORESTGREEN}{rgb}{0.0,0.34,0.0}     \definecolor{GOLDENROD}{rgb}{0.75,0.55,0.0}     \definecolor{VIOLET}{rgb}{.7,0.0,0.05}     \definecolor{MIDBLUE}{rgb}{0.08,0.08,1.28}      for the color


title: Align number from enumerate with equation

text: I'm trying to have an equation as the first line of one of my items in an `enumerate` environment. Example:               \begin{enumerate}       \item \[ x \]     \end{enumerate}      ![misaligned equation in enumerate](http://i.stack.imgur.com/08LKX.png) I want the $x$ to have the same baseline as the 1., but it's appearing lower. How can I make the two line up properly?


title: Cheat Sheet for Glossaries Package

text: I am using the `glossaries` package and always end up searching through the long documentation to find frequently used commands like `\acrshort`. Is there a nice compact cheat sheet available? If not, I would like to propose a community wiki entry which summarizes most frequently used commands and links to the documentation (which consists of several files) for further reading. I would like to see the following details:   * Usage for math notation   * Usage for standard glossary   * Usage for acronyms   * Most common problems for grammar (plurals, cases for other languages)