title: How do I fix this table?

text: The table is big in length and width, hence top and bottom of the table are chopped off from the table generated in a pdf file. Here goes the latex code.               \documentclass{article}          \usepackage[colorlinks]{hyperref}     \usepackage[noabbrev]{cleveref}     \usepackage{graphics}     \usepackage{amsmath}     \usepackage{ragged2e}     \usepackage{rotating}     \usepackage{latexsym}     \usepackage{epsfig}     \usepackage{graphicx}     \usepackage{enumitem}     \usepackage[tablename=TABLE,labelsep=newline,aboveskip=0pt,bf]{caption}     \usepackage{clipboard}     \usepackage{booktabs}     \usepackage[svgnames]{xcolor}     \usepackage[round]{natbib}     \usepackage[splitrule]{footmisc}     \usepackage{ltablex}     \usepackage{lipsum}     \usepackage{threeparttablex}     \usepackage{afterpage}     \usepackage{xr}     \usepackage{titlesec}     \usepackage{sectsty,textcase}     \usepackage{longtable}     \usepackage{sepfootnotes}     \usepackage{changepage}     \usepackage{siunitx}          %For making the titles in capital letters     %\allsectionsfont{\MakeTextUppercase}          \sisetup{         detect-mode,         %        tight-spacing           = true,         %        group-digits            = false,         input-signs             = ,         input-symbols           = ,         input-open-uncertainty  = ,         input-close-uncertainty = ,         table-align-text-pre    = false,         %        table-align-text-post   = false,         %        round-mode              = figures,         %        round-precision         = 3,         %        table-space-text-pre    = (,         %        table-space-text-post   = ),     }     \protected\def\stars#1{$^{#1}$}     \newcolumntype{k}{>{\hsize=.1\hsize}S}          %Set Counter      \setcounter{footnote}{2}          %Defining text size to control for spacing in tabularx environment      \newcolumntype{b}{>{\centering}>X}     %\newcolumntype{s}{>{\centering}>{\hsize=.25\hsize}>X}     \newcolumntype{j}{>{\centering}>{\hsize=.75\textwidth}>l}          %Redefining multicolumn environment to take care of @{}     \newcommand{\gmc}[2]{\multicolumn{#1}{@{}#2@{}}}                    \begin{document}                   \afterpage{             \begin{sidewaystable}                 \begin{ThreePartTable}                          \begin{TableNotes}[flushleft]                         \small                          \item \label{r2:a} \noindent This table presents the analyses of the nonlinear relationship between absolute discretionary accruals and observable characteristics. All models are estimated using multivariate linear regression, with dependent variable being absolute discretionary accrual and independent regressors being observable characteristics and their second order power transformations. *,**,*** indicate significance at the 0.10, 0.05, and 0.01 levels, respectively using two-tailed tests. All t-statistics (in parentheses) and p-values are calculated using heteroscedasticity-adjusted clustered (HAC) standard errors by company. Only the model in column (I) includes year and industry-specific intercepts, but for brevity those are not reported.                      \end{TableNotes}                          \begin{tabularx}{\textwidth}{@{}Xcccccccccccc@{}}                              \caption{\textit{Nonlinear Relationship}}\label{tab:sample}\\\toprule\toprule                         & \gmc{12}{l} \mbox{Dependent Variable = Absolute Discretionary Accrual}\\\cmidrule(l r){2-13}\\                         Variables & (I) & (II) & (III) & (IV) & (V) & (VI) & (VII)& (VIII)& (IX)& (X)& (XI) & (XII) \\\midrule\endfirsthead                              \caption{\textit{Nonlinear Relationship - Continued}}\\\toprule\toprule                         & \gmc{12}{l} \mbox{Dependent Variable = Absolute Discretionary Accrual}\\\cmidrule(l r){2-13}\\                         Variables & (I) & (II) & (III) & (IV) & (V) & (VI) & (VII)& (VIII)& (IX)& (X)& (XI) & (XII) \\\midrule\endhead                              \bottomrule\gmc{2}{r}{\small\textit{(Continued)}}\endfoot                         \bottomrule\insertTableNotes\endlastfoot                              (Intercept)         & $0.034^{***}$  & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$ & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$ & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$  \\                         & $(8.256)$      & $(326.308)$    & $(302.004)$    & $(295.880)$    & $(285.826)$   & $(308.718)$    & $(307.844)$    & $(284.705)$    & $(285.351)$   & $(293.573)$    & $(291.619)$    & $(285.588)$    \\                         poly(LOGASSETS, 2)1 & $-4.942^{***}$ & $-6.068^{***}$ & $-5.532^{***}$ &                &               &                &                &                &               &                &                &                \\                         & $(-20.000)$    & $(-25.236)$    & $(-94.950)$    &                &               &                &                &                &               &                &                &                \\                         poly(LOGASSETS, 2)2 & $-1.280^{***}$ & $-1.709^{***}$ & $0.948^{***}$  &                &               &                &                &                &               &                &                &                \\                         & $(-11.620)$    & $(-15.860)$    & $(15.861)$     &                &               &                &                &                &               &                &                &                \\                         poly(LOGMKT, 2)1    & $0.855^{***}$  & $1.401^{***}$  &                & $-4.618^{***}$ &               &                &                &                &               &                &                &                \\                         & $(3.435)$      & $(5.758)$      &                & $(-80.615)$    &               &                &                &                &               &                &                &                \\                         poly(LOGMKT, 2)2    & $0.747^{***}$  & $0.985^{***}$  &                & $0.161^{***}$  &               &                &                &                &               &                &                &                \\                         & $(7.709)$      & $(10.244)$     &                & $(2.740)$      &               &                &                &                &               &                &                &                \\                         poly(LEV, 2)1       & $0.486^{***}$  & $0.295^{***}$  &                &                & $0.123$       &                &                &                &               &                &                &                \\                         & $(4.894)$      & $(3.009)$      &                &                & $(1.588)$     &                &                &                &               &                &                &                \\                         poly(LEV, 2)2       & $-0.381^{***}$ & $-0.307^{***}$ &                &                & $1.808^{***}$ &                &                &                &               &                &                &                \\                         & $(-3.967)$     & $(-3.202)$     &                &                & $(15.131)$    &                &                &                &               &                &                &                \\                         poly(ROA, 2)1       & $-2.520^{***}$ & $-2.685^{***}$ &                &                &               & $-6.478^{***}$ &                &                &               &                &                &                \\                         & $(-10.658)$    & $(-11.346)$    &                &                &               & $(-66.153)$    &                &                &               &                &                &                \\                         poly(ROA, 2)2       & $-1.987^{***}$ & $-1.961^{***}$ &                &                &               & $-0.103$       &                &                &               &                &                &                \\                         & $(-11.164)$    & $(-11.039)$    &                &                &               & $(-0.912)$     &                &                &               &                &                &                \\                         poly(CFO, 2)1       & $-2.219^{***}$ & $-2.349^{***}$ &                &                &               &                & $-5.851^{***}$ &                &               &                &                &                \\                         & $(-10.461)$    & $(-11.399)$    &                &                &               &                & $(-60.246)$    &                &               &                &                &                \\                         poly(CFO, 2)2       & $3.444^{***}$  & $3.281^{***}$  &                &                &               &                & $2.536^{***}$  &                &               &                &                &                \\                         & $(22.091)$     & $(21.086)$     &                &                &               &                & $(21.182)$     &                &               &                &                &                \\                         poly(BTM, 2)1       & $-0.315^{***}$ & $-0.288^{***}$ &                &                &               &                &                & $-0.882^{***}$ &               &                &                &                \\                         & $(-3.768)$     & $(-3.406)$     &                &                &               &                &                & $(-12.263)$    &               &                &                &                \\                         poly(BTM, 2)2       & $0.046$        & $0.077$        &                &                &               &                &                & $0.590^{***}$  &               &                &                &                \\                         & $(0.582)$      & $(0.963)$      &                &                &               &                &                & $(7.778)$      &               &                &                &                \\                         poly(GROWTH, 2)1    & $0.431^{***}$  & $0.482^{***}$  &                &                &               &                &                &                & $0.826^{***}$ &                &                &                \\                         & $(6.145)$      & $(6.971)$      &                &                &               &                &                &                & $(10.033)$    &                &                &                \\                         poly(GROWTH, 2)2    & $-0.233^{***}$ & $-0.288^{***}$ &                &                &               &                &                &                & $1.298^{***}$ &                &                &                \\                         & $(-3.318)$     & $(-4.113)$     &                &                &               &                &                &                & $(14.251)$    &                &                &                \\                         poly(ABSACCRL, 2)1  & $1.299^{***}$  & $1.375^{***}$  &                &                &               &                &                &                &               & $4.043^{***}$  &                &                \\                         & $(15.240)$     & $(16.018)$     &                &                &               &                &                &                &               & $(48.167)$     &                &                \\                         poly(ABSACCRL, 2)2  & $-0.470^{***}$ & $-0.489^{***}$ &                &                &               &                &                &                &               & $-1.020^{***}$ &                &                \\                         & $(-5.455)$     & $(-5.619)$     &                &                &               &                &                &                &               & $(-11.227)$    &                &                \\                         poly(ALTMAN, 2)1    & $0.362^{***}$  & $0.434^{***}$  &                &                &               &                &                &                &               &                & $-3.508^{***}$ &                \\                         & $(3.427)$      & $(4.219)$      &                &                &               &                &                &                &               &                & $(-37.658)$    &                \\                         poly(ALTMAN, 2)2    & $0.177^{*}$    & $0.211^{**}$   &                &                &               &                &                &                &               &                & $1.280^{***}$  &                \\                         & $(1.951)$      & $(2.315)$      &                &                &               &                &                &                &               &                & $(11.271)$     &                \\                         poly(STDEARN, 2)1   & $1.557^{***}$  & $1.821^{***}$  &                &                &               &                &                &                &               &                &                & $-1.212^{***}$ \\                         & $(21.667)$     & $(25.899)$     &                &                &               &                &                &                &               &                &                & $(-21.981)$    \\                         poly(STDEARN, 2)2   & $-0.840^{***}$ & $-0.992^{***}$ &                &                &               &                &                &                &               &                &                & $1.155^{***}$  \\                         & $(-13.228)$    & $(-15.603)$    &                &                &               &                &                &                &               &                &                & $(19.654)$     \\                         Industry and Year F.E. Included & Yes & No & No & No & No & No & No & No & No & No & No & No \\                         Adjusted $R^2$ & 0.2622 & 0.2425 & \\                     \end{tabularx}                 \end{ThreePartTable}             \end{sidewaystable}         }          \end{document}


title: Way to remember LaTeX commands

text: I'm new to LaTeX but have already read so much about it. Now, as I write my first long document, I notice that my head can't process all of this new information ;) For example creating a float - and I am like "Hmm what's the option that places a float at the bottom of the page? Or on its own page?" What is your way for remembering these commands, especially if you only use them once in a while? Did you write your own short documentation or do you look up every question online?


title: keyboard issues

text: Not sure if this problem is due to remote computer access. I am trying to run MikTex remotely. Never done that before. I was trying to convert an ipython file .ipynb to latex using Pandoc. When I opened the latex file it created using MikTex and tried to make changes to it, the editor responds only to the first typed keypad entry and for the next ones it repeats the key. That is if I type 'Miktex', it prints in the editor 'MMMMMM'. I thought it was due to pandoc screwing up MikTex configuration. So I uninstalled Pandoc, uninstalled MikTex and reinstalled MikTex. But I still encounter the same problem. Now I wonder if this is some remote access issue? However, for all other non latex files the keyboard works. I can open text files and write remotely. Only MikTex has this issue. I tried to access the remote computer using Linux machine and also Windows machine. But this issue persists. Can someone please help? Thanks


