title: How to reuse data from one addplot table for plotting in another axis?

text: Is there anyway to reuse the data of a `\addplot table` for plotting in another `axis` environment? I would like to avoid putting the data into a separate file. Is there any way to refer to the data in a table for plotting? Something like: (It cannot compile)               \documentclass[12pt]{article}     \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}     \begin{axis}[%     width=5cm,     height=5cm,     scale only axis,     enlargelimits=false,     line join=round     ]     \addplot [color=white!70!black,solid,line width=0.5pt,forget plot]       table[name=tab1,row sep=crcr]{     1   -1  \\     2   -2  \\     3   3   \\     4   4   \\     };     \end{axis}          \begin{axis}[%     width=5cm,     height=5cm,     scale only axis,     enlargelimits=false,     line join=round     ]     \addplot [color=red,solid,line width=0.8pt,forget plot]     table[name=tab1]{tab1};          \end{axis}     \end{tikzpicture}%          \end{document}


title: Writing Gauss-Jordan Transformation Matrix

text: I am having trouble writing procedure for Gauss-Jordan transformation matrix in LaTeX. I want to write something like                     r2 - r1         r3-2r1     [A|I] -------> [A'|I'] ----->      and so on with the corresponding transformations (e.g., r2-r1) on top of the arrows. Could you give me an example code of how to do this? I only know that I need `\bmatrix` for matrices with [], but I do not know how to split them in between with a vertical line |. Thanks a lot!


title: Template Modification

text: I am new to LaTeX. My questions are not such difficult but for obvious reasons I do need some help. I found the following template very useful:               http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/ThesisStyle/CUEDThesisPSnPDF.tgz      It was supposed to work correctly, however it doesn't load (or it doesn't include in the final pdf file, if you prefer better) three of the sections, namely: - Contents - Nomenclature - References In addition, for some strange reason, when I try to write my long (three lines) thesis title in the appropriate place of the first page, everything goes messy with the cover page. Finally, I would like to introduce a "List of Tables" section, just after the "List of Figures" one as well as another one namely "Glossary", just after the end of the "Appendix1".


title: How to create a line graph in LaTeX?

text: I am in need of displaying line graphs in a LaTeX document but I can't figure out how. I searched on Google but did not receive any promising results. Is it really possible to do this within LaTeX or will I have to embed a jpeg image of a line graph created in Excel?


title: No clipping support in XeTeX when I use \animate in Xelatex

