title: Linux circuitikz

text: I'm making my first steps with `circuitikz`. But I'm a bit disappointed, because despite having texlive-full, some elements from the library aren't recognized while compiling, like `thyristor`, `transformer` or every types of `igbt`. Here is the code I did (with some inspiration from Texample.net) :               \documentclass{article}     \usepackage{amsmath}     %\usepackage[utf8]{inputenc}     %\usepackage[T1]{fontenc}     %\usepackage[french]{babel}     \usepackage{mathptmx}     %\usepackage{tikz}     %\usetikzlibrary{circuits.ee}     \usepackage[americaninductor,european]{circuitikz}     \usepackage{siunitx}     \usepackage{mathpazo}     \usepackage{color}     \usepackage[active,pdftex,tightpage]{preview}     \PreviewEnvironment[]{tikzpicture}     \PreviewEnvironment[]{pgfpicture}     \DeclareSymbolFont{symbolsb}{OMS}{cmsy}{m}{n}     \SetSymbolFont{symbolsb}{bold}{OMS}{cmsy}{b}{n}     \DeclareSymbolFontAlphabet{\mathcal}{symbolsb}          \usetikzlibrary{calc}     \ctikzset{bipoles/thickness=1}     \ctikzset{bipoles/length=0.8cm}     \ctikzset{bipoles/diode/height=.375}     \ctikzset{bipoles/diode/width=.3}     %\ctikzset{tripoles/thyristor/height=.8}     %\ctikzset{tripoles/thyristor/width=1}     \ctikzset{bipoles/vsourceam/height/.initial=.7}     \ctikzset{bipoles/vsourceam/width/.initial=.7}     \tikzstyle{every node}=[font=\small]     \tikzstyle{every path}=[line width=0.8pt,line cap=round,line join=round]          \begin{document}          \begin{circuitikz}     \draw     (0,0) to[battery,l=$V_{\text{pile}}$] ++(0,4)     ++(0,0) to[L,l=$L_e$] ++(2,0) coordinate (LT)     ++(0,0) to[C,l=$C_e$] ++(0,-4) -- (0,0)     %  H-bridge 1st leg     (LT) ++(2,-1) node [npn,scale=1,name=igbt1] {}     ++(0,-2) node [npn,scale=1,name=igbt3] {}     (igbt3.E)++(0,0.1) -- ++(0.3,0) to[D] ($(igbt3.C)+(0.3,-0.1)$)       -- ++(-0.3,0)     (igbt1.E)++(0,0.1) -- ++(0.3,0) to[D] ($(igbt1.C)+(0.3,-0.1)$)       -- ++(-0.3,0)     (igbt1.C) |- (LT)     (igbt1.E) -- (igbt3.C)     (igbt3.E) |- (0,0)     % H-bridge 2nd leg     (LT) ++(4,-1) node [npn,scale=1,name=igbt2] {}     ++(0,-2) node [npn,scale=1,name=igbt4] {}     (igbt4.E)++(0,0.1) -- ++(0.3,0) to[D] ($(igbt4.C)+(0.3,-0.1)$)       -- ++(-0.3,0)     (igbt2.E)++(0,0.1) -- ++(0.3,0) to[D] ($(igbt2.C)+(0.3,-0.1)$)       -- ++(-0.3,0)     (igbt2.C) |- (LT)     (igbt2.E) -- (igbt4.C)     (igbt4.E) |- (0,0)     % Transfo     (igbt1.E) node[circ] {} -| ++(4,0) to[R,l=$R_{ch}$] ++(0,-1) |-      (igbt4.C) node[circ] {}     % PWM     (2,-0.5) rectangle (6,-1.5)     (3,-0.5) |- (igbt1.B)     (3.2,-0.5) |- (igbt3.B)     (5,-0.5) |- (igbt2.B)     (5.2,-0.5) |- (igbt4.B)     ;     \node (note1) at (4,-1) {Phase-shifted PWM};     \node (note1) at (3.5,3.5) {$T_1$};     \node (note1) at (4.7,3) {$D_1$};     \node (note1) at (3.5,1.5) {$T_3$};     \node (note1) at (4.7,1) {$D_3$};     \node (note1) at (5.5,3.5) {$T_2$};     \node (note1) at (6.7,3) {$D_2$};     \node (note1) at (5.5,1.5) {$T_4$};     \node (note1) at (6.7,1) {$D_4$};     \end{circuitikz}          \end{document}      I would like to know if I'm doing anything wrong. I think it's needless to say that it compiles with `npn`, but when I put `nigbt` instead of `npn` it fails to find the element `tikz/nigbt`. Running on Ubuntu 12.04.


title: How to modify bibliography style

text: I'm using natbib package and bibliography style jtbnew which I would like to modify in this way. Instead of having author's name and (year). I would prefer author's name and (year):   For example instead of `Browder, A. (1996). Mathematical Analysis` I would like to get `Browder, A. (1996): Mathematical Analysis`


title: How to design a 3D donut pie chart with pgf-plot?