title: Problem using locally installed font

text: I installed a font locally under $HOME/texmf, and after running `texhash` everything seems to be in place:               > kpsewhich mtpro2.map     /home/mafp/texmf/fonts/map/dvips/mtpro2/mtpro2.map     > kpsewhich mt2exe.tfm     /home/mafp/texmf/fonts/tfm/pctex/mtpro2/mt2exe.tfm     > kpsewhich mt2exe.pfb     /home/mafp/texmf/fonts/type1/pctex/mtpro2/mt2exe.pfb      Then I ran               > updmap --enable Map=mtpro2.map     updmap is using the following updmap.cfg files (in precedence order):       /etc/texmf/web2c/updmap.cfg       /usr/share/texmf/web2c/updmap.cfg     updmap is using the following updmap.cfg file for writing changes:       /etc/texmf/web2c/updmap.cfg     /etc/texmf/web2c/updmap.cfg unchanged.  Map files not recreated.     updmap: Updating ls-R files.      which sounds fishy, I guess it should use a updmap.cfg under TEXMFHOME. And indeed, translating a simple test file using the font gives               > pdflatex mtpro2test     This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/TeX Live for SUSE Linux)      restricted \write18 enabled.     entering extended mode     (./mtpro2bug.tex     LaTeX2e <2011/06/27>     Babel <3.9f> and hyphenation patterns for 78 languages loaded.     (/usr/share/texmf/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texmf/tex/latex/base/size10.clo))     (/home/mafp/texmf/tex/latex/amsmath/amsmath.sty     For additional information on amsmath, use the `?' option.     (/home/mafp/texmf/tex/latex/amsmath/amstext.sty     (/home/mafp/texmf/tex/latex/amsmath/amsgen.sty))     (/home/mafp/texmf/tex/latex/amsmath/amsbsy.sty)     (/home/mafp/texmf/tex/latex/amsmath/amsopn.sty))     (/home/mafp/texmf/tex/latex/mtpro2/mtpro2.sty) (./mtpro2test.aux) [1{/usr/share/     texmf/fonts/map/pdftex/updmap/pdftex.map}] (./mtpro2test.aux)     kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 2+0/600 --dpi 1200 mt2exe     mktexpk: don't know how to create bitmap font for mt2exe.     mktexpk: perhaps mt2exe is missing from the map file.     kpathsea: Appending font creation commands to missfont.log.      )     !pdfTeX error: pdflatex (file mt2exe): Font mt2exe at 1200 not found      ==> Fatal error occurred, no output PDF file produced!      What am I missing here?


title: How to customize block in Beamer

text: I want to customize block (alertblock) in Beamer. I want a transparent block, with a red frame and where the title is also in red like the one given in the image below: ![Goal\(with rounded corners\)](http://i.stack.imgur.com/TeYAU.jpg) MWE:                \documentclass[12 pt]{beamer}         \usetheme{default}              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         \usepackage[T1]{fontenc} % pour taper les lettres accentues         \usepackage[latin1]{inputenc}         \usepackage[frenchb]{babel}         \usepackage[babel=true]{csquotes} % csquotes va utiliser la langue dÈfinie dans babel         \frenchbsetup{StandardLists=true}                   %%%%%%%%%%         % FONTS %         %%%%%%%%%%              %% Default font: lmodern, doesn't require fontspec % solves some default warnings         %\usepackage[T1]{fontenc}         %\usepackage{lmodern}                    %\usepackage{sfmath}        % Sans Serif Math, off by default              %% Protects fonts from Beamer screwing with them         %% http://tex.stackexchange.com/questions/10488/force-computer-modern-in-math-mode         \usefonttheme{professionalfonts}              %% XeLaTeX fonts: (comment out if you don't use XeLaTeX)              %% For advanced fonts: access local OS X fonts         \usepackage[no-math]{fontspec}               %% This template uses typical OS X and Adobe fonts         \defaultfontfeatures{Mapping=tex-text}  % This seems to be important for mapping glyphs properly              \setmainfont{Chalkboard}            % Beamer ignores "main font" in favor of sans font         \setsansfont{Chalkboard}            % This is the font that beamer will use by default         % \setmainfont{Gill Sans Light}     % Prettier, but harder to read              \setbeamerfont{title}{family=\fontspec{Chalkduster}}                   %\newcommand{\handwriting}{\fontspec{augie}} % From Emerald City, free font         % \newcommand{\handwriting}{}   % If you prefer no special handwriting font or don't have augie              %% Gill Sans doesn't look very nice when boldfaced         %% This is a hack to use Helvetica instead         %% Usage: \textbf{\forbold some stuff}         %\newcommand{\forbold}{\fontspec{Helvetica}}         % \newcommand{\forbold}{} % if you want no special boldface                        %%%%%%%%%%%%%%%%%%%%%%%%         % Usual LaTeX Packages %         %%%%%%%%%%%%%%%%%%%%%%%%         \usepackage{unicode-math}         \setmathfont[math-style=upright]{Neo Euler}                   \usepackage{amsmath}         \usepackage{amsfonts}         \usepackage{amssymb}         \usepackage{graphicx}         \usepackage{mathrsfs}           % For Weinberg-esque letters         \usepackage{cancel}             % For "SUSY-breaking" symbol         \usepackage{slashed}            % for slashed characters in math mode         \usepackage{bbm}                % for \mathbbm{1} (unit matrix)         \usepackage{amsthm}             % For theorem environment         \usepackage{multirow}           % For multi row cells in table         \usepackage{arydshln}           % For dashed lines in arrays and tables         %\usepackage{tikzfeynman}       % For Feynman diagrams         \usepackage{wasysym}         \usepackage{pifont}         \usepackage{ifsym}         %\usepackage{bbding}         % \usepackage{subfig}           % for sub figures         % \usepackage{young}            % For Young Tableaux         % \usepackage{xspace}           % For spacing after commands         % \usepackage{wrapfig}          % for Text wrap around figures         % \usepackage{framed}                   %\graphicspath{{images/}}   % Put all images in this directory. Avoids clutter.                   %\usetikzlibrary{backgrounds}         %\usetikzlibrary{mindmap,trees} % For mind map         % http://www.texample.net/tikz/examples/computer-science-mindmap/         %\setbeamertemplate{background canvas}{\includegraphics [width=\paperwidth]{blackboard_bk.pdf}}              %==================%         \setbeamercolor{normal text}{fg=white}         \setbeamercolor{alerted text}{fg=red!80}         \setbeamercolor{structure}{fg=yellow!80}         \setbeamercolor{frametitle}{fg=green}         \setbeamercolor{title}{fg=white}         \setbeamertemplate{blocks}[shadow=false]         \setbeamercolor{block body}{fg=normal text.bg!90!black}         \setbeamercolor{block body example}{bg=normal text.bg!90!black}     \begin{document}             \begin{frame}{Test num\'ero 2}         \begin{block}{Un bloc normal}           Texte du block           \end{block}               \begin{alertblock}{Un bloc tr\`es alerte}           Texte du block           \end{alertblock}               \begin{exampleblock}{Un bloc exemplaire}           Exemple de block           \end{exampleblock}         \end{frame}              \end{document}


title: How to make a command for a circled letter to work with all font sizes?

text: I introduced the following macros               \newcommand{\malcev}{\mathop{\text{\textcircled{\scriptsize M}}}\nolimits}     \newcommand{\imalcev}{\mathop{\text{\textcircled{\tiny M}}}\nolimits}       The code               \[       \mathbf{V} \malcev \mathbf{W}  \qquad  F_{\mathbf{V} \imalcev \mathbf{W}} \qquad S^{\mathbf{V} \imalcev \mathbf{W}}      \]      now produces an acceptable result ![Malcev example](http://i.stack.imgur.com/cDJkj.jpg) However, it is certainly not a clean solution since I have to manually switch between \malcev and \imalcev depending on the font size (not to speak about a possible double superscript). I am looking for a better solution (if possible avoiding tikz). I looked at the following questions   1. Good way to make \textcircled numbers?   2. How do I put a circle around an operator?   3. How to make a command for a composed symbol to work with all font sizes? which are certainly relevant, but I was not able to get exactly what I wanted from their answers. One of the difficulties is that I use \textcircled on a scriptsized letter (otherwise my symbol would be too big), but this is probably not a good idea. Any help would be appreciated.


title: Fancyhdr - the header image collides with the body of the content

text: I am really confused. In the original document , I had a header that collides with the body of the document. Now for preparing the MWE , I removed the unnecessary packages and code segments. I found that the collision has gone. Please help me out. And secondly , I want to reduce the gap in the header and starting of document. I am attaching both the documents. Sorry for the lengthy question but can't help it out.               \documentclass[12pt]{book}     \usepackage{graphicx}     \usepackage[explicit]{titlesec}     \usepackage{tikz}     \usepackage{suffix}     \usepackage{fancyhdr}     \usepackage[a4paper,margin=1in,includefoot,footskip=1in,bindingoffset=0.2in,centering,headheight=0.3in,heightrounded]{geometry}     \usepackage[printwatermark]{xwatermark}     \usepackage{xcolor}     \usepackage{transparent}     \usepackage{filecontents}     \usepackage[T1]{fontenc}     \usepackage{everypage}     \usepackage{datatool}     \usepackage{microtype}     \usepackage{afterpage}     \usepackage{background}     \usepackage{pgfornament}     \usepackage{ifoddpage}     \usepackage{wrapfig}     \usepackage{wallpaper}          \begin{filecontents}{quotations.csv}     I\space think everybody in this country should learn how to program a computer because it teaches you how to think.; Steve Jobs     Computer Science is no more about computers than astronomy is about telescopes.; Edsger W. Dijkstra     The computer was born to solve problems that did not exist before.; Bill Gates     A\space computer would deserve to be called intelligent if it could deceive a human into believing that it was human.; Alan Turing     UNIX is basically a simple operating system but you have to be a genius to understand the simplicity.; Dennis Ritchie     Imagination is more important than knowledge.  For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution.; Albert Einstein     The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge.; Stephen Hawking     The more you know, the more you realize you know nothing.; Socrates     Tell me and I forget.  Teach me and I remember.  Involve me and I learn.; Benjamin Franklin     Real knowledge is to know the extent of one's ignorance.; Confucius     I~do not fear computers. I fear lack of them.; Isaac Asimov     \end{filecontents}     \DTLsetseparator{;}     \DTLloaddb[noheader,keys={quote,author}]{quotes}{quotations.csv}          \usetikzlibrary{shapes.misc,arrows}     \newcommand\titlebar{%     \tikz[baseline,trim left=0.5cm,trim right=2.5cm] {%         \node [             text = red!70!green,             anchor= base east,             minimum height=3.5ex] (a) at (2.5cm,0.6ex) {%         };        \path[fill=red!70!blue] (a.east) circle (.5ex);        \draw[color=red!70!blue, thick,rounded corners=1ex] (a.east) |- (\textwidth+3cm,-0.75ex);     }     }          \newcommand\subtitlebar{%     \tikz[baseline,trim left=1cm,trim right=3.05cm] {%         \node[             text = red!70!green,             anchor= base east,             minimum height=3.5ex] (b) at (3.05cm,0.6ex) {%         };        \path[fill=red!70!blue] (b.east) circle (.5ex);        \draw[color=red!70!blue, thick,rounded corners=1ex] (b.east) |- (\textwidth+2cm,-0.75ex);     }%     }               \titleformat{\subsection}{\normalfont\large\sffamily}{}{0cm}{\textcolor{blue!60!green}{#1}}     \titlespacing*{\subsection}{0cm}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}     \titlespacing*{name=\subsection,numberless}{0cm}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}     \renewcommand*{\thesubsection}{\arabic{subsection}}               \titleformat{\section}{\LARGE\sffamily}{}{0cm}{\textcolor{blue!60!green}{#1}}     \titlespacing*{\section}{0cm}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}     \titlespacing*{name=\section,numberless}{0cm}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}     \renewcommand*{\thesection}{\arabic{section}}          \newcommand\chapterauthor[1]{\authortoc{#1}\printchapterauthor{#1}}     \WithSuffix\newcommand\chapterauthor*[1]{\printchapterauthor{#1}}     \makeatletter     \newcommand{\printchapterauthor}[1]{%       {\parindent0pt\vspace*{-25pt}%       \linespread{1.5}\large\scshape\filcenter #1%       \par\nobreak\vspace*{35pt}}       \@afterheading%     }     \newcommand{\authortoc}[1]{%       \addtocontents{toc}{\vskip-10pt}%       \addtocontents{toc}{%         \protect\contentsline{chapter}%         {\hskip1.3em\mdseries\scshape\protect\scriptsize#1}{}{}}       \addtocontents{toc}{\vskip5pt}%     }     \makeatother          \titleformat{\chapter}[display]       {\bfseries\Large}     %%  {\filright\MakeUppercase{\chaptertitlename}\Huge\thechapter}       {}       {1ex}       {\vspace{1ex}\filcenter #1}       [\vspace{1ex}]          \usetikzlibrary{calc}          \fancypagestyle{plain}{       \fancyhf{}      \fancyfoot[LE,RO]{\tikz[baseline={(0,0)},anchor=center] \node[draw,inner sep=0pt,         outer sep=0pt,label={[xshift=-.10cm,yshift=0cm]center:\footnotesize\thepage}]         {\includegraphics[scale=.15]{logo1}};}%      \fancyhead[C]{\includegraphics[scale=.85]{border}}           \renewcommand{\footrulewidth}{0.4pt}       \renewcommand{\headrulewidth}{0.0pt}     }               \fancypagestyle{myfancy}{     \fancyhf{}     \fancyhead[C]{\includegraphics[scale=.85]{border}}         \fancyfoot[LE,RO]{\tikz[baseline={(0,0)},anchor=center] \node[draw,inner sep=0pt,         outer sep=0pt,label={[xshift=-.10cm,yshift=0cm]center:\footnotesize\thepage}]         {\includegraphics[scale=.15]{logo1}};}%     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0.4pt}     }     \newcounter{thepagenum}     \setcounter{thepagenum}{0}          % Set highest row number to access     % '11' here because there are 11 rows in the .csv     \def\pagelimit{11}          \newcommand{\setquoteandauthor}{%       \parbox[c][0.9cm][b]{\dimexpr\textwidth-4.5cm\relax}{%\centering         \emph{\QValue} \hfill --- \AValue}}%          \AddEverypageHook{%       \ifnum\pdfstrcmp{\arabic{thepagenum}}{\pagelimit}=0       \setcounter{thepagenum}{0}%       \else       \fi       \stepcounter{thepagenum}       \DTLgetvalue{\QValue}{quotes}{\arabic{thepagenum}}{1}%       % Author info too?       \DTLgetvalue{\AValue}{quotes}{\arabic{thepagenum}}{2}%     %  \fancyfoot[cf]{``\QValue'' --- \AValue}%       \fancyfoot[cf]{\setquoteandauthor}}                    \let\oldcleardoublepage\cleardoublepage     \renewcommand{\cleardoublepage}{\afterpage{\thispagestyle{empty}}\oldcleardoublepage}          \pagestyle{myfancy}     \renewcommand{\chaptermark}[1]{\markboth{#1}{}}          %\newwatermark[allpages,color=red!50,scale=3,xpos=0,ypos=0]{\transparent{0.2}\includegraphics[scale=.25]{logo}}          \tikzset{mynode/.style={anchor=center,text=black,font=\fontfamily{pzc}\LARGE\selectfont,scale=1.5,inner                sep=2pt,minimum width=0.6cm}}          \usetikzlibrary{calc,chains,positioning}                \newsavebox\mybox     \savebox\mybox{%     \begin{tikzpicture}[node distance=.1cm]         \node[mynode] (c) {C};         \node[mynode,below=of c] (y1) {Y};         \node[mynode,below=of y1] (b) {B};         \node[mynode,below=of b] (y2) {Y};         \node[mynode,below=of y2] (r) {R};         \node[mynode,below=of r] (u) {U};         \node[mynode,below=of u] (s) {S};         \node[mynode,below=of s] (1) {1};         \node[mynode,below=of 1] (4) {4};         \end{tikzpicture}%     }     \backgroundsetup{     scale=1,     opacity=1,     angle=0,     color=black,     contents={%      \checkoddpage       \ifoddpage     \begin{tikzpicture}[remember picture,overlay]       \node at ($(current page.east)+(-0.5in,0)$) {\usebox\mybox};     \end{tikzpicture}%     \else     \begin{tikzpicture}[remember picture,overlay]       \node at ($(current page.west)+(0.5in,0)$) {\usebox\mybox};     \end{tikzpicture}%       \fi     }     }               \begin{document}     \input{./../Articles/Technical/backtrack/backtrack_linux}     \end{document}      The logo and the border: ![enter image description here](http://i.stack.imgur.com/fwsCD.jpg) ![enter image description here](http://i.stack.imgur.com/x0WfI.jpg) quotations.csv:               %% LaTeX2e file `quotations.csv'     %% generated by the `filecontents' environment     %% from source `document' on 2014/02/16.     %%     I\space think everybody in this country should learn how to program a computer because it teaches you how to think.; Steve Jobs     Computer Science is no more about computers than astronomy is about telescopes.; Edsger W. Dijkstra     The computer was born to solve problems that did not exist before.; Bill Gates     A\space computer would deserve to be called intelligent if it could deceive a human into believing that it was human.; Alan Turing     UNIX is basically a simple operating system but you have to be a genius to understand the simplicity.; Dennis Ritchie     Imagination is more important than knowledge.  For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution.; Albert Einstein     The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge.; Stephen Hawking     The more you know, the more you realize you know nothing.; Socrates     Tell me and I forget.  Teach me and I remember.  Involve me and I learn.; Benjamin Franklin     Real knowledge is to know the extent of one's ignorance.; Confucius     I~do not fear computers. I fear lack of them.; Isaac Asimov      The backtrack_linux.tex file is the same as in the second code from `\begin{document}` and `\end{document}`               \documentclass[12pt]{book}     \usepackage{graphicx}     \usepackage[explicit]{titlesec}     \usepackage{fancyhdr}     \usepackage[a4paper,margin=1in,includefoot,footskip=1in,bindingoffset=0.2in,centering,headheight=0.3in,heightrounded]{geometry}     \usepackage{filecontents}     \usepackage[T1]{fontenc}     \usepackage{everypage}     \usepackage{datatool}     \usepackage{microtype}     \usepackage{afterpage}     \usepackage{ifoddpage}     \usepackage{suffix}     \usepackage{tikz}          \begin{filecontents}{quotations.csv}     I\space think everybody in this country should learn how to program a computer because it teaches you how to think.; Steve Jobs     Computer Science is no more about computers than astronomy is about telescopes.; Edsger W. Dijkstra     The computer was born to solve problems that did not exist before.; Bill Gates     A\space computer would deserve to be called intelligent if it could deceive a human into believing that it was human.; Alan Turing     UNIX is basically a simple operating system but you have to be a genius to understand the simplicity.; Dennis Ritchie     Imagination is more important than knowledge.  For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution.; Albert Einstein     The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge.; Stephen Hawking     The more you know, the more you realize you know nothing.; Socrates     Tell me and I forget.  Teach me and I remember.  Involve me and I learn.; Benjamin Franklin     Real knowledge is to know the extent of one's ignorance.; Confucius     I~do not fear computers. I fear lack of them.; Isaac Asimov     \end{filecontents}     \DTLsetseparator{;}     \DTLloaddb[noheader,keys={quote,author}]{quotes}{quotations.csv}          \newcommand\chapterauthor[1]{\authortoc{#1}\printchapterauthor{#1}}     \WithSuffix\newcommand\chapterauthor*[1]{\printchapterauthor{#1}}     \makeatletter     \newcommand{\printchapterauthor}[1]{%       {\parindent0pt\vspace*{-25pt}%       \linespread{1.5}\large\scshape\filcenter #1%       \par\nobreak\vspace*{35pt}}       \@afterheading%     }     \makeatother          \titleformat{\chapter}[display]       {\bfseries\Large}     %%  {\filright\MakeUppercase{\chaptertitlename}\Huge\thechapter}       {}       {1ex}       {\vspace{1ex}\filcenter #1}       [\vspace{1ex}]          \usetikzlibrary{calc}          \fancypagestyle{plain}{       \fancyhf{}      \fancyfoot[LE,RO]{\tikz[baseline={(0,0)},anchor=center] \node[draw,inner sep=0pt,         outer sep=0pt,label={[xshift=-.10cm,yshift=0cm]center:\footnotesize\thepage}]         {\includegraphics[scale=.15]{logo1}};}%      \fancyhead[C]{\includegraphics[scale=.85]{border}}           \renewcommand{\footrulewidth}{0.4pt}       \renewcommand{\headrulewidth}{0.0pt}     }               \fancypagestyle{myfancy}{     \fancyhf{}     \fancyhead[C]{\includegraphics[scale=.85]{border}}         \fancyfoot[LE,RO]{\tikz[baseline={(0,0)},anchor=center] \node[draw,inner sep=0pt,         outer sep=0pt,label={[xshift=-.10cm,yshift=0cm]center:\footnotesize\thepage}]         {\includegraphics[scale=.15]{logo1}};}%     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0.4pt}     }     \newcounter{thepagenum}     \setcounter{thepagenum}{0}          % Set highest row number to access     % '11' here because there are 11 rows in the .csv     \def\pagelimit{11}          \newcommand{\setquoteandauthor}{%       \parbox[c][0.9cm][b]{\dimexpr\textwidth-4.5cm\relax}{%\centering         \emph{\QValue} \hfill --- \AValue}}%          \AddEverypageHook{%       \ifnum\pdfstrcmp{\arabic{thepagenum}}{\pagelimit}=0       \setcounter{thepagenum}{0}%       \else       \fi       \stepcounter{thepagenum}       \DTLgetvalue{\QValue}{quotes}{\arabic{thepagenum}}{1}%       % Author info too?       \DTLgetvalue{\AValue}{quotes}{\arabic{thepagenum}}{2}%     %  \fancyfoot[cf]{``\QValue'' --- \AValue}%       \fancyfoot[cf]{\setquoteandauthor}}                    \let\oldcleardoublepage\cleardoublepage     \renewcommand{\cleardoublepage}{\afterpage{\thispagestyle{empty}}\oldcleardoublepage}          \pagestyle{myfancy}     \renewcommand{\chaptermark}[1]{\markboth{#1}{}}          %\newwatermark[allpages,color=red!50,scale=3,xpos=0,ypos=0]{\transparent{0.2}\includegraphics[scale=.25]{logo}}               \begin{document}     \chapter{INSTALL BACKTRACK ON AN ANDROID DEVICE}     \chapterauthor*{K.DINESH KUMAR \par II Year B.Tech CSE}     \section{What is Backtrack?}     BackTrack is a distribution designed by Jason Dennis based on the Ubuntu Linux distribution aimed at digital forensics and penetration testing use. BackTrack provides users with easy access to a comprehensive and large collection of security-related tools ranging from port scanners to Security Audit. Support for Live CD and Live USB functionality allows users to boot BackTrack directly from portable media without requiring installation, though permanent installation to hard disk and network is also an option.\par     \section{Security Tools in Backtrack}          BackTrack includes many well known security tools including:     \begin{itemize}         \item Metasploit for integration         \item Wi-Fi drivers supporting monitor mode (rfmon mode) and packet injection         \item Aircrack-ng         \item Gerix Wifi Cracker         \item Kismet         \item Nmap         \item Ophcrack         \item Ettercap         \item Wireshark (formerly known as Ethereal)         \item BeEF (Browser Exploitation Framework)         \item Hydra         \item OWASP Mantra Security Framework, a collection of hacking tools, add-ons and scripts based on FirefoX.         \item Cisco OCS Mass Scanner, a very reliable and fast scanner for Cisco routers with telnet and enabling of a default password.     \end{itemize}          \section{Installing Backtrack on Android Device}     \subsection{Tools Required}     \begin{enumerate}     \item Backtrack 5 ARM.\\     Download Backtrack 5 ARM from Backtrack official site. Backtrack with ARM architecture only on Backtrack 5 version. ARM architecture not available for Backtrack 5 R1, Backtrack 5 R2, and Backtrack 5 R3.     \item Rooted android device \\     Why rooted android device ? Because we need install some application that need Android to be root     \item Busybox, Superuser, Terminal Emulator, and AndroidVNC. \\     You can download search and all of them on Google Play. BusyBox is installer and uninstaller Android program, Superuser is superuser rights manager for Android, Terminal Emulator is Android's built-in Linux command line shell program, and AndroidVNC is a VNC viewer for Android.     \end{enumerate}     \subsection{Installation}     \begin{enumerate}     \item Extract BT5-GNOME-ARM.7z to folder, for example "BT5" folder and then put on device root directory.     \item Open Terminal Emulator on device then go to BT5 folder using the command \verb+ cd sdcard/BT5 +     \item Then run this following command \verb+ su + and \verb+ sh bootbt + and you will see \verb+ root@localhost +     \item Now lets run Backtrack GUI with VNC viewer \verb+startvnc+     \item To connect wth VNC we must know the port where VNC listening. Run \verb+netstat -anpt+ and remember the port where VNC listening. In this case the port is 59016. Open AndroidVNC and fill the form like this: \\     Nickname : BT5\\     Password : toortoor\\     Address  : 127.0.0.1\\     Port     : 5901 \\     \item Connect it and you will see Backtrack 5 interface \par     \textit{Remember! Some of the Backtrack tools can't work properly and do it for your own risk. I hope you can Install Backtrack on Android device without any problems, tell me if you get problems.}     \end{enumerate}     \end{document}      The outputs: ![enter image description here](http://i.stack.imgur.com/RDYBy.png)      ![enter image description here](http://i.stack.imgur.com/73cac.png)      ![enter image description here](http://i.stack.imgur.com/R8pib.png)


title: Change side wallpapers between pages

text: My document has graphics on its left and right border on each page, I use the package `wallpaper` for that:               \newcommand{\dsaSetDefaultPageBorders}{        \ULCornerWallPaper{}{./fanpaket/balken-links.png}        \URCornerWallPaper{}{./fanpaket/balken-rechts.png}     }     \dsaSetDefaultPageBorders      I define an environment for a title page, which should have different borders:               \newenvironment{dsaTitlePage}{        \ClearWallPaper        \ThisULCornerWallPaper{}{./fanpaket/balken-symbole-links.png}        \ThisURCornerWallPaper{}{./fanpaket/balken-symbole-rechts.png}        % other stuff     }{        % other stuff        \pagebreak        \dsaSetDefaultPageBorders     }      On the title page that gets produced by this, _both_ border image sets are used on top of each other. If I remove `\dsaSetDefaultPageBorders` from the environment, this doesn't happen, but then there are no borders at all in the following document. How can I fix this? And why isn't there a `\ThisClearWallPaper`?


title: Texstudio - Preview no longer jumps to text where cursor is at

text: Yesterday I accidentally hit the escape button instead of the backward quote (`) button, causing my preview to close. I reopened it by pressing `f7` but whenever I build & view now using the `F1` button, the preview no longer jumps to the text my cursor is at. Does anyone know how to fix this? As I never adapt settings, everything is still the same as far as I know. In any case my PdfLaTeX is set to `pdflatex.exe -synctex=1 -interaction=nonstopmode %.tex` and I use the Internet PDF Viewer (Embedded). Thanks a lot!


