title: Associate counters -- stepping (many) counters simultaneously

text: This is (perhaps) not a real question and there maybe already an answer to my proposition/request. **The situation** There are packages that provide the number of the last page (i.e. `lastpage` or the 'newer' `pageslts` package), the 1st does not guarantee that it really holds the total number of pages, especially after a `\pagenumbering{}` command, the 2nd one provides this feature (according to documentation) `totcount` is a very useful package for total values of counters, but fails for resets or other manipulation of counters, especially for pages or `\chapters` etc., when `\appendix` or similar commands are used. I thought, it would be quite nice, that there would be another, associated counter to `page` (or `chapter` etc.), say `totalpages` (or `totalchapters`) which is automatically increased as well when `\stepcounter{page}` is issued, such that even a resetting of `page` counter has no influence on `totalpages` at all. The associated counters ideally be `\newtotcounters` from `totcount` package, but this is not mandatory. There might be coding situations, where the driver counter and the associated counters have different values, but still are stepped at the same time. There are some related questions,   * about the `\refstepcounter` resetting, e. g. Counters and their "partners"   * about _shared counters_ (although I am not sure whether this is the same feature what I am talking about) Per-page shared counter I provide a proposition to this, using lists from `etoolbox` and a redefined `\stepcounter` command, that runs through a list and steps the associated counters too.               \documentclass{book}%          \usepackage{etoolbox}%     \usepackage{totcount}%          % Some packages only for output and dummy pages     \usepackage{blindtext}%     \usepackage{forloop}%       \usepackage{xcolor}%          \newcounter{loopcounter}%          \makeatletter               \let\LaTeXStandardStepCounter\stepcounter%          % This command defines a list for      \newcommand{\DeclareAssociatedCounters}[2]{%     % #1 --> driver counter      % #2 --> CSV list of other counters, that should be stepped, if the driver counter is stepped     %       \csgdef{@#1AssociatedList}{}%   Define some global list      \forcsvlist{\listcsadd{@#1AssociatedList}}{#2}%     }%               \newcommand{\stepassociatedcounter}[1]{%  A wrapper, if the list command has to be extended later on       \LaTeXStandardStepCounter{#1}%     }%          \renewcommand{\stepcounter}[1]{%       \LaTeXStandardStepCounter{#1}%   Traditional behaviour, since this is expected!       \ifcsdef{@#1AssociatedList}{%    Check first, whether the list exists at all,          \forlistcsloop{\stepassociatedcounter}{@#1AssociatedList}%  March through the list       }{% No list -> do nothing at all       }%     }%          \makeatother                    \newcommand{\ShowNiceCounterOutput}[5]{%     \begin{center}%     \begin{tabular}{llll}%     & & & \tabularnewline      & \multicolumn{3}{c}{totcount page values} \tabularnewline     Page & \textcolor{red}{#1} & \textcolor{blue}{#2} & \textcolor{gray}{#3} \tabularnewline     \thepage & \textcolor{red}{\number\totvalue{#1}} & \textcolor{blue}{\number\totvalue{#2}} & \textcolor{gray}{\number\totvalue{#3}} \tabularnewline     & & & \tabularnewline       & \multicolumn{3}{c}{totcount section values} \tabularnewline      Section & \textcolor{red}{#4} & \textcolor{blue}{#5} \tabularnewline     \thesection & \textcolor{red}{\number\totvalue{#4}} & \textcolor{blue}{\number\totvalue{#5}} & \tabularnewline     &  & & \tabularnewline      \end{tabular}     \end{center}%     }%               \begin{document}     \regtotcounter{page} % Register a total value counter --> this will be the driver counter     \newtotcounter{totalpages}% 1st driven counter     \newtotcounter{anotherpagescounter}% 2nd driven counter           \regtotcounter{section}%     \newtotcounter{totalsections}          \DeclareAssociatedCounters{page}{totalpages,anotherpagescounter}%  Register the driver and the driven counters     \DeclareAssociatedCounters{section}{totalsections}%  Register the driver and the driven counters for sections%               \pagenumbering{Roman}%           \chapter{The first chapter}%          \section{My first section}%          % Generate dummy output     \forloop{loopcounter}{1}{\value{loopcounter} < 11}{%     \ShowNiceCounterOutput{page}{totalpages}{anotherpagescounter}{section}{totalsections}%          \blindtext%     \newpage%  10 pages!     }%          \section{My second section}%               % Generate dummy output, again ;-)          \forloop{loopcounter}{1}{\value{loopcounter} < 11}{%     \pagenumbering{arabic}%  -> pagenumber reset to zero , on purpose inside the loop     \ShowNiceCounterOutput{page}{totalpages}{anotherpagescounter}{section}{totalsections}%          \blindtext%     \newpage%  10 pages!     }%          \pagenumbering{arabic}%  -> pagenumber reset to zero      \appendix          \chapter{First Appendix chapter}%          \section{My (only) appendix section}%               % Generate dummy output, again ;-)          \forloop{loopcounter}{1}{\value{loopcounter} < 11}{%     \ShowNiceCounterOutput{page}{totalpages}{anotherpagescounter}{section}{totalsections}%          \blindtext%     \newpage%  10 pages!     }%               \end{document}      The MWE resets the page numbering many times, as well the section counting do to `\chapters` etc. The command `\DeclareAssociateCounters` provides a list of counters 'bound' to the driver counter. The screen shot shows, that even the resetting of driver counters does not affect the associated counters total values. In the example, there are 30 pages and three sections by setup, those numbers are reported by the `\totvalue` command applied to the associated counters. For sure, a manipulation of the driver or the associated counter values by `\setcounter` or `\addtocounter` will of course lead to deviating values. > Are there other approaches, packages, that handle simultaneous stepping of > counters (better) already? I don't think, that `aliascnt` package by H. Oberdiek addresses the same issue. ![enter image description here](http://i.stack.imgur.com/KcN78.jpg)


title: How to turn the hyphenation on?

text: I was looking for a clue on how to use cyrillics in an english text and vice versa. Finally I found a solution here: Cyrillic in (La)TeX The solution looks like this               \documentclass[article, 12pt]{article}           \usepackage[T1,T2A]{fontenc}     %\usepackage[cp1251]{inputenx}     \usepackage[utf8]{inputenx}     \usepackage[russian, english]{babel}     %\usepackage{cmap}      However it does not hyphenate the russian part of the text. How can I help this?


title: bigfoot footnotes overrun text area

text: In writing a rather complex critical edition, I often encounter problems with XeLaTeX typesetting bigfoot footnotes so that they overrun the text area and spill into the bottom margin. How can I eliminate or prevent this?


title: How to avoid extra pages before titlepage with scrbook and glossaries? Strange problem

text: I am encountering a very strange problem when combining the `scrbook` class and `glossaries` package. When using the `glossaries` package, two extra pages will always be added before the titelpage. This is obviously unwanted behaviour. Here is an example (cropped picture): ![Example of output](http://i.stack.imgur.com/zpttm.png) If I do not load the `glossaries` package, I only get the lower two pages. This no option of coruse, because I do want to use the package. MWE:               \documentclass{scrbook}     \usepackage{glossaries} % Toggle this on off to see the effect.          \begin{document}     \begin{titlepage}         This is a titlepage     \end{titlepage}           The next page.     \end{document}      Log file as per request:               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/W32TeX) (format=pdflatex 2012.10.19)  19 OCT 2012 10:40     entering extended mode      restricted \write18 enabled.      %&-line parsing enabled.     **TN-Tradeoff-New.tex     (./TN-Tradeoff-New.tex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge     rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi     c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis     h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis     h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h     ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma     rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,      kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,      polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s     lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian,      welsh, loaded.     (c:/texlive/2012/texmf-dist/tex/latex/koma-script/scrbook.cls     Document Class: scrbook 2012/07/29 v3.11b KOMA-Script document class (book)     (c:/texlive/2012/texmf-dist/tex/latex/koma-script/scrkbase.sty     Package: scrkbase 2012/07/29 v3.11b KOMA-Script package (KOMA-Script-dependent      basics and keyval usage)          (c:/texlive/2012/texmf-dist/tex/latex/koma-script/scrbase.sty     Package: scrbase 2012/07/29 v3.11b KOMA-Script package (KOMA-Script-independent      basics and keyval usage)          (c:/texlive/2012/texmf-dist/tex/latex/graphics/keyval.sty     Package: keyval 1999/03/16 v1.13 key=value parser (DPC)     \KV@toks@=\toks14     )     (c:/texlive/2012/texmf-dist/tex/latex/koma-script/scrlfile.sty     Package: scrlfile 2012/06/15 v3.12 KOMA-Script package (loading files)          Package scrlfile, 2012/06/15 v3.12 KOMA-Script package (loading files)                       Copyright (C) Markus Kohm          ))) (c:/texlive/2012/texmf-dist/tex/latex/koma-script/tocbasic.sty     Package: tocbasic 2012/04/04 v3.10b KOMA-Script package (handling toc-files)     )     Package tocbasic Info: omitting babel extension for `toc'     (tocbasic)             because of feature `nobabel' available     (tocbasic)             for `toc' on input line 117.     Package tocbasic Info: omitting babel extension for `lof'     (tocbasic)             because of feature `nobabel' available     (tocbasic)             for `lof' on input line 118.     Package tocbasic Info: omitting babel extension for `lot'     (tocbasic)             because of feature `nobabel' available     (tocbasic)             for `lot' on input line 119.     Class scrbook Info: File `scrsize11pt.clo' used instead of     (scrbook)           file `scrsize11.clo' to setup font sizes on input line 1368     .          (c:/texlive/2012/texmf-dist/tex/latex/koma-script/scrsize11pt.clo     File: scrsize11pt.clo 2012/07/29 v3.11b KOMA-Script font size class option (11p     t)     )     (c:/texlive/2012/texmf-dist/tex/latex/koma-script/typearea.sty     Package: typearea 2012/07/29 v3.11b KOMA-Script package (type area)          Package typearea, 2012/07/29 v3.11b KOMA-Script package (type area)                       Copyright (C) Frank Neukam, 1992-1994                       Copyright (C) Markus Kohm, 1994-          \ta@bcor=\skip41     \ta@div=\count79     \ta@hblk=\skip42     \ta@vblk=\skip43     \ta@temp=\skip44     Package typearea Info: These are the values describing the layout:     (typearea)             DIV  = 10     (typearea)             BCOR = 0.0pt     (typearea)             \paperwidth      = 597.50793pt     (typearea)              \textwidth      = 418.25555pt     (typearea)              DIV departure   = -6%     (typearea)              \evensidemargin = 47.2316pt     (typearea)              \oddsidemargin  = -12.5192pt     (typearea)             \paperheight     = 845.04694pt     (typearea)              \textheight     = 595.80026pt     (typearea)              \topmargin      = -25.16531pt     (typearea)              \headheight     = 17.0pt     (typearea)              \headsep        = 20.40001pt     (typearea)              \topskip        = 11.0pt     (typearea)              \footskip       = 47.60002pt     (typearea)              \baselineskip   = 13.6pt     (typearea)              on input line 1213.     )     \c@part=\count80     \c@chapter=\count81     \c@section=\count82     \c@subsection=\count83     \c@subsubsection=\count84     \c@paragraph=\count85     \c@subparagraph=\count86     \abovecaptionskip=\skip45     \belowcaptionskip=\skip46     \c@pti@nb@sid@b@x=\box26     \c@figure=\count87     \c@table=\count88     \bibindent=\dimen102     ) (c:/texlive/2012/texmf-dist/tex/latex/glossaries/base/glossaries.sty     Package: glossaries 2012/09/21 v3.03 (NLCT)          (c:/texlive/2012/texmf-dist/tex/latex/base/ifthen.sty     Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)     )     (c:/texlive/2012/texmf-dist/tex/latex/xkeyval/xkeyval.sty     Package: xkeyval 2012/10/14 v2.6b package option processing (HA)          (c:/texlive/2012/texmf-dist/tex/generic/xkeyval/xkeyval.tex     \XKV@toks=\toks15     \XKV@tempa@toks=\toks16     \XKV@depth=\count89     File: xkeyval.tex 2012/10/14 v2.6b key=value parser (HA)     ))     (c:/texlive/2012/texmf-dist/tex/latex/glossaries/base/mfirstuc.sty     Package: mfirstuc 2012/05/21 v1.06 (NLCT)          (c:/texlive/2012/texmf-dist/tex/latex/etoolbox/etoolbox.sty     Package: etoolbox 2011/01/03 v2.1 e-TeX tools for LaTeX          (c:/texlive/2012/texmf-dist/tex/latex/etex-pkg/etex.sty     Package: etex 1998/03/26 v2.0 eTeX basic definition package (PEB)     \et@xins=\count90     )     \etb@tempcnta=\count91     )     \@glsmfirst=\toks17     \@glsmrest=\toks18     )     (c:/texlive/2012/texmf-dist/tex/latex/xfor/xfor.sty     Package: xfor 2009/02/05 v1.05 (NLCT)     )     (c:/texlive/2012/texmf-dist/tex/latex/amsmath/amsgen.sty     File: amsgen.sty 1999/11/30 v2.0     \@emptytoks=\toks19     \ex@=\dimen103     )     \gls@level=\count92     \@gls@tmpb=\toks20     \gls@tmplen=\skip47     \glswrite=\write3     \glskeylisttok=\toks21     \glslabeltok=\toks22     \glsshorttok=\toks23     \glslongtok=\toks24          (c:/texlive/2012/texmf-dist/tex/latex/glossaries/styles/glossary-hypernav.sty     Package: glossary-hypernav 2007/07/04 v1.01 (NLCT)     )     (c:/texlive/2012/texmf-dist/tex/latex/glossaries/styles/glossary-list.sty     Package: glossary-list 2012/09/21 v3.03 (NLCT)     \glslistdottedwidth=\skip48     )     (c:/texlive/2012/texmf-dist/tex/latex/glossaries/styles/glossary-long.sty     Package: glossary-long 2012/09/21 v3.03 (NLCT)          (c:/texlive/2012/texmf-dist/tex/latex/tools/longtable.sty     Package: longtable 2004/02/01 v4.11 Multi-page Table package (DPC)     \LTleft=\skip49     \LTright=\skip50     \LTpre=\skip51     \LTpost=\skip52     \LTchunksize=\count93     \LTcapwidth=\dimen104     \LT@head=\box27     \LT@firsthead=\box28     \LT@foot=\box29     \LT@lastfoot=\box30     \LT@cols=\count94     \LT@rows=\count95     \c@LT@tables=\count96     \c@LT@chunks=\count97     \LT@p@ftn=\toks25     )     Class scrbook Info: longtable captions redefined on input line 43.     \glsdescwidth=\skip53     \glspagelistwidth=\skip54     )     (c:/texlive/2012/texmf-dist/tex/latex/glossaries/styles/glossary-super.sty     Package: glossary-super 2012/09/21 v3.03 (NLCT)          (c:/texlive/2012/texmf-dist/tex/latex/supertabular/supertabular.sty     Package: supertabular 2004/02/20 v4.1e the supertabular environment     \c@tracingst=\count98     \ST@wd=\dimen105     \ST@rightskip=\skip55     \ST@leftskip=\skip56     \ST@parfillskip=\skip57     \ST@pageleft=\dimen106     \ST@headht=\dimen107     \ST@tailht=\dimen108     \ST@pagesofar=\dimen109     \ST@pboxht=\dimen110     \ST@lineht=\dimen111     \ST@stretchht=\dimen112     \ST@prevht=\dimen113     \ST@toadd=\dimen114     \ST@dimen=\dimen115     \ST@pbox=\box31     ))     (c:/texlive/2012/texmf-dist/tex/latex/glossaries/styles/glossary-tree.sty     Package: glossary-tree 2012/09/21 v3.03 (NLCT)     \glstreeindent=\skip58     ))     (./TN-Tradeoff-New.aux)     \openout1 = `TN-Tradeoff-New.aux'.          LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.      [1          {c:/texlive/2012/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] [2               ] [3]          Package glossaries Warning: \makeglossaries hasn't been used,     the glossaries will not be updated.               Package glossaries Warning: No \printglossary or \printglossaries found.     This document will not have a glossary.          [4] (./TN-Tradeoff-New.aux) )      Here is how much of TeX's memory you used:      3539 strings out of 493488      53020 string characters out of 3144747      149240 words of memory out of 3000000      6852 multiletter control sequences out of 15000+200000      4293 words of font info for 16 fonts, out of 3000000 for 9000      957 hyphenation exceptions out of 8191      45i,7n,39p,1466b,170s stack positions out of 5000i,500n,10000p,200000b,50000s     <c:/texlive/2012/texmf-dist/fonts/type1/public/ams     fonts/cm/cmr10.pfb>     Output written on TN-Tradeoff-New.pdf (4 pages, 13734 bytes).     PDF statistics:      21 PDF objects out of 1000 (max. 8388607)      13 compressed objects within 1 object stream      0 named destinations out of 1000 (max. 500000)      1 words of extra memory for PDF output out of 10000 (max. 10000000)


title: Dashify in lingproc

text: I'm using lingproc.bst (http://www.lel.ed.ac.uk/~pgc/archive/1998/lingproc.bst) and lingproc.sty (http://www.lel.ed.ac.uk/~pgc/archive/temp/latex/sty/lingproc.sty). At the bottom of the latter, it says you can turn off the dashify and ampersand instead of 'and' functions by turning the comments on. I can only get the latter to work, however, and really want to turn off the dashify feature. When I try, it just completely removes the first instance of a dashified bibliography entry and then continues to dashify the second. Any ideas? Here's a link to my files (including a `.zip` of all of them): https://drive.google.com/folderview?id=0B3Si8J4jDIwaVEF0NFNnRnVnekE&usp=sharing Here's the skeleton of my file (I've taken out the body).               \documentclass[12pt, a4paper, twoside]{article}     \usepackage{lingproc}     \usepackage{filecontents}     %     \begin{filecontents*}{language_policy_in_belarus.bib}         @misc{beldig11a,        author = {{Belarus Digest}},        title = {Are the {B}elarusian and {R}ussian languages very similar?},        volume = {2013},        number = {25 December 2013},        year = {2011},        type = {Web Page},        note = {Available at: http://belarusdigest.com/myth/are-belarusian-and-russian-languages-very-similar-371 [Accessed 25 December 2013]}     }          @misc{beldig11b,        author = {{Belarus Digest}},        title = {Is the language issue important in {B}elarus?},        volume = {2013},        number = {25 December 2013},        year = {2011},        type = {Web Page},        note = {Available at: http://belarusdigest.com/myth/language-issue-important-belarus-2092 [Accessed 25 December 2013]}     }     \end{filecontents*}     %     \begin{document}     \nocite{*}     \bibliographystyle{lingproc}     \bibliography{language_policy_in_belarus}          \end{document}


title: How can I add color AND a node label to a scatter plot?

text: I'd like to produce a scatter plot from a data file. The data file could look like this:                x       y       color   myvalue      0.5     0.2     1       test      0.2     0.1     2       uniform      I'd like to add the string data in column `myvalue` to the nodes, but still have the option to colour the marks. I tried two things recommended in the manual:               \begin{tikzpicture}       \begin{axis}[% scatter/use mapped color={draw=black,fill=mapped color},                   enlargelimits=0.2]         \addplot[scatter, mark=*,only marks,                  scatter src=explicit symbolic,                 nodes near coords,]           table [x=x, y=y, meta=myvalue] {tab.tbl};             \end{axis}     \end{tikzpicture}      This allows me to put the labels to the marker in the plot. ![first attempt](http://i.stack.imgur.com/gD68B.png) But I don't know how to add colours. My second attempt was to use the colour for the point meta data (manual page 88), but then I couldn't add text (it would only accept numbers in the code below):               \begin{tikzpicture}       \begin{axis}[enlargelimits=0.2]          \addplot[scatter, mark=*,only marks,                   scatter src=explicit symbolic,                % we use ’point meta’ as color data...                point meta=\thisrow{color},                % ... therefore, we can’t use it as argument for nodes near coords ..                nodes near coords*={\myvalue},                % ... which requires to define a visualization dependency:                visualization depends on={\thisrow{myvalue} \as \myvalue},                ]                table [x=x, y=y, meta=myvalue] {tab.tbl};       \end{axis}     \end{tikzpicture}      How can I have both?


title: vim-latex 'cite' command not showing citation options in quickfix window

text: The cite completion in vim-latex does not work on my machine (Ubuntu 14.04) for a specific document. The document is a doctoral dissertation and involves multiple subdocuments that are imported into the higher-level parts of the document via subimport. The idea from [1] to create a minimal reproducible example and test completion thereon was successful, however, only for the simple example. How should I go forward get the cite autocompletion to work for the complex document? Here is one other thing I have noticed: On the minimal example mentioned above, pressing F9 opened the quickfix window. In contrast, for the complex document, pressing F9 in a               \cite{}<++>      has no consequences at all. Maybe this information is useful in tracking down the problem? Any help or hints are much appreciated! [1] How to get vim-latex's \cite completion to work?


title: How to use OGDF library with TikZ 3.0?

text: I try to compile (via `lualatex`) the following MWE without success.               \documentclass[tikz]{standalone}     \usetikzlibrary{graphdrawing}     \usegdlibrary{ogdf}     \begin{document}     \begin{tikzpicture}       \graph [SugiyamaLayout] { a -- {b,c,d} -- e -- a };     \end{tikzpicture}     \end{document}      I got this message:               ! LuaTeX error ...tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua:32: m     odule 'pgf_gd_ogdf_c_ogdf_script' not found:         no field package.preload['pgf_gd_ogdf_c_ogdf_script']         [kpse lua searcher] file not found: 'pgf_gd_ogdf_c_ogdf_script'         [kpse C searcher] file not found: 'pgf_gd_ogdf_c_ogdf_script'         [oberdiek.luatex.kpse_module_loader]-eroux Search failed     stack traceback:         [C]: in function 'require'         ...tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua:32: in main chunk         [C]: in function 'require'         [string "\directlua "]:1: in function 'lookup'         [string "\directlua "]:1: in function 'pgf_lookup_and_require'         [string "\directlua "]:1: in main chunk.     <argument> ...drawing library '\pgf@temp ' not found}}') end}                                                        \fi      l.3 \usegdlibrary{ogdf}      So, how to use OGDF library with TikZ 3.0?


title: Creating diagram using tikz

text: I am trying to create following diagram in latex- ![enter image description here](http://i.stack.imgur.com/wJeOs.png) Below is my latex code-               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{shapes.geometric, arrows}          \begin{document}     \tikzset{       box/.style    = {draw, rectangle, minimum height = 2.5em, minimum width = 2.5em},       circl/.style  = {draw, circle,minimum size = 8mm},       input/.style  = {coordinate},       output/.style = {coordinate},        to/.style    = {->,>=stealth',shorten >=1pt,semithick,font=\sffamily\footnotesize}     }          \begin{tikzpicture}[auto, node distance=2cm]     \node (in1) [input] {};     \node (cs) [box, right of=in1] {$C$};     \node (crc1) [circl, right of=cs]{};     \node (gs) [box, right of=crc1] {$G$};     \node (hs) [box, right of=gs] {$H$};     \node (ctl) [box, below of=hs] {Limiter};     \node (crc2) [circl, right of=hs]{};     \node (ze) [input, above of=crc2] {};     \node (ke) [box, right of=crc2] {$K$};     \node (fs) [output, right of=ke] {};          \draw [to] (in1) -- node {$f$}(cs);     \draw [to] (cs) -- (crc1);     \draw [to] (crc1) --(gs);     \draw [to] (gs) -- (hs);     \draw [to] (hs) -- node {$I_{max}$}(ctl);     \draw [to] (ctl) --node {$\theta$}(hs);     \draw [to] (hs) -- node {$z$}(crc2);     \draw [to] (ze) -- node {$C$}(crc2);     \draw [to] (crc2) --(ke);     \draw [to] (ke) -- node {$f(s)$}(fs);          \end{tikzpicture}          \end{document}      I am not able to draw the bottom line and two opposite directional arrow from two boxes, which is marked red in the above image. Below is what latex has generated- ![enter image description here](http://i.stack.imgur.com/uJcmE.png)


title: How to fix TikZ node's height with \heightof?

text: I can use `\widthof{text}` to fix a `minimum width` of a TikZ's node. I would like to use `\heightof{text}` to fix its `minimum height` but it doesn't work. I just want to fill my nodes with one word but I want to draw some empty nodes with same height as filled ones. But I would like not to use a trial and error system to fix it's size. Next code shows what I want to do. I've tried uncommenting `\usepackage{calc}` but nothing changed. `.log` file doesn't show any error about knowing or not command `\heightof`. A possible solution would be to use `\vphantom{text}` inside empty nodes, but I would like to know what's wrong with this one.               \documentclass[tikz,border=1mm]{standalone}     %\usepackage{calc}     \usetikzlibrary{positioning}          \tikzset{     box/.style={draw,%         minimum width=5mm,%         minimum height=\heightof{Cap},%         align=center},     }          \begin{document}     \begin{tikzpicture}[font=\small\sffamily]          \node[box] (h0) {Cap};     \foreach \i [remember=\i as \lastx (initially 0)] in {1,...,6}          \node[box,right= 0mm of h\lastx] (h\i) {};     \node[box,right=0mm of h\lastx] {cua};          \end{tikzpicture}     \end{document}      This is the result. You can see that `minimum height` is not fixed with `\heightof`. Why? ![enter image description here](http://i.stack.imgur.com/Xg6Yl.png)


title: Parsing a .bcf file to biber in the preamble

text: I have a `biber.conf` file with regular expressions for matching and replacing journal names for their abbreviations (following Paul Stanley's advice).   Right now the file is located in my home dir as `.biber.conf` and so it is always loaded.   I'd like to be able to control the loading of this file in cases where I don't need to use it. According to the biber manual this should be easy to achieve by renaming the file to say `JourAbs.bcf` and parsing it to biber like this: `biber <options> JourAbs.bcf`. What I can't figure out is how to code this in the preamble. I tried: `\usepackage[style=ISMEJ, natbib=true, backend=biber JourAbs.bcf]{biblatex}`, but that doesn't seem to work. I get: `! Package biblatex Error: Option 'backend=biberjourab invalid.` I know there's also the option of using `\DeclareSourcemap` but that would require generating a whole new file for some 50+ journals with an entirely different syntax. I'd resort to that only if there are some clear advantages to using this method. (I'm using: kubuntu 12.04; lyx 2.0.4; biblatex 2.2; biber 1.2)


title: Making thesis front

text: I am using the following code for my thesis front:               \begin{titlepage}     \begin{center}     \begin{figure}     \centering     \includegraphics[width=0.5\textwidth]{LOGO_UNIVERSITY.jpeg}     \end{figure}     \vspace{-10cm}     \textsc{\LARGE \\ Institute for Interesting People}\\[0.5cm]     \vspace{.5cm}     \textsc{\Large Master Thesis}\\[1.5cm]     \HRule \\[0.4cm] % Horizontal line     {\huge \bfseries Very Smart Stuff}\\[0.4cm]     \HRule \\[1.5cm]     \vspace{1cm}      \begin{minipage}{0.4\textwidth}     \begin{flushleft} \large     \emph{Author:}\\     X     \end{flushleft}     \end{minipage}     \begin{minipage}{0.4\textwidth}     \begin{flushright} \large     \emph{Supervisors:} \\     Y \\     Z \\     \end{flushright}     \end{minipage}\\[3cm]      {\large \textit{A thesis submitted in partial fulfilment of the requirements\\ for the degree of Master of Science\\}}     \vspace{2cm}     {\large August 2014} \vfill     \end{center}     \end{titlepage}      However, I would like to decrease the distance between the logo and the text "Institute for Interesting People". Using the command \vspace{-10cm} or e.g. \vspace{10cm} does not change anything. What's going on here and how can I change it? Note: the command \HRule is defined via               \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}.


title: How can I get fontspec to use non-system font variants intelligently?

text: I want to include fonts in a `/include/fonts/` directory alongside my `foo.tex` doc, so I don't have to install the fonts to the system. I can successfully use this to get that working:               \setmainfont[       Path=include/fonts/,       UprightFont=*,       BoldFont=*-Italic,       ItalicFont=*-Italic,       BoldItalicFont=*-Italic     ]{OFLGoudyStM}      However it's a pain to have to specify all of the variations manually, when `fontspec` has built in smarts to do this when using a font name (instead of font file name). Is there any way to get the best of both worlds: to be able to keep the fonts in a directory relative to the `.tex` file, but for fontspec to automatically figure out all the variations for itself? So really, in a perfect world I just want to be able to use the following, and for fontspec to find all the variants for itself (note I use the font name here, not file name):               \setmainfont[       Path=include/fonts/     ]{OFL Sorts Mill Goudy}      Here's a full example, FWIW:               \documentclass{article}     \usepackage{fontspec}     \begin{document}     % This works only if the font file is named OFLGoudyStM.otf     % and in the current path. Contrary to docs, TEXINPUTS is not searched.     % Also, the different variants like italic can no longer be automatically     % inferred and need to be explicitly specified     % \setmainfont[     %   ExternalLocation,     % ]{OFLGoudyStM}     % This will find the system font     \setmainfont{OFL Sorts Mill Goudy}          \newfontfamily\headingFont[       Path=include/fonts/,       Extension=.ttf,       UprightFont=*-Lig,       BoldFont=*-Lig,       ItalicFont=*-LigIta,       BoldItalicFont=*-LigIta     ]{Lato}          \LARGE{This is some \textit{text.}}     \end{document}


title: Error when using the tikz package

text: When compiling a simple MWE like:               \documentclass[letterpaper]{article}     \usepackage{tikz}     \begin{document}     test     \end{document}      I obtain an error:               ! Undefined control sequence.     l.1102 \pgfdeclarearrow                            {name=|<->|,   means={>[sep=0pt].|}}     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.               ! LaTeX Error: Missing \begin{document}.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.1102 \pgfdeclarearrow{n                              ame=|<->|,   means={>[sep=0pt].|}}     You're in trouble here.  Try typing  <return>  to proceed.     If that doesn't work, type  X <return>  to quit.      I just recently updated MiKTeX 2.9. This is what the pdf file contains: ![enter image description here](http://i.stack.imgur.com/pPnPA.png) Here is the list of files:                *File List*      article.cls    2007/10/19 v1.4h Standard LaTeX document class       size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)         tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)          pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)       pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)     everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)       pgfrcs.code.tex      pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)     graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)       keyval.sty    1999/03/16 v1.13 key=value parser (DPC)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2007/01/18 v1.5 graphics configuration of teTeX/TeXLive       pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)      ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)       pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)       pgfsys.code.tex     pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)     pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)       xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)        color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive      pgfcore.code.tex     pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)     pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)       pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)      pgfkeys.sty          pgfkeys.code.tex      pgfmath.sty          pgfmath.code.tex       pgffor.code.tex         tikz.code.tex     supp-pdf.mkii      ***********      * * * ## EDIT Completely uninstalling MikTeX 2.9 and downloading and installing MiKTeX 2.9 rev. 2.9.5105 solved the issue. This post may be closed as too localized if needed. The probably could have been in the installation of the package `pgf` since running `\listfiles` produces the same output as above?


title: Can I refer to cells in a tabular?

text: I have a `tabular` table, and in my text I want to refer to cells in the table. One way is to superscript the cell content:               \begin{table}     \begin{center}     \begin{tabular}{lrr}\hline     This & $99^a$ & $1.23$\\     That & $22$ & $3.45$\\     The Other & $69^b$ & $9.99$\\     \hline     \end{tabular}     \end{center}      \end{table}          I enjoyed `This' (a) and `The Other` (b).      but then if I rearrange the rows of the table the letters are out of alphabetical order. `\label` just uses the table number as reference so that doesn't work. Maybe there's a better stylistic device to do this...


title: how to reduce the space between subfigures with \subfigure

text: I want to put figures in rows, but the vertical space between sub-images is too large, how can I reduce the space between them? Note: The template uses `\usepackage{subfigure}`, so it cannot use `\usepackage{subcaption}` The code is there:               \begin{figure}     \centering             \subfigure[]{\label{fig:test1}\includegraphics[width=100mm]{test1.jpg}}          \subfigure[]{\label{fig:test2}\includegraphics[width=100mm]{test2.jpg}}          \caption{The space is too large}          \end{figure}      ![enter image description here](http://i.stack.imgur.com/23c9m.jpg) Thanks in advance!


title: Typesetting and Engine settings that can help improve compile time?

text: Are there any specific options that I can enable or disable to improve compiling time ? I don't understand most of what is included in the settings so I can't decide on my own (new LaTeX user here). For example, I recently learned that adding `% !TEX TS-program = pdflatexmk` at the start of the document automatically compiles twice to display the PDF. So maybe there are other quirks that I don't know of that can assist compiling speed instead ?. These are the settings I have in TexShop Editor : ![enter image description here](http://i.stack.imgur.com/fratj.png) ![enter image description here](http://i.stack.imgur.com/vDSRC.png) ![enter image description here](http://i.stack.imgur.com/SF1Eq.png) And the documents starts with :               % !TEX TS-program = pdflatexmk     \documentclass[12pt,a4paper]{report}     \usepackage[lmargin=3.81cm,tmargin=2.54cm,rmargin=2.54cm,bmargin=2.52cm]{geometry}     \linespread{1.5}


title: cannot scale curly brace

text: In follow up to my previous question, I wanted to align two arrows and put curly braces around them. The following works fine               \documentclass{article}     \usepackage[margin=2cm,centering]{geometry}     \usepackage{amsmath}     \usepackage{mathtools}     \newcommand*{\myrightarrow}[1]{\xrightarrow{\mathmakebox[5cm]{#1}}}     \newcommand*{\myleftarrow}[1]{\xleftarrow{\mathmakebox[5cm]{#1}}}          \begin{document}          \noindent\fbox{\begin{minipage}{\dimexpr6.5in-2\fboxsep-2\fboxrule\relax}     {\bfseries Alice \hfill Bob}     \begin{align*}     &\myleftarrow{a}     \\     &\myrightarrow{}     \\     \{&\begin{array}{c}     \myleftarrow{q} \\     \myrightarrow{k}     \end{array}      \}     \\     &\myleftarrow{c}     \\     \end{align*}     \end{minipage}}          \end{document}      The issue is that I need to make the curly braces fit around the array. From what I read, replacing `\\{` with `\left\\{` and `\\}` with `\right\\}` should work. But it gives me errors when I do this:               \documentclass{article}     \usepackage[margin=2cm,centering]{geometry}     \usepackage{amsmath}     \usepackage{mathtools}     \newcommand*{\myrightarrow}[1]{\xrightarrow{\mathmakebox[5cm]{#1}}}     \newcommand*{\myleftarrow}[1]{\xleftarrow{\mathmakebox[5cm]{#1}}}               \begin{document}          \noindent\fbox{\begin{minipage}{\dimexpr6.5in-2\fboxsep-2\fboxrule\relax}     {\bfseries Alice \hfill Bob}     \begin{align*}     &\myleftarrow{a}     \\     &\myrightarrow{}     \\     \left\{&\begin{array}{c}     \myleftarrow{q} \\     \myrightarrow{k}     \end{array}      \right\}     \\     &\myleftarrow{c}     \\     \end{align*}     \end{minipage}}     \end{document}      Any suggestions? Thanks!


title: Are there hexagon brackets in LaTeX?

text: I mean something like this:               /   \     | x |     \   /      I looked up many related resources but failed.


title: How to know the line width of enumeration in two column document prior to entering the enumeration?

text: ![enter image description here](http://i.stack.imgur.com/40UMX.gif) I want to populate the following lengths just **once prior to entering the enumeration** (or perhaps prior to entering the `document` environment) to free me from worrying whether or not the initialization has been invoked.               \newlength\EWD     \newlength\HWD     \newlength\HHWD      The initialization routine is given as follows,               \def\Init{%         \settowidth{\EWD}{${}={}$}%         \setlength{\HWD}{0.5\dimexpr\linewidth-\EWD\relax}%         \setlength{\HHWD}{0.5\HWD}}      And the following is my real scenario. ![enter image description here](http://i.stack.imgur.com/3Tirb.png)               \documentclass[twocolumn]{article}     \usepackage[a4paper,margin=1cm]{geometry}     \usepackage{mathtools}     \newlength\EWD     \newlength\HWD     \newlength\HHWD          \def\Init{%         \settowidth{\EWD}{${}={}$}%         \setlength{\HWD}{0.5\dimexpr\linewidth-\EWD\relax}%         \setlength{\HHWD}{0.5\HWD}}          \def\TopLHS#1{\mathrlap{#1}\rule{\HWD}{0pt}}     \def\MiddleLHS#1{\rule{\HHWD}{0pt}\mathclap{#1}\rule{\HHWD}{0pt}}     \def\BottomLHS#1{\rule{\HWD}{0pt}\mathllap{#1}}          \begin{document}          \begin{enumerate}     \item\Init     $\!     \begin{aligned}[t]       \TopLHS{\framebox[3cm]{Top LHS}}\\     \MiddleLHS{\framebox[3cm]{Middle LHS}}\\     \BottomLHS{\framebox[3cm]{Bottom LHS}}         &= \begin{multlined}[t][\HWD]                 \framebox[3cm]{Top RHS 1}\\                 \framebox[3cm]{Middle RHS 1}\\                 \framebox[3cm]{Bottom RHS 1}             \end{multlined}\\         &= \begin{multlined}[t][\HWD]                 \framebox[3cm]{Top RHS 2}\\                 \framebox[3cm]{Middle RHS 2}\\                 \framebox[3cm]{Bottom RHS 2}             \end{multlined}     \end{aligned}     $     \end{enumerate}     \end{document}      Any suggestion is welcome!


title: Aligning problem

text: Is there a way to align the telephone numbers and email in this example, and how should one go about it? I've not used LaTeX in a really really long time. ![enter image description here](http://i.stack.imgur.com/QWx4W.jpg)               \documentclass{article}     \usepackage[a4paper, left=2.5cm, top=2cm, bottom=2cm]{geometry}          % need this for Croatian letters     \usepackage[cp1250]{inputenc}     \usepackage[T1]{fontenc}          \pagestyle{empty}       % neither header nor footer is shown          \usepackage{sectsty}     \sectionfont{\rmfamily\bfseries\scshape}     \subsectionfont{\rmfamily\mdseries\itshape\large}          \usepackage[bitstream-charter]{mathdesign}     \usepackage[scaled=0.85]{beramono}          % customizing lists     \renewenvironment{itemize}{         \begin{list}{}{             \setlength{\leftmargin}{1.5em}             \setlength{\itemsep}{0.25em}             \setlength{\parskip}{0pt}             \setlength{\parsep}{0.25em}                       }                               }                          {         \end{list}                              }     % stops paragraphs (section titles) being indented     \setlength\parindent{0em}          \begin{document}     {\huge JOHN DOE}          \vspace{0.5cm}     \begin{minipage}[t]{0.5\textwidth}     Long street 50\\12345 Town\\Country\\     \end{minipage}     \begin{minipage}[t]{0.5\textwidth}     Mobile: +123 45 678 9012\\Phone: +123 4 5678 901\\Email: \texttt{some@one.com}     \end{minipage}          \end{document}


title: Indentation of shorthands list

text: A subdivision of my of my references is a `shorthands` list. In order to get it to look like the other subdivision, a regular `authoryear-ibid` bibliography, I've added this to the preamble:               \DeclareBibliographyDriver{shorthands}{%       \usedriver         {\DeclareNameAlias{sortname}{last-first}}         {\thefield{entrytype}}        \finentry}      That works. Now the problem is that the bibliography is formatted with hanging indentation. I would like that for the `shorthands` list as well. I've tried with:               \DeclareBibliographyDriver{shorthands}{%      \indent        \usedriver         {\DeclareNameAlias{sortname}{last-first}}         {\thefield{entrytype}}        \finentry}      ... but instead of indenting the `shorthands` is makes weird dot between the blocks. How do I indent the `shorthands`? **Edit:** This is what my output looks like now: ![enter image description here](http://i.stack.imgur.com/uIPwD.png) I like how it is except I would like hanging indentation in the above `shorthands` list in the same style as below.


title: Convert Latex to MathJax-HTML

text: Is there any tool that can convert Latex documents to HTML documents, so that all math is presented with MathJax? (Obviously, it is fairly easy to hack together a quick Perl script that is able to do a crude conversion, but I am interested in a bit more robust solutions — at least it should get all cross-references right automatically.)


title: redefining \index

text: I use several indices, e.g. 'names', 'subject' doing this with entries of the form `\index{names}{Columbus}`. These indices are created with the `multind` package. Unfortunately some of the tex files have index commands of the form `\index{Columbus}`. I do not want to have to go through all of these files and replace `\index{Columbus}` with `\index{names}{Columbus}`. Can I redefine `\index` to point to the correct index file?, i.e. from `myfile.ind` to `names.ind`


title: making a box in beamer -- center aligning the title

text: I want to center align the word prediction in the following. I would appreciate any help in doing so.               \documentclass[professionalfont, fleqn]{beamer}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes,positioning,fit,shapes.misc}          \begin{document}          \begin{frame}          \centering      \only<1>{%      \begin{tikzpicture}[      box/.style = {draw,rectangle,minimum size=1.0cm,text     width=1cm,align=center}      ]     \matrix (conmat) [row sep=0cm,column sep=0cm,ampersand     replacement=\&] {     \node (tpos) [box,label=left:\( \mathbf{p'} \),label=above:\(     \mathbf{p} \),] {};       \& \node (fneg) [box,label=above:\textbf{n},] {$\checkmark$}; \\      \node (fpos) [box,label=left:\( \mathbf{n'} \),] {$\checkmark$};       \& \node (tneg) [box] {$\checkmark$}; \\       };          \node [left=.05cm of conmat,text width=1.5cm,align=center]     {\textbf{actual \\ value}};     \node [above=.05cm of conmat] {\textbf{prediction}};     \end{tikzpicture}%     }          \end{frame}     \end{document}


title: pstricks-add: arrow on arcs

text: In `pstricks-add`, the arrow tip `-v` does not rotate if it is put on an arc, while other arrow heads do it.               \psarc{->}(0,0){1}{0}{30}     \psarc{-v}(0,0){1}{0}{30}      Note that along segments, the tip is rotated: `\psline{-v}(0,0)(1,1)`. Is there a way to let it rotate on arcs?


title: Vertical Text \pstPlanePut

text: I'm trying do write some vertical text, with the basis line parallel to the z-axis, in the xz-plane... Here is what I got, and I want the vertical text to be parallel to the z-axis. ![MME](http://i.stack.imgur.com/cRpkp.png) Is it possible with an equivalent of the option `planecorr=xyrot`, but for other planes (like the xz plane in my case) ? Or just a trick to do it, it's fine... Here is the code I used :               \begin{pspicture}(-5,-3)(2,3)        \pstThreeDCoor[IIIDticks,xMin=-1,yMin=-1,zMin=-1,zMax=2]        \pstPlanePut[plane=xz,planecorr=normal](4,0,0){\Large\green\textbf{Vertical Text}}     \end{pspicture}      Thanks a lot


title: Omit overlapping xtick labels

text: So right now I have something like this: ![enter image description here](http://i.stack.imgur.com/ZSYLC.png) As you can see, the xticks on the second (smaller) plot are a complete mess. Is it possible to just show 3 values (the first, midpoint and last ones)? Secondly, is it possible to place something like a `~` or `//` break symbol at the beginning of the smaller plot, as it just shows the last 10 values of the bigger plot?


title: Blank header in odd pages, toptesi class

text: I'm using the documentclass `toptesi` by Claudio Beccari for writing my master thesis.   This class automatically produce a header, with chapter title on the even pages and section title on the odd pages.   My problem is that when I have to write the appendix I only have a title for the chapter and not for the section (no section needed), and so the result is an empty header. Is it a typo or is it right?   If is not right, what solution can I use to fix it? Like printing the same title (or none) on both pages. Here is an example of the code:               \documentclass[ 12pt, twoside]{toptesi}     \usepackage{lipsum}     \usepackage[toc,page]{appendix}     \begin{document}     \english     \indici     \chapter{First chapter}     \lipsum[1-13]     \begin{appendices}     \chapter{First appendix}     \lipsum[1-12]     \end{appendices}     \end{document}


title: Alignment to left

text: I have three equal:               \begin{equation}     \begin{multlined}     P_{N_1}(t) = e^{10 \cdot (t-1)} \\ P_{N_2}(t) = (0.9 + 0.1 \cdot t)^{100} \\ P_{N_3}(t) = \frac{\frac{5}{6}}{1-\frac{1}{6}t}     \end{multlined}     \end{equation}      and I would like have it alignment to left. Is it possible? Because the last equation is moved to right, I don't know why...


title: Small note (i.e. footnotesize) below figure

text: I want to include a small note (i.e. footnotesize) below a figure. How do I do that? If I use caption, the note has a caption size and interferes with my caption.


title: psgraph: using \psdot changes origin?

text: I have the following minimal example of a document:               \documentclass{article}     \usepackage{pstricks-add}     \begin{document}     \begin{psgraph}[labels=none,ticks=none]{->}(0,0)(-8,-8)(8,8){8cm}{8cm}     \pnode(0,0){P}          \psdot{P}          \psline(1,0)(1,-1)     \psline(-1,0)(-1,-1)          \end{psgraph}     \end{document}      If I compile this on my computer then what i get is: two lines, one starting from (-0.5, 0) to (-0.5, -1) and the second one goes from (1.5, 0) to (1.5, -1) so the origin was moved by 0.5 somehow. The interesting this is: the following document compiles correctly:               \documentclass{article}     \usepackage{pstricks-add}     \begin{document}     \begin{psgraph}[labels=none,ticks=none]{->}(0,0)(-8,-8)(8,8){8cm}{8cm}     \pnode(0,0){P}          \psline(1,0)(1,-1)     \psline(-1,0)(-1,-1)          \psdot{P}          \end{psgraph}     \end{document}      So the command `\psdot{P}` causes the origin to move... Can someone explain that to me?


title: High precision \includegraphics for LaTeX

text: `\includegraphics` produces boxes whose witdth and height are about 0.5pt off:               \usepackage{graphicx}     ...     \setbox0\hbox{\includegraphics[width=\textwidth,height=\textheight]{mypic}}     \showthe\textheight     \showthe\ht0     \showthe\textwidth     \showthe\wd0      Is there a version of `\includegraphics` which can resize with higher precision? I'm using `pdflatex`. FYI There is no rounding error if only `width=` or `height=` is specified, but if both are specified, then both are rounded incorrectly.


title: \xleftrightarrows command in TikZ with arrows matching the LaTeX font

text: There is the command `\xrightarrow` that inserts an arrow that extends with the text you put above and/or under it.   There is also the command `\rightleftarrows` (notice the "s" at the end) that display two arrows, one under the other, although they are _not_ extensible and (if I'm not mistaken) require additionally the `mathtools` package. (The above is of course also valid for the "dual" leftarrows) As far as I know, there isn't a command `\xrightarrows` that extends with the text above/under it and creates and arrow like `\rightleftarrows` (I googled it and couldn't find any straightforward solution). Maybe it is contained in some obscure package - but if the package isn't already in my distribution I would prefer not haveing to install it (because if I want to compile my document somewhere else, problems might crop up!). Therefore: How can one program this `\xrightarrows` command in TikZ such that   * the arrow tips look exactly like the LaTeX arrow tips (and if I change the LaTeX font the arrow tips from the TikZ drawing also change accordingly)   * the arrows themselves look exactly like the ones `\xrightarrows` produces, when the parameters for the text under or above are empty (i.e. not text is present) or there is so little text that the arrows don't have to extend.


title: References at the end of beamer slides

text: I am preparing presentation with `beamer` and using `pdflatex` and `bibtex`. How can I put references at the end of a frame? What if I use allowframebreaks ? I do not want all the references put together in one big frame at the end of my presentation, rather I want each reference as footnote on the frame where it has been used. Note: I am using a custom bibliography style and author-year citation style. MWE               \documentclass[xcolor=dvipsnames, 10pt]{beamer}     \usepackage[T1]{fontenc}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{amsmath,bm,mathtools}          \usepackage{natbib}     \usepackage{bibentry}     \bibliographystyle{apalike}     \usepackage{chngcntr}               \counterwithin*{footnote}{page}     \newcommand\footcite[1]{\footnote{\bibentry{#1}}\label{\thepage:#1}}     \newcommand\secondcite[1]{\textsuperscript{\ref{\thepage:#1}}}                    \setbeamertemplate{navigation symbols}{}     \definecolor{byublue}{RGB}{0 34 85}%added     \definecolor{mydarkgray}{RGB}{64 64 64}%added          \usecolortheme[named=MidnightBlue]{structure}%added     \usetheme{Montpellier}%Montpellier originally     \useoutertheme{tree}%added     \useinnertheme{circles}%added     \beamersetuncovermixins{\opaqueness<1>{25}}{\opaqueness<2->{15}}                         \usefonttheme{professionalfonts} % using non standard fonts for beamer     \usefonttheme{serif} % default family is serif               \begin{document}     \nobibliography{bibliography_phd_journal_key}          \section{Introduction}                \begin{frame}     \begin{center}     Some text \footcite{titanath2008p165326}     another test \secondcite{titanath2008p165326}     \end{center}               \begin{tabular}{|c|c|}     \hline      Header\footcite{titanath2008p165326} & header \\      \hline      1 & 2 \\      \hline      \end{tabular}      \end{frame}                \bibliographystyle{mybibstyle}               \end{document}      I am using two external .bib files. One is the main .bib file and the other one is for journal name abbreviation.


title: Centering numbers in table

text: I would like to generate table which looks approximately (not necessarily) like ![enter image description here](http://i.stack.imgur.com/MbRtx.png) If you have any suggestion for this sort of data representation, don't hesitate to tell. So far I have come up with               \documentclass[12pt]{book}          \usepackage{booktabs}     \usepackage{caption}     \usepackage{siunitx}                  \begin{document}          \begin{table}[h!]       \centering       \captionsetup       {       singlelinecheck = off,       justification   = raggedright,       labelfont       = bf,       }       \begin{minipage}[b]{1.0\linewidth}             \caption{ABC}%         \begin{tabular}{@{}l SSSSSSSSS }           \toprule           & \multicolumn{2}{l}{2010} & \multicolumn{2}{l}{2011} & \multicolumn{2}{l}{2012} & \multicolumn{2}{l}{2013} \\           \cmidrule{2-9}         Name    & {bil}~\$ & \% & {bil}~\$ & \% & {bil}~\$ & \%     & {bil}~\$ & \%   \\          \midrule         {Aaaaaaaaaaaa}  &  20 456 & 1.2 &    20150 & 90.5 & 20150 & 90.5 & 20150 & 90.5    \\         {Bbbbbbb}       & 5 256 & 21.3  \\           {Ccccccc}       & 58 & 0.5 \\         {Dddd}          & 125 000\\         {Eeeeeeeeeee}   & \\         {FFFFFF}        & \\         {ggggggg}       & \\         \bottomrule         $\sum$      & \\         \bottomrule         \end{tabular}              \medskip \noindent Reference: John Johnson         \label{1111}       \end{minipage}     \end{table}          \end{document}      which unfortunately results in two problems:   1. it doesn't center the data entries, nor the columns' names "year", "bil $" and "%" right   2. table is too wide. Should I decrease font size in the table or is there anything better to do? EDIT: Another code               \documentclass[12pt]{book}          \usepackage{booktabs}     \usepackage{caption}     \usepackage{siunitx}                  \begin{document}          \begin{tabular}{ccccccccccccccc}          \toprule     \multicolumn{1}{l}{} &     \multicolumn{2}{c}{2010}    &     \multicolumn{2}{c}{2011}    &     \multicolumn{2}{c}{2012}    &     \multicolumn{2}{c}{2013}    \\      \cmidrule(lr){2-3}     \cmidrule(lr){4-5}     \cmidrule(lr){6-7}     \cmidrule(lr){8-9}           &     \multicolumn{1}{c}{bil~\$} &     \multicolumn{1}{c}{\%}     &     \multicolumn{1}{c}{bil~\$} &     \multicolumn{1}{c}{\%}     &     \multicolumn{1}{c}{bil~\$} &     \multicolumn{1}{c}{\%}     &     \multicolumn{1}{c}{bil~\$} &     \multicolumn{1}{c}{\%}      \\     \midrule                    {Aaaaaaaaaaaa}  &  20 456 & 1.2  &  20 456 & 1.2 &  20 456 & 1.2 &  20 456 & 1.2   \\         {Bbbbbbb}       & 5 256 & 21.3 & 5 256 & 21.3& 5 256 & 21.3& 5 256 & 21.3  \\           {Ccccccc}       & 58 & 0.5 & 58 & 0.5& 58 & 0.5& 58 & 0.5 \\         {Dddd}          & 125 000 \\         {Eeeeeeeeeee}   & \\         {FFFFFF}        & \\         {ggggggg}       & \\     \bottomrule     {$\sum$} \\     \bottomrule     \end{tabular}          \end{document}     enter code here


title: Superscript outside math mode

text: What is the easiest way to superscript text outside of math mode? For example, let's say I want to write `the $n^{th}$ element`, but without the math mode's automatic italicization of the `th`. And what if I still want the `n` to be in math mode, but the `th` outside?


title: Type superscript in figure captions?

text: How can I have superscript in Figure captions ??               \begin{figure}[htbp]     \centering         \includegraphics[width=0.80\textwidth]{Chapters/CResults/figures/3AxisFlexure.png}     \caption{Thorlabs Microblock$^{TM}$ flexure 3-axis translation stage}     \label{fig:3AxisFlexure}     \end{figure}      I get errors but I want to know if my approach is right first.


title: German localisation of biblatex-chem-angew

text: I'm using `biblatex-chem-angew` with a MikTeX system like this:               \usepackage[backend=bibtex,style=chem-angew]{biblatex}      I want to use a German localisation, because > [1] H. G. O. Becker, R. Beckert, Organikum, Wiley-VCH, Weinheim, 23rd ed., > 2009. is not good in a German text ("23. Auflage" would be better). Is this possible? Furthermore, how can I cite like this: Import thesis. [1-3] or another.[1,3]? Is this already included?


title: Justifying a multiline formula

text: I tried to find the answer to my incoming question on this site, but I didn't succed. Is there a way to justify formulas without using `\tabular`? I mean, I have a multiline equation splitted with `\split` in several lines. I would like to align all of these line both on left and right, just like a justified text. Since there are a lot of summands, I could do this with `\tabular`, arranging all the summands in a table like manner. The problem is that the equation is too large and I wish there is a way to do it automatically.


title: Problem getting MyriadPro package to work

text: I just managed to install MinionPro and MyriadPro by following the FontPro installation manual. Everything seems fine, only the pdf output is not in MyriadPro with the following MWE.               \documentclass{article}          \usepackage{MyriadPro}          \begin{document}     \section{Myriad Pro}     This is a test document for the MyriadPro font. Make sure that all the symbols below compiled correctly.      \\     \\     $\beta = (X'X)^{-1} X'Y$     \\     \\     $Y = X\beta + \epsilon$          \end{document}      In the log is no error except               Underfull \hbox (badness 10000) in paragraph      It also appears as if it really uses the MyriadPro font because of those lines               Using the configuration file MyriadPro.cfg     (/usr/local/texlive/2012/texmf/tex/latex/MyriadPro/MyriadPro.cfg)     Package textcomp Info: Setting MyriadPro-LF sub-encoding to TS1/1 on input    line 757.      Had anyone had a similar problem?


title: Hanging indent of citations in footnotes using koma-script

text: I'm writing a thesis using Lyx, the Koma-script bookclass and jurabib. I'm trying to format the footnotes/citations so that the citations are not indented in The trival example below (edit to remove deadspace) shows a standard footnote 1 and a footnote containing a citation using bibtex. ![Exampledifference ](http://i.stack.imgur.com/qNlyM.png) Can people give me any suggestions/tips and hints of how I could remove the dead space between the number and start of the bibtex reference? A solution from here results in an indentation for both tips of footnote               \usepackage[hang]{footmisc}     \footnotemargin1.8em      Thanks for any help/suggestions


title: setting z-limit on surfplot in PGFplots

text: I am making a 3D surfplot in pgfplots, and my situation is described by the following MWE:               \documentclass{article}     \usepackage[ansinew]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{amsmath, amsthm, amssymb}     \usepackage{pgfplots}     \usepgfplotslibrary{colormaps}     \pgfplotsset{width=12.5cm,height=8.75cm, grid style=dashed, tick label style={font=\Large}, label style={font=\Large}}          \usepgfplotslibrary{external}     \tikzexternalize[shell escape=-enable-write18] %needed for the MiKTeX compiler          \begin{document}     \begin{tikzpicture}     \begin{axis}[grid=both,  xlabel=\Large{$x$},ylabel=\Large{$y$}, zlabel=\Large{$z$}, view/v=55]     \addplot3[surf] coordinates{(0,0,0) (1,0,0) (2,0,0) (3,0,0) (0,1,0) (1,1,0.6) (2,1,0.7) (3,1,0.5) (0,2,0) (1,2,0.7) (2,2,0.8) (3,2,0.5) };     \end{axis}          \end{tikzpicture}          \end{document}      I wish to manually decide what the limits on the z-axis should be, regardless of what the coordinate-values are. E.g. I want to force them to be {0, 0.1}. Is there a way to accomplish this in pgfplots? Best, Niles.


title: Quickly extracting individual pages from a document

text: Let's say I have created a 100-page book with the `book` document class. What is the quickest way to extract, say, pages 3, 67-70, and 80 from the book into _six separate PDF files_? Is there any standard tool/script out there that does this very quickly? Manually doing this through a UI is rather tedious.


title: A tool like pdfcrop2 that only *reduces margins from original* --- as opposed to cropping and then allowing the addition of extra margins

text: I have a tool called `pdfcrop2` that I've had for a while now. It's a perl script that fully crops PDF files to the actual content (removing all surrounding whitespace), and then allowing the addition of extra margins if one wants them. However, does there exist a tool similar to this one that does _not_ perform the initial crop, but rather limits itself to reducing the margins by a specified amount from the left, right, top and bottom? This will be useful in cases where all of my one-page PDF files are all A4-sized but are not exactly of the same format. (Examples would be the initial pages of chapters vs. all other pages in a document with a book format. In these cases, it would be nice to get the same “predictable” effect on all pages.)


title: Biblatex style short name

text: I'm looking for a biblatex style which will create bibliography style according to scheme: The first letter of the name, surname, title of the book, place of publication, year of publication. I found only: BibLaTeX - replace recurrent author by short name or Idem/Eadem in citations


title: Understanding conditional page background in ConTeXt

text: How does the following code work? Source: discussion on the mailing list               \setuplayout       [header=0cm,        topspace=1.625cm,        footer=0cm,        width=fit,        height=fit]          \startMPinclusions       numeric MyTitlePageDone[] ;     \stopMPinclusions          \startuseMPgraphic{background:normal}       StartPage ;       fill         (topboundary Page --cycle) enlarged(0,5mm) shifted (0,-5mm)         withcolor \MPcolor{color:background:\namedstructureuservariable{chapter}{mycolor}} ;       StopPage ;     \stopuseMPgraphic          \defineoverlay       [background:normal]       [\useMPgraphic{background:normal}]          \startuseMPgraphic{background:title}       if unknown MyTitlePageDone.\namedstructureuservariable{chapter}{mycolor} :         StartPage ;         fill ((topboundary Page --cycle) enlarged(0,5mm))           shifted (0,-20mm)           withcolor \MPcolor{color:title:\namedstructureuservariable{chapter}{mycolor}} ;         StopPage ;         MyTitlePageDone.\namedstructureuservariable{chapter}{mycolor} := 1 ;       fi ;     \stopuseMPgraphic          \defineoverlay       [background:title]       [\useMPgraphic{background:title}]          \setupbackgrounds       [page]       [background={background:normal,background:title}]          \definecolor [color:title:one]      [r=0.86,g=0.88,b=0.76]     \definecolor [color:background:one] [.9(color:title:one)]          \definecolor [color:title:two]      [g=0.86,r=0.88,b=0.76]     \definecolor [color:background:two] [.9(color:title:two)]          \starttext          \startchapter[title=One][mycolor=one]       \input tufte \page       \input knuth     \stopchapter          \startchapter[title=Two][mycolor=two]       \input tufte \page       \input knuth     \stopchapter          \stoptext      Why are the backgrounds being applied conditionally? Why isn't the title page background applied to normal pages? In the code there doesn't seem to be any conditionals or checks to check the page type. The title background also gets applied to cover pages implemented via \startstandardmakeup, but gets a black color instead since the user variable isn't defined. Some help in understanding this code is much appreciated.


title: Problem with Gummi: Compilation Program is Missing

text: I have recently upgraded my system from TexLive2010 to TexLive2012. I have correctly set my Environment Variables and everything works well from the Command Line. My OS is OpenSuse 11.4. My Problem is:   * If I invoke the LaTex Editor Gummi from Terminal, everything works fine.   * But if I invoke it through Righ-Clicking a File (Open with Gummi) or by right-clicking on Gummi icon, I get: "Compilation Program is Missing". I have already made sure that rubber, xetex & latexmk are installed (as suggested by the below mentioned link): http://dev.midnightcoding.org/projects/gummi/wiki/Troubleshooting#compilation- program-is-missing Can anybody give me some pointers to resolve this problem. Thanks.


title: solution to overflowing equation?

text: What is the best solution for an equation which is overflowing? I have the structure:               \begin{align}     long here & long here 2     \end{align}      and this causes the long here 2 to overflow. I want to put it in the line below, shifted almost all the way to the left. One way to do it might be:               \begin{align}     \lefteqn{long here} & \\     & long here 2     \end{align}      but I thought there might be a way that wouldn't require lefteqn. is it so? (by the way, is lefteqn a no-no like eqnarray?)


title: wrong indentation after wrapfigure

text: > **Possible Duplicate:**   >  How to wrap text around a figure?   >  Textwidth wrong after wrapfigure I have the following problem: I used wrapfigure to include a floating picture. But the problem is, that the following formula is also affected by the textwidth of the wrapfigure, so the graphic goes not over a full line, but only the half textwidth, which is set in the wrapfigure! Heres my code               \documentclass{book}     \usepackage{wrapfigure}     \usepackage{shadethm}     \usepackage{mdframed}          \newtheoremstyle{mystyle}       {\topsep}{\topsep}{}{}%       {\bfseries}{:}{.5em}{}%          \theoremstyle{mystyle}          \newmdtheoremenv[hidealllines=true,backgroundcolor=red,skipabove=\topsep,     skipbelow=\topsep]{example}{Example}          \newmdtheoremenv[hidealllines=true,     backgroundcolor=blue,skipabove=\topsep,     skipbelow=\topsep]{formula}{Formula}               \begin{document}          \subsection{Subsection with wrapfigure}     text text text text wich goes around the picture text text text text text text text      \begin{wrapfigure}{l}{0.5\textwidth}       \begin{center}         \includegraphics[scale=1]{picure.png}%width=0.48\textwidth       \end{center}       \caption{Caption}     \label{fig:zins}     \end{wrapfigure}          \noindent text text text          \begin{formel}[formula name] \label{geom}     $\\ \x + y +h+f+d+s+c+x+c+s+e+w+q+d+s+d+e=2323232323 +231231231 = 44$\\     or\\     $\bar{x}_{Geom}=\sqrt[n]{\frac{end}{begin}}$     \end{formel}     text text text text text text text text text text     \end{document}      So as I said, the formula looks wrong, it is just written over half the space, like the textwidth set in wrapfigure, when I add a               \begin{wrapfigure}{l}{0cm}\end{wrapfigure}      before the formula, then the formula is correct, but the following indentation of text and items is wrong? **OK, the solution: add \par before, thanks!**


title: How to wrap text around a figure?

text: How to wrap text around a figure in LaTeX like this?               Lorem ipsum dolor sit amet, consectetur adipiscing elit.     Aenean quis mi ut elit interdum imperdiet quis non ante.     Sed imperdiet, sapien quis    +------------------------+     viverra rhoncus, tellus dui   |                        |     dictum nisl, at porta purus   |                        |     ipsum ac turpis. Fusce auctor |         FIGURE         |     ullamcorper adipiscing. Nunc  |          HERE          |     non quam ac orci egestas con- |                        |     sequat ut eget quam. Cras     |                        |     blandit condimentum ornare.   +------------------------+     Curabitur aliquam, nulla sit amet iaculis tristique, mi     nulla auctor magna, sit amet imperdiet ante arcu a libero.


title: bibliographystyle "te" not working with this LaTeX template

text: I'm trying to use the `te` bibliography style (available here) with this LaTeX template and it just doesn't work. I've placed the bst file under `<MikTeX folder>\local\bibtex\bst\te` and every folder under the template's directory structure. Nothing seems to be working.


title: TikZ vertical alignment of circled text

text: I have an issue with the vertical alignment of circled text with TikZ. This basic code causes the problem I have.                 \texttt{some text here =}       \tikz[remember picture] \node[draw,ellipse,fill=none,thick] (code) {\texttt{other text}};      The problem is that the displayed text 'some text here=' is not vertically aligned with the displayed text 'other text'. I read about anchors in the documentation and they looked promising, but I've been unable to get them to work for me so far. Perhaps I could do this by making the left hand side a node, but I don't think that should be necessary? Any suggestions would be much appreciated!


title: Listings refuses to highlight identifiers such as 'intent–filter'. Why?

text: I have some xml code, which I want to look fine in my latexdocument. I am doing it this way:               \documentclass[12pt]{scrartcl}     \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[none]{hyphenat}     \usepackage{helvet}     \usepackage{url}     \usepackage{graphicx}     \usepackage[onehalfspacing]{setspace}     \renewcommand{\familydefault}{\sfdefault}     \DeclareGraphicsExtensions{.png}     \usepackage{textcomp}     \usepackage{listings}     \usepackage{color}                    \lstset{     basicstyle=\fontsize{12}{12},     columns=fullflexible,     showstringspaces=false,     breaklines=true,     showstringspaces=false,     identifierstyle=\ttfamily,     stringstyle =\color[rgb]{0,0,1}\ttfamily,     commentstyle=\color[rgb]{0.133,0.545,0.133}\ttfamily,     keywordstyle=\color[RGB]{49,0,171}\ttfamily,     emph= {action,intent–filter,category, receiver, application, activity, manifest},     emphstyle={\color[RGB]{63,127,127}},alsoletter={-},     }                    \begin{document}          \tableofcontents     \newpage           \begin{lstlisting} [language=xml]      <intent-filter>            </intent-filter>     \end{lstlisting}         \end{document} I am using it for java and xml. It looks fine, but "intent-filter" remains black, the other keywords (I have removed it here) becomes green. Using "intentfilter" works, but it have to be "intent-filter". How can I do that?


title: Average number of characters in one line

text: How can I calculate the average number of the characters per line of my document?


title: Text and picture top-aligned, where text is left-aligned and picture is right aligned

text: Using the answers from this sight, I tried to accomplish top-aligned text and image where text would have to start from the left side of the page, and picture would be at the right side. However, using any method of stretching the table to the page width resulted in top alignment not working (tabularx or tabular* equally). How can I keep the picture right-aligned and text top-aligned with picture at the same time?               \documentclass[border=10pt]{standalone}     \usepackage{pst-barcode}     \usepackage[crop=off]{auto-pst-pdf}          \begin{document}          \begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}} r}     \vspace{0pt}Title Text &     \vspace{0pt}     \begin{pspicture}(0.7in,0.7in)         \psbarcode{http://www.ctan.org}{}{qrcode}     \end{pspicture}     \end{tabular*}          \end{document}      It did top-align text and picture when tabular was defined as follows:               \begin{tabular}{p{0.8\textwidth} p{0.8in}}     \vspace{0pt}Title Text &     \vspace{0pt}     \begin{pspicture}(0.7in,0.7in)         \psbarcode{http://www.ctan.org}{}{qrcode}     \end{pspicture}     \end{tabular}


title: Spellchecking a large latex project

text: I am currently writing a quite large report with many different .tex files. I have found some utilities (`aspell`, `ispell` ...) that are able to deal with a single file. Is there some command that will spellcheck all files in my project?


title: How to fix "no lowerable accent" error in XeLaTeX?

text: I'm writing a linguistic paper and have to use several IPA characters with certain accents (e.g. œ̞, ʉ̟). I thought I might use XeLaTeX. I have tried using the tipa-package, but I only get an error saying "no lowerable accent in position 27" and no accent is shown. Here is part of the code:               \documentclass[a4paper,12pt]{book}          \usepackage[margin=2.2cm]{geometry}     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage[tone]{tipa}     \usepackage{vowel}          \usepackage{fontspec}          \begin{document}     \renewcommand\textipa[1]{{\fontfamily{cmr}\tipaencoding #1}}          \textipa{\|`\oe}, \textipa{\|+0}          \end{document}      In this code I have explicitly changed the font for the IPA characters to Computer Modern. Otherwise, no IPA character would be shown. This gives ![](http://i.stack.imgur.com/qcgiS.png) Which obviously isn't as it is supposed to be (no accents). I have also tried to use a font supporting IPA characters, but that font doesn't look good together with the font of XeLaTeX. How can I fix this issue?


title: Is something the first item on a page?

text: How can i identify logically, whether something is the first item on a page, i.e. there is nothing above it (apart from header)? Consider the following, is is basically a feature environment, which puts a rule above some content, to separate it from anything prior. **Acceptable Output:**               \documentclass{article}     \usepackage{lipsum}          \newenvironment{feature}[1]{         \vspace*{\baselineskip}         \hrule         \vspace*{\baselineskip}         \textbf{#1}\\     }{         \vspace*{\baselineskip}     }          \begin{document}              %THIS CASE SHOULD HAVE RULE         \lipsum[1]         \begin{feature}{This is the title}         \lipsum[1]         \end{feature}          \end{document}      ![Acceptable](http://i.stack.imgur.com/6347Y.png) ## However... If the environment is the only item on a page, or at the top of the page, the rule is not only superfluous, but actually, completely undesirable. How can I switch the rule on / off depending on whether there is content directly above. **Undesirable Output:**               \begin{document}         %THIS CASE SHOULD NOT         \newpage         \begin{feature}{This is the title}         \lipsum[1]         \end{feature}     \end{document}      ![OnNewPage](http://i.stack.imgur.com/EBDxy.png)


title: Highlight / color parts of text

text: LaTex newbie here. Currently using vim with solarized color scheme to edit .tex documents. When writing I often jump around to different parts of the document, leaving gaps behind to work on later. In Microsoft Word I would highlight text in yellow to remind myself what needed to be finished. How can I do something similar with my .tex documents? I have seen this question but the answers focus on adding notes or highlighting to the final pdf product. I want something to stand out in the actual tex document I'm working on. I tried putting comments after the lines, but these didn't stand out very well (almost same color as standard text). This may simply be a color scheme problem. What is a typical/recommended way to do this?


title: Print margins of a document

text: > **Possible Duplicate:**   >  margins of book class Suppose I have a tex file with uses some document class and some packages which might control the margins of the document hidden to me as user (perhaps the document class sets the margins using the `geometry` package or via `typearea` or in an other way, let us assume, that we don't know). Is there any way to print the actual page margins (top, bottom, left, right) of the document? It would be enough to get this as compiler output.


title: How to get BibTeX to work with Org mode LaTeX export?

text: I am trying to get Emacs (24.3.1), Org-mode (8.0.3, from ELPA) and BibTeX (from TeX Live 2012) to work together. I have followed the instructions under the **Bibliography** section in http://orgmode.org/worg/org-tutorials/org- latex-export.html but after exporting the document to LaTeX, compiling to PDF, and opening the result (with key sequence `C-c C-e l o` in the latest Org mode) I see a question mark instead of a citation (i.e., **[?]** ) which means that the reference was not resolved by LaTeX. In fact, checking the `Org PDF LaTeX Output` buffer, I see the following warning:               LaTeX Warning: Citation `Tappert77' on page 3 undefined on input line 43.          No file org-bib-test.bbl.     [3] (.//org-bib-test.aux)           LaTeX Warning: There were undefined references.      It looked to me that probably Org-mode was looking for a `.bib` file with the same base name as the `.org` file but renaming the `.bib` file and updating the `\bibliography` line did not solve the problem. Here are two minimal `.org` and `.bib` files that together can be used to reproduce the behavior described above: **`org-bib-test.org`**               * Tests     ** Test1 slide        - This is test1 \cite{Tappert77}.          \bibliographystyle{plain}     \bibliography{org-bib-test-refs}      The following, using `#+LATEX_HEADER`, gives the same result: **`org-bib-test.org`**               #+LATEX_HEADER: \bibliographystyle{plain}     #+LATEX_HEADER: \bibliography{org-bib-test-refs}          * Tests     ** Test1 slide        - This is test1 \cite{Tappert77}.      **`org-bib-test-refs.bib`**               @incollection {Tappert77,     AUTHOR = {Tappert, Fred D.},     TITLE = {The parabolic approximation method},     BOOKTITLE = {Wave propagation and underwater acoustics ({W}orkshop,                   {M}ystic, {C}onn., 1974)},     PAGES = {224--287. Lecture Notes in Phys., Vol. 70},     PUBLISHER = {Springer},     ADDRESS = {Berlin},     YEAR = {1977},     MRCLASS = {76.41 (86.41)},     }      Currently I am using the following **ugly** hack to get the references resolved: I generate the `.bbl` file from the `.bib` file (using a minimal `.tex` file) and then I `\include` the resulting `.bbl` file directly in my `.org` file. This is rather cumbersome and of course requires that I regenerate the `.bbl` file every time I make a change to the `.bib` file. Although this process can be automated in Emacs by writing a lisp function to encapsulate these actions, I'd rather solve the problem than streamline a hack. **Edit** I have checked the `.tex` file generated by Org mode. It _does_ have the following necessary lines exported in it:               \bibliographystyle{plain}     \bibliography{org-bib-test-refs}


title: Comparing packages which facilitate typesetting exercises and solutions: exercise vs. answers vs. probsoln

text: Could someone with experience in using these exercise typesetting packages please offer a quick compare and contrast of these packages to help me choose? Packages under consideration are:   1. `exercise`   2. `answers`   3. `probsoln` Having read briefly the documentation, they all seem to do the same thing generally, so could you please focus on the differences? Some differences will not be obvious until I've learnt and used all the different packages but I want to better appreciate the differences now, a priori.


title: How to write directly French characters in Emacs and print them in LaTeX?

text: I am editing LaTeX with Emacs. I would like to write in French. At the moment I have to write special French characters for instance like this: `\'e` prints `é`. If I write directly `é` in Emacs, the character will not be shown in the resulting pdf. It seems that it is possible to write special characters directly in Emacs, which will be shown directly in the pdf. Does anyone know me how to this set up?


title: Expl variable assignments not behaving as I expect

text: I don't get what I'm doing wrong here. Neither of the commented lines work as the uncommented version does.               \begin{filecontents}{silly.tex}         This is just a test.     \end{filecontents}     \documentclass{article}     \usepackage{xparse}     \NewDocumentCommand{\setversion}{ m }         {                 Hello I'm version \texttt{#1}.\par                 }     \ExplSyntaxOn     \cs_generate_variant:Nn \seq_set_split:Nnn {NVV}     \DeclareExpandableDocumentCommand{\makeversions}{ somm }     %\NewDocumentCommand{\makeversions}{ somm }         {             \bool_set:Nn \l_ae_makeversions_star_bool       { #1 }             \tl_set:Nn   \l_ae_makeversions_delimiter_tl    { #2 }             \tl_set:Nn   \l_ae_makeversions_versionlist_tl  { #3 }             \tl_set:Nn   \l_ae_makeversions_inputfile_tl    { #4 }             \exp_args:NV \IfNoValueTF \l_ae_makeversions_delimiter_tl                          {                             TRUE:I have no value:\par                             \tl_set:Nn \l_ae_makeversions_delimiter_tl { ; }                         }                         {                             FALSE:\l_ae_makeversions_delimiter_tl \par                         }                         Delimiter ~ is ~ \l_ae_makeversions_delimiter_tl \par     %% In the following, I want the first commented out line of code to work.     %% Only one of the next FOUR lines should be left uncommented.     %        \seq_set_split:NVV \l_ae_version_seq  \l_ae_makeversions_delimiter_tl  \l_ae_makeversions_versionlist_tl      %        \seq_set_split:NnV \l_ae_version_seq { ; } \l_ae_makeversions_versionlist_tl      %        \seq_set_split:Nxn \l_ae_version_seq { \tl_use:N \l_ae_makeversions_delimiter_tl  }{ #3 }             \seq_set_split:Nnn \l_ae_version_seq { ;  }{ #3 }             \seq_map_inline:Nn \l_ae_version_seq {                                                       \setversion{##1}                                                      \input{  \l_ae_makeversions_inputfile_tl }                                                      \IfBooleanT { \l_ae_makeversions_star_bool }                                                                   { \par\clearpage }                                                   }         }          \ExplSyntaxOff     \pagestyle{empty}     \begin{document}          \makeversions*{a;b;c;d}{silly}          \end{document}      I've made various attempts at generating variants for `\seq_set_split:N**` but to no avail. # Addendum I'm very aware that I could have defined `\makeversions` as follows:               \NewDocumentCommand{\makeversions}{ s O{;} mm }         {             \tl_set:Nn   \l_ae_makeversions_versionlist  { #3 }             \tl_set:Nn   \l_ae_makeversions_input_file   { #4 }             \seq_set_split:Nnn \l_ae_version_seq { ;  }{ #3 }             \seq_map_inline:Nn \l_ae_version_seq {                                                       \setversion{##1}                                                      \input{#4}                                                      \IfBooleanT { #1 }                                                                   { \par\clearpage }                                                   }         }      But I would like to remind readers that this is a MWE. My original code is much more complicated than the above example suggests. The first MWE merely illustrates how I managed to boil my original problem down to something short and concise for this website. In my original `\makeversions` calls another function which is context sensitive. This new function, let's call is `\ae_makeversion_by_context` makes various decisions on how various parameters should be handled and then farms out the jobs to several other macros which then make further decisions. For example, there is no universal default value for the _delimiter_. As I change context, what constitutes the default also changes (this might sound wacky on the surface, but it makes sense within the type of documents my group needs to create). But, I also do want to allow the user to override this _context dependent default value_. Based upon the responses I've been getting, I'm beginning to think that, with regards to the _delimiter_ , I should probably just create a boolean variable. That is, I could write something like               \bool_new:N \g_ae_makeversions_delimiter_override_bool     \NewDocumentCommand{\makeversions}{ somm }         {             \IfNoValueTF {#2}                         {                             \bool_gset_true:N \g_ae_makeversions_delimiter_override_bool                         }                         {                             \bool_gset_false:N \g_ae_makeversions_delimiter_override_bool                         }             ... < other code> ....             }      And that would probably be a better design decision. So my original question boiled down to the following two questions:   * How do I get `\IfNoValue` to return the correct value if passed a token and not the raw input variable `#2`?   * How do I get `seq_set_split` to properly interpret tokens in its 2nd and 3rd arguments? I kept these questions together because they seemed, at first blush, to revolve around the same issue. @ScottH very nicely answered both of these questions. I suspected there was still something deeper going on with `\IfNoValue`. Hence I posted a new question to address that matter. I hope this better explains some of my _apparent_ poor design decisions.


title: How to make "outline" frame in Beamer?

text: In a presentation, people show regularly a "outline" frame containing the table of contents where some sections are grey (have been presented) and others are highlighted (will be presented right now). Could anyone tell me how to realize it? Do we have to copy the same frame (table of contents) every time and change the color of some titles? Thank you very much


title: Misaligned paragraph (after subsubsection)

text: I'm new to LaTeX & LyX. I find that in LyX, when I have a "subsubsection" then "standard" block of text, it looks like ![enter image description here](http://i.stack.imgur.com/rTmDV.png) where the immediate line after the subsubsection is aligned with the header while following paragraphs are not. Why is that? How do I align them?


title: What is the proper way to create a horizontal table?

text: I want to have a horizontal table, like this: ![Horizontal table](http://i.stack.imgur.com/gKgYE.png) However, when using the usual method of creating a table, it quickly becomes a pain having to pre-define the number of columns (especially since I want to generate them using the data tool):               \begin{tabular}{ | l | l | l | l | l | l | l | l | l | l | l | l | l | l | }      I also want it to be multi-line. Is there a better way?


title: Installing dictionary for TeXnicCenter 2.0

text: It seems that the way how to install dictionaries has changed. Doesn´t work to install `.dic` and `.aff` dictionaries. I´m using TeXnicCenter 2.0 with MiKTeX 2.9 and Windows 8.


title: A taller version of \parallel

text: I need a taller version of `\parallel` in order to typeset a norm correctly. I have tried variations of things like               \Bigg{\parallel}      and               \left{\parallel} \right{\parallel}      but receive the error "Missing delimiter (. inserted)" with the file not compiling. Any suggestions would be appreciated...


title: Where to copy algpseudocode.sty package

text: I am totally new to LaTeX. Let me tell my problem. I have installed TexStudio, after that I took thesis template and editing it using textstudio. If I want to write pseudo code in my template I have downloaded algpseudocode.sty and copied to template, where min.tex is located. But I am getting the "can be used only in preamble error" in editor. Do I need to copy this file somewhere in textstudio or anywhere else? I am using windows7. I am testing with the following code               \usepackage{algpseudocode}          \begin{algorithm}     \caption{Euclid’s algorithm}\label{euclid}     \begin{algorithmic}[1]     \Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}     \State $r\gets a\bmod b$     \While{$r\not=0$}\Comment{We have the answer if r is 0}     \State $a\gets b$     \State $b\gets r$     \State $r\gets a\bmod b$     \EndWhile\label{euclidendwhile}     \State \textbf{return} $b$\Comment{The gcd is b}     \EndProcedure     \end{algorithmic}     \end{algorithm}      The Error:               Can be used only in preamble. \usepackage     Environment algorithm undefined. \begin{algorithm}     Package caption Error: \caption outside float \caption     Environment algorithmic undefined. \begin{algorithmic}     Undefined control sequence \Procedure     Undefined control sequence \Procedure{Euclid}{$a,b$}\Comment     Undefined control sequence \State     Undefined control sequence \While     Undefined control sequence \While{$r\not=0$}\Comment     Undefined control sequence \State     Undefined control sequence \State     Undefined control sequence \State     Undefined control sequence \EndWhile     Undefined control sequence \State     Undefined control sequence \State \textbf{return} $b$\Comment     Undefined control sequence \EndProcedure     \begin{document} ended by \end{algorithmic}. \end{algorithmic}     \begin{document} ended by \end{algorithm}. \end{algorithm}     Underfull \hbox (badness 10000) in paragraph     Difference (3) between bookmark levels is greater (hyperref) than one, level fixed


title: Plot complex self defined function with TikZ

text: I'm trying to plot a function with TikZ that behaves different for several cases. Therefore I use an \ifthenelse in the \def statement. Using such a definition a plot with TikZ does not work. However, simple functions without \ifthenelse are no problem. I have a minimal example to show this problem:               \documentclass[10pt]{article}     \usepackage{ifthen}     \usepackage{tikz}          \def\simpleFunction(#1,#2){#1*#1}     \def\complexFunction(#1,#2){\ifthenelse{\equal{#1}{0}}{0}{4}}          \begin{document}     \section{foo}          % definition of function correct and working     \complexFunction(0.005,0.00000003)     \complexFunction(0,0.00000003)          % simple function plot works     \begin{tikzpicture}     \draw [red, thick, x=0.0085cm, y=1cm]     plot [domain=-200:200, samples=100, smooth] (\x,{\simpleFunction(\x/200,0.00000003)});     \end{tikzpicture}          % complex function plot does not work     \begin{tikzpicture}     \draw [red, thick, x=0.0085cm, y=1cm]     plot [domain=-200:200, samples=100, smooth] (\x,{\complexFunction(\x/200,0.00000003)});     \end{tikzpicture}          \end{document}      I assume that the problem are the several brackets within my function definition. Does anyone know a solution for my problem?


title: stop bold in algorithmx

text: I am using the algorithmx package: http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/algorithmicx/algorithmicx.pdf The keywords such as "if", "while", "then", "else" "end if" etc. etc. all appear in bold font. I am looking for an easy "switch" to turn off the bold font "feature" of this package. Any help would be appreciated.


title: LaTeX minimal installation in GNU/Linux distributions (e.g., in Ubuntu and using apt-get)

text: I am running LaTeX on a Linux VM. I am running a Xubuntu and have very little space to use. I managed to install some of the latex packages without documentation. Currently I am missing `fullpage` amongst others. I am looking to install `texlive-latex-extra` but it is asking for 200 MB of space. I am good with using latex, so I can live without the documentation. Is there a way to do this in `apt-get` ? RRS


title: scrreprt - add levels below \subparagraph

text: I have to write my thesis in (German) law and we usually use a very nested headline system. I use `scrreprt` and have these levels:   * (part)   * chapter   * section   * subssection   * subsubsection   * paragraph   * subparagraph But I need at least 3 more levels. They don't have to be in the ToC but it would be nice. I searched a lot and found a snippet that works but I can't reproduce it and create more levels.               % Fügt Gliederungsebene \subsubparagraph hinzu.     \titleclass{\subsubparagraph}{straight}[\subparagraph]     \makeatletter     \newcounter{subsubsubsection}[subsubsection] \newcounter{subsubparagraph}[subparagraph]     \newcommand*\l@subsubparagraph{\bprot@dottedtocline{6}{14em}{6em}}     \makeatother      * * * Somewhat related is my second question. Is there any way to rename some of the levels? It's always a little annoying trying to remember what comes after subsubsection etc. Maybe `\chapter`, `\section`, `\sub1section`, `\sub2section`, `\sub3section` or something else. Your help is greatly appreciated :)


title: Media button in RTL

text: It appears that there is a problem with the placement of media buttons in RTL text. Consider this MWE:               \documentclass{article}     \usepackage{libertine,media9,polyglossia}     \setdefaultlanguage[variant=british]{english}     \setotherlanguage[]{hebrew}          \begin{document}     \marginpar{\includemedia[       label=song49,       activate=pagevisible,       deactivate=pageinvisible,       noplaybutton,       flashvars={source=http://www.kfeuerherm.ca/IntHeb/BBE.mp3&hidebar=true},       transparent     ]{\makebox[1cm]{x}}{APlayer.swf}\mediabutton[mediacommand=song49:playPause,tooltip={Play/Pause}]{(P)}\mediabutton[mediacommand=song49:play[(0.0)],tooltip={Reset}]{(R)}}      %\begin{RTL}     \mediabutton[       mediacommand=song49:play[(0.65)],       mediacommand=song49:pause[(1.45)],       overface=ONE     ]{בראשׁית}     \mediabutton[       mediacommand=song49:play[(1.8)],       mediacommand=song49:pause[(2.45)],       overface=TWO     ]{ברא}     \mediabutton[       mediacommand=song49:play[(2.8)],       mediacommand=song49:pause[(3.8)],       overface=THREE     ]{אלהים}     %\end{RTL}     \end{document}      This example compiles fine, with or without `\texthebrew` in the media button label. However, trying to place `\texthebrew` around the buttons so that the labels will typeset in the correct order, or uncommenting the lines `\begin{RTL}` and `\end{RTL}` results in the error "xdvipdfmx:fatal: A pending form XObject at the end of page.” Can anyone advise on the root of the problem and/or how to get around it?


title: Editing cleveref's format for multiple label references

text: I am using the `cleveref` package to refer to theorems, equations, etc, in an article (LaTeX). I wish to have the format of reference as: Thm. (1) for single theorem (or equation, figure, etc) and Thms. (1,2) for a pair of (theorem) labels. To achieve my required format with `cleveref` I do:               \usepackage{cleveref}     \crefformat{theorem}{Thm.~(#2{}#1{}#3)}     \crefname{theorem}{Thm.}{Thms.}     \newcommand{\crefpairconjunction}{ ,~}      However, I am not quite able to achieve the format required for the case where I have a pair of labels -- I require the counters in the reference to be enclosed by "(" and ")" parenthesis: > Thms. (1.1, 1.2) Can anyone please help me modify the format for multiple labels case ? Since some had asked for a MWE, here is one:               \documentclass[12pt]{article}     \usepackage{amsmath}          \newtheorem{theorem}{Theorem}[section]          \usepackage{hyperref}     \hypersetup{colorlinks,linkcolor=blue}          \usepackage{cleveref}     \crefformat{theorem}{Thm.~(#2{}#1{}#3)}     \crefname{theorem}{Thm.}{Thms.}     \newcommand{\crefpairconjunction}{ ,~}          \renewcommand{\baselinestretch}{2}          \begin{document}          \section{\today}          Here is a sample theorem:     \begin{theorem} \label{thm-something}     Define something \dots     \end{theorem}          Here is another sample theorem:     \begin{theorem} \label{thm-some-other-thing}     Define some other thing \dots     \end{theorem}          I do not want references in this format: \cref{thm-something,thm-some-other-thing}          I want to enclose the counters by ``('' and ``)'' parenthesis. So it should be: ``Thms. (1.1, 1.2)''.     \end{document}      I have edited this question based on comments on its previous posting. (This question is a continuation of How to cross-reference several objects simultaneously )


title: How to remove section indentation in partial ToC using titletoc?

text: See MWE below. How can I remove the indent in front of the section entries in the `partial ToC` (only there, not in the normal ToC)?               \documentclass{book}     \usepackage{titletoc}     \usepackage{lipsum}     \begin{document}     \setcounter{tocdepth}{2}       \tableofcontents     \chapter{A chapter}     \startcontents[chapters]     \printcontents[chapters]{}{1}{}     \section{Section}     \subsection{Subsection}     \lipsum[4]     \subsection{Another Subsection}      \lipsum[1]     \section{Section 2}     \lipsum     \chapter{Second chapter}     \startcontents[chapters]     \printcontents[chapters]{}{1}{}     \section{Section}     \lipsum[2]     \section{Another section}     \lipsum     \end{document}      This question is related to this answer.