text: When I run the code, it has warnings as "Package xetex.def Warning: No clipping support in XeTeX yet on input line **." Why? My MWE is               \documentclass[presentation]{beamer}     \usepackage[slantfont,boldfont,CJKnumber]{xeCJK}     \usepackage{animate}     \usepackage{fontspec}     \usepackage{xunicode}     \usepackage{xltxtra}     \usepackage{hyperref}     \defaultfontfeatures{Mapping=tex-text}     \setromanfont{Times New Roman}     \setCJKmainfont[BoldFont=SimHei,ItalicFont=KaiTi]{SimSun}     \setCJKmonofont[BoldFont=SimHei]{SimSun}     \setCJKsansfont{KaiTi}     \setmainfont{TeX Gyre Pagella}     \setmonofont{Monaco}     \setsansfont{Trebuchet MS}     \usetheme[width=50pt]{Berkeley}     \renewcommand{\thefootnote}{$\aleph$}     \title{中国     \thanks{\scriptsize 中国B (10872051)}}     \author{中国C}     \institute{中国D}     \date{2014年6月2号}     \begin{document}     \begin{frame}     \titlepage     \end{frame}     \begin{frame}     \animategraphics[autoplay,loop,height=0.8\textheight]{1}{lambda_all_p}{01}{02}     \end{frame}     \end{document}      My example is as follows. ![enter image description here](http://i.stack.imgur.com/bfxUG.png) ![enter image description here](http://i.stack.imgur.com/3cf2c.png)


title: Units, in brackets, right aligned in align environment

text: I need to supply the unit of the formulas I use, in square brackets, right aligned. I use the align environment. I have tried several things, like manually changing the style of the equation numbering to include the units, but I need to be able to toggle the units. Any ideas on how to do this? Example of how I would like this feature to work:               \begin{align}      \CL(s) &= \frac{\OL(s)}{1 + \OL(s)}         \unit{kg}     \end{align}


title: mdframed missing half the frame

text: Any obvious reason some of the frame is missing here: ![enter image description here](http://i.stack.imgur.com/wXUZX.png)               \documentclass{article}          \usepackage{color}     \usepackage{hyperref}     \usepackage{mdframed}     \begin{document}          \begin{mdframed}     \begin{enumerate}        \item Create the cumulative sum of probabilities for each care type, thus defining the interval width        \item \textcolor{blue}{for} jj=1:m \textcolor{gray}{\% where m is the number of nurses}        \item Choose care type        \item \hspace{3cm}Randomly select care length ($n$) based on care type          \item \item \textcolor{blue}{for} ii=1:n  \textcolor{gray}{\% where n is the sequence length}        \item\hspace{3cm}Generate a random number $w$       \item \hspace{3cm}Check into which cumulative probability interval $w$ falls and choose the corresponding surface category       \item update ii=ii+1       \item update jj=i+1       \item \textcolor{blue}{end}       \item \textcolor{blue}{end}     \end{enumerate}%}     \end{mdframed}          \end{document}


title: Why does first use of \gls look different than \glsfirst?

text: I customized the layout of acronyms which works well for \gls. Surprisingly it does not work when using \glsfirst.               \documentclass{scrartcl}          \usepackage[         acronym,     ]{glossaries}           \renewcommand*{\SetCustomDisplayStyle}[1]{%         % need only to redefine the use of displayfirst          \defglsdisplayfirst[acronym]{%             \ifthenelse{\boolean{glsacrfootnote}}%             {% footnote style                 \glsentryshort{\glslabel}\protect\footnote{%                     \glsentryshort{\glslabel}: \glsentrylong{\glslabel}%                 }             }             {% inline style                 \glsentryshort{\glslabel} (\glsentrylong{\glslabel})%             }%         }%     }          \SetCustomStyle          \newacronym{UML}{UML}{Unified Modeling Language}          \begin{document}     \gls{UML}\\     \gls{UML}\\     \glsfirst{UML}\\     \end{document}


title: Is the following layout possible with the subfigure package?

text: Is it possible to achieve the following layout with the `subfigure` package (and any other package/command I don't know about):               ############# ##############     #           # #            #     #  pic1     # #            #     #           # #      pic2  #     #           # #            #     ############# #            #                   #            #     ############# #            #     #           # #            #     #   pic3    # #            #     #           # #            #     #           # #            #     ############# ##############       Each picture should have a subcaption.


title: xelatex: Japanese + latin diacritics with cedilla/comma, slanted text

text: In a document, I need to get all these working:   * japanese text   * latin diacritics with cedilla, e.g `şţ` and with comma, e.g `șț`   * slanted text This is a book I also distribute to others, so I can't change back to pdflatex, it has to remain xelatex (and besides, in xelated the second criteria is fulfilled). With the following POC, the former and the latter don't work:               \documentclass[10pt]{article}     \usepackage{ifxetex}          \ifxetex       \usepackage{fontspec}       \usepackage{xunicode}       \defaultfontfeatures{Mapping=tex-text} % To support LaTeX quoting style       \defaultfontfeatures{Ligatures=TeX}     \else       \usepackage[utf8]{inputenc}       \usepackage[T1]{fontenc}     \fi          \usepackage{helvet}          \begin{document}         \setmainfont[Ligatures={TeX, Common}, % sequences of two or more characters yeld one character]         ItalicFont={Charis SIL:style=Italic},     %    SlantedFont={SourceSansPro Slanted},         ItalicFeatures=FakeSlant,         %MonoFont={Myriad CAD:style=Regular},         Mapping=tex-text,AutoFakeSlant=0.2         ]{Source Sans Pro:style=Regular} % found by $ fc-list          hello world \textit{italic text} and \textsl{slanted text} and \texttt{monospaced text}.          Diacritics: șş țţ ȘŞ ȚŢ î Î ă Ă          Japanese: 守 破 離          \end{document}      The output looks like: ![enter image description here](http://i.imgur.com/EsaAX.png) How to get it working properly? # Working example Thanks to @Ulrike Fischer, I got it working like this on ArchLinux with xelatex:               \documentclass[10pt]{article}          \usepackage{fontspec}     \defaultfontfeatures{Ligatures=TeX}     \setmainfont[SlantedFont={Charis SIL},SlantedFeatures={FakeSlant=0.2}]{Charis SIL}          \usepackage{xeCJK}     \setCJKmainfont{DejaVu Sans Mono}     \setCJKfamilyfont{sf}{Kozuka Mincho Pr6N:style=R,Regular}     \setCJKfamilyfont{tt}{DejaVu Sans Mono}     \newcommand{\jptext}[1]{\sffamily#1}               \begin{document}     %Roman font Charis SIL:     hello world \textit{italic text} and \textsl{slanted text}.     Diacritics: șş țţ ȘŞ ȚŢ î Î ă Ă          \texttt{monospaced font}          Japanese: \jptext{守 破 離}          ----------------------------------------------          %Sans serif font:     \sffamily     hello world \textit{italic text} and \textsl{slanted text}.     Diacritics: șş țţ ȘŞ ȚŢ î Î ă Ă          \texttt{monospaced font}          Japanese: \jptext{守 破 離}     \end{document}      Hope it helps someone.


title: Chngcntr: \counterwithout not working

text: I need to place the tables section after my appendix. I've used `\counterwithin{table}{section}` to number appendix tables A.1, A.2, etc. Then I use `\counterwithout{table}{section}` so that the tables in the main Table section (which is forced to technically be in the appendix) are numbered 3, 4, etc. But still the main tables come out as B.3, B.4, etc. It seems `\counterwithout` is not working.


title: Modifying a thesis class file

text: A friend of mine gave me a class file he had used for his dissertation, which he submitted this spring. This is a class file he wrote; it was not provided by the university. Between spring & summer, the university changed the requirements for a dissertation slightly, so that now the signatures of the committee belong on the title page, whereas before they were two separate pages. I tried editing the `.cls` file so that it would combine the two into one page, but when I compile it, I get the two separate pages I got before. I'd like to know how to fix the `.cls` file so that there's no page break between the two. Here's what the `.cls` file was before I changed it:               \NeedsTeXFormat{LaTeX2e}     \def\fileversion{v.1.0}\def\filedate{2011/20/04}     \ProvidesClass{uathesis}[\filedate\space\fileversion\space%     Provides the format required by the Graduate School for dissertations]          \DeclareOption{10pt}{\PassOptionsToClass{10pt}{report}}     \DeclareOption{11pt}{\PassOptionsToClass{11pt}{report}}     \DeclareOption{12pt}{\PassOptionsToClass{12pt}{report}}     \DeclareOption{draft}{\PassOptionsToClass{draft}{report}}     \DeclareOption{final}{\PassOptionsToClass{final}{report}}     \DeclareOption{fleqno}{\PassOptionsToClass{fleqno}{report}}     \DeclareOption{leqno}{\PassOptionsToClass{leqno}{report}}     \DeclareOption{openany}{\PassOptionsToClass{openany}{report}}     \DeclareOption{openbib}{\PassOptionsToClass{openbib}{report}}     \DeclareOption{openright}{\PassOptionsToClass{openright}{report}}     \DeclareOption{oneside}{\PassOptionsToClass{oneside}{report}}     \DeclareOption{twoside}{\PassOptionsToClass{twoside}{report}}          \ProcessOptions          \LoadClass[12pt,letterpaper]{report}[1996/10/31]          \RequirePackage{setspace}     \RequirePackage{ifpdf}          \if@twoside       \def\ps@headings{%           \let\@oddfoot\@empty\let\@evenfoot\@empty           \def\@evenhead{\thepage\hfil\slshape\leftmark}%           \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%           \let\@mkboth\markboth         \def\chaptermark##1{%           \markboth {\MakeUppercase{%             \ifnum \c@secnumdepth >\m@ne                 \@chapapp\ \thechapter. \ %             \fi             ##1}}{}}%         \def\sectionmark##1{%           \markright {\MakeUppercase{%             \ifnum \c@secnumdepth >\z@               \thesection. \ %             \fi             ##1}}}}     \else       \def\ps@headings{%         \let\@oddfoot\@empty         \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%         \let\@mkboth\markboth         \def\chaptermark##1{%           \markright {\MakeUppercase{%             \ifnum \c@secnumdepth >\m@ne                 \@chapapp\ \thechapter. \ %             \fi             ##1}}}}     \fi          \DeclareOption{final}{%      \ifpdf       \AtBeginDocument{%         \pdfpagewidth=8.5in         \pdfpageheight=11in}       \fi       \doublespacing      }          \def\@makechapterhead#1{%     %%  \vspace*{50\p@}%       {\parindent \z@ \raggedright \normalfont         \ifnum \c@secnumdepth >\m@ne             \normalsize \centering \@chapapp\space \thechapter             \par\nobreak             \vskip 10\p@         \fi         \interlinepenalty\@M         \normalsize \bfseries \centering \MakeUppercase{#1}\par\nobreak         \vskip 20\p@       }}     \def\@schapter#1{\if@twocolumn                        \@topnewpage[\@makeschapterhead{#1}]%                      \else                        \@makeschapterhead{#1}%                        \@afterheading                      \fi}     \def\@makeschapterhead#1{%     %%  \vspace*{50\p@}%       {\parindent \z@ \raggedright         \normalfont         \interlinepenalty\@M         \normalsize \bfseries \centering \MakeUppercase{#1}\par\nobreak         \vskip 20\p@       }}     \renewcommand\section{\@startsection {section}{1}{\z@}%                                        {-3.5ex \@plus -1ex \@minus -.2ex}%                                        {2.3ex \@plus.2ex}%                                        {\normalfont\normalsize\bfseries}}     \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%                                          {-3.25ex\@plus -1ex \@minus -.2ex}%                                          {1.5ex \@plus .2ex}%                                          {\normalfont\normalsize\bfseries}}     \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%                                          {-3.25ex\@plus -1ex \@minus -.2ex}%                                          {1.5ex \@plus .2ex}%                                          {\normalfont\normalsize\bfseries}}          \ExecuteOptions{final}     \ProcessOptions          \renewenvironment{thebibliography}[1]     {\singlespacing     \chapter*{\bibname}         \@mkboth{\bibname}{\bibname}%         \addcontentsline{toc}{chapter}{\bibname}%       \list{\@biblabel{\@arabic\c@enumiv}}%       {\settowidth\labelwidth{\@biblabel{#1}}%         \leftmargin\labelwidth         \advance\leftmargin\labelsep         \@openbib@code         \usecounter{enumiv}%         \let\p@enumiv\@empty         \renewcommand\theenumiv{\@arabic\c@enumiv}}%       \sloppy       \clubpenalty4000       \@clubpenalty \clubpenalty       \widowpenalty4000%       \sfcode`\.\@m}     {\def\@noitemerr       {\@latex@warning{Empty `thebibliography' environment}}%       \endlist}          \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else       \hbox{}       \thispagestyle{empty}       \newpage       \if@twocolumn\hbox{}\newpage\fi\fi\fi}          \newif\if@mainmatter \@mainmattertrue          \newcommand\frontmatter{%         \cleardoublepage      \@mainmatterfalse       \pagenumbering{roman}}     \newcommand\mainmatter{%         \cleardoublepage      \@mainmattertrue       \pagenumbering{arabic}}     \newcommand\backmatter{%       \if@openright         \cleardoublepage       \else         \clearpage       \fi       \@mainmatterfalse}          \renewcommand*{\title}[1]{\def\ua@title{#1}}     \newcommand{\department}[1]{\def\ua@dept{#1}}     \renewcommand*{\author}[1]{\def\ua@author{#1}}     \newcommand{\director}[1]{\def\ua@director{#1}}     \renewcommand*{\month}[1]{\def\ua@month{#1}}     \renewcommand*{\year}[1]{\def\ua@year{#1}}     \newcommand{\previous}[1]{\def\ua@preved{#1}}     \title{The title}     \department{Mathematics}     \author{A.U.~Thor}     \director{The director}     \month{April/July/November}     \year{2011}     \previous{}          \def\halftitlepage{%       \addtocounter{page}{-1}       {\singlespacing         \thispagestyle{empty}         \vspace*{-1in}         \vfill         \begin{center}           \ua@title         \end{center}         \vfill\eject       }     }          \def\titlepage{%       {\singlespacing         \thispagestyle{empty}         \vspace*{1in}         \begin{center}           \ua@title           \vfill           A dissertation submitted in partial fulfillment\\           of the requirements for the degree of\\           Doctor of Philosophy in \ua@dept           \vfill           By           \vfill           \ua@author\\           \ua@preved\\           \vspace*{1in}           \ua@month~\ua@year\\           University of Arkansas         \end{center}         \vspace*{1in}\eject       }     }          \newcommand{\committeemember}[1]{%     \par     \begin{minipage}{.6\textwidth}     \vspace*{.5in}     \hrulefill\\     #1     \end{minipage}\par     }          \def\duplicationrelease{%       \chapter*{Dissertation Duplication Release}       {\singlespacing         \raggedright         \thispagestyle{empty}         I hereby authorize the University of Arkansas Libraries to         duplicate this dissertation when needed for research and/or         scholarship.              \vspace*{.5in}         \noindent         Agreed\qquad         \begin{minipage}[t]{.5\textwidth}           \hrulefill\\           \ua@author         \end{minipage}       }     }               \newenvironment{committee}     {\singlespacing       \thispagestyle{empty}       \parindent=0pt       This dissertation is approved for recommendation\\       to the Graduate Council\\[.5in]       Dissertation Director:       \committeemember{\ua@director}       \vspace*{.5in}       Dissertation Committee:       }     {\vfill\eject}          \setlength{\textheight}{9in}     \setlength{\textwidth}{6in}     \setlength{\oddsidemargin}{0.525in}     \setlength{\evensidemargin}{0.025in}     \setlength{\topmargin}{-0.5in}          %% \CharacterTable     %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z     %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z     %%   Digits        \0\1\2\3\4\5\6\7\8\9     %%   Exclamation   \!     Double quote  \"     Hash (number) \#     %%   Dollar        \$     Percent       \%     Ampersand     \&     %%   Acute accent  \'     Left paren    \(     Right paren   \)     %%   Asterisk      \*     Plus          \+     Comma         \,     %%   Minus         \-     Point         \.     Solidus       \/     %%   Colon         \:     Semicolon     \;     Less than     \<     %%   Equals        \=     Greater than  \>     Question mark \?     %%   Commercial at \@     Left bracket  \[     Backslash     \\     %%   Right bracket \]     Circumflex    \^     Underscore    \_     %%   Grave accent  \`     Left brace    \{     Vertical bar  \|     %%   Right brace   \}     Tilde         \~}     %%     \endinput     %%     %% End of file `uathesis.cls'.      I removed the `\newenvironment{committee}` section and replaced the `\def{titlepage}` section with the following:               \def\titlepage{%       {\singlespacing         \thispagestyle{empty}         \parindent=0pt         \vspace*{1in}         \begin{center}           \ua@title           \vfill           A dissertation submitted in partial fulfillment\\           of the requirements for the degree of\\           Doctor of Philosophy in \ua@dept           \vfill           By           \vfill           \ua@author\\           \ua@preved\\           \vspace*{1in}           \ua@month~\ua@year\\           University of Arkansas         \end{center}         \vfill         This dissertation is approved for recommendation\\         to the Graduate Council.\\[.5in]         Dissertation Director:         \committeemember{\ua@director}         \vspace*{.5in}         Dissertation Committee:           \committeemember{Dr. First Member}         \committeemember{Dr. Second Member}         \vspace*{1in}\eject       }     }      Previously, the main `.tex` document contained the following:               \halftitlepage     \titlepage          \include{abstract}          \begin{committee}     \committeemember{Dr. First Member}     \committeemember{Dr. Second Member}     \end{committee}          \duplicationrelease      but I commented out the 4 lines from `\begin{committee}` to `\end{committee}`. I can't see what in the `.cls` file is causing the page break between "University of Arkansas" and "This dissertation is approved...". (I know that adding the names of the committee members inside the class file isn't ideal, but I'm not giving this to anyone else to use, and I just need to get this finished so I can submit it.) How can I eliminate that page break?


title: custom bib style, book output with pages numbers ex. 522pp

text: This is my first post, after I have been looking for a while at the related posts without success. I'm using `TeXworks` (0.4.3 r.857 `MikTeX` 2.9 64bits) on Windows. Well, I have modified an existing style from the Canadian Journal of Aquatic and Fisheries Science (`cjafs.bst`) to fit Fisheries Oceanography requirements the journal ask for book references like this:               Kawasaki, T. (1982) Pelagic Fish Stocks. Tokyo: Koseisha-Koseikaku, 327pp. (In Japanese).      Until now I just managed to get it like this:               Kawasaki, T. (1982) Pelagic Fish Stocks. Koseisha-Koseikaku.p.327.      I need to add the `city adress={}` follow by colon, then publishers and a comma, and finally pages (`field pages={}`) like the example * _number_ *pp... how can I do that, modifying the FUNCTION {book}?                   FUNCTION {book}         { output.bibitem          author empty$         { format.editors "author and editor" output.check         editor format.key output         }         { format.authors output.nonnull           crossref missing$         { "author and editor" editor either.or.check }         'skip$          if$          }          if$           format.date "year" output.check           date.block           format.btitle "title" output.check           crossref missing$          { format.bvolume output            new.block            format.number.series output            new.sentence            format.publisher.address output            }            {            new.block            format.book.crossref output.nonnull            }            if$            format.edition output            format.doi output            new.block            format.note output            new.block            %just added number pages            format.pages output  %just added number pages            fin.entry            }


title: Embedding Adobe Type Basics T1 Postscript fonts in Beamer