title: How to not have an equation in the first line using the align environment?

text: Here is my code:                \begin{align*}     (a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|}      &=(a-bx-by)e^{-\frac{1}{4}((x-y)^2+(x+y)^2)(1+c)+\frac{1}{2}(1-c)(x+y)(y-x)}\\     &=(a-bx-by)e^{-(x^2+cy^2)} \\     &=f(x,y).     \end{align*}      I have a long equation. My question is as follows: I want to isolate the expression                (a-bu)e^{-\frac{1}{4}(v^2+u^2)(1+c)+\frac{1}{2}(1-c)u|v|}      on the first line so that I don't have an equation on the first line and I want this expression left justified with the other lines (that have the equal sign). How can I do this?


title: Placing bibtex entries inline

text: I would like to place the name and the title of a BibTeX entry inline. Something like: > [JD2012] John Doe, Title of Paper. Any Idea?


title: Problem with addition and macro argument

text: I need to use a formula like this:               y = 1.8pt * x + 1.5pt      inside a macro, where `x` is a scalar macro argument. My idea:               \kern \advance #1\dimexpr1.8pt\relax by \dimexpr1.5pt\relax      This doesn't really work, the `\advance` command seems wrongly formatted.


title: Code for drawing two intersecting lines and the acute angle between them

text: Here is the code for two intersecting lines. I know the code that I use to draw lines `$\ell$` and `$k$` is bad. I am sure that is the reason that the labels `$\ell$` and `$k$` are not in the right places. I want `$\ell$` to be to the above and left of upper arrowhead and `$k$` to be to the right and below the right arrowhead. (Line `$\ell$` is the more upright line.) Point `$P$` should be at the intersection of the two lines. It is not. Point `$A$` should be on `$\ell$` and point `$B$` should be on `$k$`. They are not. `$\angle APB$` should be marked with an arc. The arc is not centered at `$P$`. The line segments `$\overline{AP}$`, `$\overline{BP}$`, and `$\overline{AQ}$` should be labeled with `$r$`, `$x$`, and `$y$`, respectively, in the middle of arrows. The arrows are all there but shifted. The diagram is a mess. I think that with an appropriate code for the two lines, the new code would give the diagram that I want. (It is a diagram for defining the sine and cosine functions for acute angles.) Please add `"$\theta$"` to the angle in the diagram.               \begin{tikzpicture}[     dot/.style={       fill,       circle,       inner sep=1.5pt       }     ]     \path (80:3) coordinate (a) (20:3.5) coordinate (b) (0:0) coordinate (P);     \path (-70:1) coordinate (e) (-160:1) coordinate (f) (0:0) coordinate (P);     \path (80:2) coordinate (A) (20:2.5) coordinate (B) (0:0) coordinate (P);     \draw[<->] node [at start, left]{$\ell$} (a) -- (e);     \draw[<->] node [at start, right]{$k$} (b) -- (f);          \node[dot,label={left:$P$}] at (A) {};     \node[dot,label={below:$B$}] at (B) {};     \node[dot,label={left:$P$}] at (P) {};     \node[dot,label={right:$P$}] at (B) {};          \draw (A)     -- (P) node [at start, below left]{$A$}     -- (B) node [at start, right]{$B$};     \coordinate (Q) at ($(P)!(A)!(B)$);     (P) node [at start, left below]{$P$};     (Q) node [at start, right]{$Q$};     \draw[purple!70!black,dashed] (A) -- (Q);     \tkzMarkRightAngle(A,Q,P);          \draw[|<->|] ($(P)!7mm!90:(A)$)--node[fill=white,sloped] {$r$} ($(A)!7mm!-90:(P)$);     \draw[|<->|] ($(P)!7mm!90:(B)$)--node[fill=white,sloped] {$x$} ($(B)!7mm!-90:(P)$);     \draw[|<->|] ($(Q)!7mm!90:(A)$)--node[fill=white,sloped] {$y$} ($(A)!7mm!-90:(Q)$);     \draw pic[draw, angle radius=2mm,"$\theta$",angle eccentricity=2] {angle = B--P--A};     \end{tikzpicture}