text: It seems that `pgfplots` users don't like pie charts but sometimes we can't go without (for some reasons). So I was wondering if there was a way to make what is called a donut chart. For example one like this: ![Image of an donut](http://i.stack.imgur.com/ydMBg.jpg)


title: Long tabularx doesn't break rows

text: My long tabularx doesn't break rows when it runs to a second page. Are there any ways I can break long table? (But doesn't tabularx break long table automatically?) In this case, I'd like Par. 1 in the first page with chapter title and direction. Then second page starts with Par. 4. I tried `\pagebreak`, but it didn't work. ![enter image description here](http://i.stack.imgur.com/ELDiF.jpg)               \documentclass[11pt]{book}          \usepackage{tabularx,booktabs}               \begin{document}          \chapter{Notes}          \noindent Some direction      \\           \noindent     \begin{table}     \begin{tabularx}{\textwidth}{c>{\raggedright}X}     \toprule     \textbf{Par.\ \#} & \textbf{Description:} \tabularnewline     \midrule          1 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean vel dui mauris.     Duis iaculis leo tortor, in facilisis metus tincidunt ut. Praesent id accumsan urna.     Suspendisse aliquam adipiscing quam, sit amet dapibus nunc auctor nec. Pellentesque     vel odio sem. Ut rutrum accumsan libero, ac ultrices lectus ullamcorper in. Nullam     congue bibendum erat, quis venenatis mauris porttitor in. Donec dignissim ut nulla sed     hendrerit. Duis viverra semper ipsum, ac pulvinar velit tincidunt ut. Praesent sit     amet tempus sapien. Sed hendrerit mattis interdum. Nulla facilisi. In pharetra sapien     lorem. Donec consequat tellus ut risus tristique imperdiet.  \tabularnewline     \midrule          4 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean vel dui mauris.     Duis iaculis leo tortor, in facilisis metus tincidunt ut. Praesent id accumsan urna.     Suspendisse aliquam adipiscing quam, sit amet dapibus nunc auctor nec. Pellentesque     vel odio sem. Ut rutrum accumsan libero, ac ultrices lectus ullamcorper in. Nullam     congue bibendum erat, quis venenatis mauris porttitor in. Donec dignissim ut nulla sed     hendrerit. Duis viverra semper ipsum, ac pulvinar velit tincidunt ut. Praesent sit     amet tempus sapien. Sed hendrerit mattis interdum. Nulla facilisi. In pharetra sapien     lorem. Donec consequat tellus ut risus tristique imperdiet.  \tabularnewline     \midrule               5 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean vel dui mauris.     Duis iaculis leo tortor, in facilisis metus tincidunt ut. Praesent id accumsan urna.     Suspendisse aliquam adipiscing quam, sit amet dapibus nunc auctor nec. Pellentesque     vel odio sem. Ut rutrum accumsan libero, ac ultrices lectus ullamcorper in. Nullam     congue bibendum erat, quis venenatis mauris porttitor in. Donec dignissim ut nulla sed     hendrerit. Duis viverra semper ipsum, ac pulvinar velit tincidunt ut. Praesent sit     amet tempus sapien. Sed hendrerit mattis interdum. Nulla facilisi. In pharetra sapien     lorem. Donec consequat tellus ut risus tristique imperdiet.  \tabularnewline     \midrule          6 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean vel dui mauris.     Duis iaculis leo tortor, in facilisis metus tincidunt ut. Praesent id accumsan urna.     Suspendisse aliquam adipiscing quam, sit amet dapibus nunc auctor nec. Pellentesque     vel odio sem. Ut rutrum accumsan libero, ac ultrices lectus ullamcorper in. Nullam     congue bibendum erat, quis venenatis mauris porttitor in. Donec dignissim ut nulla sed     hendrerit. Duis viverra semper ipsum, ac pulvinar velit tincidunt ut. Praesent sit     amet tempus sapien. Sed hendrerit mattis interdum. Nulla facilisi. In pharetra sapien     lorem. Donec consequat tellus ut risus tristique imperdiet.  \tabularnewline     \midrule          7 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean vel dui mauris.     Duis iaculis leo tortor, in facilisis metus tincidunt ut. Praesent id accumsan urna.     Suspendisse aliquam adipiscing quam, sit amet dapibus nunc auctor nec. Pellentesque     vel odio sem. Ut rutrum accumsan libero, ac ultrices lectus ullamcorper in. Nullam     congue bibendum erat, quis venenatis mauris porttitor in. Donec dignissim ut nulla sed     hendrerit. Duis viverra semper ipsum, ac pulvinar velit tincidunt ut. Praesent sit     amet tempus sapien. Sed hendrerit mattis interdum. Nulla facilisi. In pharetra sapien     lorem. Donec consequat tellus ut risus tristique imperdiet.  \tabularnewline     \midrule          8 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean vel dui mauris.     Duis iaculis leo tortor, in facilisis metus tincidunt ut. Praesent id accumsan urna.     Suspendisse aliquam adipiscing quam, sit amet dapibus nunc auctor nec. Pellentesque     vel odio sem. Ut rutrum accumsan libero, ac ultrices lectus ullamcorper in. Nullam     congue bibendum erat, quis venenatis mauris porttitor in. Donec dignissim ut nulla sed     hendrerit. Duis viverra semper ipsum, ac pulvinar velit tincidunt ut. Praesent sit     amet tempus sapien. Sed hendrerit mattis interdum. Nulla facilisi. In pharetra sapien     lorem. Donec consequat tellus ut risus tristique imperdiet.  \tabularnewline     \midrule          9 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean vel dui mauris.     Duis iaculis leo tortor, in facilisis metus tincidunt ut. Praesent id accumsan urna.     Suspendisse aliquam adipiscing quam, sit amet dapibus nunc auctor nec. Pellentesque     vel odio sem. Ut rutrum accumsan libero, ac ultrices lectus ullamcorper in. Nullam     congue bibendum erat, quis venenatis mauris porttitor in. Donec dignissim ut nulla sed     hendrerit. Duis viverra semper ipsum, ac pulvinar velit tincidunt ut. Praesent sit     amet tempus sapien. Sed hendrerit mattis interdum. Nulla facilisi. In pharetra sapien     lorem. Donec consequat tellus ut risus tristique imperdiet.  \tabularnewline     \midrule               \bottomrule     \end{tabularx}     \end{table}     \end{document}


title: Why do I have overfull \hbox when I use inline math without line breaks

text: To prevent line break within equation I use following LaTeX command:               ${r^2 = x^2 + y^2}$.      Unfortunately it gives me `Overfull \hbox (12.4459pt too wide)` warning. Why LaTeX doesn't move whole equation to next line?


title: Typesetting classical data structures in tikz

text: During this discussion an example image generated with TikZ was given by Christian R. but no code was provided: ![enter image description here](http://i.stack.imgur.com/A1rZb.png) It would be great to have the code snippet that implements it, because I think it has the basic pieces to typeset the most common data structures found in imperative languages.


title: Using \lstinline inside a \item

text: I know about the fragility of verbatim-like commands, and that they should not be used as an argument of another macro, but a need to write a `description` environment in which the terms to be defined are programming variables and functions, and thus I need use `\lstinline` with them. I know about Verbatim description list item, but my question is somewhat different, for the following reasons:   * I don't want only verbatim output and `tt` font, I want the syntax highlighting provided by `\lstinline`.   * I don't write those description environments, they are automatically generated with a tool (`pandoc`). In essence, I have a `markdown` source file containing for example:               The arguments of the function are:          `foo`        : Name of the file     `bar`        : Permissions      (the syntax is a markdown extension for descriptions, implemented by `pandoc`). When processed through `pandoc` with the appropiate options, the following `tex` code is generated:               The arguments of the function are:          \begin{description}     \item[\lstinline!foo!]      Name of the file     \item[\lstinline!bar!]     Permissions     \end{description}      And of course when latex compiles this, it chokes (strangely enough, it does not produce compiling errors, but in the resulting pdf the defined terms disappeared, and they appear later, all overlayed at the same place, at first `\item` in the next `itemize`). So my questions are (in order of preference):   1. There is some way to redefine `\item` or `\lstinline` so that the above works without changes in the generated `tex` code?   2. If not, is it possible to define some other command instead of `\item` (say, `\lstitem`) which would produce the defined term typeset (and syntax-highlighted) by `listings`. In this second case I would write a script which searches the `tex` file for the `\item[\lstinline!.*!]` stuff and replaces it by `\lstitem{.*}`.


title: Flashmode and OS X Mountain Lion

text: I have trouble installing Claus Gerhardt Flashmode on my new Mac (Mac mini + Lion 10.8.2). I use TeXShop.   * Flashmode 7.0.2 does not work at all. (It worked fine with my old Mac, 10.6.8)   * Instead, Flashmode 6.1.0 works under 10.8.2. By the way, the synchronisation on both Flashmode is lousy or inexistant. My feeling is that Flashmode does not have enough time to refresh the `synctex.gz` file. It works (very approximatively) only when I go backward in the file. (But I must recognise that synchronisation is not precise -- and often inexistent -- under TeXShop; I am still crying about my old Textures synchronisation ...) Any suggestion?


title: What is the correct form for a webpage in biblatex?

text: What is the correct format for the _biblatex_ entry for a webpage? The _biblatex_ documentation mentions only `@online`, but my tools generate `@webpage`. Is there a difference between these, or are they equivalent? For example, is the following correct?               @webpage{MathGroupsQ,     organization={Mathematics - Stack Exchange},     title = {{Is the “binary operation” in the definition of a group always deterministic?}},     year = {2012},     url = {http://math.stackexchange.com/q/148970/}     }


title: How do I use simple integer numbering for subsections?

text: I want to use a list of `\subsection` elements numbered "1", "2", "3", "4"... but by default they're numbered "0.1", "0.2", "0.3", "0.4". How do I do this?


title: Why do some spacing commands work correctly after end commands, and others don't?

text: Why is it that               \begin{verbatim}     some verbatim     \end{verbatim}\bigskip      will work without errors, but if I changed the ending line to               \end{verbatim}\\[1\baselineskip]      I'll get errors? Am I misunderstanding a basic concept of LaTex or?


title: Number of \ (backslash) characters in a string

text: I'm trying to built a code that counts the number of `\` in a string. My code can work with any other symbols (for example, if I need to count the number of 'a's, that works). I already tried to modify the catcode of the backslash symbol to 12, but with no success. Any ideas? My (incomplete) solution:               \newcounter{alternatives}     \renewcommand\thealternatives{\alph{alternatives}}     \makeatletter     \def\endtab{\vspace{-4 mm}}     \def\endtabi{\endtab}          \newcount\testcount     \def\gobblechar{\let\char= }         \newcount\slashcount     \def\countunlessnil     {%         \let\a=0         \let\\=\a         \ifx\char\a     %       \slashcount=             \advance\slashcount by 1         \fi         \ifx\char\nil             \let\next=\relax%         \else%             \let\next=\auxcountchar%         \fi         \let\\=\\         \next     }%     \def\auxcountchar{%       \afterassignment\countunlessnil\gobblechar%     }     \def\countchar#1{\edef\xx{#1} \expandafter\auxcountchar\xx\nil}     \def\analyze#1{%       \countchar{#1}%     }     \newlength{\alternativessize}     \newlength{\abcde}     \settowidth{\abcde}{a)~b)~c)~d)~e)}     \WithSuffix\DeclareRobustCommand\tab+{\@tabbb}     \def\@tabbb#1 \endtab     {         \tabiiii#1         \endtab\\             \analyze{dfgreggegewg\a}         \the\testcount     %   \setcounter{alternatives}{0}         \settowidth{\alternativessize}{#1}         \setlength{\alternativessize}{\linewidth - \alternativessize}         \setlength{\alternativessize}{\alternativessize - \abcde}         \the\value{alternatives}\\[4 mm]         \ifthenelse{\equal{\value{alternatives}}{5}}         {         \setlength{\alternativessize}{0.17\alternativessize}         }         {             \setlength{\alternativessize}{0.27\alternativessize}         }         \setcounter{alternatives}{0}     %   \setlength{\alternativessize}{0.18\alternativessize}         \begin{minipage}[t]{\linewidth}                 \tabiii#1         \end{minipage}\vspace{-2 mm}\\         \endtab\\     \setcounter{alternatives}{0}     }     \def\tabiii#1\\     {         \def\tempa{#1}         \ifx\tempa\endtabi             \endtab              \else             \if\relax\detokenize{#1}\relax             \else                 \stepcounter{alternatives}\thealternatives)~~\@ifnextchar {_}{}#1                 \hspace{\alternativessize}             \fi             \expandafter\tabiii         \fi     }     \def\tabiiii#1\\     {         \def\tempa{#1}         \ifx\tempa\endtabi             \endtab         \else             \if\relax\detokenize{#1}\relax             \else                 \stepcounter{alternatives}\thealternatives)~~\@ifnextchar {_}{}#1                 \hspace{\alternativessize}             \fi             \expandafter\tabiii         \fi     }     \makeatother      When tabiii is called, it detokenize the sequence: `aaaaa\\` `bbbbb\\` `ccccc\\` `ddddd\\` and so on, putting a marker a), b), c) in front of each line. I need to count the number of \, OR get the count of the `\thealternative`. Reason: I'm trying to make a code that cant put 4 or 5 alternatives in the same line, but I need to know the string size BEFORE TeX read it. This is why I'm calling tabiii and tabiiii: tabiiii reads the sentence to calculate the size of the spaces, and tabiii prints the content on the PDF file. Any ideas?


title: IEEE two column format

text: This should be a quick answer that I can't seem to find again. A while ago, I found out that I can use a one line addition in the preamble to format the document to the IEEE standard. It wasn't a reference to a style sheet or something else, but was integrated into TexLive. What is it again?


title: Biblatex: include bbl, problem with "verb" field

text: This is a follow up question to Biblatex: submitting to a journal. As noted in the comments to Herbert's answer, some users have problems with his solution as compiling produces the error `Use of \blx@bbl@verbadd@i doesn't match its definition \blx@bblfile@biber ...2004} \verb {eprint} \verb cond-mat/0407066 \endverb`. I have narrowed the problem down: the issue are `\verb` "fields" in the bbl. If those are present (for example for DOI or URL), then the error above is thrown _unless_ the bbl is included via `\input`. See the following MWE:               \documentclass[a4paper,10pt]{article}     \usepackage{biblatex}          %-------------- start insert modified commands ------------------     \makeatletter     \def\blx@bblfile@biber{%       \blx@secinit       \begingroup       \blx@bblstart          \refsection{0}       \sortlist{entry}{nty}         \entry{Agarwal2007}{article}{}           \verb{doi}           \verb 10.2139/ssrn.943524  %%--PROBLEM--%%           \endverb         \endentry       \endsortlist     \endrefsection            \blx@bblend       \endgroup       \csnumgdef{blx@labelnumber@\the\c@refsection}{0}}     \makeatother     %-------------- end insert modified commands --------------          \begin{document}          Some words \cite{Agarwal2007}.          \printbibliography          \end{document}      Compiling does not work unless commenting `\verb 10.2139/ssrn.943524`. Edit: the code to generate the bbl is               @article{Agarwal2007,     author = {Agarwal, S.},     doi = {10.2139/ssrn.943524},     year = {2006}     }


title: LaTeX Source Code Listing

text: I want a code listing, but the code I'm listing is LaTeX. When I simply use:               \usepackage{listings}     ...     \begin{lstlisting}     ...LaTeX document goes here...     \end{lstlisting}      The listing looks like this: ![screenshot of listing generated by above code](http://i.stack.imgur.com/BRQTy.png) I want it to look a little more professional than this. Can anyone help me out?


title: pdfLaTeX in Aquamacs

text: I have installed Aquamacs, but it looks like it is connecting pdfTeX to compile pdf's instead of the pdfLaTeX. how can I change the path or the link to the compiler?


title: How to define a pgf curve with points instead of controls?

text: The syntax to produce a Bézier curve in pgf is               \pgfpathcurveto{first control point}{second control point}{target}      This defines the curvature by control points. Considering the degrees of freedom the curve definition provides, it should also be possible to define the shape by stating two points on the curve. TikZ provides this with the `smooth` parameter as shown in another answer. But within `\pgfdeclareshape`, TikZ luxury is not available. While declaring a shape to cleanly surround the text box, a pure pgf solution is needed. This would greatly simplify it to surround the text box by a curve. ![the right corner points are way off](http://i.stack.imgur.com/9enLr.png) The full code example can be found in a gist. In the result, the text box is marked in gray. The surrounding shape should exactly pass through the corner points of these gray rectangles. > So, is there some command like this?               \pgfpathcurvethrough{first relay point}{second relay point}{target}


title: `media9.sty' not found

text: I am using Texmaker and Gummi on Ubuntu 12.04. I want to embed videos in my PDFs and have downloaded `media9.tds.zip`, `l3kernel.tds.zip`, `l3packages.ts.zip` and `l3experimental.tds.zip`. I unzipped and pasted them in `/usr/local/share/texmf` and then I ran `sudo texhash` command in terminal. The problem is that when I am using `media9` package in the document either using Texmaker or Gummi the error arises saying: > LaTeX Error: File `media9.sty' not found. I have looked for some of the answers on the similar questions but those do not work for me.


title: Pgfplotstable: how can I add percent signs (and respect dec sep align)?

text: My data contains a column with numbers like `0.01` or `0.9412` which I want to display as `1.00%` and `94.12%` . I would like to declare the column by means of `dec sep align`. How can I do that? [This question arose after the answer for PGFplotstable: Is it possible to set a number format for a *row* instead of a column? has been accepted. I add it as separate answer to simplify searching]


title: How to install cyrillic enc bundle

text: I'm following this solution to mix Latin and Cyrillic characters (if there is a faster way, please, let me know). I got the errors > Package fontenc Error: Encoding file `t2aenc.def` not found > `\ProcessOptions*` Encoding scheme `T2A` unknown. > `\fontencoding\encodingdefault` But since I installed my TeXlive using the `iso` (and not by terminal `apt- get`) I'm not able to install `texlive-language-cyrillic` via terminal because it'll install a lot of common base files. Well, I got from here the `cyrillic` package bundle. On `readme` we find > So you should first process `cyrlatex.ins`:                 latex cyrlatex.ins      OK, I did it. But how to do the next step following the rules, that is, how to find the right paths to cut/paste those file: > The files with extensions `.def`, `.fd`, `.sty` and `.tex` should then be > moved to a directory on LaTeX's standard input path. **Edited:** I'm using               pdflatex --version     pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)     kpathsea version 6.0.1     Copyright 2011 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.2; using libpng 1.5.2     Compiled with zlib 1.2.5; using zlib 1.2.5     Compiled with xpdf version 3.02pl5


title: How to install additional LaTeX packages in Debian/Ubuntu

text: I just installed `texlive-latex-base` package from official Ubuntu repo, now I have to add some modules (`ucs` and `utf8x`) for compiling .pdf files with Cyrillic encoding, so, how to install it? I found `tlmgr` \- the TeX Live manager, but I have no such command, it seems that I could install tlmgr using this: "You may end up in a situation where tlmgr itself does not run due to Perl errors, failed updates, or some other reason. If this happens, the simplest way forward is to download and run update-tlmgr-latest.sh" Am I right? Update:               argon@vprime:~/Documents/diplom$ sudo bash update-tlmgr-latest.sh      [sudo] password for argon:      Verifying archive integrity... All good.     Uncompressing TeX Live Manager Updater..........................................................................................................................................................................     ./runme.sh: Cannot find TeX Live root using kpsewhich --var-value=SELFAUTOPARENT.     ./runme.sh: Please call update-tlmgr-latest.sh --noexec --keep     ./runme.sh: and then call the runme.sh script in the unpacked directory     ./runme.sh: with the directory root as the first argument, something like:     ./runme.sh: sh runme.sh /path/to/your/texlive/installation/2010     argon@vprime:~/Documents/diplom$ dpkg -L tex     tex-common          texlive-binaries    texlive-doc-base     texlive-base        texlive-common      texlive-latex-base      So, path to which package should i use?


title: Disable shortvrb in math mode

text: I have enabled `shortvrb` so that I can enclose text in pipes to write small pieces of code. Unfortunately this conflicts with math mode when I write `$|A|$` to indicate the cardinality of a set. How can I disable `shortvrb` in math mode ?


title: How do I use mathematical symbols in verbatim mode?

text: How can I get mathematical symbols in verbatim mode? If I use them, for example \equiv, it is just reproduced as is in the pdf.


title: pdfcomment and Evince

text: I was using `pdfcomment` to generate annotations in PDF files. But when I try to view the output PDF in Evince the annotations appear as a weird symbol that is not clickable: ![screenshot](http://i.stack.imgur.com/P6zoA.jpg) Any suggestions for fixing the problem? I am using Evince 3.4.0 with Poppler 0.18. I tried viewing other PDFs with annotations in Evince and those seem to be fine, so I think it might be a `pdfcomment` issue. Here is an example:               \documentclass{article}     \usepackage{pdfcomment}          \begin{document}     \pdfcomment{hello}world                                                                                \end{document}      The generated pdf looks just like the screenshot above.


title: How make Standalone with Subpreambles respect group?

text: I am trying to use the subpreambles option with the standalone package. My main file is:               \documentclass[subpreambles]{standalone}     \usepackage{standalone}          \newtoks{\MyToken}     \MyToken={MainFile}          \begin{document}     Before Input: MyToken = \the\MyToken  \par     \input{MySubfile.tex} \par     After Input: MyToken = \the\MyToken     \end{document}      and the MySubfile.tex content is:               \documentclass{standalone}     \usepackage{standalone}          \ifdefined\MyToken% prevent redfintion.     \else%         \newtoks{\MyToken}%     \fi%          \MyToken={Subfile}          \begin{document}     In sub file: MyToken = \the\MyToken     \end{document}      The output from this is: > Before Input: MyToken = Subfile   >  In sub file: MyToken = Subfile   >  After Input: MyToken = Subfile but I what I want is this: > Before Input: MyToken = MainFile   >  In sub file: MyToken = Subfile   >  After Input: MyToken = MainFile I tried using \begingroup \endgroup around the input and that did not work. I don't want to use different tokens in the standalone and main files, as what is currently the main file, will eventually also be a subfile. I am not stuck using \newtoks, any method that I can use to achieve this is fine. I am also ok with last line printing > Input: MyToken = Subfile Is this possible?


title: LaTeX alternative (amongst the "TeX style dialects")?

text: I'm confused about the different TeX "dialects", and can help to wonder if any of the others is better than LaTeX that I'm using today. Let's say I would like to write a document that would contain   1. Include images/pictures in the document. Maybe a lot of screenshots.   2. Show some C-code (include verbatim)   3. Output a nice PDF with internal links to different places in the doc.   4. Easy to install on Debian style distributions like Ubuntu.   5. Command line driven, since most of my documents contain a lot of auto-generated content. There is more, but I think the rest is kind of similar between the different TeX dialects. And to be honest LaTeX does a quite good job with point 2-5, but not really on the first point. (That is why I'm asking this question). But since I don't know much about the "other TeX:s" could someone point me in the right direction?


title: Cell borders in tables "disappear"

text: I'm using LyX to edit some tables and TexMaker, but when I set the background color in the cell, the border line "disappear". For example: http://postimg.org/image/xp2xocp7z/ (one of my tables in TexMaker) and http://postimg.org/image/aav1nhwar/ (other of my tables in LyX). This is my LaTeX code from my first table:               \documentclass{article}         \textheight = 20cm         \textwidth = 18cm         \topmargin = -2cm         \oddsidemargin= -1cm         \parindent = 0mm     \usepackage{amsmath}     \usepackage{multirow}     \usepackage{array}     \usepackage[table]{xcolor}     \usepackage{colortbl}          \begin{document}              \begin{table}[h]             \centering                 \begin{tabular}{|p{2.64cm}|p{5.45cm}|p{7.14cm}|@{\vrule height 11pt depth 5pt width 0pt}}\hline                         \rowcolor{lightgray}\begin{center}Preferential relationship\end{center} &   \begin{center}Modelled decision\end{center} &   \begin{center}Definition*\end{center} \\ \hline                             \begin{center}Strict preference $(xPy)$\end{center} &   \begin{center}The DM certainly prefers $x$ over $y$, and (s)he has clear reasons to justify this choice\end{center} &   \begin{center}$P=\{(x,y): x\ dominates\ y\ \vee\ \sigma(x,y)\geq \lambda\ \wedge\ [\sigma(y, x)<0.5\ \vee\ 0.5\leq \sigma(y,x)<\lambda\ \wedge\ \sigma(x,y)-\sigma(y,x)\geq\beta]\}$\end{center} \\ \hline                             \begin{center}Indiference\linebreak $(x$I$y)$\end{center}   &   \begin{center}The DM perceives a high degree of equivalence between $x$ and $y$, hence (s)he cannot set a preference between them\end{center}   &   \begin{center}$\linebreak I=\{(x,y):\sigma(x,y)\geq\lambda\ \wedge\ \sigma(y,x)\geq\lambda\ \wedge\ |\sigma(x,y)-\sigma(y,x)|\leq\varepsilon\}$\end{center} \\ \hline                             \begin{center}Weak preference\linebreak $(xQy)$\end{center} &   \begin{center}The DM is doubting between\linebreak $xPy$ or $xIy$\end{center}   & \begin{center}$Q=\{(x,y):\sigma(x,y)\leq\lambda\ \wedge\ \sigma(x,y)\geq\sigma(y,x)\ \wedge\ \linebreak \neg xPy\ \wedge\ \neg xIy\}$\end{center} \\ \hline                             \begin{center}Incomparability\linebreak $(xRy)$\end{center} &   \begin{center}From  the perspective, there is a high level of heterogeneity between both alternatives, so (s)he cannot set a preference\end{center} &   \begin{center}$\linebreak \linebreak R=\{(x,y):\sigma(x,y)<0.5\ \wedge\ \sigma(y,x)<0.5\}$\end{center}\\ \hline                             \begin{center}$k$-Preference\linebreak $(xKy)$\end{center}  &   \begin{center}The DM is hesitating between\linebreak $xPy$ and $xRy$\end{center}    &   \begin{center}$K=\{(x,y):0.5\leq\sigma(x,y)\leq\lambda\ \wedge\ \sigma(y,x)<0.5\ \wedge\ \sigma(x,y)-\sigma(y,x)>\frac{\beta}{2}\}$\end{center}\\ \hline                                         \end{tabular}                 \centering *Considering the parameters $\lambda$, $\beta$ and $\varepsilon(0\leq\varepsilon\leq\beta\leq\lambda\leq1\ and\ \lambda>0.5)$         \end{table}          \end{document}      In LyX I played with the toolbar of borders but I can't get to display the missing border cells. I'll appreciate any help.


title: en dash and em dash spacing

text: I've noticed that en dashes and em dashes run into certain numbers and letters, and I don't believe it's standard to use spaces with these. For example, if a 'b' comes before the dash or a '6' comes after, the dash looks like it's actually touching the character unless you zoom way in. I know I'm being picky, but any ideas? MWE:               \documentclass[11pt]{amsart}     \begin{document}          61--68     49--81     58--44     bib---thing          \end{document}


title: Why aren't the references for a Thesis sorted as per order of usage in PdfLatex?

text: I've explained my problems in the end               \begin{figure}     \captionsetup{format=hang}     \begin{figure}[!h]     \centering     \includegraphics[width=\textwidth]{PTC}     \caption{Solar Thermal energy collection devices \cite{quaschning2003solar}}     \label{PTC}     \end{figure}          *Wall of code without any float*          \begin{table}[!h]     \centering     \includegraphics[width=\textwidth,height=317pt,keepaspectratio]{LCOE}     \caption{U.S. average levelized costs (2011 \$/MWh) for plants entering service in 2018\cite{website:http://www.eia.gov/}}     \end{table}      I've made the references section in the end. I'm using PdfLatex on normal mode.               \bibliographystyle{unsrt}     \bibliography{bibfile}{}      Two problems : 1) PdfLatex doesn't seem sensitive to changes in bibliography style 2) Even while using bibliography style as unsorted, the references aren't ordered as per first usage. In this case, the reference for the table is marked as [1] in the output while the figure is marked as [2]. What can be the possible problem?


title: Lyx - Bibliography order

text: I'm using a Lyx 2.0 for my thesis and I have a problem. The bibliography order is the bibliography order of figures index, and not the order of citations in text. Can I solve this? I use an external file (by JabRef). An example: document


title: Putting text in a box: custom box : different color for each line

text: For a beamer presentation, I would like to enclose text in a box such that:   \- all the line of the box are blank,   \- except the upper left corner, and the lower right corner of the box which are color X.               \begin{\mybox}{blue}          Some text here     \end{\mybox}      ![box example](http://i.stack.imgur.com/97Fxq.jpg) (I made this example by hand, the text doesn't have to be centered). I saw some examples where the box lines all have the same color.   But I don't see how to adapt them.


title: How to install the latest version of microtype (v. 2.5) in Linux (Ubuntu)?

text: How to install the latest version of microtype (v. 2.5) in Linux (Ubuntu) ? (also, is v. 2.5 still in beta?) **Edit** I'm using this ppa https://launchpad.net/~texlive-backports/+archive/ppa/ which currently delivers `2012.20120611-3~ubuntu12.04.1`, where `texlive- latex-recommended` contains **`microtype`** (v. 2.4).               /usr/share/texlive/texmf-dist/tex/latex/microtype     /usr/share/texlive/texmf-dist/tex/latex/microtype/letterspace.sty     /usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.lua     /usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.sty     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-bch.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-blg.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-cmr.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-euf.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-eur.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-euroitc.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-eus.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-msa.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-msb.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-mvs.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-pad.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-pmn.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-ppl.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-ptm.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-ugm.cfg     /usr/share/texlive/texmf-dist/tex/latex/microtype/mt-zpeu.cfg


title: Shape driven formatting

text: I'm not exactly sure how to call it, so I've had a hard time search for it online. What I have is a solid block of text. What I want is to change the formatting of part of this block of text (make it bold, italic, change its color) according to a shape or picture.   ![Photoshoped example](http://i.stack.imgur.com/TMXrH.jpg) I'm already using pstricks for all my other figures so I'd rather stick to that if at all possible. I have a picture (png) with the shape I'm trying to imprint, but I could recreate it in pstricks if it's necessary.


title: Change header in a4paper

text: I want to write my master thesis and I use the following setting:                  \documentclass[a4paper,           12pt,                                        bibliography=totoc,              index=totoc,             abstracton,              headsepline,             %footnosepline,              ]{scrartcl}          \usepackage{latexsym}                \usepackage[latin1]{inputenc}        \usepackage[ngerman,english]{babel}            \usepackage{subfig}          \usepackage{float}           \usepackage{graphicx}            \usepackage{rotating}       \usepackage{mathrsfs}     \usepackage{eurosym,bm,amsmath,amssymb,verbatim}     \usepackage{listings}     \usepackage[T1]{fontenc}     \usepackage{setspace}     \usepackage [round,authoryear] {natbib}           \usepackage{amsmath}          \usepackage{graphicx,eso-pic,lipsum}     \usepackage[automark]{scrpage2}     \usepackage{url}          \usepackage{tocstyle}      \usetocstyle{noonewithdot}     \usepackage[bookmarksopen,hyperfootnotes=false,pdftitle=test, pdfauthor=test,pdfsubject=Project]{hyperref}     \usepackage{listings}      \lstset{        language=R,                   basicstyle=\scriptsize,       showstringspaces=false,       showspaces=false,       keywordstyle=\color{blue},                commentstyle=\color{green},              stringstyle=\color{black}     }     %------------------------------------------------------------------------          \parindent0em                \topmargin-20.4mm        \textheight245mm          \textwidth157mm \oddsidemargin11mm \evensidemargin11mm          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \pagestyle{scrheadings}          \ifoot[]{My Name}          \AddToShipoutPicture{%     \hspace{16cm}     % {\includegraphics[scale=1]{Logowatermark.jpg}}}               \begin{document}         \begin{titlepage}          %\hspace{2cm}\scalebox{1}{\includegraphics{Logo.jpg}}          \vspace*{1cm}     \large\textbf{Title}\\[0.5cm]          \normalsize description\\          subtext\\                    Degree Course: enter here\\          \textbf{School of  \mbox{test}}\\[0.8cm]          Name of Chair \\[1.5cm]     %     %     \noindent\begin{tabular}[h]{@{}ll}     %\begin{tabular}{l l}     Chairholder:  \\     \\     Supervisors:             \\     \\     Author:   &My Name              \\     \\     %Address:         &               \\[0.2cm]     %                 &1                   \\     \\     Matriculation Number.:    &            \\     \\     Email:           &      \\     \\     \end{tabular}          \vfill     Place, Date          \end{titlepage}               \newpage     \pagenumbering{Roman}                    \clearpage     \pagenumbering{arabic}     \onehalfspacing                           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \tableofcontents          \newpage     \listoffigures     \newpage     \listoftables     \newpage     \setcounter{page}{1}           % \input{Chapter1}       %\newpage     %\input{Chapter2}     \newpage     \part{Description}     \section{Description}     test test test test test test     %\input{Chapter3}     \newpage     %\input{Appendix}     \newpage     \end{document}                                           % Ende des Dokuments      I am not happy with my header: As you can see on the first page (roman number 1 ), there is no text in the header. So this would be only the case on the next page. But I want to have a header text on every page with the chapter description and with the section description. Second I want to have at the left and at the rigth side of the black line of the header an additional vertical line. I attached a link to a screenshot which illustrates what I mean (I have not enough reputation to attach images :-( ) ![enter image description here](http://i.stack.imgur.com/dSy5d.png)


title: Algorithmic package for loop and comment at the same line

text: I want to have the following output using algorithmic package:               for i = 1 : z do // number of rows        x = 1      end for      I use the following tex code:               \begin{algorithmic}         \FOR{$p=1:r$} // number of rows             \STATE $x=1$         \ENDFOR     \end{algorithmic}      It doesn't work. I couldn't find any way to put the `comments` to the same line with `for`. Is there any way to do that with the algorithmic package? # EDIT ## 1. Code:               \FOR[// loop over all puppies]{$p=1:r$}         \STATE $x=1$     \ENDFOR      Result:               for i = 1 : z do {// number of rows}        x = 1      end for      ## 2. Code:               \FOR{$p=1:r$ \COMMENT{// number of rows}}         \STATE $x=1$     \ENDFOR      Result:               for i = 1 : z {// number of rows} do        x = 1      end for      Is there any way to get rid of these curly brackets?


title: When to use a \mbox or a tilde for words that have to stay together

text: I am new to La Tex and wondering when to use a tilde, or a `\mbox`? A tilde prohibits a line break and so does `\mbox`, so when to use one or the other? For example, should I use:               \mbox{words to kept together}       or,                words~to~be~kept~together


title: amsthm not working correctly with unicode-math

text: I'm trying to use `unicode-math` with `amsthm`. I'm using the following code:               \documentclass{article}          \usepackage{amsthm}     \usepackage[math-style=TeX]{unicode-math}          \newtheorem{question}{Question}          \begin{document}         \begin{question}             My question         \end{question}     \end{document}      The output produced looks like this:               ? My question      Any idea how to fix this? Thanks!


title: How can I change the indentation in quote and quotation environments and commands?

text: I need to change the indentation that the `quote` and `quotation` environments and commands employ. I assume that there is some length I need to set, but I've googled around, and cannot find what I am after. So, how to alter the indentation?


title: Lists in Tabular Environment

text: So I'm writing up a CV and I would like to use the nifty `itemize` environment to list some things within a `tabular` environment. Unfortunately, things end up looking a bit this, which isn't at all what I want. Specifically, I want to the itemize environment to hug closely to "BIG COMPANY NAME" so that it appears as "Software Development Intern" does, and likewise at the bottom. My current code looks a bit like so:               \textsc{May 2010 to Aug 2010}         & Software Development Intern  \\         & \textsc{BIG COMPANY NAME} \\         & \begin{itemize}             \setlength{\itemsep}{0pt}             \setlength{\parskip}{0pt}             \setlength{\parsep}{0pt}             \setlength{\partopsep}{0pt}             \setlength{\topsep}{0pt}             \item item1             \item item2         \end{itemize} \\         & \small{Cool Details}\\      Buuut it's not doing the job at all. Any suggestions, Latex gurus?


title: Different indentations of same level in ToC

text: I am writing a paper for university and I need to do it according to style guides. Everything looks peachy, except for the ToC. This is how it comes out for me: ![enter image description here](http://i.stack.imgur.com/BKcRr.png) The word "appendix" shouldn't overlap with the section name, but also the non- appendix subsections cannot be further to the right than they are now. That's why I cannot use               \renewcommand\l@subsection{\@dottedtocline{2}{1.5em}{3em}}      Following is the code I have in my *.cls file which might have some influence in current formatting.               \renewcommand{\section}{%         \@startsection {section}{1}{\z@}         {-3.5ex \@plus -1ex \@minus -.2ex}         {2.3ex \@plus.2ex}         {\normalfont\Large\bfseries}     }          \renewcommand{\l@section}[2]{%         \ifnum \c@tocdepth >\z@             \addpenalty\@secpenalty             \setlength\@tempdima{1.5em}             \begingroup                 \vspace{1.5mm}                 \parindent \z@ \rightskip \@pnumwidth                 \parfillskip -\@pnumwidth                 \leavevmode {                 \advance\leftskip\@tempdima                 \hskip -\leftskip                 \MakeUppercase{#1}}\nobreak\ %                 \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}                 \hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par             \endgroup         \fi     }          \renewcommand{\appendix}{%         \renewcommand{\thesubsection}{\arabic{subsection} appendix.}     }      The ToC in the image was generated with following statements:               \section{Section 1}     \section{Section 2}     \subsection{Subsection 2.1}     \section{Appendices}     \appendix     \subsection{Awesome appendix}     \subsection{Not so awesome appendix}      I will be grateful for any help you can provide.


title: How editing chapter number at Fancy Page?

text: I am very interesting about fancy page and i have minimal working answers dan the result :                   \documentclass{book}     \usepackage[top=20mm,bottom=20mm,left=20mm,right=20mm,a4paper]{geometry}     \usepackage{microtype,soul,filecontents}     \usepackage{pgf}     \usepackage{lettrine,caption,multicol}     \usepackage{xcolor}     \usepackage{lipsum,soul}     \usepackage{palatino}     \usepackage{calligra}     \usepackage[T1]{fontenc}     \makeatletter     \usepackage[listings,theorems]{tcolorbox}     %\usepackage[charter]{mathdesign}     % \def\rmdefault{bch} % not scaled     % \def\ttdefault{blg}     \usepackage{xcolor,filecontents,ragged2e}     \definecolor{theblue} {rgb}{0.02,0.04,0.48}     \definecolor{thered}  {rgb}{0.65,0.04,0.07}     \definecolor{thegreen}{rgb}{0.06,0.44,0.08}     \definecolor{thegrey} {gray}{0.5}     \definecolor{theshade}{gray}{0.94}     \definecolor{theframe}{gray}{0.75}     \newcommand\lorem{Fusce adipiscing justo nec ante. Nullam in enim.      Pellentesque felis orci, sagittis ac, malesuada et, facilisis in,      ligula. Nunc non magna sit amet mi aliquam dictum. In mi. Curabitur      sollicitudin justo sed quam et quadd. \par}          \lstloadlanguages{[LaTeX]TeX, [primitive]TeX}          % Emphasis     \newcommand\emphasis[2][thered]{\lstset{emph={newcommand,def,gdef,#2},        emphstyle={\ttfamily\textcolor{#1}}}}%          \lstset{language={[LaTeX]TeX},           escapeinside={{(*@}{@*)}},            numbers=left, gobble=0,            stepnumber=1,numbersep=5pt,            numberstyle={\footnotesize\color{gray}},firstnumber=last,            breaklines=true,            framesep=5pt,            basicstyle=\small\ttfamily,            showstringspaces=false,          % keywordstyle=\ttfamily\textcolor{thegreen},           stringstyle=\color{orange},           commentstyle=\color{black},           rulecolor=\color{theshade},           breakatwhitespace=true,          showspaces=false,  % shows spacing symbol           xleftmargin=0pt,           xrightmargin=5pt,           aboveskip=3pt plus1pt minus1pt, % compact the code looks ugly in type           belowskip=7pt plus1pt minus1pt,  % user responsible to insert any skips           backgroundcolor=\color{theshade}     }          \begin{filecontents*}{chapterx.sty}     \ProvidesPackage{chapters}[2012/04/07 v0.1 Typesetting chapters]     \newcommand\HUGE{\@setfontsize\Huge{38}{47}}     \newcommand\HHUGE{\@setfontsize\HHUGE{58}{67}}               \newenvironment{summary}                    {\list{}{\listparindent0pt %                             \itemindent\listparindent                             \leftmargin0pt                             \rightmargin\leftmargin                             \parsep\z@ \@plus\p@}%                     \item\relax\itshape}                    {\endlist}          % helper macros     \gdef\thinrule{\rule{\textwidth}{0.4pt}}     \gdef\mediumrule{\rule{\textwidth}{0.8pt}}     %% broad positions     \newif\if@left     \newif\if@right     \newif\if@center     \@leftfalse     \@rightfalse     \@centerfalse     % newifs for number position     \newif\if@lefttitle     \newif\if@righttitle     \newif\if@leftname     \newif\if@rightname     \newif\if@chapterspaceout\@chapterspaceoutfalse     \newif\if@titlespaceout\@chapterspaceoutfalse          %\section{Libraries}          \def\cx@optionlist{}               \def\cx@optionlist{}          \def\cxuselibrary#1{\cxset{library/.cd,#1}}     %     % The library is added by inputting the file and setting the path accordingly.     \def\cx@add@library#1#2{%       \cxset{library/#1/.code={\@ifundefined{cxlibrary@#1@loaded}{\input #2}{}}}%       \DeclareOption{#1}{\edef\cx@optionlist{\cx@optionlist,#1}}%     }          \def\thickrule{\leavevmode \leaders \hrule height 3pt \hfill \kern \z@}               % Define a family for chapter styling keys     \pgfkeys{/chapter/.is family}                    \def\cxset{\pgfqkeys{/chapter}} %Notice this is pgf q keys     % spent half the evening to debug it;)Aarg!!!     % We define keys for all major components     \cxset{%       name/.code={\gdef\chaptername{#1}},       color/.store in=\color@cx,       color/.default=black,       chapter font-family/.store in=\chapterfontfamily@cx,       chapter font-weight/.store in=\chapterfontweight@cx,       chapter font-size/.store in=\chapterfontsize@cx,       chapter color/.store in=\chaptercolor@cx,       chapter before/.store in=\chapterbefore@cx,       chapter after/.store in=\chapterafter@cx,       chapter spaceout/.is choice,       chapter spaceout/soul/.code={\@chapterspaceouttrue},       chapter spaceout/none/.code={\@chapterspaceoutfalse},       % title keys       title font-family/.store in=\titlefontfamily@cx,       title font-family/.default=\rmfamily,       title font-weight/.store in=\titlefontweight@cx,       title font-size/.store in=\titlefontsize@cx,       title font-color/.store in=\titlefontcolor@cx,       title spaceout/.is choice,       title spaceout/soul/.code={\@titlespaceouttrue},       title spaceout/none/.code={\@titlespaceoutfalse},       title font/.style={title font-family=#1},       title before/.store in=\titlebefore@cx,       title after/.store in=\titleafter@cx,       title beforeskip/.store in=\titlebeforeskip@cx,       title afterskip/.store in=\titleafterskip@cx,       position/.is choice,       position/left/.code={\@lefttrue},       position/right/.code={\@righttrue},       position/center/.code={\@centertrue},     % numbering options that are required       numbering/.is choice,     % better to rename thechapter?       numbering/roman/.code={\gdef\thechapter{\@roman\c@chapter}},       numbering/Roman/.code={\gdef\thechapter{\@Roman\c@chapter}},       numbering/arabic/.code={\gdef\thechapter{\@arabic\c@chapter}},       numbering/none/.code={\gdef\thechapter{}},       number dot/.store in=\numberpunctuation@cx,       number position/.is choice,       number position/leftname/.code={\@leftnametrue\@rightnamefalse},       number position/rightname/.code={\@rightnametrue\@leftnamefalse},       number position/absolute/.code={},       number position/righttitle/.code={\@righttitletrue},       number position/lefttitle/.code={\@lefttitletrue},       number after/.store in=\numberafter@cx,       number before/.store in=\numberbefore@cx,       number color/.store in=\numbercolor@cx,       number font-size/.store in=\numberfontsize@cx,       number font-family/.store in=\numberfontfamily@cx,       number font-weight/.store in=\numberfontweight@cx,     % headers and footers       header style/.store in=\headerstyle@cx,     % general draft rules       rule /.is choice,       rule on/.code={\gdef\rulewidth@cx{0.4pt}},       rule off/.code={\gdef\rulewidth@cx{0pt}},     }          \cxset{%       color=blue,       position=center,       name=chapteris,       title font-family=\rmfamily,       title font-weight=\bfseries,       title font-size=\Huge,       title font-color=\color{olive},       numbering=arabic,       number dot=,       chapter font-family=\sffamily,       chapter font-weight=\bfseries,       chapter font-size=\Large,       chapter color=gray,       chapter before={\leavevmode\par\hfill},%need to correct for 0pt       chapter after=\hfill\hfill,       number position=rightname,       number color=\color{gray},       number after=\hspace{20pt},       number before=\hspace*{20pt},       number font-size=\huge,       number font-family=\sffamily,       number font-weight=\bfseries,       number before=,       number after=,       title before=,       title after=,       title afterskip={\vskip50pt},       title beforeskip={\vskip10pt},       header style=plain,     }          \gdef\setdefaults{%     \cxset{%     name=CHAPTER,     title font-family=\rmfamily,     title font-weight=\bfseries,     title font-size=\Huge,     title font-color=\color{purple},     numbering=arabic,     number dot=,     number before=,     number after=,     chapter font-family=\sffamily,     chapter font-weight=\bfseries,     chapter font-size=\large,     chapter spaceout=soul,     chapter color=gray,     chapter before={},%need to correct for 0pt     chapter after=,     number position=rightname,     number color=\color{gray},     number after=\hspace{20pt},     number before=\space,     number font-size=\large,     number font-family=\sffamily,     number font-weight=\bfseries,     title before=,     title after=,     title afterskip={\vskip24pt},     title beforeskip={\vskip10pt},     title font=\rmfamily,     header style=plain,     }     }          % The |\@makechapterhead| is used by LaTeX to typeset the     % Chapter heading. This is a rewrite in order to make it     % more flexible and use the keys.          \renewcommand\@makechapterhead[2][]{%     % macro for typesetting the chapter number       \def\printnumber{%         \numberbefore@cx           {%           \numbercolor@cx           \numberfontsize@cx           \numberfontfamily@cx           \numberfontweight@cx           \thechapter           \numberpunctuation@cx           }           \numberafter@cx       }%     % macro for typesetting the chapter name       \def\printchaptername{%         {         \chapterfontfamily@cx         \chapterfontsize@cx         \chapterfontweight@cx         \color{\chaptercolor@cx}     % Check if the chapter name is spaced out and use the     % soul package. TODO add values for soul parameters     % as a style feature.         \if@chapterspaceout          \expandafter\so\expandafter{\chaptername}         \else           \@chapapp\space         \fi         }%       }%     % set all keys         {%         \parindent0pt         \normalfont%         \ifnum \c@secnumdepth>\m@ne%           \if@mainmatter%      % we start displaying  the names and any preambles such      % as images      % print chapter name              \chapterbefore@cx%              \if@leftname                 \printnumber              \fi%              \printchaptername              \if@rightname                 \printnumber              \fi%              \chapterafter@cx           \fi%         \fi%          %chapter title         \interlinepenalty\@M%     % if the number is before the title     % if the number prints together with the title they     % are considered as one indivisible part.          \titlebeforeskip@cx%          \if@lefttitle%            \beforenumber@cx%            \counterdisplay\c@chapter\afternumber@cx%          \fi     % Display title           \titlefontfamily@cx           \titlefontweight@cx           \titlefontsize@cx           \titlefontcolor@cx           \selectfont           \titlebefore@cx%           \if@titlespaceout              \so{#2}%           \else              #2           \fi%           \titleafter@cx         \if@righttitle%           \afternumber@cx           \counterdisplay\c@chapter\afternumber@cx%         \fi         \par\nobreak%     % skip after title         \titleafterskip@cx     % headers         \thispagestyle{\headerstyle@cx}     }}               %% Special Chapter command     \newcommand\specialchapter@cx[2][]{%     \cxset{image/.store in=\image@cx,            image caption/.store in=\caption@cx}     \cxset{#1}     \vbox to 0pt{\color{blue}\rule{\paperwidth}{0.4pt}\par\vskip-1.4pt     \rule{0.4pt}{\textheight}\rule{4cm}{0.4pt}}          \vbox to 0pt{\parbox[b]{4.7cm}{%     \raggedright          \leftskip1.5cm     \caption@cx\par      \expandafter\rule{\rulewidth@cx}{5.8cm}     }\parbox[b]{0.5cm}{\includegraphics[width=0.5cm,height=9.15cm]{shadow2}}\includegraphics{\image@cx}\par}          \vspace{8.2cm}     \hspace*{-3.51cm}\hbox to 0pt{\hspace*{1.01cm}\includegraphics[width=7.7cm,height=3.8cm]{shadow4}     \hspace*{-2.7cm}\sffamily\color{\numbercolor@cx}\HHUGE \raise30pt\hbox{4}%     \hspace{1.5cm}\raise0.5pt\hbox{\includegraphics{shadow5}\includegraphics{shadow4}}     }          %% Title name     \parbox[b]{0.45\textwidth}{%       \titlefontsize@cx       \titlefontweight@cx       \titlefontfamily@cx       \leftskip0.5em \color{\titlefontcolor@cx}       #2     }     %% Concepts     }          \newenvironment{specialchapter}[2][]{%       \if@openright\cleardoublepage\else\clearpage\fi         \thispagestyle{plain}%         \global\@topnum\z@         \@afterindentfalse         \specialchapter@cx[#1]{#2}         \begin{minipage}{0.5\textwidth}%         \vspace{0.5\baselineskip}         \raggedright     }{\end{minipage}}     \end{filecontents*}          \usepackage{chapterx}     \usepackage{makeidx}     \makeindex     \author{Y Lazarides}     \title{\parindent0pt A New Approach in\\ Styling Chapters}     \begin{document}     \maketitle     \tableofcontents     \mainmatter     \setdefaults          \cxset{      name={CHAPTER CONCEPT},      numbering=none,      number font-size=,      number font-family=,      number font-weight=,      number color=white,      chapter color=theblue,      chapter font-family=\sffamily,      chapter font-size=\large,      chapter font-weight=\bfseries,      title font-family=\sffamily,      title font-color=theblue,      rule off,     }          \begin{specialchapter}[          image=catcute,%genetics-dogs,          image caption={Labrador retriever\\              puppies expressing\\              brown (chocolate),\\              golden (yellow),\\              and black\\              coat colors,\\              traits controlled\\              by two gene pairs.}]%     {Extensions\\ of Mendelian\\ Genetics}     \end{specialchapter}                         \end{document}       and The Result : ![The Result ](http://i.stack.imgur.com/KQJ8h.jpg) And i have a problem about setting table of contents and chapter name, like this picture ![Replace and Add Chapter](http://i.stack.imgur.com/tlXue.jpg)


title: Lots of text in one table cell

text: I need to place lots of text in one table cell. I tried to use longtable, but it seems to work, say, only on a row basis and gives terrible result in case when one row isn't fit in a page. Something like this               \documentclass {article}          \usepackage [utf8] {inputenc}     \usepackage [english] {babel}     \usepackage{lipsum}          \begin{document}          \clearpage     \section{My section}          \begin{longtable}{| c | p{3cm} | p{5cm} | p{3cm} |}     \hline     1   & 2         & \lipsum          & 3 \\ \hline     \hline     \end{longtable}          \section{Another section}          \end{document}      gives a result close to this ![longtable with long text in a cell](http://i.stack.imgur.com/PAW4n.png) **EDIT:** If it is completely impossible to have a table with a cell like this, how would you suggest to layout such a data (that is without table-like environment). This is just an ordinary table with heading, specifying the meaning of each column (four of them). One column tend to have lots of text in its cells. That's it.


title: Testing for current page

text: Is there a way of testing if a `\pageref` is the current page? For example, in the next code:               \newcommand\figureref[1]{%       Figure~\ref{#1} (p.~\pageref{#1})     }      I would like to eliminate the `(p.~\pageref{#1})` if the referenced figure is on the same page as the reference. I tried using the `varioref` package and but couldn't tweak it to the desired behavior. **UPDATE:** Going back to the original question of _testing for current page_ , this almost worked:               \newcounter{cPage}     \newcommand\figureref[1]{%       Figure~\ref{#1}%       \setcounter{cPage}{\value{page}}\addtocounter{cPage}{1}%       \ifthenelse{\value{cPage}=\pageref{#1}}{}{(p.~\pageref{#1})}%     }      But, the page value is not very consistent. Sometimes it changes in the middle of a page. The offset varies, between -1/1 and +1/2, and I can't seem to find any logic behind it.


title: How do I modify the amount of space between the heading and the chapter's number and/or name?

text: Currently, the space between the bottom of my header and the top of the chapter number is quite large and I would like to be able to reduce the space between the header and the chapter number. How would I go about doing this? I am using the report documentclass.


title: Latex finding underfull hboxes

text: I got an underful hbox in my document which I can't find the log tells me its in line 3-3 which is \input{costumshortcuts} which I haven't changed in ages. So is there a way to find it. Or even visualize it like overfull hboxes in a draft? thanks


title: Is there a better way to "absorb" the subscript than this \@ifnextchar-hackery?

text: In this example document, I want to make a math relation called `R` which gets typeset as `R^X`, but as a math relation. But I want to maybe be able to subscript it. The macro `\myRbad` looks okay without the subscript, but with a subscript it looks wrong because the subscript occurs "after" the superscript instead of being underneath it as it should be. The macro `\myRgood` looks correct in either case. It works by checking whether the next character is `_` and if it is, gobbling the `_` and delegating to another macro which typesets the subscripted version. I wondered though, whether there's a more straightforward way than this to make LaTeX do what I want.               \documentclass[a4paper]{amsart}          \def\myRbad{\mathrel{R^X}}          \makeatletter     \def\@myRgood@#1{\mathrel{R^X_{#1}}}     \def\myRgood{\@ifnextchar_{\expandafter\@myRgood@\@gobble}{\mathrel{R^X}}}     \makeatother          \begin{document}          $a \myRbad b$          $a \myRbad_Y b$          $a \myRgood b$          $a \myRgood_Y b$          $a R^X_Y b$          $a \mathrel{R^X}_Y b$          $a \mathrel{R^X_Y} b$          \end{document}      # Edit: As a bonus, here is a macro that automates the creation of macros like `\myRgood` (using the improved method shown by @egreg's answer). (You have to `\usepackage{xstring}`.)               \makeatletter     \def\makeprocessedmathabsorbsubscript#1#2#3{        \edef\@themacroname{\string#1}%        \saveexpandmode%        \fullexpandarg%        \StrGobbleLeft{\@themacroname}{1}[\@themacroname]%        \restoreexpandmode%        \ifcsname\@themacroname\endcsname%           \errmessage{The macro "\@themacroname" already exists}%        \fi%        \ifcsname @\@themacroname @\endcsname%           \errmessage{Something strange is happening.                       I want to create an internal macro for "\@themacroname",                       but it exists already}%        \fi%        \expandafter\def\csname @\@themacroname @\endcsname##1##2{#2{#3_{##2}}}%        \edef#1{%           \unexpanded{\@ifnextchar_}%              {\unexpanded\expandafter{\csname @\@themacroname @\endcsname}}%              \unexpanded{{#2{#3}}}%        }     }     \makeatother      Now one can write something like:               \makeprocessedmathabsorbsubscript{\myRbetter}{\mathrel}{R^X}      and the macro `\myRbetter` is provided.


title: ConTeXt: arbitrary Unicode code point

text: How to print a glyph by Unicode code point? i.e. what is the ConTeXt equivalent of the following LaTeX (displaying a capital Alpha):               \symbol{"0391} % hex     \symbol{913}   % dec     \symbol{'1621} % oct


title: Creating static head title for a document class

text: I am making my own document class in LaTeX but I have a problem on how will I make this title appear automatically when my class is used. ![example title](http://i.stack.imgur.com/xUIU3.png) Should I code it this way?               \AtBeginDocument{%        \vspace*{-0.4in}\noindent        {\Large\bfseries School name here} \\        {\large\sffamily college name here} \\[0.2in]        {\Large\sffamily department name here} \\[0.2in]        {\Large\sffamily Subjectcode, subject name here} \\[0.2in]        {\Large\sffamily school year here} \\[0.2in]        \vspace{0.2in}     }


title: biblatex - quote in chronological order but bibliography list must be alphabetical order

text: I want to use more than one type of specification in my bibliography. I want to quote in chronological order but have the bibliography list in alphabetical order. If I am quoting 2-3 references in the middle of my thesis writing, I want them to be displayed in chronological order. e.g. * * * {biblatex} > The human race has had a fast and accelerating growth in terms of technology > and communication, in the past decade, [Turner, 2001; Allis et al., 2007]. {bibliography} * * * But When the bibliography is displayed at the end of the document, I want them to be displayed in alphabetical order e.g. * * * BIBLIOGRAPHY >   1. Allis, C. D., Jenuwein, T., Reinberg, D., and Caparros, M. L. (2007). > Epigenetics. Cold Spring Harbor Press >   2. Turner, B. M. (2001). Chromatin and Gene Regulation – Mechanisms in > Epigenetics. 2nd Edition, BlackWell Science Ltd. > * * * **How should this be achieved given than I use bib latex package? I have not pasted the code of my biblatex line, but I hope that some1 can help me sort this out as not many topics in this forum is handling it.**


title: How to make subsections not appear in the text?

text: I have the following preamble and I want the subsection not to be visible in the text. Instead of Chapter 1 "Blah Blah" I only want "Blah Blah to be visible. With this code I did it bu the subsections are still visible in the text. e.g. 2.5 "blah blah". How can I also remove 2.5 ??               \documentclass[a4paper,12pt]{book}     \usepackage{titlesec}          \titleformat{\chapter}[display]{\normalfont\huge\bfseries}{}{20pt}{\Huge}          \let\cleardoublepage\clearpage     \usepackage[english,greek]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{blindtext}     \usepackage[pdftex]{graphicx}     \usepackage[skip=2pt, font=small, labelformat = empty]{caption}          \newcommand{\gr}{\selectlanguage{greek}}     \newcommand{\en}{\selectlanguage{english}}     \usepackage{wrapfig}     \usepackage[paperwidth=17cm, paperheight=24cm]{geometry}               \usepackage[onehalfspacing]{setspace}     \usepackage{textcomp}     \useshorthands{;}     \defineshorthand{;}{?}     \usepackage{fancyhdr}     \fancyhf{}     \fancyhead[LE]{\nouppercase{\leftmark}}     \fancyhead[RO]{\nouppercase{\rightmark}}     \fancyfoot[LE,RO]{\thepage}     \pagestyle{fancy}          \renewcommand{\chaptermark}[1]{ \markboth{#1}{} }     \renewcommand{\sectionmark}[1]{ \markright{#1}{} }


title: Footnote not appearing in Document

text: I am using a footnotes with urls inside. This works fine for most cases, but for some reason I cannot understand, sometimes the footnotes are not generated and I do not know why. Here is the MWE (Minimal Working Example) that I am using:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{paralist}          \begin{document}     \begin{compactdesc}       \item[Speedup\footnote{Am I Here?}] \hfill \\         A missing footnote.     \end{compactdesc}          \end{document}      What am I doing wrong here?


## Version 1 In this version, I put the full width floating image _outside_ the `enumerate` environment.               \begin{enumerate}     \item     \MarginFig     \lipsum[1]     \end{enumerate}          \FullFig          \begin{enumerate}[resume]     \item     \lipsum[1]          \item     \MarginFig     \lipsum[1]     \end{enumerate}      ## Version 2 And in this version, I put it _inside_ the `enumerate` environment.               \begin{enumerate}     \item     \MarginFig     \lipsum[1]          \item     \FullFig     \lipsum[1]          \item     \MarginFig     \lipsum[1]     \end{enumerate}      The complete MWE is given as follows:               \documentclass[12pt]{book}     \usepackage[         a4paper,         vmargin=2cm,         outermargin=9cm,         innermargin=2cm,         marginparwidth=7cm,         marginparsep=20pt     ]{geometry}          \usepackage{graphicx}     \usepackage{marginfix}     \usepackage{caption}     \usepackage{lipsum}     \usepackage{ifoddpage}     \usepackage{microtype}     \usepackage{enumitem}          \newcounter{temp}     \setcounter{temp}{0}          \newcommand\MarginFig{%     \marginpar{\includegraphics[width=\marginparwidth]{example-image-a}     \captionof{figure}{This is an image A. This is subject to change without notice. Be careful my friend!}     \addtocounter{temp}{1}     \label{fig:\arabic{temp}}}}                    \newcommand\FullFig{%     \begin{figure}[hbtp]         \checkoddpage       \edef\side{\ifoddpage l\else r\fi}%         \makebox[\textwidth][\side]{%          \parbox{\dimexpr\textwidth+\marginparwidth+\marginparsep\relax}{%             \includegraphics[width=\linewidth]{example-image-b}             \caption{This is an image B. This is subject to change without notice. Be careful my friend!}             \addtocounter{temp}{1}             \label{fig:\arabic{temp}}}}     \end{figure}     }               \begin{document}          % Version 1     \begin{enumerate}     \item     \MarginFig     \lipsum[1]     \end{enumerate}          \FullFig          \begin{enumerate}[resume]     \item     \lipsum[1]          \item     \MarginFig     \lipsum[1]     \end{enumerate}          \newpage     % Version 2     \begin{enumerate}     \item     \MarginFig     \lipsum[1]          \item     \FullFig     \lipsum[1]          \item     \MarginFig     \lipsum[1]     \end{enumerate}          \end{document}      The PDF output of one version is slightly different from that of the other one. Which one is recommended when putting a full width floating image? Please give me the reason as well. Note: This question was based on the quest to avoid possibility of bad behavior of floating images on the margin par and full width floating images.


title: Turn off appendix header in list of figures/tables when there are no tables or figures in any appendix

text: My list of tables and list of figures are showing correctly for my main document, but after the main list I get a header for the appendix that looks like: > 4.1 Last Figure...................................whatever page > > Appendix > > Figure I do not have any figures in any of my appendices, but the header still shows. If I add a fake figure to an appendix it appears after the header. I have tried using `\addtocontents{lof}{\protect\setcounter{tocdepth}{0}}` to turn off the list of figures in appendices, and it works in that no more figures are shown after the header, but the header is still there. I'm using a thesis .cls that I didn't write, so I'm not sure what everything does. The section that covers the list of tables/figures/contents looks like this:               \def\tableofcontents{\@tableof{TABLE OF CONTENTS}{}{tocpage}{toc}{}}          \def\listoffigures{       \@tableof{LIST OF FIGURES}{Figure}{lofpage}{lof}       {\protect\addcontentsline{toc}{chapter}{LIST OF FIGURES}}}          \def\listoftables{       \@tableof{LIST OF TABLES}{Table}{lotpage}{lot}       {\protect\addcontentsline{toc}{chapter}{LIST OF TABLES}}}          \def\@tableof#1#2#3#4#5{     { % limit scope of following declarations!!       \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi       \addtolength{\textheight}{-40pt}       % -24-16       %\addtolength{\majorheadskip}{-40pt}    % -24-16       \addtolength{\headheight}{52pt}        %  36+16       \addtolength{\headsep}{-12pt}          % -12       \begin{center}       \chapter*{#1}       \end{center}       #5       \relax\markboth{#1}{#1}       \hbox to \hsize{#2 \hfil Page}       \singlespace       \setcounter{#3}{0}       \setcounter{listofheading}{1}  % change from 0 to 1       \def\@oddhead{\vbox to \headheight{\vspace{4pt}         \hbox to \hsize{\hfil\rm\thepage} \vfil         \ifnum\value{#3}=1           \ifnum\value{listofheading}=2             \hbox to \hsize{Appendix\hfil} \vspace{4pt} \fi           \ifnum\value{listofheading}=1             \stepcounter{listofheading} \fi           \hbox to \hsize{#2 \hfil Page}         \else           \setcounter{#3}{1}         \fi         }}       \def\@evenhead{\vbox to \headheight{\vspace{4pt}         \hbox to \hsize{\rm\thepage\hfil} \vfil         \ifnum\value{#3}=1           \ifnum\value{listofheading}=2             \hbox to \hsize{Appendix\hfil} \vspace{4pt} \fi           \ifnum\value{listofheading}=1             \stepcounter{listofheading} \fi           \hbox to \hsize{#2 \hfil Page}         \else           \setcounter{#3}{1}         \fi         }}       \@starttoc{#4}  \if@restonecol\twocolumn\fi       % \newpage     }}      I have tried removing everything in the `@tableof` definition except the `@starttoc` line and the header still appears. How do I get the lists to not show headers for sections that are empty?


title: biblatex-apa: for citations in text of the same author but different publications: shortauthor every time in [ ]

text: I am using `biblatex-apa`with the `apa6.cls`. In the text I cite several versions of the DSM (Diagnostic and Statistical Manual for Mental Disorders) by the American Psychiatric Association (APA):               @book{APA1994,         author={{American Psychiatric Association}},         shortauthor = {APA},         year={1994},         title="{Diagnostic and statistical manual of mental disorders: {DSM-IV}}",         publisher={Autor},         edition = {4th ed.},         address={Washington, DC},     }          @book{APA2000,         title = {Diagnostic and Statistical Manual of Mental Disorders: {DSM-IV-TR}},         edition = {4th ed., text rev.},         publisher = {Autor},         author = {{American Psychiatric Association}},         shortauthor = {APA},         year = {2000},         address={Washington, DC},     }          @book{APA2013,         author = {{American Psychiatric Association}},         shortauthor = {APA},         address = {Washington, {DC}},         edition = {5th ed.},         title = {Diagnostic and statistical manual of mental disorders: {DSM-5}},         publisher = {Autor},         year = {2013},     }      When I first cite f. e. `\parencite{APA1994}` I get the correct output: > (American Psychiatric Association [APA], 1994) When I cite that a second time, I get (which is also correct): > (APA, 1994) However, when I cite another publication with `\parencite{APA2000}` then after that, I get: > (American Psychiatric Association [APA], 2000) But, as this publication has the same author as cited before, I want the shortauthor to be put there, like: > (APA, 2000) How do I achieve that?


title: Caption font size problem

text: I'm using the `\documentclass{tufte-book}` and have a series of longtables for which I wish to place the caption in the margin. I found a solution to redefine the caption for such tables in this post, which worked perfectly.               \makeatletter     \def\LT@makecaption#1#2#3{%       \noalign{\smash{\hbox{\kern\textwidth\rlap{\kern\marginparsep       \parbox[t]{\marginparwidth}{%     \@tufte@caption@font \@tufte@caption@justification \noindent         #1{#2: }\ignorespaces #3}}}}}}     \makeatother      I'm also placing figures in the margin using the `marginfigure` but the font size for the captions of these are larger than the other text. I read in the Tufte Example Book that I can customise the style of margin content using (see pg31)...               \setsidenotefont{\footnotesize}     \setcaptionfont{\footnotesize}     \setmarginnotefont{\footnotesize}     \setcitationfont{\footnotesize}      ...and these work, but they don't affect the size of fonts for `marginfigure` and there is no mention/description in the section on `marginfigure` (see pg23) of how to customise them either. However they all appear to be the same size in the example document I had a search around and found the recommendation here to use the `\usepackage[font=footnotesize]{caption}` package/options, and this works, but it over-rides the custom caption defined for placing the caption of `longtable` in the margin, so its not really a viable option. Can anyone advise as to how to modify the font size of captions in `marginfigure` or how to use the `caption` package but still define longtable captions to be placed in the margin? Thanks in advance.


title: PSTricks figure turned 90 degrees

text: Consider the following example:               \documentclass{article}          \usepackage{pstricks-add}          \def\RPut(#1)#2{%       \rput[r]{90}(!#1 1980 sub 2 div 0){#2 \quad}       \rput[l]{90}(!#1 1980 sub 2 div 0){\quad #1}     }          \begin{document}          \psset{unit=0.78}     \begin{pspicture}(-0.1,-2.9)(14.7,1.3)      \psaxes[labels=none,Dx=2,dx=1,Ox=1980,yAxis=false]{->}(15,0)      \RPut(1980){Lake Placid}      \RPut(1984){Sarajevo}      \RPut(2006){Torino}     \end{pspicture}          \end{document}      If I compile using `xelatex` everything is fine but if I compile using `latex` \--> `dvips` \--> `ps2pdf` the figure is rotated 90 degrees. How do I compile using `latex` \--> `dvips` \--> `ps2pdf` but without getting the ratation?


title: \expandafter, \csname issue related to test for macro being defined

text: Just when I think I starting to understand `\expandafter` I run into this problem where I am trying to test if `\ConditionG`, `\ConditionH`, etc are defined in a loop. I tried all the combinations I could think of and am not able to get this to work:               \documentclass{article}     \usepackage{pgffor}     \usepackage{etoolbox}          \begin{document}          %\def\ConditionG{}% This should show up as undefined     \def\ConditionH{}          \foreach \i in {G, H}{         \expandafter\ifdefined\csname Condition\i\endcsname% Incorrect Results: everything defined             \textbackslash Condition\i\ is defined\par         \else             \textbackslash Condition\i\ is not defined\par         \fi     }          \hrule     \foreach \i in {G, H}{% Using etoolbox         \ifdef{\expandafter\csname Condition\i\endcsname}{% Incorrect Results: everything defined             \textbackslash Condition\i\ is defined\par         }{             \textbackslash Condition\i\ is not defined\par         }     }          \end{document}      Joseph's detailed explanation regarding When to use \edef, \noexpand, and \expandafter? makes sense to me, but can't seem to apply that to my problem.


title: Is there an ebib-like bibliography manager for emacs designed for biblatex?

text: I've been using ebib to manage my .bib files, but I've just switched over from using bibtex to using biblatex & biber to actually generate the bibliographies in documents. Obviously the file format is still the same since I'm still just using .bib files, but a couple of things make ebib non-ideal:   1. the required fields for the bibliography types aren't all the same; e.g., for @article entries biblatex expects "journaltitle" rather than just "journal"   2. ebib is not aware of biber's context-sensitive handling of crossref fields; e.g., biber will make the title field of a @collection item the booktitle field of an @incollection item that refers to it with crossref. The first of these is not really a big deal, but the second would take more work to remedy. I have a _lot_ of cross-references in my bib file and don't really want to undertake a bunch of elisp hacking, welcome as the procrastination would be. Anyone know of a package for emacs that does biber-like context-sensitive crossref stuff?


title: Second line of the footnote aligned left

text: I have used the `footmisc` package, in order to suppress the indentation at the beginning of my footnotes.               \usepackage[hang]{footmisc}     \setlength\footnotemargin{15pt}      So, the first line begins with the number, and then the text of the footnote. The thing is, I would like the second (and third, and fourth, and so forth) line of the note to be aligned left, under the number of the footnote. It would be great if you could help me! Thanks a lot.


title: Changing height of vertical line in tabular

text: Is there any way of changing the height of the vertical lines of a tabular environment? Here is my MWE:               \begin{tabular}{|c|c|}     \multicolumn{2}{|c|}{Header 1}\\     Subheader 1 & Subheader 2 \\ \hline     Cell 1 & Cell 2 \\ \hline     \end{tabular}      which generates: ![enter image description here](http://i.stack.imgur.com/kOfwX.png) However, I'd like to have the vertical line between Subheader 1 and Subheader 2 a bit shorter.


title: Apply shift to (current axis.left of origin)

text: I was trying to improve the solution at Drawing lines in a plot and give them a label? by using Jake's answer at How to access \xmin, \xmax, \ymin, \ymax from within PGFplots axis environment. So, Jake's answer produces the brown dotted line (the x-axis) with               (current axis.left of origin) -- (current axis.right of origin)      I thought a simple use of `tikz`'s `calc` library would allow me to adjust the vertical position of the horizontal line. If I want a horizontal line at `y=12`, for example, I simply use               ($(current axis.left of origin)+(axis cs: 0,12)$) -- ($(current axis.right of origin)+(axis cs: 0,12)$)      where I have applied a `+ (axis cs: 0,12)` and same for the other coordinate. Well, that is great in theory, but doesn't work. Instead, it produces the dashed line in red (which is only half the desired line): ![enter image description here](http://i.stack.imgur.com/pfgth.png) ## Notes:   * Instead of doing coordinate calculations, I also tried applying `shift={(axis cs: 0,12)}` option but that had no effect on the output. ## Code:               \documentclass{article}     \usepackage{pgfplots}     \usetikzlibrary{calc}          \begin{document}     \begin{tikzpicture}     \begin{axis}         \addplot {x*x};              \draw [ultra thick, dotted, draw=brown]              (current axis.left of origin) --              (current axis.right of origin);              \draw [ultra thick, dashed, draw=red]              ($(current axis.left of origin) +(axis cs: 0,12)$) --              ($(current axis.right of origin)+(axis cs: 0,12)$);     \end{axis}     \end{tikzpicture}     \end{document}


title: Does \let\a=\a do anything more than \relax?

text: Poking around with `\show` (and `\loggingall`) in the TikZ code, I see that the definition of `\tikz@command@path` (which `\path` is `\let` to inside tikzpictures) starts with               \let \tikz@signal@path =\tikz@signal@path      Is that doing anything? The only possibilities I see are an `\afterassignment` trickery, or a _very_ unlikely use of `\global`.               \RequirePackage{tikz}     \makeatletter     \show\tikz@command@path      or, to see that this is the definition of `\path` also,               \documentclass{article}     \usepackage{tikz}     \begin{document}     \tikz{\show\path}     \end{document}


title: Program to display/rewrite/reformat log file in the terminal

text: I usually compile my `.tex` files from the terminal without the `-interaction=nonstopmode`, so that it stops at every error, but of course I still need to look at the `.log` file from time to time, but mostly it is only to find bad boxes, undefined references and other warnings. My question is, does anyone know of a program, a script or some method to display the log file in a terminal, in a reformated way which is more readable, like some TeXeditors do. Just to add some examples of what could be nice. It would be nice if it couted how many errors, warning and bad boxes there where, maybe even the number of unknown references as well. It would probably also be nice it used a small amount of colors (when in a color terminal), to make things easier to distinguish. These things are done by TeXmaker, and it even produces a list telling you in which file the problem is, if it is a warning, a bad box an error, etc., gives you the line number and the message given by TeX. It would be really nice if something like that was possible in the terminal.


title: Beamer Headline

text: I am putting together a presentation for my Master's thesis defense with Beamer. I've tried to keep the number of sections small to consistently conserve space in the headline. However, in certain sections the number of subsections is greater and gets cutoff in the headline. Is there any way I can dynamically increase/decrease the height of the headline based on the number of subsections in the current section? By default it seems to be exclusively determined by the number of sections. I am using the beamerthemesplit package for theming. Thanks in advance.


title: Problems setting BIBINPUTS var for MikTex on Windows (.bib file won't read properly)

text: I'm trying to centralize all my bibliography into one `.bib` file that lives in:               C:\Users\My Name\Documents\GitHub\Bib      I'm using MikTex on Windows 7 with the default `pdfLaTeX+MakeIndex+BibTeX` typesetting option. Now, because TeX can't handle whitespace in dir paths, at first I tried to follow the instruction for TeXWorks here. But it was impossible to successfully modify the texify.exe arguments in `Preferences-->Typesetting-->pdfLaTeX+MakeIndex+BibTeX-->Edit`. Following @Guido, I next tried to export the correct path to the BIBINPUTS env variable. UPDATE:               $ uname && bibtex -version && env | grep BIB     MINGW32_NT-6.1     MiKTeX-BibTeX 2.9.4360 (0.99d) (MiKTeX 2.9)     Copyright (C) 1985, 1988, 2010 Oren Patashnik; all rights reserved.     BIBINPUTS=C:\Users\My Name\Documents\GitHub\Bib      OK, so this is my setup. When I run the MikTex default, I get:               This is BibTeX, Version 0.99d (MiKTeX 2.9)     The top-level auxiliary file: test.aux     The style file: plain.bst     Database file #1: biblio.bib     Warning--I didn't find a database entry for "[myref]"     (There was 1 warning)      This seems to indicate that the `.bib` file is found, but then all the references are junk for some reason. Very confusing. To confirm, I ran:               $ kpsewhich -var-value=BIBINPUTS     C:\Users\My Name\Documents\GitHub\Bib      So, the variable IS being set correctly.


title: How can I tell lstlisting to use sans-serif when escaping to math mode?

text: Title says it all, an example follows:               \lstset{         mathescape=true,         basicstyle = \sffamily     }          \begin{lstlisting}         func($x_0$)     \end{lstlisting}      Where and how can I set the math font used here to be sans-serif italic?


title: Stable vertical alignment of columns in Beamer

text: In Beamer, I often use a two-column slide layout, picture on the left and text on the right. Sometimes the same picture is used on multiple slides, with the text on the right changing. I use the Beamer `columns` environment for this purpose. My problem is that typically the pictures in the two slides do not have the same vertical alignment, causing a slightly annoying "jiggle". None of the various options for `column` seems to help, and the default (align centers) is the most reasonable anyway. Is there a way to force the picture to be vertically centered with respect to the page, irrespective of the size of the content of the other column? Here's an example - the text on the left (representing a picture) moves a little between frames.               \documentclass{beamer}     \usepackage{calc}     \begin{document}     \begin{frame}\frametitle{Test frame}         \begin{columns}             \column{.5\textwidth}               A figure             \column{.5\textwidth}               \begin{itemize}                   \item Item 1                   \item Item 2               \end{itemize}           \end{columns}     \end{frame}     \begin{frame}\frametitle{Test frame 2}         \begin{columns}             \column{.5\textwidth}               A figure             \column{.5\textwidth}               \begin{itemize}                   \item Another item 1                   \item Another item 2                   \item This list is longer                   \item Than the previous one                   \item was               \end{itemize}           \end{columns}     \end{frame}     \end{document}


title: Defining a good tab-able macro for matrices.

text: I want to declare some macros in my preamble which allow me to create 2 x 2 matrices more quickly, and in particular, I want to be able to tab through the four entry positions. I feel like this is super basic and I am missing an obvious solution. Ideally I would like the command to implement `smallmatrix` and `pmatrix`. Thanks in advance! **EDIT:** I apologize for the confusion. What I mean was something like `\newcommand{\norm}[1]{\left|\left|#1\right|\right|}` where the command takes an argument and using tab-completion in TexWorks or enter-completion in Kile will put your cursor in the argument field automatically. I hope this clarification helps!


title: More compact Algorithm template in Latex

text: All, I am using the following Algorithm template:                   \usepackage{algorithmicx}         \usepackage[ruled]{algorithm}         \usepackage{algpseudocode}          \vspace{-0.2cm}%     \alglanguage{pseudocode}     \begin{algorithm}[h]     \small     \caption{Delete item from Hash Table (with mCBF and aCBF)}     \label{Algorithm:delete_mCBF_aCBF}     \begin{algorithmic}[1]     \Procedure{$\mathbf{DeleteItem}$}{item $x$}         \LineComment{\emph{Quick check if $x$ is in mCBF}}         \For {$i = 1 \to k$}                 \If {$mCBF.C_{f_i(x)\%N}$ == 0}                     \State \textbf{return}                 \EndIf         \EndFor         \LineComment{\emph{Look up $x$ in $aCBF_1\cdot\cdot\cdot aCBF_k$}}         \For {$i = 1 \to k$}             \If {\textbf{CBF\_query}($aCBF_i$, $x$) == \textbf{TRUE}}                 \State $j \gets C_{f_i(x)\%N}$                 \For {item $y \in B_j$}                     \If {$y.key == x$}                         \Comment \emph{found}                         \State \emph{remove $y$ from hash table}                     \EndIf                 \EndFor             \EndIf         \EndFor     \EndProcedure     \Statex     \end{algorithmic}       \vspace{-0.4cm}%     \end{algorithm}      And I get this: ![enter image description here](http://i.stack.imgur.com/ojiAm.jpg) However, there are too many lines of `end if` and `end for`. Is there any more compact Algorithm template that does not contain these lines?


how to enumerate theorems using letters?


title: problems with code in package nomencl

text: Good Afternoon How can I run this code ?               latex <filename>.tex      makeindex <filename>.nlo -s nomencl.ist -o <filename>.nls      latex <filename>.tex      thanks


title: Automatic upright math when text is in italic

text: This is in a way a follow-up to this question about upright math. I would like to have upright math (essentially variable names) when I use a theorem-like environment with statement in italic. This used to be done that way in certain 19th century mathematical publications, and I would like to reproduce that look.   1. I could use \mathrm everywhere I need it in the formulas.   2. I could remove the $...$ everywhere only isolated letters are used in the statement and surround them with appropriate commands.   3. I could use the `mathastext` LaTeX package with its "subdued" option But   1. It's a pity to surcharge all the formulas for the special case of theorems   2. It's also not great to _un-TeX_ math variables in theorems as well, also bad for proofreading, cuting and pasting.   3. The use of the `mathastext` package is quite heavy in consequences because of all its interaction with mathfonts, mathversions and seems a bit of a risk for a large document using already many packages. As its author himself writes: > Without the subdued option, the mathastextification applies by default to > the whole of the document (and one may also define additional math versions > in the preamble); with the **subdued** option the mathastextification is > done only in math versions distinct from the standard and bold ones. > > The previous description is in fact a bit optimistic: mathastext was not > written initially in order to allow its action to be completely cancelled, > and achieving this would require a complete rewrite of large portions of the > code. In order to really have the displayed math (almost) as if mathastext > had not been loaded, one must at a minimum also use the option > defaultmathsizes. This does not quite suffice,[...] So, is there a simple way I could define a theorem environment where (simple) math would be upright ? * * * **EDIT** Thanks to jfbu's answers, here is a visual illustration. The case I wanted is the last one. ![Demonstration of various combinations of italic and upright for theorems](http://i.stack.imgur.com/VsJTu.png)


title: Theorem Ambient

text: it is possible to switch the list of theorems between letters and numbers?


title: Macro definition: Ignoring leading "MR" and trailing garbage begun by non-numeric / Parsing the mrnumber returned by MathSciNet

text: I have a bibtex .bst file that issues something like:               "\MR{" mrnumber "}" * *      in order to produce things like:               \MR{MR123456789 (99 \#9999)}      or:               \MR{MR123456789}      inside the .bbl file. This is then parsed by one of the many MR implementations out there to produce a little URL to the review:               \href{http://www.ams.org/mathscinet-getitem?mr=123456789}{MR123456789}      Unfortunately, it no longer works too reliably as some records I am getting now look like:               \MR{123456789 (99 \#9999)}      or:               \MR{123456789}      without the inital MR. In terms of (perl compatible) regexes I want to capture $1 from `/^(?:MR)([0-9]*)[^0-9]*.*$/`. > What sort of magic do I put in the `\def` in order to omit an optional > leading "MR" and optional trailing garbage begun by a non-numeric character?


title: How to make keyboard shortcuts for Beamer that cycle through frames

text: I'm making a presentation in Beamer, and I'm using the `\uncover` command to reveal certain parts of my frames in a certain order. I plan to show the resulting `PDF` with Adobe Acrobat during my presentation. **My problem:** I cannot figure out a way how to cycle through just the frames. That is, I would like there to be two buttons (or two combinations of buttons) on my keyboard, which, when pressed, either go to the next frame with all `\uncover`s activated, or to the previous frame, also with all `\uncover`s activated. Since my presentation has a lot of steps in each frame, I would like to skip over them if I need to refer back to them later in the presentation. The right arrow/down arrow/page down buttons all do the same thing (just go to the next page in the document, which is not necessarily the next frame), and I've tried different combinations, with Shift, Alt, Ctrl, Cmd, but nothing works in the way I would like it to. I do get some weird behavior with Tab, which skips to the beginning and then to the same (seemingly) random frame (I haven't been able to deduce what exactly Tab does).


title: Using TikZ absolute coordinates

text: I wonder is that possible to use absolute coordinates regarding all document? Please see my example               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \filldraw[red]     (30pt, 9pt) -- (130pt, 9pt);     \end{tikzpicture}          \begin{tikzpicture}     \filldraw[blue]     (3pt, 9pt) -- (130pt, 9pt);     \end{tikzpicture}          \end{document}       ![enter image description here](http://i.stack.imgur.com/gmqrr.png) Why red and blue lines have the same left x-coordinate? I would like to move the second on 27pt left!


title: Conditional typesetting / build

text: Let's say I have .tex file which is a set of problems and solutions, of which I want to make two pdf files, one which includes the solutions and one which doesn't. so I need to build the .tex file under two different modes, and specify that parts of the document be ignored under one of the modes. This is something common in programming context. e.g. in `C++` i can code               #ifdef DEBUG       // do this additional stuff ...     #endif      How can I do something equivalent in latex?