text: Recently I acquired the Adobe Type Basics T1 package and I am using Acrobat Distiller for the ps2pdf option (Winedt 8.0 + MikTeX 2.9). If I create a file using latex-dvi2ps-ps2pdf, the Times Roman/Courier fonts are embedded in the .pdf file. The problem is with Beamer, I have to use the PDFTexify option and it changes my fonts to Nimbus. Is there any way to embed this kind of fonts with PDFTexify? I have already seen the updmap.cfg file and the option _pdftexDownloadBase14_ is set to true. My other question is related to the GS viewer. When using dvi2ps, I don't get the Courier font with texttt. However, when I convert that .ps file to .pdf using Acrobat Distiller (prepress) I recover the "fancy" fonts. I am telling this because printing from the .ps file (with Windows GDI Printer) gives me better results than from the "Distilled" .pdf. Thank you very much for your help.


title: \SetTracking from microtype is ineffective with mathdesign

text: I like the tracking but I wish to descrease the spacing a bit. But it does not work:               \documentclass[twoside,a4paper,12pt]{article}         %\usepackage[T1]{fontenc}               \usepackage[charter]{mathdesign}          \usepackage[     protrusion=true,     tracking=true,     ]{microtype}     \SetTracking{encoding={*}, family= mdbhc, shape=sc}{900}               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}                    \textsc{My text}     \end{document}      so               \SetTracking{encoding={*}, family= mdbhc, shape=sc}{900}      Has no effect on the spacing. When I comment out the use of mathdesign in order to use the default font, the settracking is used and functions well. I installed the microtype package yesterday, so it is the latest available.


title: Creating plasmid diagrams in TeX