title: Vertical spacing before and after equation environment: empty line or not?

text: The vertical spacing in front of and behind the `amsmath` `equation` environment is different whether I insert a blank line or not (im using KOMA- Script with `parskip=half` if this is important). I'd like to insert a blank line so that my code is more readable, but then the vertical space is rather big:               Some text here          \begin{equation}       a = b     \end{equation}          Some other text      Way two (no blank line)               Some text here     \begin{equation}       a = b     \end{equation}     Some other text      Way three (blank line only at the bottom, this looks very good, IMHO, but I think the spacing is asymmetric then):               Some text here     \begin{equation}       a = b     \end{equation}          Some other text      I know I could fix the code readbility with commenting the blank lines               Some text here     %     \begin{equation}       a = b     \end{equation}     %     Some other text      But my question is: Are there some typographical (thumb) rules, guidelines, do's or dont's or whatever, on how to space the `equation` environment?


title: Tikz example doesn't compile

text: I tested this example (from tikz package) example's link and my IDE TexMaker with MiKTeX returns an error               ! Package pgfkeys Error: I do not know the key '/tikz/edge from parent fork dow      I aalo tested this one : example's link and I have this error               ! Package pgfkeys Error: I do not know the key '/tikz/grow via three points' an      Then, I check and all my packages seem to be updated with the last versions... I really don't understand what's the problem. Thks.


title: Remove affiliation from author

text: I am using the `authblk` package on a modified LaTeX report class and I require to show the author as a footnote on every page, without affiliations (still showing the affiliations on the title page). the problem is that when I use the `\@author`command on my modified class, it shows the author with the affiliation indexes. Is there any way to remove it? Class Code:               \ProvidesClass{ThesisClass}     \LoadClass[twoside,11pt,a4paper]{report}     \usepackage[noblocks]{authblk}                                       % redefine \author command     \def\@author{}     \renewcommand\@author{\ifx\AB@affillist\AB@empty\AB@author\else           \ifnum\value{affil}>\value{Maxaffil}\def\rlap##1{##1}%         \AB@authlist\\         \else  \AB@authors\fi\fi}          % Define \institutes command         \def\@institutes{}     \renewcommand\@institutes{\AB@affillist}     %   HEADERS AND FOOTERS     \usepackage{fancyhdr}         \fancyfoot{}      \fancyfoot[R]{\@author}      One of the reasons I defined a `\institutes` command is to be able to setup a `\supervisors` command that can share the affiliations with the authors.


title: Running latex in interactive mode from texstudio

text: I am using TeXStudio as LaTeX editor. Can I configure TeXStudio such that it can run commands in terminal in interactive mode. I have found some solution from this site: http://sourceforge.net/p/texstudio/feature-requests/393/   but for Windows. I am using TeXStudio 2.6 in Ubuntu 13.04.


title: Layout issues when using `subcaption` together with `sidecap`

text: I am using the `sidecap` package for side captions. I also want to have subfigures (for example, three or four subfigures labeled with a), b), c) and d), respectively). When _not_ using the `SCfigure` environment, this is what I get (the figures are aligned correctly, but the caption is obviously not at the side):               \documentclass[a4paper,twoside,11pt,openright]{scrbook}              \usepackage{graphicx}     \DeclareGraphicsExtensions{.pdf,.png,.jpg}     \graphicspath{{./images/}}     \usepackage[wide]{sidecap}                                                      % custom captions on the side     \sidecaptionvpos{figure}{t}                                                     % captions should be on top     \sidecaptionvpos{table}{t}     \usepackage[font=footnotesize,         format=plain,         labelfont={bf,sf},         nooneline,         textfont={it}]{caption}          \usepackage{subcaption}      \usepackage[twoside]{geometry}     \geometry{a4paper,                         left=24.8mm,                         top=27.4mm,                         %headheight=\baselineskip,                         %headsep=2\baselineskip,                         textwidth=135mm,                         marginparsep=8.2mm,                         marginparwidth=28mm                         }          \begin{document}     \begin{figure}         \subcaptionbox{\label{fig:01:054a}}               {\includegraphics[width=0.5\textwidth]{a}}         \subcaptionbox{\label{fig:01:054b}}               {\includegraphics[width=0.5\textwidth]{b}}       \subcaptionbox{\label{fig:01:054c}}               {\includegraphics[width=0.5\textwidth]{c}}     \caption{A test figure}\label{fig:01:054}     \end{figure}              \end{document}      ![using figure](http://i.stack.imgur.com/6RwyK.png) When using `SCfigure` but with only two subfigures, the result is satisfying, correctly displaying the side caption:               \begin{SCfigure}         \subcaptionbox{\label{fig:01:054a}}               {\includegraphics[width=0.5\textwidth]{a}}         \subcaptionbox{\label{fig:01:054b}}               {\includegraphics[width=0.5\textwidth]{b}}     %  \subcaptionbox{\label{fig:01:054c}}     %          {\includegraphics[width=0.5\textwidth]{c}}     \caption{A test figure}\label{fig:01:054}     \end{SCfigure}        ![using SCfigure with two subfigures](http://i.stack.imgur.com/dGntS.png) When I uncomment the last `\subcaptionbox`, this is what I get: ![Using SCfigure with three subfigures](http://i.stack.imgur.com/HkGcB.png) What do I have to do in order to display three or more figures of `width=0.5\textwidth` correctly like in the `figure` environment? Can't be that I'm the only one who's using side captions in conjunction with subfigures.... **Edit:** In this German forum thread, the author of the `subcaption` package claims that it is compatible with `sidecap`.


title: How count a space betwen glyph (without glue)

text: How do I count width of glyph, and the space between glyphs? I have:   * font   * word How to get all information about the space between glyph. "Test." in font "Times New Roman". I need get: width "T" space + kerning , width "e" space + kerning , width `\char101` ..... If it is possible, how can I put some box: string= > "`\hbox{TeX}` is," width "TeX" space+ kerning , width "space", space + > kerning, width "i" ..... width "," Box is everything. Box is mathematic code is graphics, everything. How write this information to a file?


title: Biolinum missing greek letters

text: I have texlive installed (via the repositories) on ubuntu 13.10. The version number it lists is 2013.20130722, so I figure this is texlive 2013? I have a Biolinum font file with path /usr/share/fonts/opentype/linux- libertine/LinBiolinum_R.otf. Trying to load               \usepackage[T1]{fontenc}     \usepackage{libertine}     \renewcommand{\familydefault}{\sfdefault}     \usepackage[greek=n,biolinum]{libgreek}     \usepackage{mathastext}      everything is typeset as expected, except that all Greek letters are replaced with a space. Is this a problem with my texlive installation, with the font file, the libgreek package or something else? _Edit_. The code is               \documentclass[12pt,a4paper]{article}     \usepackage[T1]{fontenc}     \usepackage{libertine}     \renewcommand{\familydefault}{\sfdefault}     \usepackage[greek=n,biolinum]{libgreek}     \usepackage{mathastext}     \begin{document}       $\Gamma$     \end{document}      and libertine-legacy is installed (correctly, I hope).


title: Embedding \soulomit in a macro

text: In the MWE below, the code:               \MyUl{abd \soulomit{\MyLink{www.google.com}{The Google}} ghi}      works exactly as desired: ![enter image description here](http://i.stack.imgur.com/mn5Ut.png) However, when I attempt to wrap this in a macro, and use               \MyUl{abd \SoulOmitMyLink{www.google.com}{The Google} ghi}      I get: > Argument of \SoulOmitMyLink has an extra }. ## Question: What changes are required to `\SoulOmitMyLink` to get this to work? ## Notes:   * The following is not an option for my current use case:              \MyUl{abd} \MyLink{www.google.com}{The Google}  \MyUl{ghi}      ## Code:               \documentclass{article}     \usepackage{xcolor}     \usepackage{xparse}     \usepackage{soul}     \setulcolor{red}          \usepackage{hyperref}          \NewDocumentCommand{\MyUl}{%         s%   #1 = starred variant         O{}% #2 = options, if any         m%   #3 = mandatory param     }{%         \ul{#3}%     }%          \NewDocumentCommand{\MyLink}{%         s%   #1 = starred variant  (unused as of yet)         O{}% #2 = options, if any  (unused as of yet)         m%   #3 = link text         m%   #4 = link target     }{%         \href{#3}{#4}%     }%          \NewDocumentCommand{\SoulOmitMyLink}{%         s%   #1 = starred variant  (unused as of yet)         O{}% #2 = options, if any  (unused as of yet)         m%   #3 = link text         m%   #4 = link target     }{%         \IfBooleanTF{#1}{%             \soulomit{\MyLink*[#2]{#3}{#4}}%         }{%             \soulomit{\MyLink[#2]{#3}{#4}}%         }%     }%               \begin{document}     \MyUl{abd \soulomit{\MyLink{www.google.com}{The Google}} ghi}          %\MyUl{abd \SoulOmitMyLink{www.google.com}{The Google} ghi}% I want this     \end{document}


title: How to correct install PSCyr font in Linux?

text: How to correct install PSCyr font on Linux? I try to install it in `~/.texmf-var` but this doesn't help. And into local tree: `/usr/local/share/texmf` \- nothing.


title: Where to put initials (a.k.a. drop caps) in an interview?

text: I am typesetting an interview in a special issue of a journal. In this issue, we begin each article with a drop cap and a few words in small caps (using the `lettrine` package). My question is: from aesthetical/typographical point of view, where is it best to put an initial (or is it better not to use it at all - though I'd prefer to use it, for the sake of consistency with the rest of the issue)? The beginning of the interview looks more or less like this (this is not the actual code, but reflects the look):               \documentclass{article}          \usepackage{lettrine}          \title{Interview with Johannes Gutenberg}     \author{}     \date{}          \begin{document}     \maketitle     \noindent Mbork: \emph{I had the pleasure to meet Mr. Gutenberg in Mainz.       He kindly agreed to talk to me. Sir, please tell me something about you.}     \medskip     \noindent\emph{Johannes Gutenberg}: I was born in 1398\dots     \end{document}


title: How to change the margins for a landscape-orientated longtable in classicthesis

text: I am using the excellent `classicthesis` to typeset my thesis. It looks great, and I would be loathe to change unless I had to, but I've run up against a problem. I have a number of `longtable`s in the document that are in landscape orientation. I want to make the top and bottom margins, before and after the tables smaller, so that I can get more information on a page. At the same time I want to keep the margins in the rest of the document the same. I have:   1. Tried using the package `changepage`, but this does not seem to work with `longtable` (http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2007-05/msg00623.html also had problems with this)   2. Considered using package `geometry` and then changing the margins before I enter the `landscape` environment with `\newgeometry`, but `classicthesis` does not appear to use `geometry` to manage page layout, so I think this will disrupt the page setup for the rest of the document   3. Tried playing with `\LTpre`, `\LTpost`, `\LTleft`, `\LTright`   4. Tried playing with the `\addmargin` command for KOMA script Any thoughts appreciated


title: Error using tikz externalize with TeXnicCenter

text: When I compile my document i get the following error               ! Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "tikz/myfile-figure1" \def\tikzexternalrealjob{myfile}\input{myfile}"' did NOT      result in a usable output file 'tikz/myfile-figure1' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'writ     e 18' or something like that. Or maybe the command simply failed? Error messages can be found in 'tikz/OReilly_Gerard_Th     esis-figure1.log'. If you continue now, I'll try to typeset the picture.          See the tikz package documentation for explanation.     Type  H <return>  for immediate help.      I am using TexnicCenter to compile the document and have the following in the path to the compiler:               C:\Program Files (x86)\MiKTeX\miktex\bin\pdflatex.exe -shell-escape      and this in the:               -synctex=-1 -max-print-line=120 -interaction=nonstopmode "%wm"      The PDF file is still produced no problem but I know this error should not be occurring. My LaTeX skills are ok at best so hopefully I am making a glaring mistake here. Thanks.


title: pgfplots: percentages and endvalues in stacked ybar

text: I have two questions regarding the `pgfplots` package. I have attached the source code I worked on. There are two features I am not able to realize:   1. I would like to put the total value (sum of the whole stacked bar) on top of the bar, rotated by `90°`. For me, it was only possible yet to get the value of each part of the stacked bar by using the nodes near coords command.   2. Additionally, the percentage of each part of the stacked bar as relative to the whole stacked bar should be displayed in the bar, also rotated by `90°` (addition equals `100%`) If it is somehow possible, percentages shoud have only one significant digit, and those below `5%` should not be displayed in the bar. I know this is a pretty complex example, but maybe there is one who can solve it.               \documentclass{article}      \usepackage{pgfplots,pgfplotstable}       \usetikzlibrary{pgfplots.groupplots}        \pgfplotsset{compat=1.8}           \pgfplotstableread{      Criterion  ddd     ccc     vvv       (0)    700         750         750       (a)    700         750         750       (b)        1200        750         750           (c)    33      345     345      (d)    34      333     345      (e)    234     344     344       }\Rob           \pgfplotstableread{      Criterion  ddd     ccc     vvv       0      70          75          75        a      70          75          75        b          120         75      75            c      3       34      34      d      3       33      34      e      23      34      34      }\Gab               \begin{document}      \begin{tikzpicture}     \begin{groupplot}[group style= {         columns=2,xlabels at=edge bottom,         ylabels at=edge left,         horizontal sep=1cm,group name=plots,     },     ymin=0, enlarge x limits={abs=.5}, enlarge y limits={upper,value=0.4},      ylabel=Mon, ylabel style={text height=0.02\textwidth,inner ysep=0pt},      ybar,ybar stacked,     major x tick style = transparent,      /pgf/bar shift=0pt, /pgf/bar width=9pt,     x tick label style={text height=2ex},        xlabel style={yshift=-2ex},      xticklabels from table={\Rob}{Criterion},      xtick=data,legend columns=-1, legend style={draw=none, /tikz/every even column/.append   style={column sep=5pt}}]          \nextgroupplot[xlabel=Rob, xlabel shift = -7.5cm, legend to name=grouplegend]     \pgfplotstableforeachcolumn\Rob\as\col{         \ifnum\pgfplotstablecol=0          \else           \edef\tmp{             \noexpand\addplot table [x expr=\noexpand\coordindex,y=\col] {\noexpand\Rob};             \noexpand\addlegendentry {\col}         }         \tmp         \fi     }          \nextgroupplot[xlabel=Gab, xlabel shift = -7.5cm]     \pgfplotstableforeachcolumn\Gab\as\col{         \ifnum\pgfplotstablecol=0          \else         \edef\tmp{             \noexpand\addplot table [x expr=\noexpand\coordindex,y=\col] {\noexpand\Gab};         }         \tmp         \fi           }       \end{groupplot}      \draw[dashed] (plots c1r1.south west) -- ++(0,-1.5);       \draw[dashed] (plots c1r1.south east) -- ++(0,-1.5);      \draw[dashed] (plots c2r1.south west) -- ++(0,-1.5);      \draw[dashed] (plots c2r1.south east) -- ++(0,-1.5);      \node at (plots c1r1.south) [inner sep=0pt,anchor=north, yshift=-12ex]     {\ref{grouplegend}};      \end{tikzpicture}      \end{document}


title: Page numbers in Romannumeral in ConTeXt

text: I tried to change the page number into Romannumeral with                   \setuppagenumbering[conversion=romannumerals]      but it did nothing. I had to use a macro to achieve that:                   \def\RomanNumeral#1{\uppercase\expandafter{\romannumeral#1}}         \setuppagnumbering[command=\RomanNumeral]      But it is wrong, it seems that ConTeXt inserts some characters just after `\romannumeral`. The first example is given in Page 88 of the manual.


title: texindy equivalence to makeindex settings

text: I'm currently using makeindex to generate an index and was advised by @egreg to use xindy instead to properly manage accents in French. However, I can't find how to reproduce my current settings:               \makeindex[title={Index th\'ematique},intoc,options=-r -s thematique.ist,columns=2]     \newcommand{\themeindex}[1]{\index{#1|transform}}      I then use `\themeindex` in my text. `thematique.ist` contains:               % Dotfill style     headings_flag 1     heading_prefix "\\hfill\{\\dayheadfont\\large\\textbf- "     heading_suffix " -\}\\hfill\\nopagebreak\\vspace\{0.5\\baselineskip\}"     delim_0 "\\dotfill "     delim_1 "\\dotfill "     delim_2 "\\dotfill "     item_0 "\n \\item\\raggedright "     item_1 "\n \\subitem\\raggedleft "      How can I achieve the same with xindy?


title: Interference between crop and (new)geometry

text: I encountered a strange behavior of the command `\newgeometry` when using the `crop` package. After the first call of `\newgeometry` the centering of the page layout is lost and also can not be restored by calling `\restoregeometry`. **What should I do in order to avoid the loss of the centering?** Some pictures so you can see what I'm talking about (marked the physical margins with a thin red line): ![page 1](http://i.stack.imgur.com/rdoP8.png) ![page 2](http://i.stack.imgur.com/G9MjE.png) ![page 3](http://i.stack.imgur.com/8byu1.png) MWE creating the pages shown above:               \documentclass{scrbook}     % driver=none is recommended when using geometry and crop together     % geometry documentation - Known problems:     % With crop package and mag not equal 1000, center option of crop doesn't work well.     % Therefore I have added mag=1000 (although it should be the default value)     \usepackage[a4paper,twoside,showframe,driver=none,mag=1000]{geometry}     \usepackage[width=216truemm, height=303truemm, center, frame, noinfo]{crop}     \usepackage{blindtext}          \begin{document}     \blindtext     \newgeometry{showframe, margin=1cm, includefoot, includehead, mag=1000}     \blindtext     \restoregeometry     \blindtext     \end{document}


title: API replacement for our collaborative LaTeX gadget

text: My team created LaTeX gadget as a part of our groupwork web service - Rizzoma. To draw LaTeX formulas, we're using Google Charts API now: it's simple and sufficient, but supports input up to 200 characters only. Is there any LaTeX API which we can use as a replacement to Google one?


title: Problem when bidi & hyperref packages are used with custom document class (XeLaTeX)

text: There is a problem when bidi & hyperref packages are used together and custom document style is used. For example:               \documentclass[unicode]{myreport}          \usepackage{xltxtra}          \author{Author}     \title{Title}          \usepackage[pagebackref=true, xetex, unicode]{hyperref}     \usepackage{bidi}          \begin{document}          \maketitle          Test          \end{document}      `myreport` class is the exact copy of standard `report` class (nothing is changed). Problem is in `\maketitle` command. Result:               ! TeX capacity exceeded, sorry [input stack size=5000].     \@ifnextchar #1#2#3->\let \reserved@d =#1                                              \def \reserved@a {#2}\def \reserved...     l.14       This error doesn't occur when:   1. `hyperref` package isn't used, or   2. standard `report` class is uded, or   3. `\maketitle` command isn't used I can't find any information about such behavior neither in bidi nor in hyperref documentation, nor in google. I see that `bidi` package uses command `\@ifclassloaded` and plugs files like `report-xetex-bidi.def`. Maybe such file should be created for custom docclass. But I saw this file and didn't find anything 'special' in it. Bidi package is needed, since document will be multilingual with polyglossia and with some text in Arabic (and maybe other) language. What can be done in this situation?


title: How to typeset a letter or grapheme specimen with alternates?

text: I want to print a font specimen for certain letters, each of which should cover a complete A4 page. The Open Type font contains many letters with several glyphs, which are accessible as character variants (`cc..`), in stylistic sets (`ss..`), as contextual and positional alternates (`calt`; `init`, `medi`, `fina`), local or historic forms (`locl`; `hist`) or otherwise; some are available through different methods, of course. Some letters are also part of ligatures (`liga`, `dlig`, `clig`, `hlig`). Most of them can be seen with Access All Alternates (`aalt`) in GUIs. I’d like to typeset them all at the same font size, which would be considerably larger than `\Huge`, say 5 cm (140 pt or so). Preferably, they would be put on a background that showed light lines at baseline, x-height, cap-height or ascender-height and descender-height, all determined automatically if possible. The thing is, I have no idea if LuaTeX or Tikz/PGF or a combination thereof is the best tool for the job. The specimens might become part of a `.tex` document later on, but I could live with independent pages for now. So any pointers in the right direction are appreciated.   * How do I draw and, most importantly, correctly position the horizontal lines – automatically? (Background colors to show the “bands” would be okay, too.)   * Is there a better way to access glyphs (without Unicode position) by name than shown in the code below? ## Rough concept Using Linux Libertine as an example without employing OT features yet.               % !TEX TS-program = LuaLaTeX     \documentclass{scrartcl}          \usepackage{fontspec,xcolor,libertine,graphicx}     \setmainfont[Color=brown]{Linux Libertine O}          % access glyph by name with LuaTeX     \usepackage{luaotfload,luacode}     \begin{luacode}       documentdata       = documentdata or { }       local stringformat = string.format       local texsprint    = tex.sprint       local slot_of_name = luaotfload.aux.slot_of_name       documentdata.fontchar = function (chr)         local chr = slot_of_name(font.current(), chr, false)         if chr and type(chr) == "number" then           texsprint             (stringformat ([[\char"%X]], chr))         end       end     \end{luacode}          \newcommand\linecolor{gray}     \newcommand\lineheight{1mm}     \newcommand\linelength{\textwidth}          % \horizontalline{<color>}{<thickness>}{<width>}{<position>}     \newcommand\horizontalline[4]{\relax} %  <== how to?     % \textline{<color>}{<thickness>}{<position>}     \newcommand\textline[1]{\horizontalline{\linecolor}{\lineheight}{\linelength}{#1}}          \newcommand\ascenderline{\textline{k-height}} % stem     \newcommand\capitalline{\textline{H-height}} % majuscule size     \newcommand\midline{\textline{A-line}} % crossbar     \newcommand\meanline{\textline{x-height}} % minuscule size     \newcommand\baseline{\textline{0}} % alphabetic base     \newcommand\descenderline{\textline{-p-height}} % depth          \newcommand\visiblelines{%       \ascenderline\capitalline\midline\meanline\baseline\descenderline}          \newcommand\letterspecimen[1]{\visiblelines%       {\framebox[1.1\width]{\fontsize{40mm}{50mm}\selectfont #1\strut}}}          \def\fontchar#1{\directlua{documentdata.fontchar "#1"}}     \def\yround{\fontchar{y.alt}}     \def\heng{\fontchar{h.alt}}          \begin{document}          \letterspecimen{A a ɑ}          \letterspecimen{G g ɡ \fontchar{uni0262} \fontchar{g.sc}}          \letterspecimen{H h \heng}          \letterspecimen{Y y \yround}          \end{document}


title: Can't get rid of strange underfull \hbox with TikZ fit library

text: > **Possible Duplicate:**   >  Badbox from PGF layer using fit This peace of code is compiled with 'Underfull \hbox (badness 1484) in paragraph at lines 23--23' message. Line 23 is `\node[draw, inner sep = 10pt, fit=(MUL1) (MUL2)] {};`. How can I get rid of underfull box?               \documentclass[a4paper]{report}          \usepackage{tikz}     \usetikzlibrary{positioning,fit}          \pgfdeclarelayer{background}     \pgfsetlayers{background,main}           \begin{document}          \begin{tikzpicture}       \node[draw]                  (MUL1) {MUL1};       \node[draw, right = of MUL1] (MUL2) {MUL2};            \node[left =  of MUL1] (A) {A};       \node[right = of MUL2] (B) {B};            \draw[->] (A)    -- (MUL1);       \draw[->] (MUL1) -- (MUL2);       \draw[->] (MUL2) -- (B);            \begin{pgfonlayer}{background}         \node[draw, inner sep = 10pt, fit=(MUL1) (MUL2)] {};       \end{pgfonlayer}           \end{tikzpicture}          \end{document}


title: inputting a file not from a subdirectory

text: I apologise if this question has already been addressed. Say I have a set up like this: I have a main folder in which I have both **preamble.tex** and a folder **sub_1**. In **sub_1** , there is another folder **sub_2** \- and in **sub_2** there is **my_file.tex** What must I write in my_file.tex in order to input preamble.tex? A cursory google and tex.stackexchange search of "input" and "different directory" seems only to address the case when, say, the preamble is located in some subdirectory of where the main file is. Any help is appreciated.


title: Start chapter numbering not from 1?

text: Can I set chapter numbering in book document class not start from 1? I want the chapter to start from 9. Can I do this to another environment like section or equation? I'm using LyX.


title: Intersection of paths with constructed names

text: This question is a "follow up" of the question naming paths inside a TikZ foreach loop. I can construct the name of paths, but there are errors when using them to calculate intersection. An example follows               \documentclass{book}     \usepackage{tikz}     \usetikzlibrary{intersections}     \usetikzlibrary{calc}          \newcommand{\modulargrid}{%      \begin{tikzpicture}[remember picture,   overlay,  ]          %% Trick to name paths:     %% http://tex.stackexchange.com/questions/5242/naming-paths-inside-a-tikz-foreach-loop          %% Draw horizontal lines       \foreach \x in {1,...,6}   {         \edef\pathhone{name path global=horizontal\x}         \expandafter\draw\expandafter[\pathhone] ($         (current page.north west)          + \x-1*(0,20pt-5cm)         $)         -- +(20cm, 0);          %% Draw vertical lines        \edef\pathvone{name path global=vertical\x}        \expandafter\draw\expandafter[\pathvone] ($         (current page.south west)          + \x-1*(20pt+5cm,0)         $)         -- +(0,25cm);     }               \draw (0,0)--(0,0);     \fill[red, opacity=0.5, name intersections={of=vertical1 and horizonta1}]     (intersection-1) circle (2pt) node {1};      \end{tikzpicture}     }          \begin{document}          \modulargrid     \newpage          \end{document}      **The purpose of the code** The idea behind this code is to make a grid of vertical and horizontal line, calculate the intersection points and them build rectangular shapes with the calculated points (I want to be able to each cell in the grid as a node.) **EDITED CODE** I edited the code according to the comment by @jake. (Sorry for the errors, due to coping an more complex example to a MWE.) My problem is to use `\i` in the `\fill` command               \documentclass{book}     \usepackage{tikz}     \usetikzlibrary{intersections}     \usetikzlibrary{calc}          \newcommand{\modulargrid}{%      \begin{tikzpicture}[remember picture,   overlay,  ]          %% Trick to name paths:     %% http://tex.stackexchange.com/questions/5242/naming-paths-inside-a-tikz-foreach-loop          %% Draw horizontal lines       \foreach \x[count=\i] in {1,...,6}   {         \draw[name path global=horizontal\i] ($         (current page.north west)          + \x-1*(0,20pt-5cm)         $)         -- +(20cm, 0);          %% Draw vertical lines        \draw[name path global=vertical\i] ($         (current page.south west)          + \x-1*(20pt+5cm,0)         $)         -- +(0,28cm);      \draw (0,0)--(0,0);      \fill[red, opacity=0.5, name intersections={of=vertical\i and horizontal\i}]      (intersection-1) circle (2pt) node {1};     }                \end{tikzpicture}     }          \begin{document}


title: Centering the align environment on the middle column

text: I have a set of aligned equations that I would like to provide an `\implies` for down the left hand side. I used this originally:               \begin{align}         (x-1)^2 &= -1    \\             x-1 &= \pm i \\               x &= 1 \pm i     \end{align}      which results in a centred set of equations. Then added the `\implies` in a left column:               \begin{align}         &          & (x-1)^2 &= -1    \\         & \implies &     x-1 &= \pm i \\         & \implies &       x &= 1 \pm i     \end{align}      However now the entire environment is shifted to the right. Is there a way to keep the original alignment?


title: Drawing a ring around a torus (doughnut) using TikZ

text: I was trying to draw a 2-torus (a doughnut) using `TikZ`, based on the answer to my previous question Moebius Strip using Tikz, and got the following ![](http://i.stack.imgur.com/zbHit.png) The result is impressive! However, the vertical circle does not look as surrounding the torus. **Q:** How could I give the right perspective of 3D? **MWE** WARNING: main tex-memory of my computer has been enhanced to compite this code               \documentclass{report}     \usepackage{amsmath,units}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}       \begin{axis}[           hide axis,           view={60}{60}         ]         \addplot3 [           surf, shader=interp,           point meta=x,           colormap/greenyellow,           samples=40,           samples y=40,           z buffer=sort,           domain=0:360,           y domain=0:360         ] (                   {(3.5 + 0.5*cos(y))*cos(x)},                   {(3.5 + 0.5*cos(y))*sin(x)},                   {0.5*sin(y)});         \addplot3 [          samples=40,          domain=0:360,          thick         ] (                   {(3.5 + 0.5*cos(80))*cos(x)},                   {(3.5 + 0.5*cos(80))*sin(x)},                   {0.5*sin(80)});         \addplot3 [           samples=40,           domain=0:360,           thick         ] (                   {3.5 + 0.5*cos(x)},                   {0},                   {0.5*sin(x)});            \end{axis}     \end{tikzpicture}          \end{document}


title: Draw line from a point to another line (along x-axis or y-axis) in TikZ

text: I would like to make use of the intersection tools to draw a line to another line in a way that it only reaches along the x-axis or y-axis. I mean I currently _think_ that I would achieve this via the intersection part... but I'm not entirely sure on that. I hope the attached picture clears it up properly. Is this possible? _Note_ : The coordinate values are only that simple for the sake of demonstration. _edit:_ Edited with better code and screenshot to clarify the problem, a thank you to Jake. ![Image with target points whose values only change on one axis](http://i.imgur.com/lkGahk0.png) **MWE**                   \documentclass[     a4paper     ]{scrartcl}          \usepackage{     lmodern,     }     \usepackage[T1]{fontenc}     \usepackage{     tikz     }     \usetikzlibrary{calc}               \begin{document}     \begin{center}     \begin{tikzpicture}[font=\sffamily\small]         %         \draw[style=help lines,step=0.5cm] (0,0) grid (6.2,6.2);         %         \draw[->,thick] (-0.1,0) -- (6.5,0) node[anchor=west]{x};         \draw[->,thick] (0,-0.1) -- (0,6.5) node[anchor=south]{y};         %         \foreach \x in {0,1,...,6} \draw [thick](\x cm,-2pt) -- (\x cm,2pt);         \foreach \y in {0,1,...,6} \draw [thick](-2pt,\y) -- (2pt,\y);         %         \foreach \x in {0,1,...,6} \draw (\x cm, 0 cm) node[anchor=north]{\x};         \foreach \y in {0,1,...,6}  \draw (0 cm, \y cm) node[anchor=east]{\y};         %         \begin{scope}[color=black]         \filldraw (1,1) circle (0.08cm) node (A) {} node[anchor=north,fill=white,yshift=-0.1cm] {A};         \filldraw (6,6) circle (0.08cm) node (B) {} node[anchor=west,fill=white,xshift=5pt] {B};         \filldraw (4,2) circle (0.08cm) node (C) {} node[anchor=south,fill=white,yshift=0.1cm] {C};         \end{scope}         \draw[very thick] (A) -- (B);         \draw[->,>=latex,very thick,dashed] (C.center) -- ($(A)!(C)!(B)$);         \draw (2,5) node[fill=white] {\textcolor{red}{from C\ldots}};         \draw[color=red,very thick] (2,2) circle (0.1cm) node[above,yshift=5pt,fill=white]{to this point};         \draw[color=red,very thick] (4,4) circle (0.1cm) node[below,yshift=-5pt,fill=white]{or this one};         %\node (Ex) at (....)?         %\draw[->,>=latex',very thick,dashed] (E.center) -- ($(A)!(E.135)!(B)$);         \end{tikzpicture}     \end{center}     \end{document}


title: Factorial spacing inside equation

text: Good day, My minimum working example:               \documentclass[]{report}          \begin{document}          \begin{equation}     \hat{d}=\frac{(d+n)!}{n!d!}     \end{equation}          \end{document}      The result is: ![Result of MWE](http://i.stack.imgur.com/V68jS.jpg) Now I don't like the spacing for the term: "n!d!". I'd prefer a bit more space between 'n' and '!' and between 'd' and '!'. Any ideas?


title: texcl, escapeinside, and single character comments, with listings package

text: I'm using the excellent listings package to typeset some code in a language very similar to Scheme. The language has one type of comment: when an (un- escaped) semicolon is encountered, the rest of the line (including the semicolon) is ignored (as a comment). While only the single semicolon is necessary to introduce a comment, coding convention uses `;;;`, `;;`, and `;` to designate different levels of comments, as in               ;;; Top level comment     (define (foo x)       ;; within body comment       (list x x)) ; after line comment      I'd like to use listings `texcl` option to typeset all comments using LaTeX, and have been able to do that so far. I'd also like to use `\label{...}` to support later references to particular lines of code. I can do this with the regular comments when `texcl` is turned on, as in               \documentclass{article}     \usepackage{xcolor,listings}     \usepackage{hyperref}          \begin{document}          \lstset{%       comment=[l]{;},       texcl=true,     }     \begin{lstlisting}       ;;; top level       (defun foo (x)          ;; in body         (let ((y (+ x 1))) ; on line           y)) ; \label{code:y}     \end{lstlisting}     Cross-reference to line \ref{code:y}.     \end{document}      which produces ![sample of listings](http://i.stack.imgur.com/EUIok.png) The problem is that the comment with the label, `; \label{code:y}` still displays the leading semicolon. `listings` has an `escapeinside` option that can be used to escape to LaTeX, as in the sample from the documentation:               \lstset{escapeinside={(*@}{@*)}}     \begin{lstlisting}     for i:=maxint to 0 do     begin         { comment }(*@\label{comment}@*)     end;     \end{lstlisting}     Line \ref{comment} shows a comment.      The documentation also points out that the closing escape delimiter can be `\^^M`, to support escapes that are terminated by newlines, as in `escapeinside={//*}{\^^M}`. What I'd like to do is use something like `escapeinside={;@}{\^^M}` to provide LaTeX escapes that are still within a comment in the programming language, e.g., (modified from above):               \lstset{%       comment=[l]{;},       texcl=true,       escapeinside={;@}{\^^M}     }     \begin{lstlisting}       ;;; top level       (defun foo (x)          ;; in body         (let ((y (+ x 1))) ; on line           y)) ;@ \label{code:y}     \end{lstlisting}      but this produces an error (which only occurs while using the `texcl` option):               ! Undefined control sequence.     \lst@next ->\lst@c;1 ;          l.14   ;;              ; top level      Is there a way to fix this, or another way to get the desired behavior (i.e., comment lines generally set with LaTeX with semicolons displayed, but supporting some escape-to-LaTeX beginning with `;` in which the semicolon will not be displayed)? As a temporary workaround, I can define the standard comment sequence to be `;;`, and the escaping-comment sequence to be `;@`; this works without a problem, except that I no longer have support for comments beginning with a single semicolon.


title: Can't install LyX through package installer

text: There once was a question that popped up and was closed without an answer...well, I have the same problem, and the same amount of answers as Iszi. LyX & MiKTeX installation problems on Windows 7 Essentially speaking, I have all the same issues, have tried all the same things, and have gotten all the same results. Running Windows 8 x64 Home. Using the individual installer, I was able to proceed without issues, so I guess this is just an issue with the package installer.


title: Alienation for a manually generated legend

text: I have generated the graphic below with the following code:               \documentclass[11pt]{article}      \usepackage{tikz,xifthen}     \usetikzlibrary{arrows, decorations.text, decorations.markings, shapes, patterns, positioning, shapes.multipart, fit}                         \begin{document}     \thispagestyle{empty} %Please, no page numbers or similar               \begin{figure}[Htbp]     \centering               \begin{tikzpicture}[scale=3]          \def\trainingSamples{0.17/0.76/2,  0.14/0.62/2,  0.23/0.63/2,  0.25/0.77/2,  0.11/0.68/2,  0.25/0.68/2,  0.16/0.68/2,  0.72/0.55/1,  0.68/0.46/1,  0.74/0.39/1,  0.82/0.53/1,  0.75/0.64/1,  0.81/0.40/1,  0.46/0.28/3,  0.33/0.28/3,  0.22/0.17/3,  0.22/0.24/3,  0.28/0.10/3,  0.31/0.19/3,  0.51/0.16/3,  0.37/0.12/3,  0.42/0.20/3,  0.49/0.24/3,  0.19/0.54/2,  0.31/0.58/2,  0.41/0.67/2,  0.35/0.75/2,  0.32/0.67/2,  0.28/0.85/2,  0.67/0.55/1,  0.70/0.63/1,  0.78/0.54/1,  0.66/0.36/1,  0.63/0.21/3,  0.70/0.29/1,  0.74/0.21/1,  0.62/0.46/1,  0.40/0.27/3,  0.39/0.17/3,  0.32/0.24/3}     \def\testSamples{0.14/0.71,  0.24/0.79,  0.23/0.60,  0.13/0.61,  0.11/0.49,  0.38/0.69,  0.27/0.71,  0.16/0.86,  0.06/0.67,  0.17/0.54,  0.33/0.79,  0.36/0.55,  0.92/0.65,  0.81/0.47,  0.30/0.28,  0.19/0.18,  0.40/0.12,  0.52/0.23,  0.23/0.10,  0.37/0.27 }          \def\blockSpace{.2}          \tikzset{Marker/.style={inner sep=0pt,minimum size=3pt}}     \tikzset{classMarker/.style={regular polygon,regular polygon sides=3,Marker,minimum size=4pt}}     \tikzset{trainingMarker/.style={fill,circle,Marker}}     \tikzset{testMarker/.style={fill,regular polygon,regular polygon sides=4,Marker,minimum size=4pt,teal}}     \tikzset{classAMarker/.style={rotate=0,classMarker,red}}     \tikzset{classBMarker/.style={rotate=-90,classMarker,violet}}     \tikzset{classCMarker/.style={rotate=180,classMarker,blue}}     \tikzset{textNode/.style={anchor=north,text width=3cm, align=center}}     \tikzset{lineTextNode/.style={bend left,anchor=south,text width=4cm, align=center}}               %\draw [help lines,step=.2] (-.5,-.5) grid (5,1.5);     %\draw [step=1] (-.5,-.5) grid (5,1.5);          \foreach \x/\y/\classID in \trainingSamples      \draw (\x,\y) node[trainingMarker]{};          \foreach \x/\y/\classID in \trainingSamples {         \ifthenelse{\classID = 1}             { \draw (1+\blockSpace+\x,\y) node[fill,classAMarker]{};}             {\ifthenelse{\classID = 2}                 { \draw (1+\blockSpace+\x,\y) node[fill,classBMarker]{};}                 { \draw (1+\blockSpace+\x,\y) node[fill,classCMarker]{};}             }     }          \foreach \x/\y in \testSamples      \draw (2+2*\blockSpace+\x,\y) node[testMarker]{};          \draw   (1+\blockSpace+.7225,.4612) node[draw,classAMarker,fill=white]{}                 (1+\blockSpace+.2436,.6823) node[draw,classBMarker,fill=white]{}                 (1+\blockSpace+.3818,.2057) node[draw,classCMarker,fill=white]{};          \draw   (2+2*\blockSpace+.7225,.4612) node[draw,classAMarker,fill=white]{}                 (2+2*\blockSpace+.2436,.6823) node[draw,classBMarker,fill=white]{}                 (2+2*\blockSpace+.3818,.2057) node[draw,classCMarker,fill=white]{};          \begin{scriptsize}     \draw   (.5,0)  node[textNode]{Local features of training images}                 (1.5+\blockSpace,0) node[textNode]{Clustered training \\ features}                 (2.5+2*\blockSpace,0) node[textNode]{Local features of testing images }                 (3.5+3*\blockSpace,0) node[textNode]{Normalized Bag-of-Features (BoF) }                 ;          \path[->,>=stealth',shorten >=1pt,auto,node distance=2.8cm,                         semithick]                          (.9,.85) edge [lineTextNode]    node{Generate the dicctionary} +(.2+\blockSpace,0)                         (1.9+\blockSpace,.85) edge [lineTextNode]   node{Keyword assignation} +(.2+\blockSpace,0)                         (2.9+2*\blockSpace,.85) edge [lineTextNode] node{Feature generation} +(.2+\blockSpace,0)                         ;     \end{scriptsize}          \draw (3.1+4*\blockSpace,.3) node[] (HistOrigin){};          \draw[->,>=stealth',shorten >=1pt,auto] (HistOrigin) +(-0.05,0) -- ++(-0.05,.6);          \draw[-|,shorten >=1pt,auto] (HistOrigin)  +(-0.05,0) -- +(-0.05,.48);     \draw[-o,shorten >=1pt,auto] (HistOrigin)  +(.1,0) --    +(.1,.5);     \draw[-|,shorten >=1pt,auto] (HistOrigin)  +(-0.05,0) -- +(-0.05,.08);     \draw[-o,shorten >=1pt,auto] (HistOrigin)  +(.3,0) --    +(.3,.1);     \draw[-|,shorten >=1pt,auto] (HistOrigin)  +(-0.05,0) -- +(-0.05,.24);     \draw[-o,shorten >=1pt,auto] (HistOrigin)  +(.5,0) --  +(.5,.26);               \begin{tiny}     \draw (HistOrigin) ++ (.1,-.045) node [draw,classAMarker,fill=white,anchor=center]{}                 (HistOrigin) ++(.325,-.04) node [draw,classBMarker,fill=white,anchor=north]{}                 (HistOrigin) ++(.5,-.065) node [draw,classCMarker,fill=white,anchor=north]{}                 (HistOrigin) ++(-0.1,.08) node [anchor=east,inner sep=0pt]{$2$}                 (HistOrigin) ++(-0.1,.24) node [anchor=east,inner sep=0pt]{$6$}                 (HistOrigin) ++(-0.1,.48) node [anchor=east,inner sep=0pt]{$12$}                 (HistOrigin) ++(0,.55) node [anchor=south west,inner sep=0pt] (histName){word  occurrences}                          ;     \draw[] (HistOrigin) +(-0.05,0)  --(HistOrigin -| histName.east);                     \draw   (3+3*\blockSpace,.08)   node[ anchor=south west, align=center] (A) {Final feature}                   node [draw,right=10pt of A,inner sep=0pt,minimum size=10pt] (B) {$.6$}                 node [draw,right=-.5pt of B ,inner sep=0pt,minimum size=10pt] (C) {$.1$}                 node [draw,right=-.5pt of C ,inner sep=0pt,minimum size=10pt] (D) {$.3$}                 ;          \end{tiny}     \end{tikzpicture}          \center     \begin{tikzpicture}     \tikzset{Marker/.style={inner sep=0pt,minimum size=3pt}}     \tikzset{classMarker/.style={regular polygon,regular polygon sides=3,Marker,minimum size=4pt,anchor=center,fill}}     \tikzset{trainingMarker/.style={fill,circle,Marker}}     \tikzset{testMarker/.style={fill,regular polygon,regular polygon sides=4,Marker,minimum size=4pt,teal}}     \tikzset{classAMarker/.style={rotate=0,classMarker,red}}     \tikzset{classBMarker/.style={rotate=-90,classMarker,violet}}     \tikzset{classCMarker/.style={rotate=180,classMarker,blue}}     \tikzset{textNode/.style={anchor=west}}          \def\spaceDist{10pt}     \def\spaceTokenDist{3pt}     \begin{tiny}     \draw   node [ trainingMarker ] (A) {}                   node [right=\spaceTokenDist of A,textNode] (An) {Training local feature}                 node [right= \spaceDist of An, classAMarker ] (B) {}                     node [right=\spaceTokenDist of B,textNode] (Bn) {Class A}                 node [right=\spaceDist of Bn, classBMarker ] (C) {}                  node [right=\spaceTokenDist of C,textNode] (Cn) {Class B}                 node [right=\spaceDist of Cn, classCMarker ] (D) {}                  node [right=\spaceTokenDist of D,textNode] (Dn) {Class C}                 node [right=\spaceDist of Dn, testMarker ] (E) {}                    node [right=\spaceTokenDist of E,textNode] (En) {Testing local feature}                 node[draw,fit=(A) (En)]{}                 ;     \end{tiny}                    \end{tikzpicture}     \end{figure}     \end{document}      The problem is that the token used for the different classes are colored rotated triangles, and even rotating them from the center anchor, while generating the legend they do not get vertically aligned when using positioning. On the top of that I did not manage to horizontally align the legend with the figure center. My best attempt has been using another `tikzpicture` environment. But still the result look shifted still. ![enter image description here](http://i.stack.imgur.com/makde.png) I tried also to use the legend environment such as in here but I could not figure out how to pass the tokens I am using.


title: a small halo symbol

text: One can generate an oval shape using `$\subset\supset$` and adjusting the space in between to make this look like a "halo". Are there any other solutions that would make it look more like an ellipse? I am interested in a smallish symbol that I can use as a sub/superscript or "overscript".


title: What causes this \discretionary error?

text: I would like to compile my old LaTeX thesis to PDF. The text was created in 1999 (emTeX, I believe) when the computers and the tools were a bit different -- read it, I am returning to LaTeX after 14 years; that is long enough time to forget everything :) The babel was not used for Czech in the time. So far, (after several trial/failure, digging the info from my memory, and searching a bit) I have converted the sources to UTF-8, and changed the               \documentclass[a4paper,11pt]{report}     \usepackage{czech}      to               \documentclass[a4paper,11pt]{report}     \usepackage[czech]{babel}     \usepackage[utf8]{inputenc}      When running the following `pdflatex --version` on Windows 7               pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX)     kpathsea version 6.1.1     Copyright 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).     There is NO warranty.  Redistribution of this software is     covered by the terms of both the pdfTeX copyright and     the Lesser GNU General Public License.     For more information about these matters, see the file     named COPYING and the pdfTeX source.     Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).     Compiled with libpng 1.5.16; using libpng 1.5.16     Compiled with zlib 1.2.7; using zlib 1.2.7     Compiled with xpdf version 3.03      (and running bibtex for my.aux file, and rerunning several times the `pdflatex pri98dis.tex`, I still get the following problem reported:               ) [141] (./pri98dis.aux (./dekuji.aux) (./abstrakt.aux)     ! Missing \endcsname inserted.     <to be read again>                         \unhbox      l.223 ...`\discretionary {-}{}{}step}{{3.1.5}{52}}          The control sequence marked <to be read again> should     not appear between \csname and \endcsname.          ! Improper alphabetic constant.     <to be read again>                         \discretionary      l.223 ...`\discretionary {-}{}{}step}{{3.1.5}{52}}          A one-character control sequence belongs after a ` mark.     So I'm essentially inserting \0 here.          ! Extra \endcsname.     \@newl@bel ... \bbl@tempa \csname #1@#2\endcsname                                                        \def \bbl@tempb {#3}\@safe...     l.223 ...`\discretionary {-}{}{}step}{{3.1.5}{52}}          I'm ignoring this, since I wasn't doing a \csname.          )          LaTeX Warning: There were undefined references.               LaTeX Warning: There were multiply-defined labels.      The `[141]` is the very last page of the document. (Notice the `! Missing \endcsname inserted.` and later the `! Extra \endcsname.`) In `pri98dis.aux` (belongs to the main document), the lines 222 and 223 look this way:               \@writefile{toc}{\contentsline {paragraph}{Krok modelov\IeC {\'e}ho \IeC {\v c}asu.}{52}}     \newlabel{time\unhbox \voidb@x \kern \z@ \char `\discretionary {-}{}{}step}{{3.1.5}{52}}      It seems that it belongs to the following part of the source:               \paragraph{Krok modelového času.}          ... text of one paragraph...          \begin{verbatim}         in('EvQue', 'head', ?head_time);                               { 1 }         in('EvQue', 'list', head_time, ?next_time);                    { 2 }         out('EvQue', 'head', next_time);                               { 3 }     \end{verbatim}     \label{time-step}      It seems that the problem is somehow caused by the `\label{time-step}`. How can I fix the problem? (Thanks, and wishing you the Happy New Year, and all of the days after.)