text: I need to create a diagram of plasmid in TeX, which looks like that: ![enter image description here](http://i.stack.imgur.com/UYoqe.jpg) ![enter image description here](http://i.stack.imgur.com/Nn6O2.jpg) ![enter image description here](http://i.stack.imgur.com/aYrqI.gif) The images above are slightly different but show pretty much the same thing so it would be great if I could create any of them with TeX. Of course it would be easy to just insert an image but I want to challenge myself if there's nothing like that available. **Is there any package I could use to create such diagram or should I create my own package?**


title: \nameref only shows reference as a red rectangle, no name in it

text: I'm trying to use `\usepackage{hyperref}` to reference in the text a section by name. The section to be referenced is               \section{whatever}\label{sec:marker}      However, when I place in the text               \nameref{sec:marker}      I get nothing but a narrow red rectangle without a text in it (I expected the text 'whatever' to appear there). Is there anything else I should do to fix this problem? Here is a MWE of the problem I have:               \documentclass[onecolumn,twoside]{revtex4}     %\usepackage{float}     %\usepackage{graphicx}     %\usepackage{sansmath}     %\usepackage{amsmath}     %\usepackage{tikz}     %\pdfpagewidth 8.32in     %\pdfpageheight 11in     %\setlength{\topmargin}{-20mm}     %\setlength{\columnsep}{10mm}     %\setlength{\oddsidemargin}{-2mm}     %\setlength{\evensidemargin}{-2mm}     %\setlength{\textwidth}{170mm}     %\usepackage{anttor}     %\bibpunct{(}{)}{;}{s}{,}{,}     %\usepackage{fancyhdr}     %\usepackage{longtable}     %\usepackage{pgothic}     %\usepackage[T1]{fontenc}     %\usepackage{eufrak}     %\usepackage{oldgerm}     %\usepackage[normalem]{ulem}     %\usepackage{cancel}     %\usepackage{wasysym}     \usepackage{hyperref}          \begin{document}          \section*{FirstSection}          In \nameref{sec:marker} it is stated that ...          \section*{SecondSection} \label{sec:marker}          \end{document}


title: biber error: BibTeX subsystem expected "@"

text: I'm having a problem getting biber to process my bibliography file. I've updated my TeXLive distribution to have the following package/program versions:               biblatex 2011/11/13 v1.7     biber version: 0.9.8      When I compile this minimal example,               \documentclass{report}     \usepackage[backend=biber]{biblatex}     \addbibresource{test}          \begin{document}         \nocite{thebook}         \printbibliography     \end{document}      with this .bib file,               @book{thebook,         author = "Me"     }      I get the following error:               $ pdflatex test     This is pdfTeX, Version 3.1415926-2.3-1.40.12 (Web2C 2011)     ....     Transcript written on test.log.          $ biber test     INFO - This is Biber 0.9.8     INFO - Logfile is 'test.blg'     INFO - Reading 'test.bcf'     INFO - Found 1 citekeys in bib section 0     INFO - Processing bib section 0     INFO - Looking for bibtex format file 'test' for section 0     INFO - Found BibTeX data source './test.tex'     ERROR - BibTeX subsystem: C:\Users\jmert\AppData\Local\Temp\LhBA8BxHUk\test.tex_2824.utf8, line 12, syntax error: at end of input, expected "@"     INFO - ERRORS: 1      Can anyone provide any help debugging this problem? I've compiled biber from source and downloaded all the dependencies from CPAN on a Fedora 16 machine as well as used the precompiled version available for Windows on TeXLive (where the version numbers and compiler output here are taken).


title: How can I strikethrough a character in an equation?

text: I'm trying to create an equation where the letter "I" has a horizontal line through it. The only name I know for this action is "strikethrough" but I'm not sure if this would be correct when dealing with equations specifically; I don't want the line to be too long. I've tried the `ulem`, soul, `sout` and `cancel` but none of these seem to work inside a `\begin{equation}` ... `\end{equation}` environment.


title: Where are \left and \right defined?

text: In order to define a new environment using `\left` and `\right`, I need to know how those macros are defined. Unfortunately, both `\show\left` and `\show\right` return an error. My last resort was to scan latex.ltx for the definitions of `\left` and `\right`, to no avail. Where are `\left` and `\right` defined?


title: Complex bibliography setup

text: I cite some things in footnotes, and want to cite some other things in bibliography using a numbered style. I have to use `biblatex-gost` style, and it provides the functionality. But I get issue: bibliography counter doesn't start with 1. I tried to reset it using solutions found here. But it doesn't work. Neither               \usepackage[     ...     defernumbers=true,     ...     ]{biblatex}          ...          \printbibliography[resetnumbers=true, notkeyword=footcited]      works. Here's an MWE:               \documentclass{article}          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{DejaVu Sans}     \setsansfont{DejaVu Sans}     \setmonofont{DejaVu Sans Mono}          % Russian/English document:     \usepackage{xecyr}     \newfontfamily\cyrillicfont{DejaVu Sans}     \setmainlanguage{russian} % \setdefaultlanguage{russian} is obsolete and not needed     \setotherlanguage[variant=american]{english}          % bibliography:     \usepackage[         backend=biber,         minnames=3,         citestyle=gost-footnote-min,         bibstyle=gost-numeric-min,         url=false,         sorting=none,         language=auto,         babel=other,     ]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},       keywords = {footcited},     }     @misc{B02,       author = {Buthor, B.},       year = {2002},       title = {Bravo},     }     @misc{C03,       author = {Cuthor, C.},       year = {2003},       title = {Charlie},     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          Text\footcite{A01}.          \nocite{B02, C03}          % bibliography:     \printbibliography[notkeyword=footcited]          \end{document}      Result: ![enter image description here](http://i.stack.imgur.com/Zv5KF.png) **Edit** : No Russian, no `biblatex-gost` MWE with `resetnumbers`:               \documentclass{article}          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{DejaVu Sans}     \setsansfont{DejaVu Sans}     \setmonofont{DejaVu Sans Mono}          \setmainlanguage{english} % \setdefaultlanguage{russian} is obsolete and not needed          % bibliography:     \usepackage[         backend=biber,         minnames=3,         url=false,         sorting=none,         language=auto,         babel=other,         defernumbers=true,     ]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},       keywords = {footcited},     }     @misc{B02,       author = {Buthor, B.},       year = {2002},       title = {Bravo},     }     @misc{C03,       author = {Cuthor, C.},       year = {2003},       title = {Charlie},     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          Text\footcite{A01}.          \nocite{B02, C03}          % bibliography:     \printbibliography[resetnumbers=true, notkeyword=footcited]          \end{document}      Result: ![enter image description here](http://i.stack.imgur.com/hFOCj.png)


title: Why doesn't \renewcommand{\ref}{\autoref} change \ref into \autoref?

text: First off, I'm very grateful of the help this community has provided me so far. Anyway, to my problem: I feel like I'm missing something obvious here. I want...               \documentclass{article}          \usepackage{hyperref}      \renewcommand{\ref}{\autoref}          \begin{document}     \section{Section Title} \label{anchor}     Blah Blah Blah. \ref{anchor}     \end{document}      to print as... > 1 Section Title > > Blah Blah Blah. section 1 but instead I get ... > 1 Section Title > > Blah Blah Blah. 1 ... so `\ref` is not being replaced with `\autoref`. How can I correct this? Do I have no option but to do a _find-and-replace_ to change `\ref` to `\autoref`?


title: Line numbers for listings using program package

text: Is it possible to add line numbers to listings using the `program`package? (I know, that it should be possible within the much more sophisticated other listings packages available, but I would really rather stick to to `program`, as I am used to the pseudocode syntax now and I like the style of the result, which did not require a plethora of options to make it look "nice").


title: Cannot insert TiKZ LaTeX code in LyX

text: I'm trying to embed TiKZ code in my LyX document. When exporting the document to pdf (pdflatex) I get a blank area instead of the TiKZ output. Here's what I've done: I've added the following two lines to LaTeX Preamble:               \usepackage{tikz}     \usetikzlibrary{automata,positioning}      I've added the following to a new TeX code:               \begin{tikzpicture}[shorten >=1pt, node distance=2cm, on grid, auto]         \node[state, initial] (q_0) {$q_0$};         \node[state] (q_1) [above right=of q_0] {$q_1$};         \node[state] (q_2) [below right=of q_0] {$q_2$};         \node[state, accepting] (q_3) [below right=of q_1] {$q_3$};         \path[->]         (q_0) edge node {0} (q_1)               edge node [swap] {1} (q_2)         (q_1) edge node {1} (q_3)               edge [loop above] node {0} ()         (q_2) edge node [swap] {0} (q_3)               edge [loop below] node {1} ();     \end{tikzpicture}      (The code is copied from another tex.stackexchange answer: Which package can be used to draw automata?) What's wrong with what I've done?


title: Alignment of items inside and outside Beamer {columns} environment

text: I've noticed that items inside and outside Beamer's `columns` environment are not aligned horizontally. Is there a way to fix this? ## Code               \documentclass{beamer}          \begin{document}          \begin{frame}[t]{Title}     \begin{itemize}         \item item outside columns         \item item outside columns     \end{itemize}          \begin{columns}         \column{.6\textwidth}         \begin{itemize}             \item item in first column         \end{itemize}              \column{.4\textwidth}         text in second column     \end{columns}     \end{frame}          \end{document}      ## Output ![enter image description here](http://i.stack.imgur.com/IIL5l.png)


title: Show sometimes only first author

text: assume there is a paper written by Foo and Bar. When there is a citation, I want to show sometimes(!) only the first author (Foo) and the rest of the time all authors (foo/Bar). The reason is that I have table and the first column is for the paper citations. However, the column has fixed width, therefore sometimes i get an ugly result if there are more than two authors, see: ![enter image description here](http://i.stack.imgur.com/oV8ZI.png) I am using `scrbook`.


title: Example environment

text: I want an example environement that put Example 1.2 in the margin (bold) Text of example in the textwidth, Solution in the margin (italics) and the text of solution in the text width.


title: plotting graphs with dspPlot functions

text: I have tried plotting graphs with dspPlot as explained by Prof. Paolo Prandoni and Prof. Martin Vetterli in their site but failed. They have run the following code to generate curve in their DSP book available online in their site. However, when I run the same, it does not work. Anybody can help me out please. [I wrote to authors few days back and reply is yet to receive from their end]               \documentclass[a4paper,11pt]{ltxdoc}     \usepackage{float}     \usepackage{fancyvrb}     \usepackage{enumitem}     %\usepackage{courier}     \usepackage[utopia]{mathdesign}     \usepackage{dspTricks, dspFunctions, dspBlocks}          \newenvironment{centerfig}{%       \begin{figure}[H]         \begin{center}}{         \end{center}       \end{figure}}               \begin{document}     \begin{centerfig}     \begin{dspPlot}[sidegap=0.5,yticks=none]{-6, 6}{-1.2, 1.2}         \def\signal{ 0.5235 mul RadtoDeg sin }         \def\quantize{ dup 0 gt {-0.5} {0.5} ifelse sub truncate }         \dspFunc[linecolor=gray,linewidth=2pt]{x \quantize \signal }         \dspFunc[linestyle=dotted,linewidth=1pt]{x \signal}         \dspSignal{x \signal}     \end{dspPlot}     \end{centerfig}     \end{document}      Program fragment and its output is appended below for your kind reference: ![enter image description here](http://i.stack.imgur.com/zslne.png) Error I got after running the code is:               ! Undefined control sequence.     <recently read> \c@lor@to@ps          l.19 ...sidegap=0.5,yticks=none]{-6, 6}{-1.2, 1.2}          ?


title: Package conflict between eso-pic and wallpaper

text: The following code gives me a conflicting options message. Does anyone know if there is a way to fix it?               \documentclass[10pt,landscape]{article}     %\input{this-preamble}     \usepackage{wallpaper}     \usepackage{xcolor}     \usepackage{textpos}     \usepackage{adjustbox}     \usepackage[grid, gridcolor=red!20, subgridcolor=green!20]{eso-pic}     \usepackage[left=0.5in,right=1.5in,top=1in,bottom=0.5in]{geometry}          \begin{document}     \pagestyle{empty}     \begin{textblock}{4}(5,-0.5){\Huge{General Overview of some very important stuff}}\end{textblock}     \end{document}


title: Setting Knitr options

text: The following code chunk doesn't work I get an error message and it disrupts the compilation of my document. Not sure if anyone has any ideas? Very M WE below. As @Speravir pointed out, not sure it adds much to enlighten. This is really about getting efficient code together.. The error message is `Error object options_chunk not found`               \documentclass[10pt]{article}     \begin{document}     Testing knitr               <<set-options>>=     options_chunk$set(cache=TRUE,cache.path='Data/Cache/',warning=FALSE,error=FALSE,message=FALSE)     @      Something in the middle to prove its working        <<somechunk,results='asis'>>=      a=1      b=2      print(a+b)     @     \end{document}


title: Extend a frame to two pages

text: I am using `beamer` to create slides for presentation. I am trying to put 4 equations with numbers from 1 to 4 in two pages. in short, how can I extend a frame to two pages?


title: aligning several trees to the baseline

text: I want to have the following trees aligned to the baseline. There is a problem which is probably due to the "g" in some of the trees. How do I get these trees aligned? I tried `\strut`, but this somehow did not work.               \documentclass{article}          \usepackage{tikz-qtree}     \tikzset{every roof node/.append style={inner sep=0.1pt,text height=2ex,text depth=0.3ex}}                    \begin{document}                    \begin{figure}[htbp]     \begin{tikzpicture}     \tikzset{level 1+/.style={level distance=2\baselineskip}}     \Tree[.NP            [.Det die ]            [.N Frauen ] ]     \end{tikzpicture}     \begin{tikzpicture}     \tikzset{level 1+/.style={level distance=2\baselineskip}}     \tikzset{frontier/.style={distance from root=6\baselineskip}}     \Tree[.NP            [.Det die ]            [.N               [.Adj klugen ]              [.N Frauen ] ] ]     \end{tikzpicture}     \begin{tikzpicture}     \tikzset{level 1+/.style={level distance=2\baselineskip}}     \tikzset{frontier/.style={distance from root=6\baselineskip}}     \Tree[.NP            [.Det die ]            [.N               [.Adj klugen ] ] ]     \end{tikzpicture}     \begin{tikzpicture}     \tikzset{level 1+/.style={level distance=2\baselineskip}}     \tikzset{frontier/.style={distance from root=6\baselineskip}}     \Tree[.NP            [.N               [.Adj kluge ]              [.N Frauen ] ] ]     \end{tikzpicture}          \caption{\label{abb-np2}Verschiedene Nominalstrukturen ohne leere Elemente}     \end{figure}          \end{document}


title: Three minipages side by side but over several pages

text: Im searching for a way to typeset the following scenario: ![Desired Layout](http://i.stack.imgur.com/GQmpi.jpg) With three minipages this works fine:               \documentclass{minimal}     \usepackage{blindtext}          \begin{document}     \begin{minipage}[t]{0.1\textwidth}         A 1.1     \end{minipage}%     \begin{minipage}[t]{0.8\textwidth}         \blindtext     \end{minipage}%     \begin{minipage}[t]{0.1\textwidth}\raggedleft         2 P     \end{minipage}     \end{document}      But this won't work with a pagebreak. So how could I alternatively do this? BTW: How is it possible to align the text inside the out right minipage with the last line of the minipage in the middle?


title: Problem with \chapter* and fancyhdr

text: I'm having a problem with `\chapter*{}` and `fancyhdr`. I want to start the first chapter of my thesis with a introduction section, appearing in the TOC but without numeration, that's why I use:               \chapter*{Introduccion}       and               \addcontentsline{toc}{chapter}{Introduccion}      at the beginning of the `Introduccion.tex` file, but I don't know why, the `fancyhdr` header shows "list of tables" instead of "Introduccion"! (the list of tables is immediately before the introduction). Here is my code:               \documentclass[a4paper,12pt,twoside]{book}     %     \usepackage[bottom=25mm,top=25mm, left=30mm, right=25mm]{geometry}     %     \parskip=8pt     %     \widowpenalty=10000     \clubpenalty=10000     %     \usepackage[spanish, es-tabla]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{morefloats}     %     \setcounter{secnumdepth}{3}     \usepackage{eurosym}     \usepackage[pdftex]{graphicx}     \usepackage{pdfpages}     \usepackage[pagebackref=true]{hyperref}     \hypersetup{%         bookmarks=true,         % barra de marcadores         unicode=false,          % caracteres non-Latin en marcadores de Acrobat         pdftoolbar=true,        % mostrar barra de herramientas de Acrobat         pdfmenubar=true,        % mostrar menú de Acrobat         pdffitwindow=false,     % ajustar ventana al ancho de página         pdfstartview={FitH},    % ajustar documento al ancho de página         pdftitle={Memoria PFC}, % título         pdfauthor={},           % autor         pdfsubject={},          % tema del documento         pdfcreator={},          % generador del documento         pdfproducer={},         % productor del documento         pdfkeywords={},         % lista de palabras clave         pdfnewwindow=true,      % enlaces en una nueva ventana         colorlinks=true,        % false: enlaces en caja; true: enlaces coloreados         linkcolor=blue,         % color de enlaces internos         citecolor=green,        % color de enlaces a bibliografía         filecolor=magenta,      % color de enlaces a ficheros         urlcolor=blue           % color de enlaces externos     }     %     \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhf{}     \fancyhead[EL]{\nouppercase\leftmark}     \fancyhead[OR]{\nouppercase\rightmark}     \fancyhead[ER,OL]{\thepage}     %     \makeatletter     %     \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else       \hbox{}       \thispagestyle{empty}       \newpage       \if@twocolumn\hbox{}\newpage\fi\fi\fi}     \makeatother     %     \begin{document}     %     \pagenumbering{gobble} % Las primeras paginas no quiero que se numeren     %     \includepdf[pages={-}]{./Archivos/Portada_PFCccompleto.pdf}     \input{./Archivos/Capitulos/pfc_dedicatoria}     \input{./Archivos/Capitulos/pfc_agradecimientos}     \include{./Archivos/Capitulos/pfc_abreviaturas}     %     % FRONTMATTER: TOC, LOF, LOT      \frontmatter     %     \tableofcontents     \listoffigures     \listoftables     %     % MAINMATTER     %     \mainmatter     \include{./Archivos/Capitulos/pfc_intro}     \include{./Archivos/Capitulos/pfc_main_010}     ...     %


title: Extract first letter of each word in a sentence

text: I don't know if already exists a question like this, but after 20 minutes I haven't found one. There are similar ones, like How to define a command that bolds the first letter of each word in the input argument?, but it's not the same as mine. I'm looking for a command `\shortenthis{…}` which extracts the first letter of each word in the command. `\shortenthis{Leonard Euler}` will give us `LE`. In case of `\shortenthis{Pierre de Fermat}` it should give `PdF`. The idea is to shorten names. I guess this is “easy” with LaTeX3 (although I'm a newbie, I looked in the documentation, and examples in this site, and couldn't do it), but any solution would be accepted.


title: Change document class per page

text: Let's say I have a document that has many pages and some pages have different formats. For example, most of the pages are fine with `\documentclass{article}` but there may be pages in the middle that I want to be `\documentclass{letter}`. I want my letter pages to be numbered inline with the other pages and have them show up in the Table of Contents. Is it possible to change the class used for an individual or range of pages while still keeping things like page numbering consistent across them? **EDIT** I'm trying to create a "welcome to the company" sort of document that has a cover page, table of contents, welcome letter, then various sections of information. I've never tried this in anything other than a word processor where it's easy to set "master pages" or "template pages" for individual pages in the document. So I could use a letterhead template page for the welcome letter part and a standard article-type template for the rest and still have the letter numbered/referenced in the ToC. So the idea was to take advantage of the classes written, if possible, rather than have to format a single page by hand differently from the rest.


title: Using two latex classes simultaneously

text: I have two latex classes and I would like to use them simultaneously. Let's say put title and cover pages from one class and rest of the context from the other one.


title: How can I combine two standalone documents (CV and letter) into one?

text: I have two standalone `.tex` documents that compile fine independently:   1. my resume that is using the well known `moderncv` package   2. a standard `.tex` document (cover letter)  I would like to combine, in a single `.tex` document, those two files using the `combine` or `subfiles` package but I haven't managed to do so. As suggested by others using alternate solutions as pdfpage is not what I want. Just because I don't want to go outside my auctex-mode buffer within Emacs to compile.


title: How do I add my Vita to the end of my dissertation?

text: Our grad school has a dissertation.cls and I've already put my vita into a res.cls. Is there any way that I can run these two things together? Here is what my code looks like:               \documentclass[phd,12pt]{psuthesis}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{exscale}     \usepackage{booktabs}     \usepackage[mathscr]{eucal}     \usepackage[section]{placeins}     \usepackage{bm}     \usepackage{eqlist} % Makes for a nice list of symbols.     \usepackage[final]{graphicx}     \usepackage[dvipsnames]{color}      etc. etc. and then at the very end I have this:               % Vita     \vita{SupplementaryMaterial/Vita}          \end{document}      However, in my Vita.tex file, it opens with               \documentclass{res}      \setlength{\textheight}{9.5in} % increase text height to fit on 1-page           \begin{document}       Is there any way that I can add my already made vita without reformatting it? Thanks.


title: Include a paper in a dissertation

text: I'm start writing my dissertation and I want to include two papers that I wrote in the appendix. I want them to appear in the original format that they were written (amsart). I'm using a template provided by my uni for the dissertation. What's the best way for doing it in LaTeX? Or should I work only with the pdf file?


title: Hebrew text in English LyX file

text: I have a LyX paper that needs some text (specifically, text within a table) to be in Hebrew. Culmus is installed, language hebrew is mapped to F10. linguistics module is activated. When I try to compile, I get the error "missing number, treated as zero". So far as I can tell, the problem seems to be having numbered examples (or subexamples, possibly glosses as well) while having Hebrew in the text. Are the linguistics module and the language clashing somehow? How can I solve it if so? redacted version that won't compile:               \lyxformat 413     \begin_document     \begin_header     \textclass article     \begin_preamble          \usepackage{cjhebrew}     \end_preamble     \use_default_options true     \begin_modules     linguistics     \end_modules     \maintain_unincluded_children false     \language british     \language_package default     \inputencoding auto     \fontencoding global     \font_roman default     \font_sans default     \font_typewriter default     \font_default_family default     \use_non_tex_fonts false     \font_sc false     \font_osf false     \font_sf_scale 100     \font_tt_scale 100          \graphics default     \default_output_format default     \output_sync 0     \bibtex_command default     \index_command default     \float_placement H     \paperfontsize default     \spacing single     \use_hyperref false     \papersize default     \use_geometry false     \use_amsmath 1     \use_esint 1     \use_mhchem 1     \use_mathdots 1     \cite_engine basic     \use_bibtopic false     \use_indices false     \paperorientation portrait     \suppress_date false     \use_refstyle 1     \index Index     \shortcut idx     \color #008000     \end_index     \secnumdepth 3     \tocdepth 3     \paragraph_separation indent     \paragraph_indentation default     \quotes_language english     \papercolumns 1     \papersides 1     \paperpagestyle default     \tracking_changes false     \output_changes false     \html_math_output 0     \html_css_as_file 0     \html_be_strict false     \end_header          \begin_body          \begin_layout Numbered Example (multiline)     at some level, because the relation between     \end_layout          \begin_layout Standard     \begin_inset Tabular     <lyxtabular version="3" rows="3" columns="2">     <features tabularvalignment="middle">     <column alignment="center" valignment="top" width="0">     <column alignment="center" valignment="top" width="0">     <row>     <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">     \begin_inset Text          \begin_layout Plain Layout          \end_layout          \end_inset     </cell>     <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">     \begin_inset Text          \begin_layout Plain Layout     Identity     \end_layout          \end_inset     </cell>     </row>     <row>     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">     \begin_inset Text          \begin_layout Plain Layout     Forward mask     \end_layout          \end_inset     </cell>     <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">     \begin_inset Text          \begin_layout Plain Layout     ########     \end_layout          \end_inset     </cell>     </row>     <row>     <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">     \begin_inset Text          \begin_layout Plain Layout     Prime     \end_layout          \end_inset     </cell>     <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">     \begin_inset Text          \begin_layout Plain Layout          \lang hebrew     תזמורת     \end_layout          \end_inset     </cell>     </row>     </lyxtabular>          \end_inset               \end_layout          \begin_layout Standard          \end_layout          \end_body


title: Problem with й (\cyrishrt) in LuaLaTeX

text: Initially I've asked a different question, but digging up I've found a true reason. The problem occurs when Cyrillic letter й is used with maths in another font in the same paragraph. Here is the minimal example:               \documentclass{minimal}      \usepackage{fontspec}     \setmainfont{Cambria}     \begin{document}     й $xy$     \end{document}      The compilation stops and the error is following:               error: ...s/MiKTeX 2.9     /tex/luatex/luaotfload/otfl-node-inj.lua:225: attempt to index local 'tm' (a nil     value)     .     \newpage ...k \@nobreakfalse \everypar {}\fi \par                                                   \vfil \penalty -\@M     l.6 \end{document}      When they are in different paragraphs e.g. the document body is               \begin{document}     й           $xy$     \end{document}      then there is no problem. Also there is no problem as well if I use the same math font e.g. with               \usepackage{unicode-math}     \setmathfont{Cambria Math}      But still the compilation stops if I use a symbol from a different font (e.g. \Box from amssymb). UPD: I get the same problem with other accented letters, not only Cyrillic: à, ѓ, ё, ї, ќ, ў etc, except i. UPD2: Happens only with Cambria.


title: Problem with \pgfmathparse and font style of array elements

text: There are probably other ways to do that, but I was happy I've found this code working just fine for my needs:               \documentclass{article}     \usepackage{tikz}     \newcounter{grpcnt}     \def\groups{grp1, grp2, grp3}     \def\keyvals{{ {"key 00/val 00, key 01/val 01"}, {"key 10/val 10, key 11/val 11, key 12/val 12"}, {"key 20/val 20"} }}     \begin{document}     \setcounter{grpcnt}{0}     \foreach \grp in \groups {         \section*{\grp}         \pgfmathparse{\keyvals[\thegrpcnt]}         \foreach \key/\val in \pgfmathresult         {             \textbf{\key}: \val \\[1ex]         }         \addtocounter{grpcnt}{1}     }     \end{document}      The problem I have is if I try to store any font styling in the 2nd array, say an `\emph{}` on the first value 00:               \documentclass{article}     \usepackage{tikz}     \newcounter{grpcnt}     \def\groups{grp1, grp2, grp3}     \def\keyvals{{ {"key 00/val \emph{00}, key 01/val 01"}, {"key 10/val 10, key 11/val 11, key 12/val 12"}, {"key 20/val 20"} }}     \begin{document}     \setcounter{grpcnt}{0}     \foreach \grp in \groups {         \section*{\grp}         \pgfmathparse{\keyvals[\thegrpcnt]}         \foreach \key/\val in \pgfmathresult         {             \textbf{\key}: \val \\[1ex]         }         \addtocounter{grpcnt}{1}     }     \end{document}      Which will break compilation. I found out that some other types of commands are seen and interpreted correctly (e.g., some special characters like `\AE` work just fine), but any font syling command I've tried (`\large`, `\textbf{}`, `\itshape`, etc.) have failed. Any idea why and/or how I could store some font styling in the 2nd array? Thanks! :)


title: Proper display of fractions

text: Have a look at the following code:               \documentclass[letterpaper]{article}     \usepackage{amsmath,amssymb}     \begin{document}      $2-\frac{2}{1-\left(\frac{2}{2-\frac{2}{x^2}}\right)}$\quad      $2-\dfrac{2}{1-\left(\dfrac{2}{2-\dfrac{2}{x^2}}\right)}$\quad      $2-\cfrac{2}{1-\left(\cfrac{2}{2-\cfrac{2}{x^2}}\right)}$\quad      $2-\dfrac{2}{1-\left(\cfrac{2}{2-\dfrac{2}{x^2}}\right)}$     \end{document}      This gives: ![enter image description here](http://i.stack.imgur.com/etIFY.png) Evidently, the first display is not the proper way. The second and last are the same I guess. The third has a better display but there is too much space above the 2 in `\left(\cfrac{2}{2-\cfrac{2}{x^2}}\right)`. Essentially, non of the above displays satisfies, for me, a good Mathematical typsetting. Although, it may be argued that it is the default in LaTeX. I just can't get it right? Any insights? In a book I got this example from it looks like this without the excessive bold (this is a scanned image): ![enter image description here](http://i.stack.imgur.com/E2ONZ.png)


title: Changing colors of MATH functions and DRAWING lines

text: My problem is that I want my math functions and drawing illustrations to be in different colors. I want my colors to be defined at the beginning so they will automatically change the color of math and illustration as i like. I was never working with math and drawing before so that's why it is a bit problem for me. Thank you very much for your help. WORKING CODE:               \documentclass[svgnames]{report}     \usepackage{tikz}     \usepackage[cp1250]{inputenc}     \usepackage[slovak]{babel}     \usepackage{kpfonts}                    \definecolor{colMATH}{RGB}{255,0,0} % color of the math functions     \definecolor{colILLUS}{RGB}{0,0,255} % line color in illustration          % example     \begin{document}          % MATH                 $$detA=|A|= \left|\begin{array}{cccc}                 a_11 & a_12 & \ldots & a_{1n} \\                 a_21 & a_22 & \ldots & a_{2n} \\                 . & . &  & . \\                 . & . &  & . \\                 . & . &  & . \\                 a_{n1} & a_{n2} & \ldots & a_{nn} \\                 \end{array} \right|=\sum{(-1)^ja_{1k_1}\cdot a_{2k_2}\cdot a_{3k_3}\cdot...\cdot a_{nk_n}} $$                                                      % ILLUSTRATION     \setlength{\unitlength}{1mm}     \begin{picture}(120,100)(-8,0)        \put(35,5){\vector(1,0){50}}        \put(88,5){\makebox(0,0){$h$}}        \put(40,2){\makebox(0,0){$h_A$}}        \put(70,2){\makebox(0,0){$h_B$}}        \multiput(40,5)(30,0){2}{\line(0,1){90}}        \multiput(40,5)(0,10){7}{\line(1,1){30}}        \multiput(40,35)(6,0){5}{\line(1,0){3}}        \multiput(40,65)(6,0){5}{\line(1,0){3}}        \multiput(40,5)(0,30){3}{\circle*{2}}        \multiput(70,35)(0,15){3}{\circle*{2}}        \multiput(40,35)(0,30){2}{\line(1,-1){30}}        \multiput(39.75,15)(.25,0){3}{\line(0,1){10}}        \multiput(39,15)(0,10){2}{\line(1,0){2}}        \multiput(69.75,55)(.25,0){3}{\line(0,1){10}}        \multiput(69.75,40)(.25,0){3}{\line(0,1){5}}        \multiput(69,35)(0,5){7}{\line(1,0){2}}        \put(97,60){\makebox(0,0){$          \left\}\rule[-4mm]{0mm}{8mm}\right.\leftarrow          \Delta\tau = 2T_{Cs}\mbox{(lokale Uhr)}          $}}        \put(98,50){\makebox(0,0){$\leftarrow$ \emph{Explosion der 2. Uhr}}}        \put(96,42.5){\makebox(0,0){$\left\}\rule[-1.5mm]{0mm}{3mm}\right.          \hskip1mm\leftarrow\Delta\tau = T_{Cs}\mbox{(lokale Uhr)}$}}        \put(25,20){\makebox(0,0){$\Delta\tau = T_{Cs}\rightarrow          \left\{\rule[-4mm]{0mm}{8mm}\right.$}}  %}        \put(38,8){\makebox(0,0){1}}        \put(17,35){\makebox(0,0){ \emph{Start der 1. Uhr} $\rightarrow$ 2$A$}}        \put(13,65){\makebox(0,0)                     {\emph{Explosion der 1. Uhr} $\rightarrow$ 3$A$}}        \put(93,35){\makebox(0,0)                     { 2$B \leftarrow$ \emph{Start der 2. Uhr}}}        \put(74,68){\makebox(0,0){$3B$}}     \end{picture}          \end{document}      THIS IS WHAT I WANT TO HAVE: ![enter image description here](http://i.stack.imgur.com/7VyYC.jpg)


title: Extraneous space inserted before citealp command

text: I am defining a citation (using the `citealp`) command and using it like this:               \documentclass{article}     \usepackage[super]{natbib}          \setcitestyle{square,citesep={; }}     \newcommand*{\citesquare}[2]{\mbox{\textsuperscript{[}\citealp{#1}\textsuperscript{#2]}}}          \begin{document}          This\citesquare{lamport94}{, pp.~20-30} is a citation     used for experimentation and demonstration purposes only.          \begin{thebibliography}{9}     \bibitem{lamport94}       Leslie Lamport,       \emph{\LaTeX: A Document Preparation System}.       Addison Wesley, Massachusetts,       2nd Edition,       1994.     \end{thebibliography}          \end{document}      The problem is that there appears an extraneous space after the opening square bracket in the output. A hacky solution would be to insert something like `\hspace` with a negative argument after the opening square bracket in the command's definition, but this doesn't scale (if used in footnotes - actually is that right? I tried a negative `em`-argument (which didn't scale) but perhaps there are scalable ways of doing this?), and I'm looking for a real solution that exactly removes the space. Note that I'm really looking for something that makes citations look exactly like shown, (bare numbers embedded in superscript square brackets, with additional text possibly before (which I have another macro for) and after). While my personal citation style is not important, the emphasis in my question is that I would like this particular approach fixed (so please not a reference to an alternative package/style that gives me something that looks _almost_ like what I am interested in: I'm likely aware of those).


title: Progress bar for latex-beamer

text: Instead of slide numbers, I find it very nice to have something like a unobtrusive progressbar at the bottom which grows each slide about (width of screen)/(slide numbers). I've found here (page in German) the following code snippet:               %%-----------------------------------------------------------------------     %% progress bar in footline     %% http://www.mrunix.de/forums/showpost.php?p=316577&postcount=3     %% -----------------------------------------------------------------------     \definecolor{lightgr}{rgb}{0.7 0.7 0.7}     \makeatletter     \addtobeamertemplate{footline}{%       \color{lightgr}% to color the progressbar       \hspace*{-\beamer@leftmargin}%       \rule{\beamer@leftmargin}{2pt}%       \rlap{\rule{\dimexpr           \beamer@startpageofframe\dimexpr           \beamer@rightmargin+\textwidth\relax/\beamer@endpageofdocument}{1pt}}       % next 'empty' line is mandatory!            \vspace{0\baselineskip}       {}     }      It work fine in the beginning, but after I added a certain number of frames, suddenly it caused the following error message:               ! Dimension too large.     <argument> ...amer@rightmargin +\textwidth \relax                                                        /\beamer@endpageofdocument      l.517 \lyxframeend      It took me several hours to figure out that the progress bar caused the error message, because it is thrown only when I add certain images. But I couldn't figure out any system, when there is an error and when not. Sometimes it is possible to add new frames without problems, sometimes not. Sometimes when I use pdfpages to add a page the error occurs. I use LyX (as you can see) and the Pittsburgh theme, but I suppose such a (running) progress bar snippet would be interesting for many users (also those with other themes and without LyX). A screenshot of a frame to illustrate the result: ![Screenshot](http://i.stack.imgur.com/ZEsKb.png) **My Qustions:**   * Is there a way to get this code more stable and compatible with any theme?   * Would it be easy to turn this into an package?   * How can I change the `\beamer@startpageofframe` to the real PDF page number? (Otherwise there are quite big and sudden jumps of the progressbar.) (Please comment if I should provide more information, e.g. my whole LyX file.)


title: Relation spacing error using =& in aligned equations

text: The middle equation in the following example seems to have wrong spacing around the `=` sign. The only difference is that I used `=&` for aligning around the `=` sign rather than `&=`. This worries me, because sometimes I want to emulate "multline equations", and I want the equations to be aligned like that but without putting an `=` sign at all. Is it known, explainable behaviour? I.e., is it a bug or a feature?               \documentclass{minimal}     \usepackage{amsmath}     \begin{document}     \[      a=b     \]      \begin{align*}       a =& b\\       c =& d      \end{align*}      \begin{align*}       a &= b\\       c &= d      \end{align*}     \end{document}      ![output](http://i.stack.imgur.com/YWsIr.png)


title: Place a column vector surrounded by square brackets in a 3-column table?

text: I have a 3 column table and in the third column I am representing a $20\times 1$ vector. I would like to put square brackets on each side of this vector.               \documentclass[a4paper,12pt,times,numbered,print,index]{Classes/PhDThesisPSnPDF}          \RequirePackage[left=37mm,right=30mm,top=35mm,bottom=30mm]{geometry}     \RequirePackage{libertine}      \RequirePackage[small,bf]{caption}     \RequirePackage[labelsep=space,tableposition=top]{caption}      \usepackage{subfig}       \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{braket}     \usepackage{algorithm}% http://ctan.org/pkg/algorithms     \usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx     \usepackage{algorithm}% http://ctan.org/pkg/algorithms     \usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx          \begin{document}          \begin{table}[ph]       \centering       \begin{tabular}{| >{$}c<{$} | >{$}c<{$} | >{$}c<{$} |}         \hline         \text{Position} & \text{State} & \text{P} \\         \hline         \multirow{4}{*}{-2}          & \ket{\leftarrow, 0}   & 0 \\         & \ket{\leftarrow, 1}   & 0 \\         & \ket{\rightarrow, 0}  & 0 \\         & \ket{\rightarrow, 1}  & 0 \\         \hhline{--~}         \multirow{4}{*}{-1}          & \ket{\leftarrow, 0}   & 0 \\         & \ket{\leftarrow, 1}   & 0 \\         & \ket{\rightarrow, 0}  & 0 \\         & \ket{\rightarrow, 1}  & 0 \\         \hhline{--~}         \multirow{4}{*}{0}          & \ket{\leftarrow, 0}   & 1 \\         & \ket{\leftarrow, 1}   & 0 \\         & \ket{\rightarrow, 0}  & 0 \\         & \ket{\rightarrow, 1}  & 0 \\         \hhline{--~}         \multirow{4}{*}{1}          & \ket{\leftarrow, 0}   & 0 \\         & \ket{\leftarrow, 1}   & 0 \\         & \ket{\rightarrow, 0}  & 0 \\         & \ket{\rightarrow, 1}  & 0 \\         \hhline{--~}         \multirow{4}{*}{2}          & \ket{\leftarrow, 0}   & 0 \\         & \ket{\leftarrow, 1}   & 0 \\         & \ket{\rightarrow, 0}  & 0 \\         & \ket{\rightarrow, 1}  & 0 \\         \hline           \end{tabular}       \caption{Interpretation of the particle matrix for a $1$-step memory walk. Observe that for each position we are able       to represent the p}       \label{T:peak}     \end{table}     \end{document}      Does any one know how to place square brackets on either side of the vector P?


title: Backward definition of (La)TeX commands

text: _Again and again I see, that TeXnicians define commands and do several things with them in the reverse order, I would do this as amateur. See this example:_ In his answer to scrpage2: Three "marks" for headings egreg defines a `\parttitle`, and even more he applies also a patch:               \apptocmd{\@part}{\parttitle{#2}}{}{}     \def\parttitle#1{\gdef\theparttitle{#1}}     \def\theparttitle{} % initialization      I would have done it in this way - first initialization, then real definition, and last patching:               \def\theparttitle{} % initialization     \def\parttitle#1{\gdef\theparttitle{#1}}     \apptocmd{\@part}{\parttitle{#2}}{}{}      A test shows, that this works, as well. So, my question is: **What is the advantage of defining TeX commands backwards?**   _(At least from an amateur’s point of view …)_


title: Problem with boxes and paragraphs

text: I am trying to create a form for my company. I am new to Latex and based on some tutorials i was able to get to a certain point. But as you can see   1. The `fbox` is starting from a different margin   2. I am trying to get the paragraph to move up close to the first table.   3. The table that starts with an arrow seems to start before the margin, how do i align them   4. I am trying to have the underline of "unit holder information" to match the bottom line of the `fbox` and extend it to the rest of the line. 4. Any help on these would be appreciated. ![enter image description here](http://i.stack.imgur.com/Y6L5x.png)               \documentclass[a4paper,10pt]{report}     \usepackage[margin=0.45cm]{geometry}     \usepackage[utf8]{inputenc}     \newenvironment{nscenter}      {\parskip=0pt\par\nopagebreak\centering}      {\par\noindent\ignorespacesafterend}     \newcommand{\myheading}[1]{     \fbox{\phantom{\rule{.7ex}{.7ex}}}\hspace{1pt}\underline{\textbf{#1}\hfill}\tabularnewline     }      \usepackage{array}     \usepackage{ulem}     \usepackage{hyperref,wasysym}     \usepackage{pifont}     \begin{document}     \begin{nscenter}      \textbf{\Large ABC COMPANY Transaction Form}{\footnotesize (For existing     unit holders only)}     \end{nscenter}     \setlength{\arrayrulewidth}{1pt}     \setlength{\tabcolsep}{1pt}     \footnotesize     \begin{tabular}{|>{\centering}p{4.2cm}|>{\centering}p{4.0cm}|>{\centering}p{3.9cm}|>{\centering}p{3.1cm}|>{\centering}p{3.0cm}|}     \hline      Broker ARN & Sub Broker/Branch Code & Sub-Broker ARN & EUIN &             Date\tabularnewline     \hline      {\textbf{\large ABC 12345}} &  &{\textbf{\normalsize A012344}} &      &\underline{${}$\hspace{0.6cm}}/\underline{${}$\hspace{0.6cm}}/\underline{${}$\hspace{1.0cm}} \tabularnewline[1.0pt]     \hline      \end{tabular}\\     \normalsize     \fboxrule=1pt \fbox{\phantom{\rule{2.7ex}{2.7ex}}} \fbox{\parskip=0pt\parbox[t]{0.90\textwidth}{\raggedright{}{\tiny I/We hereby     confirm that the EUIN box has been intentionally left blank by me/us as this is     an “execution-only” transaction without any interaction or advice by the     employee/relationship manager/sales person of the above distributor or     notwithstanding the advice of in-appropriateness, if any, provided by the     employee/relationship manager/sales person of the distributor and the     distributor has not charged any advisory fees on this transaction.\par}}}\\     \hspace{0.5cm}     \setlength{\arrayrulewidth}{1pt}     \setlength{\tabcolsep}{1pt}     \scriptsize     \begin{tabular}{p{2.3cm}|p{4.4cm}|p{1.9cm}|p{3.7cm}|p{1.8cm}|p{4.5cm}}     \hline     {\textbf{\huge\hspace{4pt}\ding{220}}}\parbox[t]    {0.85\textwidth}{Sole/First\\ unit Holder}& &\parbox[t]{0.85\textwidth}{Second     \\unit Holder}& &\parbox[t]{0.85\textwidth}{Third\\ unit holder}&     \tabularnewline     \hline       \end{tabular}\\\\     \normalsize     \underline{\textbf{ABC Company Transfer}}\\     \myheading{Unit Holder Information}\\     \end{document}


title: Changing contents of a table to verbatim

text: As per title, I would like the text in a specific table to be written in verbatim. Being able to change the font of specific rows in a table would be a bonus. Currently what I have is as follows:               \begin{table}[!htbp]     \fontsize{11}{9}     \begin{center}     \begin{tabular}{| l |  l | l | l |}      \hline     \hline\hline      Parse subtree    & String & Semantics & Agreement Features  \\ [0.7ex]      %heading     \hline     np(noun(brad))    & brad&  [brad]  &  [masculin,singular]\\      verb(saves)     &  saves&  [Y,X,saves(X,Y)] &  \\     np(det(a),n(life))  & a life & [a(Z),life(Z)]  & [singular] \\     vp(v(saves),np(det(a),n(life)) & saves a life& ? & \\ [1ex]      \hline      \end{tabular}     \end{center}     \end{table}


title: LyX undefined control sequence \input

text: I'm a new user. I-m in trouble with lyX and in particular how to use `\input{file.tex}` correctly. Error: "undefined control sequence". Actually I'm not sure where I have to specify the path so that LyX can recognize and find it. So far I used Insert > float > table (here is where I'm going to append 2 different tables). In LateX preamble (Document > Settings > LateX Preamble) I'm using the following:               % Packages for tables     \usepackage{booktabs}% Pretty tables     \usepackage{threeparttablex}% For Notes below table          % *****************************************************************     % siunitx     % *****************************************************************     \newcommand{\sym}[1]{\rlap{#1}}           \usepackage{siunitx}         \sisetup{             detect-mode,             group-digits            = false,             input-symbols           = ( ) [ ] - +,             table-align-text-post   = false,             input-signs             = ,             }             % Character substitution that prints brackets and the minus symbol in text mode. Thanks to David Carlisle     \def\yyy{%       \bgroup\uccode`\~\expandafter`\string-%       \uppercase{\egroup\edef~{\noexpand\text{\llap{\textendash}\relax}}}%       \mathcode\expandafter`\string-"8000 }          \def\xxxl#1{%     \bgroup\uccode`\~\expandafter`\string#1%     \uppercase{\egroup\edef~{\noexpand\text{\noexpand\llap{\string#1}}}}%     \mathcode\expandafter`\string#1"8000 }          \def\xxxr#1{%     \bgroup\uccode`\~\expandafter`\string#1%     \uppercase{\egroup\edef~{\noexpand\text{\noexpand\rlap{\string#1}}}}%     \mathcode\expandafter`\string#1"8000 }          \def\textsymbols{\xxxl[\xxxr]\xxxl(\xxxr)\yyy}               % *****************************************************************     % Estout related things     % *****************************************************************     \let\estinput=\input % define a new input command so that we can still flatten the document          \newcommand{\estwide}[3]{             \vspace{.75ex}{                 \textsymbols% Note the added command here                 \begin{tabular*}                 {\textwidth}{@{\hskip\tabcolsep\extracolsep\fill}l*{#2}{#3}}                 \toprule                 \estinput{#1}                 \bottomrule                 \addlinespace[.75ex]                 \end{tabular*}                 }             }             \newcommand{\estauto}[3]{             \vspace{.75ex}{                 \textsymbols% Note the added command here                 \begin{tabular}{l*{#2}{#3}}                 \toprule                 \estinput{#1}                 \bottomrule                 \addlinespace[.75ex]                 \end{tabular}                 }             }          % Allow line breaks with \\ in specialcells     \newcommand{\specialcell}[2][c]{%         \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}     }          % *****************************************************************     % Custom subcaptions     % *****************************************************************     % Note/Source/Text after Tables     % The new approach using threeparttables to generate notes that are the exact width of the table.     \newcommand{\Figtext}[1]{%         \begin{tablenotes}[para,flushleft]         \hspace{6pt}         \hangindent=1.75em         #1         \end{tablenotes}         }     \newcommand{\Fignote}[1]{\Figtext{\emph{Note:~}~#1}}     \newcommand{\Figsource}[1]{\Figtext{\emph{Source:~}~#1}}     \newcommand{\Starnote}{\Figtext{* p < 0.1, ** p < 0.05, *** p < 0.01. Standard errors in parentheses.}}% Add significance note with \starnote      I appreciate your support! Thank you!


title: TikZ: compilation time performance of decorations

text: I want to produce a picture that contains lots of two-part cylinder-kind shapes (maybe about 200) along certain paths. Here is an example of such a shape:               \documentclass{standalone}     \usepackage[svgnames]{xcolor}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}          %%%%% H-O bond between atom 1 and atom 3          %%% O half of the bond     % O half bond shading     \pgfdeclareverticalshading{1_3_O3_BondShading}{100bp}{       color(0.000bp)=(Black!75!Red);       color(22.773bp)=(Black!75!Red);       color(45.525bp)=(Black!3.893!Red);       color(53.986bp)=(White!26.261!Red);       color(59.561bp)=(White!26.261!Red);       color(68.022bp)=(Black!3.893!Red);       color(90.773bp)=(Black!75!Red);       color(100.000bp)=(Black!75!Red)}     % O half bond drawing     \begin{scope}       \pgfsetadditionalshadetransform{\pgftransformyscale{0.0856124622417}}       \pgfpathmoveto{\pgfpoint{3.107cm}{-5.942cm}}       \pgfpathlineto{\pgfpoint{2.998cm}{-5.816cm}}       \pgfpatharcaxes{0}{180}{\pgfpoint{0.085cm}{0.073cm}}{\pgfpoint{-0.034cm}{0.040cm}}       \pgfpathlineto{\pgfpoint{2.936cm}{-6.088cm}}       \pgfpatharcaxes{180}{0}{\pgfpoint{0.085cm}{0.073cm}}{\pgfpoint{-0.034cm}{0.040cm}}       \pgfusepath{clip}       \pgfpathcircle{\pgfpoint{2.968cm}{-5.952cm}}{1.168cm}       \pgfshadepath{1_3_O3_BondShading}{-49.384}       \pgfusepath{}     \end{scope}          %%% H half of the bond     % H half bond shading     \pgfdeclareverticalshading{1_3_H1_BondShading}{100bp}{       color(0.000bp)=(Black!75!White);       color(22.773bp)=(Black!75!White);       color(45.525bp)=(Black!20.000!White);       color(53.986bp)=(White!26.261!White);       color(59.561bp)=(White!26.261!White);       color(68.022bp)=(Black!20.000!White);       color(90.773bp)=(Black!75!White);       color(100.000bp)=(Black!75!White)}     % H half bond drawing     \begin{scope}       \pgfsetadditionalshadetransform{\pgftransformyscale{0.0856124622417}}       \pgfpathmoveto{\pgfpoint{2.936cm}{-6.088cm}}       \pgfpathlineto{\pgfpoint{3.026cm}{-6.193cm}}       \pgfpatharcaxes{180}{0}{\pgfpoint{0.086cm}{0.073cm}}{\pgfpoint{0.034cm}{-0.040cm}}       \pgfpathlineto{\pgfpoint{3.107cm}{-5.942cm}}       \pgfpatharcaxes{0}{180}{\pgfpoint{0.085cm}{0.073cm}}{\pgfpoint{-0.034cm}{0.040cm}}       \pgfusepath{clip}       \pgfpathcircle{\pgfpoint{3.066cm}{-6.067cm}}{1.168cm}       \pgfshadepath{1_3_H1_BondShading}{-49.384}       \pgfusepath{}     \end{scope}          \end{tikzpicture}          \end{document}      Since this makes the code unreadably long I thought of putting this into a decoration. The decoration will have to take a lot of arguments: the names, colors and positions of the shadings, as well as the coordinates for the `\pgfpatharcaxes` commands. Unfortunately, I have very little experience with TeX and `pgf` programming so that this will take up some time. Since I want to be sure that this time investment is not wasted I'd like to know whether it is to be expected that TikZ decorations come with any penalty for the compilation time compared to the normal code shown above (I would refrain from using a decoration if the compilation would take more than twice as long)? Is it advisable to use a decoration in my case or might there be reasons against it?


title: Globally setting the separation length for _subitems_ in Beamer

text: How can I **globally** change the item separation length for **subitems** in Beamer? I need a command such as the below, only working.               \setbeamertemplate{itemize/enumerate subbody begin}{\normalsize \itemsep=0.2mm}      I have already searched the forum and have seen answers addressing the topics of setting the space before/after the itemize environment as well as setting the spacing in normal itemize body (i.e. not subbody or subsubbody). I think this has not been asked before. Note: My main concern is to set all body and subbody styles having the same font size as well as seperation. The command               \setbeamertemplate{itemize/enumerate subbody begin}{\normalsize}      lets set the font, however, the nested items are tighter (vertically) than those of their parents.


title: TikZ current page.north west shifted ~4pts?

text: I'm trying to draw a background grid on a page, but `current page.north west` is shifted down and to the right ~4pt. Anyone know how I can get the _exact_ north west corner of the page? Here's an example:               \documentclass{article}     \setlength{\parindent}{0pt}     \usepackage[papersize={2.5in,0.5in},margin=0in]{geometry}     \usepackage{tikz}     \pagestyle{empty}     \begin{document}%     \begin{tikzpicture}[remember picture,overlay]%       \node at (current page.north west) [anchor=north west]{%         \tikz{\draw[step=0.25in,color=red,thick] (0,0)           grid (\paperwidth,\paperheight);}%       };%     \end{tikzpicture}%     \begin{minipage}{\linewidth}%     In Ti\emph{k}Z, \texttt{current page.north west} is shifted $\sim$4pt     right and down%     \end{minipage}%     \end{document}      ![enter image description here](http://i.stack.imgur.com/5uD37.png)


title: Drawing of PSTricks figure not precise

text: Consider the following code:               \documentclass{article}          \usepackage{pstricks-add}     \usepackage[locale=DE]{siunitx}          \ExplSyntaxOn       \cs_new_eq:NN \calculate \fp_eval:n     \ExplSyntaxOff          \def\ORb{\calculate{\SideLength/(2*sin(pi/\NoSides))-2.7}}     \def\ORh{\calculate{\SideLength/(2*sin(pi/\NoSides))-1.1}}     \def\area{\calculate{\NoSides*\SideLength^2*cot(pi/\NoSides)/4}}     \makeatletter       \def\LabelLine{\@ifnextchar[\LabelLine@i{\LabelLine@i[0]}}       \def\LabelLine@i[#1](#2)(#3)#4#5{%         \pcline[linestyle=dashed,offset=#4]{|*-|*}(#2)(#3)         \ncput*[nrot=#1]{#5}       }     \makeatother          \def\polygon#1#2{%      \def\NoSides{#1 }      \def\SideLength{#2 }      \psset{unit=0.75mm}       \begin{pspicture}(-\ORb,-\ORh)(\ORb,\ORh)        \edef\dAngle{\the\numexpr360/\NoSides}        \pstVerb{%          /R \SideLength 180 \NoSides div sin 2 mul div def          /Q R \dAngle\space 2 div tx@Dict begin PtoC end pop def        }         \pscircle(0,0){!R}         \multido{\rA=\numexpr\dAngle/2+\dAngle,\iB=0+1}{\NoSides}{%           \pcline[linewidth=2pt](!R \rA\space PtoC)(!R \rA\space \dAngle\space add PtoC)           \ifnum\iB=0              \LabelLine[:U](!R \rA\space \dAngle\space add PtoC)(!R \rA\space PtoC)%               {-8pt}{\SI{\SideLength}{\m}}             \LabelLine(!R \rA\space \dAngle\space add PtoC)(!Q dup){8pt}{$x$}             \LabelLine(!R \rA\space PtoC)(!Q dup){-8pt}{$x$}           \fi         }        \psset{linestyle=dotted}         \psframe(!Q neg dup)(!Q dup)         \rput(!Q neg dup)    {\psframe(5,5)}         \rput(!Q neg Q 5 sub){\psframe(5,5)}         \rput(!Q 5 sub Q neg){\psframe(5,5)}         \rput(!Q 5 sub dup)  {\psframe(5,5)}         \rput(0,0){$A \approx \SI[round-mode=places,round-precision=0]{\area}{\square\m}$}       \end{pspicture}     }          \begin{document}          \polygon{8}{60}          \end{document}      ![output](http://i.stack.imgur.com/6Neo5.jpg) As can be seen in the picture, the line segment in the octagon is not completely horizontal; why and how do I fix it? Furthermore, how do I get a smooth connection between the line segments making up the octagon, i.e., the sides?


title: is it possible to add dashed lines between rows/column of pmatrix from amsmath?

text: I wish these packages from amsmath have more options! Is there a way to add a macro to add dashed lines between rows and columns for a matrix typeset using `pmatrix`? Similar to what is being asked here A Matrix with labels, dashed lines But I can't use the solution given in the above, since I have to use `pmatrix` I have to use `pmatrix`, since this is what `Scientific Word` supports/produces when I click on add a matrix from the GUI and I have no control over changing this. Here is a typical Latex file generated using one matrix               \documentclass{article}%     \usepackage{amsmath}%     \usepackage{amsfonts}%     \begin{document}     This is my matrix          $     \begin{pmatrix}     \sin x & \cos x\\     B & A     \end{pmatrix}     $     \end{document}      ![Mathematica graphics](http://i.stack.imgur.com/L8AiR.png) I can't modify the code generated and change `pmatrix` to say `array` or such in order to use the solution shown above, since then SW will not display the result on the screen when I open the file again to continue working on it. But what I can do is add a macro in the preamble to modify the definition of `pmatrix` since I use `texlive` 2013 to build the file and only use `SW` for entering the math since it is much easier for me to do so at this time. So, I'd like to ask for help if there is a way to use some `\renewcommad` or such to replace `pmatrix` with `array` or some other solution in order to add these dashed lines between rows and columns when compiling the file? thank you,


title: Table cell color overlaps cell border

text: As the graphic and MWE below show, some of colored my table cells are obscured the cell colors. I'd appreciate help fixing this. ![Table with colored cells](http://i.stack.imgur.com/mwvI0.png)               \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage[table]{xcolor}          \makeatletter     \providecommand{\tabularnewline}{\\}     \makeatother          \usepackage{babel}     \begin{document}     \begin{tabular}{c|c|c|c|cc|}     \multicolumn{1}{c}{} & \multicolumn{1}{c}{A} & \multicolumn{1}{c}{B} & \multicolumn{1}{c}{C} & D & \multicolumn{1}{c}{E}\tabularnewline     \cline{2-6}      a & \cellcolor{blue!25} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} &  & \cellcolor{red!25} \tabularnewline     \cline{2-3}      b &  &  & \multicolumn{1}{c}{} &  & \tabularnewline     \cline{2-4}      c &  &  &  &  & \tabularnewline     \cline{2-5}      d &  &  &  & \multicolumn{1}{c|}{} & \tabularnewline     \cline{2-6}      e &  & \cellcolor{green!25} &  & \multicolumn{1}{c|}{} & \tabularnewline     \cline{2-6}      \end{tabular}     \end{document}


title: Optimum parameters for 1280x727 screen?

text: I'm going to experiment with using my Android tablet to lecture from this coming semester: moving between LaTeX PDFs and a handwriting note app. My usable screen size is 1280 x 727 pixels (there's a status bar which I can't remove without rooting, which I'm hesitant to do...) What are the optimum parameters (geometry, font type and size etc) for a LaTeX file to look best on this device; or where should I start experimenting to find the best solution? In the past I've simply used ConTeXT with S8 paper size and a helvetica 20 pt font, but I'm moving back to LaTeX (simply because most of my notes for this subject are already in LaTeX and I don't want to spend time converting them). And as I've just discovered, S8 provides a 4:3 screen ratio, and I need something closer to 9:5.


title: Strech the text to the borders of a node by using \hfill

text: The text inside the nodes is not streched to the right side of the node by using `\hfill`. Could it be the reason that it doesn't work with `font=\tiny`? But I need the text that small and I would like that the explanation text is at the right side inside the node and the short term like `Frg 1` is on the left side inside the node. * * *               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{positioning,shadows,arrows,backgrounds,fit,matrix}          \begin{document}          \begin{figure} [H]          \begin{tikzpicture}     [font=\tiny,      pfeil/.style                   ={draw,->,shorten <=0pt,>=stealth', thick, -latex',shorten >=0pt},      stext/.style                   ={draw,solid, fill=gray!10, text width=25em,minimum height=1em, drop shadow, rounded corners},      snr/.style                     ={drop shadow,fill=gray!10,draw,solid,circle,minimum width=4mm,inner sep=0pt},      every matrix/.style    ={matrix of nodes, row sep=1mm, column sep=3mm,fill=gray!40,draw=black,dashed,rounded corners,inner sep=2mm}]              \newcommand{\beschr}[1]{\hfill\textit{#1}};              \matrix (einlegen)                   {                 \node   (e11)       {}; &   \node   (e12)       [snr]   {1.};   &   \node   (e13)       [stext] {Frg 1\beschr{Freigabe Einfahrt Bauteil}};                  \\                 \node   (e21)       {}; &   \node   (e22)       [snr]   {2.};   &   \node   (e23)       [stext] {MZ 11 V\beschr{Sauger ein}};      \\                                                                                \node   (e31)       {}; &   \node   (e32)       [snr]   {3.};   &   \node   (e33)       [stext] {Frg 2\beschr{Freigabe Ausfahrt Bauteil}};                  \\             };              \node   [fit=(e11)(e31),label={[rotate=90,xshift=1mm]center:\textbf\tiny{Einlegen}}] {};              \matrix (arbeitsstellung)   [below=.3cm of einlegen]             {                 \node   (a11)       {}; &   \node   (a12)       [snr]   {4.};   & \node (a13)       [stext] {MZ 12 V\beschr{Spanner Innenblech vorw\"arts}};            \\                 \node   (a21)       {}; &   \node   (a22)       [snr]   {5.};   & \node (a23)       [stext] {M1 \& M2 V\beschr{B\"ugel M1 \& M2 vorw\"arts}};           \\                 \node   (a31)       {}; &   \node   (a32)       [snr]   {6.};   & \node (a33)       [stext] {M3 \& M6 V\beschr{B\"ugel M3 \& M6 vorw\"arts}};           \\                 \node   (a41)       {}; &   \node   (a42)       [snr]   {7.};   & \node (a43)       [stext] {M4 \& M5 V\beschr{B\"ugel M4 \& M5 vorw\"arts}};           \\                 \node   (a51)       {}; &   \node   (a52)       [snr]   {8.};   & \node (a53)       [stext] {MZ 13 V\beschr{Klemmeinheit l\"osen}}; \\                                   \node   (a61)       {}; &   \node   (a62)       [snr]   {9.};   & \node (a63)       [stext] {MZ 14 V\beschr{Niederhalteraufnahme vorw\"arts}};          \\                 \node   (a71)       {}; &   \node   (a72)       [snr]   {10.};& \node   (a73)       [stext] {MZ 15-19 V\beschr{Niederhalteraufnahmen vorw\"arts}};          \\                 \node   (a81)       {}; &   \node   (a82)       [snr]   {11.};& \node   (a83)       [stext] {MZ 21-22 V\beschr{Niederhalterzustellungen vorw\"arts}};           \\                 \node   (a91)       {}; &   \node   (a92)       [snr]   {12.};& \node   (a93)       [stext] {MZ 23-24 V\beschr{Niederhalterzustellungen vorw\"arts}};           \\                 \node   (a101)  {}; &   \node   (a102)  [snr]   {13.};& \node   (a103)  [stext] {MZ 20 V\beschr{Sperrventil vorw\"arts}};   \\             };                    \node   [fit=(a11)(a101),label={[rotate=90]center:\textbf\tiny{Falze in Arbeitsstellung}}] {};     \begin{scope}   [every path/.style=pfeil]                     \path   (e33)   --  (a13);                 \end{scope}              \end{tikzpicture}          \end{figure}


title: How to keep section titles together with the content in ConTeXt?

text: I found many places in my document where the subsection titles are places alone at the bottom of the page with the content on the next page, like this:                ____________ ____________     |            |            |     | Section    | .......... |     | .......... | .......... |     | .......... | .......... |     | .......... | .......... |     | .......... | .......... |     | .......... | .......... |     | Section    | .......... |     |____________|____________|      I do not want any section titles to appear without any text below them, e.g., this will be fine:                ____________ ____________     |            |            |     | Section    | Section    |     | .......... | .......... |     | .......... | .......... |     | .......... | .......... |     | .......... | .......... |     | .......... | .......... |     |            | .......... |     |____________|____________|        * I used `\startsubsection` and `\stopsubsection` to define the whole section text. Is there any way to make sure that the section titles always appear together with at least one line of text from the paragraph inside?


title: Two columns for grammar environment

text: My grammar is long and thin. I'd like to space it out horizontally, as two columns.               \newenvironment{BNF}       {\captionsetup{type=lstlisting}}       {}          \begin{BNF}     \caption{My Grammar}     \label{grammar:my-grammar}     \begin{grammar}     <f> ::= "p"     \alt "true"     \alt "false"     \alt <f> <binop> <f>          <binop> ::= "U" (strong until)      \alt "&&" (logical and)      \alt $\rightarrow$ (implication)      \alt $\leftrightarrow$ (equivalence)     \end{grammar}     \end{BNF}      I'd like it to be one Listing, with one caption. But I'd like `<f>` to be in the first column, and `<binop` to be in the second. Is this possible?