title: right-justified column and bold-face rows

text: I'm new to latex but I'm trying to learn and am piecing together various pieces of code from different postings, so I apologize if this code is "messy". In a table, I would like to have the widths of the columns custom-defined, and I would also like to make specific rows bold. I had found out from another posting how to make specific rows bold, but now when I add code to make my column custom-width and right-justified, the bold-faced row part doesn't work anymore. Here is an example, where you see both situations:               \documentclass{scrreprt}          %for adding the ability to make entire rows bold:     \usepackage{array}     \newcolumntype{$}{>{\global\let\currentrowstyle\relax}}     \newcolumntype{^}{>{\currentrowstyle}}     \newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%       #1\ignorespaces     }          %define right justified column with custom width     \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}          \begin{document}     \begin{table}[ht]          \begin{tabular}{$p{2.1cm} ^p{1.6cm} R{1.5cm} R{2cm}}     \hline     header1 & header2 & header3 & header4\\     \hline     a & b & c & d\\     \rowstyle{\bfseries}     e & f & g & h\\     \hline     \end{tabular}     \end{table}     \end{document}      ![enter image description here](http://i.stack.imgur.com/lFXbl.png) As you can see, when I use the raggedleft column type (to make it right- justified), the bold-face doesn't work. Any ideas as to how I can get these two to work together?


title: Create new environment with options

text: I'm new to creating new environments and even though I searched at the `xparse*`documentation I couldn't figured out how to solve my specific problem. I would like to create a new environment, say `concept`, and I would like it to take an optional argument (I don't know if it has to be a boolean or what). This optional argument will make the text to be in italics. If the argument is not declared, it will simply print normal font. It's as simple as that. So               \begin{concept}[i] % I just invented a option named "i"       This text will be in italics     \end{concept}      or without an option               \begin{concept}       This text will be in normal font.     \end{concept}      I thought that may be using the `xparse` package would make the task easier. Sorry to ask such a silly question but I couldn't come to a solution.


title: gnuplot true standalone

text: Finally I have decided to go PDF. I can add pictures without EPS wrapper, and do drawings with TikZ - life is good :o) But how do I use gnuplot? For consistency I would like to use the `tikz` terminal, and I would like to be able to preview my graphs without including them in a document. This               set term tikz standalone preamble '\usepackage[version=3]{mhchem}'     set output "test.tex"     plot x title '\ce{H2O}'      will make an `article` class document that can compile alone, but it can not be included in another document. One solution would be _not_ to use the `standalone` option, and then make a small script, that wraps the output in the `standalone` class. Now the document can compile alone, and it can be included in a document, but I would not be able to specify an additional preamble. :o( Does anyone have a smart solution?


title: Spurious space above align environment at top of page/minipage

text: It seems that the `align` environment adds additional vertical space if it starts at the top of a page or `minipage`. Below are two pages, and two `minipage`s (on Page 1), where the first page/`minipage` has text followed by an `align*` environment, and the second page/`minipage` starts with an `align*` environment, and note that the equations are still aligned. ![enter image description here](http://i.stack.imgur.com/G8cE3.png) ## Attempted Solution: The closest related question I found was:   * Extra space above boxed multi-line equation I attempted to use the solution by Gonzalo Medina at the above by adding `\setlength\abovedisplayskip{0pt}` (after the preamble as per Vertical space before and after align environment). Although, this did move the equations up vertically, they were still vertically aligned: ![enter image description here](http://i.stack.imgur.com/xeN7k.png) And since the problem occurs at top of a page as well, I don't think this is related to Understanding minipages - aligning at top ## Question:   1. How can I adjust the `align` environment to automagically not have additional space at the top of a page or `minipage`?   2. Is there a reason for this behavior, and perhaps should not be changed? ## Code:               \documentclass{article}     \usepackage[showframe,paperwidth=3.5in,paperheight=2.2in,margin=0.5in]{geometry}     \usepackage{amsmath}          \begin{document}%\setlength\abovedisplayskip{0pt}     Top of Page 1     \begin{align*}% Text above at top of page      e &= m c^2     \end{align*}          \hrule     \begin{minipage}[t]{0.45\linewidth}         Top of minipage 1         \begin{align*}% Text above this minipage          e &= m c^2         \end{align*}     \end{minipage}     \begin{minipage}[t]{0.45\linewidth}         \begin{align*}% No text above in this minipage          e &= m c^2         \end{align*}     \end{minipage}          \newpage     \begin{align*}% No text above at top of page      e &= m c^2     \end{align*}     \end{document}


title: Display source for a command

text: When using `renewcommand`, sometimes I wish to first check what the original source code for a particular command, such as `chapter` was before I change it, so that I can be certain that I do not make unintended changes. When I have a lot of packages loaded, sometimes looking through the source code of a package to find the answer is not so simple. Is there a way to print out the source code used to define a particular command?


title: Indenting long citations inside a document?

text: > **This question led to a new feature in a package:**   >  `quoting` Suppose I have a very long sentence of law text that I need to have in my document. And according to the XYZ law: > Aaaaaa aoe oa ao oa oa aou oauoaeuoae uao aaaaaa aoe oa ao oa oa aou > oauoaeuoae uao aaaaaa aoe oa ao oa oa aou oauoaeuoae uao aaaaaa aoe oa ao oa > oa aou oauoaeuoae uao aaaaaa aoe oa ao oa oa aou oauoaeuoae uao aaaaaa aoe > oa ao oa oa aou oauoaeuoae uao aaaaaa aoe oa ao oa oa aou ... aaaaaa aoe oa > ao oa oa aou oauoaeuoae uao aaaaaa aoe oa ao oa oa aou oauoaeuoae uao aaaaaa > aoe oa ao oa oa ou oauoaeuoae uao aaaaaa aoe oa ao oa oa aou oauoaeuoae uao > aaaaaa aoe oa ao oa oa aou oauoaeuoae uao aaaaaa aoe oa ao oa oa aou > oauoaeuoae uao aaaaaa aoe oa ao oa oa aou oauoaeuoae uao. How can I indent that clearly with italics and proper citations to make it clear that it is not my writing?


title: Dynamically define commands

text: I have some latex code that goes a bit like this:               % Sp defines a generic command for an arbitrary space,      % and all of the others just delegate the bulk of their     % work to it so that when I decide to change the formatting,     % I can in one place.     \newcommand{\Sp}[2]{\textrm{#1}\left(#2\right)}     \newcommand{\Nul}[1]{\Sp{Nul}{#1}}     \newcommand{\Col}[1]{\Sp{Col}{#1}}     \newcommand{\Row}[1]{\Sp{Row}{#1}}          % Some common vectors, so I don't have to repeatedly type     % \vec{x}_1:     \newcommand{\u}{\vec{u}}     \newcommand{\v}{\vec{v}}     \newcommand{\w}{\vec{w}}     \newcommand{\x}{\vec{x}}     \newcommand{\y}{\vec{y}}      The work I'm doing is in linear algebra, where I need to use these vectors a _lot_. So, defining shorter commands seems pretty natural. But when papers start getting longer, I end up with either half the alphabet being defined as different commands -- one for each letter. So I tried to define a command that just defines another command so that I could just put it in a loop...               \newcommand{\MkVec}[1]{\expandafter\def\#1{\vec{#1}}}      and several variations thereupon... But the closest I came to a working model was when the error that the compiler gave me changed to `missing \begin{document}`. Can someone explain or give a source to learn more about what I should be doing (or if there's a better way after all) to define dynamic commands? Note that this specific instance is just one example. I'm interested in doing LaTeX metaprogramming, not rendering vectors nicely specifically.


title: Auto-generating a small book?

text: I'm considering a dive into TeX, but first want to determine if it makes sense for my particular project. I've inherited responsibility for a roster book with names, addresses, etc. for a club with several hundred members. Every year we print hard copies of this book. Currently, the book is a hand-edited Word document. I have three requirements:   1. Auto-generate the TeX that constitutes the book, pulling current member data from a database/spreadsheet.   2. Calculate page breaks dynamically so that member entries are not split across pages.   3. Have it look really nice. I figure I'm in the right place for #3, but, being a complete TeX n00b, I'd like opinions on whether this is something I should even attempt, and if so, the best way to approach it. My programming skills are fairly decent, so that won't be an issue. Thanks much.


title: Hyperref ignores \setdefaultlanguage from polyglossia

text: I use `polyglossia` to set my default language with `\setdefaultlanguage` to German. This works for the captions of tables, figures etc. I want to reference to these figures with the `\autoref` command of the `hyperref` package. But `hyperref` ignores the default language setting. But the reference name stays English ( _Table_ ), although the caption title is showed German ( _Tabelle_ ). A minimal XeLaTeX example:               \documentclass{article}     \usepackage{xltxtra}     \usepackage{polyglossia}     \usepackage{hyperref}                                                                               \setdefaultlanguage{german}     \begin{document}     \begin{table}             \centering             \caption{Testtabelle}             \begin{tabular}{lr}                     bla     & blub \\                     blabla  & blubblub \\             \end{tabular}             \label{test}     \end{table}     Die Tabelle \autoref{test}.     \end{document}      I use a workaround `\renewcommand{\tableautorefname}{Tabelle}` to rename the reference. But of course, this is only a workaround and no real solution. Has anybody any idea solving this issue?


title: Using commands inside environment definitions

text: I want to do something like               \newenvironment{definition}     {         \textit{     }     {         }     }      but of course it doesn't work, the braces get mixed up. (In other words, I want that within my environment, the content is surrounded by a command such as \textit or \textbf for instance.) Any ideas? EDIT : My environment now looks like this :               \newenvironment{definition}     {         \textbf{\underline{Definition.}}         \vspace{12 pt}         \begin{itshape}     }     {         \end{itshape}     }


title: Maintained version of tikz documentation

text: Is there maintained version of tikz and pgf documentation? The webpage doesn't state any but this file (pdf} is very useful.


title: Control vertical space of a caption in a given figure

text: I have used `\captionsetup` before mentioning the `\caption{}` I couldn't find a proper setting of this property. How can I adjust the caption's margin in order to illustrate it clearly?               \documentclass[english,a4paper,12pt]{report}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{lipsum}     \usepackage{tikz}     \usepackage{listings}     \usepackage{caption}     \usetikzlibrary{decorations.pathreplacing,calc}     \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}     \newcommand{\AddBelowPointcut}[3]{%         \begin{tikzpicture}[overlay, remember picture]             \draw [decoration={brace,amplitude=0.5em,mirror},decorate, thick,black]                     {($(#1.north west)-(0,0.2)$) -- ($(#2.north east)-(0,0.2)$)                      node [align=center, text width=4cm, pos=0.5, anchor=west,below=0.3cm,scale=0.8] {#3}};         \end{tikzpicture}     } %     \newcommand{\AddBelowPointcuttwo}[3]{%         \begin{tikzpicture}[overlay, remember picture]             \draw [decoration={brace,amplitude=0.5em,mirror},decorate, thick,black]                     {($(#1.north west)-(0,0.9)$) -- ($(#2.north east)-(0,0.9)$)                      node [align=center, text width=4cm, pos=0.5, anchor=west,below=0.3cm,scale=0.8] {#3}};         \end{tikzpicture}     } %     \newcommand{\AddBelowPointcuttwoname}[3]{%         \begin{tikzpicture}[overlay, remember picture]             \draw [->]                     {($(#1.south)-(-1,0.8)$) -- ($(#2.north)-(0.98,0.3)$)                      node [align=center, text width=2cm, pos=0.5, anchor=west,below=0.3cm,scale=0.8] {#3}};             \draw (0.8,-0.1) rectangle (2.1,-0.8);         \end{tikzpicture}     } %     \newcommand{\AddBelowPointcuttwokw}[3]{%         \begin{tikzpicture}[overlay, remember picture]             \draw [->]                     {($(#1.south)-(-0.7,0.8)$) -- ($(#2.north)-(0.74,0.3)$)                      node [align=center, text width=2cm, pos=0.5, anchor=west,below=0.3cm,scale=0.8] {#3}};         \end{tikzpicture}     } %     \begin{document}              \lipsum[1]                   \vspace{2.5em}                   \begin{figure}[ht]         \begin{lstlisting}[         basicstyle={\fontsize{8}{9}\ttfamily},mathescape,         identifierstyle={\color{black}},         tabsize=2,         language=Java,         numbersep=1pt,         xleftmargin=0cm,frame=tlbr,framesep=2pt,framerule=0pt,         morekeywords ={class,run}         ]         $\tikzmark{listing-ptkw-start}$pointcut$\tikzmark{listing-ptkw-end}$ $\tikzmark{listing-ptn-start}$getMedias()$\tikzmark{listing-ptn-end}$:$\tikzmark{listing-pt-start}$execution($\tikzmark{listing-p-start}$public MediaData[] AlbumData.getMedias(String)$\tikzmark{listing-p-end}$);$\tikzmark{listing-pt-end}$     \end{lstlisting}     %     \captionsetup{margin=0cm,position=below} %,belowskip=1pt,aboveskip=20pt}     \caption{\label{fig:text}text experiment ent experiment experiment}     %     \end{figure}          \AddBelowPointcut{listing-p-start}{listing-p-end}{braces again}     \AddBelowPointcuttwo{listing-pt-start}{listing-pt-end}{braces again}     \AddBelowPointcuttwoname{listing-ptn-start}{listing-ptn-end}{braces again}     \AddBelowPointcuttwokw{listing-ptkw-start}{listing-ptkw-end}{braces again}          \end{document}      ![enter image description here](http://i.stack.imgur.com/oZOeH.gif) What I want to do is this: ![enter image description here](http://i.stack.imgur.com/WWEYo.gif)


title: Why is the page number shown at two places when the page is set to landscape?

text: The following is the environment I used to change a certain page to be displayed in landscape. The picture shows where the page number is displayed after the code is compiled. I don't know how to remove the page number that is shown at the center of the page.               \documentclass{dissertation}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{rotating}     \usepackage[labelsep=space]{caption}     \usepackage{titlesec}     \titleformat{\section}       {\normalfont\fontsize{30}{15}\LARGE }{\thesection}{1em}{}     \titleformat{\subsection}       {\normalfont\fontsize{30}{15}\Large}{\thesubsection}{1em}{}     \usepackage{pdflscape}          \begin{document}     \LOT          \begin{landscape}         \begin{figure}\vspace{-0.2in}         \center           % Requires \usepackage{graphicx}           \includegraphics[width=22cm]{potential-scheme}\\           \caption{Schematic of voltages applied to each element.}\label{}         \end{figure}     \end{landscape}          \end{document}       * * *               \RequirePackage{ifthen}     \RequirePackage{setspace}     \RequirePackage[titles,subfigure]{tocloft}     \RequirePackage{subfig}     \RequirePackage[margin=1.1in]{geometry}     \RequirePackage{pdflscape}     \RequirePackage{fancyhdr}     \RequirePackage{rotating}          \renewcommand\listtablename{List of Tables}      \renewcommand\listoftables{%            \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi        \chapter*{\vspace{-2.5\baselineskip}\centerline{\large \MakeUppercase        \listtablename}}         \addcontentsline{toc}{chapter}{\textbf{List of Tables}\vspace{\baselineskip}}%           \@mkboth{\MakeUppercase\listtablesname}%                   {\MakeUppercase\listtablename}%        \begin{singlespace}         \@starttoc{lot}%         \if@restonecol\twocolumn\fi         \end{singlespace}         }          \newcommand{\LOT}{     \clearpage     \listoftables     \clearpage     \pagestyle{plain}}              \renewcommand{\cftafterlottitle}{\vspace{\baselineskip}}         \renewcommand{\cfttabnumwidth}{6em}           \renewcommand{\cfttabpresnum}{Table }          * * * ![enter image description here](http://i.stack.imgur.com/yetVI.png)


I "inherited" a huge manual written in tex. I should now update some lines. Unfortunately I am not a tex expert and get the following error not nailed down: I get the Error Message: Package calc Error: '!' invalid at this point               (/usr/share/texlive/texmf-dist/tex/latex/fancybox/fancybox.sty     Style option: `fancybox' v1.4 <2010/05/15> (tvz)     ) (/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty))     (/usr/share/texlive/texmf-dist/tex/latex/draftcopy/draftcopy.sty     (/usr/share/texlive/texmf-dist/tex/latex/draftcopy/draftcopy.cfg)     Prints ENTWURF on pages; does not show in your DVI viewer     ) (/usr/share/texlive/texmf-dist/tex/latex/ifsym/ifsym.sty     (/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty)          ! Package calc Error: `!' invalid at this point.          See the calc package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.33 \newcounter{ifsymcnt}      calc.sty does not really seem to be false. The only occurence of ! is here:                \calc@open(#4!%      and here                \ifx#1!\let\calc@next\endgroup \else      The file must have been compiled lately, unfortunately I do not find out how and who. So I assume that it would be more an environment question. I user Ubunut 13.10 with tetex Any hint would be great! Thanks a lot Michael


title: New environment. Highlight content with symbols and indentation

text: I'm writing my thesis and I want to highlight some part of my text which resides in a separate paragraph. I like the well-known example of               \newenvironment{king}     {\rule{1ex}{1ex}\hspace{\stretch{1}}}     {\hspace{\stretch{1}}\rule{1ex}{1ex}}      and then               \begin{king}     My humble subjects \ldots     \end{king}      But if the sentence is very long (more than one line) the result is not good looking at all, e.g.               \begin{king}     Energy is the property of matter and radiation that is manifest as a capacity to perform work.     \end{king}      I'm wondering how I can keep the margins (left and right), repeat the square every line and.. make it bold (or with a gray background). Thanks for any help Alex PS: This is my first post so I hope it's good


title: comment a boxed equation with a arrow

text: I would like to comment a variable inside a boxed equation with an arrow (like the picture a), I hope someone could help me. I used to comment the equation by an under/over-brace, but if there is too many text, the equation will be given a large space (like the picture b). If this problem could be solved also, I would be very grateful. ![enter image description here](http://i.stack.imgur.com/3qoeO.jpg)


title: Aligning sections to the left

text: I am writing my thesis and using `\documentclass{thesis.tex}`, how do I left align only my sections and subsections without it affecting the chapter which is centered


title: biblatex style=apa, letter after references of the same year

text: I'm searching for a solution of my problem for days: I use biblax with style apa. There is an option for the case if there are more than one references of ONE author in the same year. Than a letter is inserted after the year. My problem is that there is a letter inserted not only if the references are of the same author but only in the same year regardless of the authors. My document:               \documentclass[11pt,a4paper,twoside]{report}          \usepackage[ngerman]{babel}                                 %          %\usepackage{fancyhdr}     %\usepackage{hyperref}      \usepackage{csquotes}      \usepackage[ style=apa,                 url=false,                 doi=false,                 isbn=false,                 backend=biber,                 hyperref=false,                 eprint=false,                 babel=other     ]{biblatex}          \addbibresource{C:/Users/Konsi/Documents/Studium/test.bib}  %ort der bib    %          %\bibliography{C:/Users/Konsi/Documents/Studium/test.bib}   %ort der bib    %     \DeclareLanguageMapping{german}{german-apa}     \DefineBibliographyStrings{german}{andothers={et\ al\adddot}}                     \begin{document}          \parencite{Billard2001}\\     \parencite{Wolpert2001487}          \printbibliography     \end{document}      Than the first problem I have: if I compile this the first time with latex->biber->latex->latex than the `.bbl` file is not built. Therefor I changed the style to authoryear, latex->biber->latex->latex, `.bbl` file is built. I changed the style back to `apa`, everthing is `apa` conform, except the letters after the years. My `.bib` is:               % This file was created with JabRef 2.7.2.     % Encoding: Cp1252               @ARTICLE{Billard2001,       author = {Billard, Aude},       title = {Learning motir skills by imitation: A biologically inspired robotiv         model},       journal = {Cybernetics and Systems},       year = {2001},       volume = {32},       pages = {155-193},       number = {1-2},       doi = {10.1080/019697201300001849},       eprint = {http://www.tandfonline.com/doi/pdf/10.1080/019697201300001849},       timestamp = {2012.07.08},       url = {http://www.tandfonline.com/doi/abs/10.1080/019697201300001849}     }               @ARTICLE{Wolpert2001487,       author = {Daniel M Wolpert and Zoubin Ghahramani and J.Randall Flanagan},       title = {Perspectives and problems in motor learning},       journal = {Trends in Cognitive Sciences},       year = {2001},       volume = {5},       pages = {487 - 494},       number = {11},       doi = {10.1016/S1364-6613(00)01773-3},       issn = {1364-6613},       keywords = {movement},       timestamp = {2012.07.07},       url = {http://www.sciencedirect.com/science/article/pii/S1364661300017733}     }      Could anyone please help me? The second problem is caused by the first maybe, but if so, how can I compile with `style=apa`? Thanks a lot! Edit: Used versions are (I'm not really sure, what is useful and what not): The `apa.dbx` is missing. is this maybe a problem? I installed the `biblatex- apa` package with the MiKTeX 2.9 Package Manager.               *File List*     report.cls    2007/10/19 v1.4h Standard LaTeX document class             size11.clo    2007/10/19 v1.4h Standard LaTeX file (size option)           babel.sty    2008/07/08 v3.8m The Babel package            bblopts.cfg    2006/07/31 v1.0 MiKTeX 'babel' configuration           ngermanb.ldf    2008/07/06 v2.6n new German support from the babel system           csquotes.sty    2011/10/22 v5.1d context-sensitive quotations           etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX          etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)             keyval.sty    1999/03/16 v1.13 key=value parser (DPC)           csquotes.def    2011/10/22 v5.1d csquotes generic definitions           csquotes.cfg               biblatex.sty    2012/07/01 v2.0 programmable bibliographies (PK/JW/AB)           biblatex2.sty    2012/07/01 v2.0 programmable bibliographies (biber) (PK/JW/AB)               kvoptions.sty    2010/12/23 v3.10 Keyval support for LaTeX options (HO)            ltxcmds.sty    2011/04/18 v1.20 LaTeX kernel commands for general use (HO)           kvsetkeys.sty    2011/04/07 v1.13 Key value parser (HO)           infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)           etexcmds.sty    2011/02/16 v1.5 Prefix for e-TeX command names (HO)           ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)           logreq.sty    2010/08/04 v1.0 xml request logger             logreq.def    2010/08/04 v1.0 logreq spec v1.0             ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)          url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.             blx-dm.def          apa.dbx           biblatex-dm.cfg           blx-compat.def    2012/07/01 v2.0 biblatex compatibility (PK/JW/AB)           biblatex.def               standard.bbx    2012/07/01 v2.0 biblatex bibliography style (PK/JW/AB)          apa.bbx    2012/07/01 v5.0 APA biblatex references style          apa.cbx    2012/07/01 5.0 APA biblatex citation style           biblatex.cfg                 german.lbx    2012/07/01 v2.0 biblatex localization (PK/JW/AB)           german-apa.lbx    2012/07/01 v5.0 APA biblatex localisation           ngerman.lbx    2012/07/01 v2.0 biblatex localization (PK/JW/AB)      ***********


title: What is the magic of scribd.com?

text: Scribd.com shows pdfs produced by TeX in HTML format, its HTML version is 100% like pdf one. How it's possible? Is there a tool for doing that publicly available? For example see http://www.scribd.com/doc/65397968/xepersian


title: Trying to change a predefined value in a package

text: I am trying to use the dnaseq package (documentation here: http://mirrors.linsrv.net/tex-archive/macros/latex/contrib/dnaseq/dnaseq.pdf) Basically, it takes whatever you put between "\DNA!" and "!", organizes it in blocks of customizable length, and displays the text with a numbering on the left, starting from 1. This package is useful for displaying easy-to-read DNA sequences, but for any reason, I would like it to start numbering from a negative number (actually my starting reference is in the middle of my sequence). So I have to redefine the starting number to something negative. I'm not new to latex but I never tried to customize packages, this is why I request some help to : -localize in code the variable to change (I think it's \@tempcntb=0) -write a command to redefine this variable from my preamble (something like \def, not used to its syntax) This package is relatively simple so I hope somebody will help me out. Thank you anyway !


title: How to copy contents of one file to another?

text: So I have a .txt-file and I need to import the data line per line. That works like it should. I need however to adapt the contents loaded into a command an write it to another .txt file that later will be used by the datatool package. Problem is that if I write this:               \documentclass{article}          \begin{document}          \newopen\copyfile  % open the file to write to     \openout\copyfile=copy.txt          \newread\file      % open the file to read from     \openin\file=file.txt          \loop\unless\ifeof\file       \read\file to\fileline  % Read one line and store it into \fileline            \fileline                   % print the content into the pdf       \write\copyfile{\fileline}  % print the content to copy.txt     \repeat          \end{document}      The output file looks like this:               \par     \par     \par     ...      While the pdf displays the actual content of the file. Here is an example of a text file for input. data.txt:               This is the first line.     And the second one.     Here is the third.     And so on...      If anyone has another solution of making datatool skip the first `x` lines, or even better when reading a certain string, that will solve my problem too in a more efficient way `:)` p.s.: I cannot adapt the .txt-files


title: How do I get BibTeX entries from amazon.com?

text: Has anyone written an interface through which I can get a citation of a book/paper from amazon.com? Thanks for the suggestions from fellow users. I'm updating the questions to detail in more specifics:   * Citeulike.org issue: I used BibTeX "Export from my library" features. However it's not that accurate... it cannot extract all meta-data from amazon and complete the bibliographic reference.   * Mendeley Desktop: I used http://www.mendeley.com/blog/academic-features/mendeley-bookmarklet-released-one-click-import-from-google-scholar-pubmed-arxiv-acm-ieee-etc/. This is a long way round, I want something where I give the URL and it gives me back the BibTeX entry.


title: Extract bibliographic references from pdf files to a bib file

text: Is there a software which can parse pdfs and extract bibliographic references? ACM DL is a web service which can give that info like here: http://portal.acm.org/citation.cfm?id=296806.296823&coll=ACM&dl=ACM&CFID=98288669&CFTOKEN=12911537 Mendeley's current release can't do this, would someone confirm: link > Hello - This feature was removed in 0.9.7 because it was consuming a fair > amount of resources (client and server side) without providing enough value. > We plan to re-introduce it in an improved form in future


title: How to use \displaybreak?

text: I have a very long equation               \begin{equation*}       \begin{aligned}         multiple line equation...       \end{aligned}     \end{equation}      But just using the above code causes the whole equation to start from a new page leaving behind a third of previous page empty. Where should i put the \displaybreak command to ensure that the page breaks occurs conveniently in between the equation. I tried using it in the following manner but it doesn't help.               \begingroup     \allowdisplaybreak     \begin{equation*}       \begin{aligned}         multiple line equation...       \end{aligned}     \end{equation}      \endgroup


title: utf8 or latin1 encoding - german

text: \usepackage[utf8]{inputenc}      or               \usepackage[latin1]{inputenc}      I write in german if that matters. pro and contra?


title: One header for all subtables: Correct arranging of Columns

text: I am trying to create a table consisting of three other subtables. I have tried it with two versions (see e.g Alignment Problem in Table environment). There are three problems: 1) The Columns of the subtabtles without header are "shifted". 2) For the last subtabtles there appears wide space. 3) I´d would like to put the caption of the first subtables after the headline (like the other subtables). 1) The version with dcolumn:               \begin{table}[ht!]     \setlength\tabcolsep{0.1pt}  % default value: 6.0pt     \caption{Post-Announcement Returns to Earnings Surprise Portfolios}     \label{tab:PortfolioReturns}          \begin{subtable}{\textwidth}     \caption*{\textbf{Panel A:} Portfolio Ranks formed according to SUE1}      \label{tab:PortfolioSUE1}     \begin{tabular*}{\textwidth}%       { @{\extracolsep{\fill}} l *{1}{d{4.0}} *{1}{d{2.5}}            *{2}{d{4.0}} *{2}{d{2.5}} @{} }     \toprule      & \multicolumn{1}{c}{N} & \multicolumn{1}{c}{mean} & \multicolumn{2}{c}{N} & \multicolumn{2}{c}{mean} \\     \cmidrule{4-5} \cmidrule{6-7}     Surprise Portfolio & \mc{N} & \mc{mean} & \mc{CASC} & \mc{BHAR} & \mc{CASC} & \multicolumn{1}{r@{}}{BHAR} \\     \midrule     1 & 1389 & -0.09759 & 1226 & 1350 & -0.00029 & -0.00566 \\     2 & 1348 & -0.01259 & 1181 & 1331 & 0.00065 & -0.00232 \\     3 & 1390 & -0.00447 & 1213 & 1367 & 0.00050 & -0.00404 \\     4 & 1376 & -0.00184 & 1164 & 1360 & 0.00009 & -0.00140 \\     5 & 1402 & 0.00046 & 1222 & 1383 & 0.00025 & 0.00189 \\     6 & 1331 & 0.00180 & 1175 & 1322 & 0.00025 & 0.00667 \\     7 & 1349 & 0.00368 & 1182 & 1333 & 0.00019 & 0.00675 \\     8 & 1327 & 0.00622 & 1193 & 1318 & 0.00031 & 0.00557 \\     9 & 1303 & 0.01191 & 1137 & 1283 & 0.00002 & 0.01829 \\     10 & 1335 & 0.08969 & 1183 & 1300 & -0.00044 & 0.03208 \\     \multicolumn{5}{l}{Hedge return (Portfolio 10 - Portfolio 1)} & -0.00015 & 0.03774\\     \bottomrule     \end{tabular*}     \end{subtable}     \bigskip     \begin{subtable}{\textwidth}     \caption*{\textbf{Panel B:} Portfolio Ranks formed according to SUE2}      \label{tab:PortfolioSUE2}     \begin{tabular*}{\textwidth}%       { @{\extracolsep{\fill}} l *{1}{d{4.0}} *{1}{d{2.5}}            *{2}{d{4.0}} *{2}{d{2.5}} @{} }     1 & 1409 & -0.06690 & 1235 & 1372 & -0.00041 & -0.00714 \\     2 & 1324 & -0.01011 & 1164 & 1306 & 0.00086 & -0.00222 \\     3 & 1382 & -0.00383 & 1182 & 1363 & 0.00049 & -0.00555 \\     4 & 1419 & -0.00136 & 1207 & 1399 & 0.00014 & -0.00317 \\     5 & 1338 & 0.00063 & 1181 & 1324 & 0.00012 & 0.00219 \\     6 & 1370 & 0.00177 & 1223 & 1353 & 0.00024 & 0.01033 \\     7 & 1351 & 0.00323 & 1197 & 1336 & 0.00006 & 0.00835 \\     8 & 1329 & 0.00545 & 1180 & 1318 & 0.00015 & 0.00528 \\     9 & 1348 & 0.01014 & 1177 & 1331 & 0.00015 & 0.01316 \\     10 & 1300 & 0.06622 & 1140 & 1263 & 0.00002 & 0.03416 \\     \multicolumn{5}{l}{Hedge return (Portfolio 10 - Portfolio 1)} & 0.00043 & 0.04130\\     \bottomrule     \end{tabular*}     \end{subtable}     \bigskip     \begin{subtable}{\textwidth}     \begin{threeparttable}     \caption*{\textbf{Panel C:} Portfolio Ranks formed according to SUE3}      \label{tab:PortfolioSUE3}     \small     \begin{tabular*}{\textwidth}%       { @{\extracolsep{\fill}} l *{1}{d{4.0}} *{1}{d{2.5}}            *{2}{d{4.0}} *{2}{d{2.5}} @{} }     1 & 1231 & -0.02934 & 1084 & 1213 & 0.00196 & -0.02531 \\     2 & 1232 & -0.00173 & 1052 & 1223 & 0.00043 & -0.01476 \\     3 & 1200 & -0.00032 & 1046 & 1196 & 0.00030 & -0.01422 \\     4 & 1252 & 0.00028 & 1110 & 1245 & 0.00030 & 0.00016 \\     5 & 1181 & 0.00058 & 1028 & 1177 & 0.00021 & 0.00516 \\     6 & 1220 & 0.00097 & 1060 & 1215 & 0.00007 & 0.00587 \\     7 & 1195 & 0.00152 & 1050 & 1186 & 0.00020 & 0.00998 \\     8 & 1193 & 0.00228 & 1046 & 1185 & -0.00037 & 0.02167 \\     9 & 1249 & 0.00386 & 1099 & 1246 & 0.00042 & 0.02336 \\     10 & 1171 & 0.01378 & 1065 & 1162 & -0.00089 & 0.04821 \\     \multicolumn{5}{l}{Hedge return (Portfolio 10 - Portfolio 1)} & -0.00285 & 0.07352\\     \bottomrule     \end{tabular*}          \begin{tablenotes}     \item[a] A subtable-specific footnote     \end{tablenotes}          \end{threeparttable}     \end{subtable}          \end{table}      and the siunitx version:               \begin{table}[ht!]     \setlength\tabcolsep{0.1pt}  % default value: 6.0pt     \caption{Post-Announcement Returns to Earnings Surprise Portfolios}     \label{tab:PortfolioReturns}     \begin{subtable}{\textwidth}     \caption*{\textbf{Panel A:} Portfolio Ranks formed according to SUE1}      \label{tab:PortfolioSUE1}          \begin{tabular*}{\textwidth}{       @{\extracolsep{\fill}}       l        S[table-format=4.0]       S[table-format=-1.5]       *{2}{S[table-format=4.0]}       *{2}{S[table-format=-1.5]}       @{}     }     \toprule      & & & \multicolumn{2}{c}{N} & \multicolumn{2}{c}{mean} \\     \cmidrule{4-5} \cmidrule{6-7}     Surprise Portfolio & {N} & {mean} & {CASC} & {BHAR} & {CASC} & {BHAR} \\     \midrule     1 & 1389 & -0.09759 & 1226 & 1350 & -0.00029 & -0.00566 \\     2 & 1348 & -0.01259 & 1181 & 1331 & 0.00065 & -0.00232 \\     3 & 1390 & -0.00447 & 1213 & 1367 & 0.00050 & -0.00404 \\     4 & 1376 & -0.00184 & 1164 & 1360 & 0.00009 & -0.00140 \\     5 & 1402 & 0.00046 & 1222 & 1383 & 0.00025 & 0.00189 \\     6 & 1331 & 0.00180 & 1175 & 1322 & 0.00025 & 0.00667 \\     7 & 1349 & 0.00368 & 1182 & 1333 & 0.00019 & 0.00675 \\     8 & 1327 & 0.00622 & 1193 & 1318 & 0.00031 & 0.00557 \\     9 & 1303 & 0.01191 & 1137 & 1283 & 0.00002 & 0.01829 \\     10 & 1335 & 0.08969 & 1183 & 1300 & -0.00044 & 0.03208 \\     \multicolumn{5}{l}{Hedge return (Portfolio 10 - Portfolio 1)} & -0.00015 & 0.03774\\     \midrule     \end{tabular*}     \end{subtable}     \bigskip     \begin{subtable}{\textwidth}     \caption*{\textbf{Panel B:} Portfolio Ranks formed according to SUE2}      \label{tab:PortfolioSUE2}     \begin{tabular*}{\textwidth}{       @{\extracolsep{\fill}}       l        S[table-format=4.0]       S[table-format=-1.5]       *{2}{S[table-format=4.0]}       *{2}{S[table-format=-1.5]}       @{}     }     1 & 1409 & -0.06690 & 1235 & 1372 & -0.00041 & -0.00714 \\     2 & 1324 & -0.01011 & 1164 & 1306 & 0.00086 & -0.00222 \\     3 & 1382 & -0.00383 & 1182 & 1363 & 0.00049 & -0.00555 \\     4 & 1419 & -0.00136 & 1207 & 1399 & 0.00014 & -0.00317 \\     5 & 1338 & 0.00063 & 1181 & 1324 & 0.00012 & 0.00219 \\     6 & 1370 & 0.00177 & 1223 & 1353 & 0.00024 & 0.01033 \\     7 & 1351 & 0.00323 & 1197 & 1336 & 0.00006 & 0.00835 \\     8 & 1329 & 0.00545 & 1180 & 1318 & 0.00015 & 0.00528 \\     9 & 1348 & 0.01014 & 1177 & 1331 & 0.00015 & 0.01316 \\     10 & 1300 & 0.06622 & 1140 & 1263 & 0.00002 & 0.03416 \\     \multicolumn{5}{l}{Hedge return (Portfolio 10 - Portfolio 1)} & 0.00043 & 0.04130\\     \midrule     \end{tabular*}     \end{subtable}     \bigskip     \begin{subtable}{\textwidth}     \begin{threeparttable}     \caption*{\textbf{Panel C:} Portfolio Ranks formed according to SUE3}      \label{tab:PortfolioSUE3}     \begin{tabular*}{\textwidth}{       @{\extracolsep{\fill}}       l        S[table-format=4.0]       S[table-format=-1.5]       *{2}{S[table-format=4.0]}       *{2}{S[table-format=-1.5]}       @{}     }     1 & 1231 & -0.02934 & 1084 & 1213 & 0.00196 & -0.02531 \\     2 & 1232 & -0.00173 & 1052 & 1223 & 0.00043 & -0.01476 \\     3 & 1200 & -0.00032 & 1046 & 1196 & 0.00030 & -0.01422 \\     4 & 1252 & 0.00028 & 1110 & 1245 & 0.00030 & 0.00016 \\     5 & 1181 & 0.00058 & 1028 & 1177 & 0.00021 & 0.00516 \\     6 & 1220 & 0.00097 & 1060 & 1215 & 0.00007 & 0.00587 \\     7 & 1195 & 0.00152 & 1050 & 1186 & 0.00020 & 0.00998 \\     8 & 1193 & 0.00228 & 1046 & 1185 & -0.00037 & 0.02167 \\     9 & 1249 & 0.00386 & 1099 & 1246 & 0.00042 & 0.02336 \\     10 & 1171 & 0.01378 & 1065 & 1162 & -0.00089 & 0.04821 \\     \multicolumn{5}{l}{Hedge return (Portfolio 10 - Portfolio 1)} & -0.00285 & 0.07352\\     \bottomrule     \end{tabular*}          \begin{tablenotes}     \item[a] A subtable-specific footnote     \end{tablenotes}          \end{threeparttable}     \end{subtable}          \end{table}      The result is the same for both versions. Thank you very much.


title: LaTeX - PGF groupplot - polar axis

text: I can't find the answer anywhere, is it [and how] possible to make a group plot of multiple polar graphs? For grouping, I use `pgf.groupplot` library, for polar axis, I use `\begin{polaraxis}` from `pgf` package too. But it can be another library or package. _I want to visualize polar distribution characteristics of audio signal for each third-octave band from 20 to 20.000 Hz_ _The target page should look somehow like this picture:_ ![Third-octave bands](http://i.stack.imgur.com/MXZjs.gif)


title: Changing layout is difficult or easy in LaTeX?

text: I am new to LaTeX. I am writing an article in LaTeX but at the moment I am not sure what should be the final layout of my article; so, I am writing it in `IEEEtran` format. I thought that it would be easy to change the layout later if required. But I read a book on LaTeX and I found the following line written in it which has made me worried: > "Although some parameters can be adjusted within a predefined document > layout, the design of a whole new layout is difficult and takes a lot of > time." So, is it true that it will be difficult for me to change the layout later? **PS:** Just now I saw that if I change the line `\documentclass[conference]{IEEEtran}` to `\documentclass[a4paper,11pt]{article}`, then I get so many errors for the keywords related to `IEEEtran`.


title: Using tikz or pgfplots with plasTeX

text: I'm using `plastex` to convert LaTeX files to `xml` code. Is there any way to use `tikz` or `pgfplots` with `plastex`? `plastex example1.tex` compiles fine:               %example1.tex     \documentclass{article}          \begin{document}     Hello, world!     \end{document}      but `plastex example2.tex` yields lots of warnings about how plastex does not recognize `tikz` commands.               %example2.tex     \documentclass{article}     \usepackage{tikz}          \begin{document}     Hello, world! Enjoy this red circle:     \tikz{\draw[fill=red] (0,0) circle[radius=1] ;}     \end{document}      Are there any reasonable workarounds? [Some background: I have a host of old physics problems written in LaTeX with `tikz` figures and `pgfplots` graphs that I would like to convert to problems for edX.org via a `latex2edx` tool that uses `plastex`.]


title: Add \midrule Every 5 Lines Automatically

text: I wrote a table listing scores of 40 students using booktabs package. How to write `midrule` command automatically every 5 rows?               \documentclass{article}     \usepackage{booktabs}     \begin{document}     \begin{table}[h]     \centering     \begin{tabular}{rclc}     \toprule     Number  & Student Id    & Name  & Score \\     \midrule % adding automatically     1       & 14-001    & Andy  & 75 \\     2       &           &       &    \\     3       &           &       &    \\     4       &           &       &    \\     5       &           &       &    \\       \midrule % adding automatically     6       &           &       &    \\     7       &           &       &    \\     8       &           &       &    \\     9       &           &       &    \\     10      &           &       &    \\     \midrule % adding automatically     11      &           &       &    \\     \bottomrule     \end{tabular}     \caption{A List of Student Scores}     \label{}     \end{table}     \end{document}


title: Format of author and collaboration

text: I'm using `biblatex` + `biber` to produce my bibliography. Right now I'm using the following code to include a `collaboration` field into my bib.               \DeclareSourcemap{       \maps[datatype=bibtex,overwrite=true]{         \map{           \step[fieldsource=Collaboration, final=true]           \step[fieldset=usera, origfieldval, final=true]         }       }     }          \renewbibmacro*{author}{%       \iffieldundef{usera}{%         \printnames{author}%       }{%         \printnames{author} (\printfield{usera})%       }     }      However, I'm not satisfied. I would like to obtain the following format:   * If there is a collaboration field **and** and author field print `AUTHOR (COLLABORATION)`   * If there is an author field and no collaboration field print `AUTHOR`   * If there is a collaboration field and no author field print `COLLABORATION` Furthermore I would like the `COLLABORATION` field to be formatted as follows:   * For `collaboration = {NAME}` print `The NAME collaboration`   * For `collaboration = {NAME_1, NAME_2}` print `The NAME_1 and NAME_2 collaborations`   * For `collaboration = {NAME_1, NAME_2, ..., NAME_N}` print `The NAME_1, NAME_2, ..., and NAME_N collaborations` * * * **::BEGIN EDIT:::**   I have solved formatting the `collaboration` field using the regexp facilities. The code is listed below. I still have not solved how to print the collaboration field without parens when there's no author. Oh, and feel free to comment on this solution; point out any problems / bugs you find!               \DeclareSourcemap{       \maps[datatype=bibtex]{         % Format the collaboration field         \map{           \step[fieldsource=Collaboration, match=\regexp{([^,]+), ([^,]+), (.+), ([^,]+)}, fieldset=usera, fieldvalue={The $1, $2, $3, and $4 collaborations}, final=true]         }         \map{           \step[fieldsource=Collaboration, match=\regexp{([^,]+), ([^,]+), ([^,]+)}, fieldset=usera, fieldvalue={The $1, $2, and $3 collaborations}, final=true]         }         \map{           \step[fieldsource=Collaboration, match=\regexp{([^,]+), ([^,]+)}, fieldset=usera, fieldvalue={The $1 and $2 collaborations}, final=true]         }         \map{           \step[fieldsource=Collaboration, match=\regexp{([^,]+)}, fieldset=usera, fieldvalue={The $1 collaboration}, final=true]         }       }     }      **:::END EDIT:::** * * * > Is this possible? If so, how? Below you can find an MWE for testing a solution ...               \documentclass{article}          \usepackage[     hyperref=true,     backend=biber,     style=numeric-comp,          % Sort and compress     backref=true,                % Print Backreferences     backrefstyle=three,          % start combining pages after third page     sorting=none,                % Do not sort!     firstinits=true,             % First and Middle names as initials     maxbibnames=3                % Maximum number of authors to print in Bibliography     ]{biblatex}          \begin{filecontents}{\jobname.bib}     @article{key1,       author = {Franck, James and Brown, Bob and Doe, John},       collaboration = {COLLAB},       title = {Authors and Collab}}     @article{key2,       author = {Frank, James and Brown, Bob and Doe, John},       collaboration = {COLLAB1, COLLAB2},       title = {Authors and Collabs}}     @article{key3,       author = {Frank, James and Brown, Bob and Doe, John},       collaboration = {COLLAB1, COLLAB2, COLLAB3, COLLAB4},       title = {Authors and Collabss}}     @article{key4,       collaboration = {COLLAB1, COLLAB2, COLLAB3, COLLAB4},       title = {Collabss}}     \end{filecontents}     \addbibresource{\jobname.bib}          \begin{document}     \cite{key1}     \cite{key2}     \cite{key3}     \cite{key4}     \printbibliography     \end{document}


title: How to achieve this cover design using LaTeX?

text: I am about to print the dissertation in an online printing house in A4 format 222 pages adhesive binding. The printing house asked to send the cover of the dissertation in a separete file as a double page with a binding thickness of 15.4mm. I have the design in mind already (see image below) but I want to meet their demand concerning the spine thickness using LaTeX. **Cover Design (done in Inkscape 0.48)** ![enter image description here](http://i.stack.imgur.com/CewtY.png) **Some points about the cover design:**   1. The cover in black and text in white   2. Logo1 is the logo of the university as an image in pdf format and logo2 is the logo of the online printing house (Yes, they give a discount as thank you)   3. In the book spine (15.4mm thick), the text direction should be from below upwards so that when the book lies on its face cover (in this case you can't tell which book is this) the text in the spine can still be read in the _correct_ direction as shown in the left image.   4. The location of logo2 (on the back cover) is below which I could not reproduce using LaTeX, I did my search on this issue, it seems never easy, so I wish there is some better solution by now   5. I want to achieve this using KOMA-script and XeLaTeX, I can provide a MWE, but I think that won't make sense may be because it is more about the approach rather than LaTeX code


title: draw a smooth dendrite

text: I want to draw a dendrite and here is what I have done till now,               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{3d,calc}     \newcommand*{\hd}{1.0}%     \newcommand*{\vd}{1.5}%          \begin{document}                 \begin{tikzpicture}         \begin{scope}[rotate=90]         \draw (0,0) -- (\hd,0)--(\hd,\vd) -- (2*\hd, \vd) -- (2*\hd, 0) -- (3*\hd, 0) --(3*\hd, \vd)--(4*\hd, \vd) --(4*\hd, 0) --(5*\hd, 0) ;      \end{scope}            \begin{scope}[rotate=270,shift = {(-5*\hd,0.75*\vd)}]         \draw (0,0) -- (\hd,0)--(\hd,\vd) -- (2*\hd, \vd) -- (2*\hd, 0) -- (3*\hd, 0) --(3*\hd, \vd)--(4*\hd, \vd) --(4*\hd, 0) --(5*\hd, 0) ;      \end{scope}      \draw(0,3.333*\vd) --(1.1*\hd,3.333*\vd);            \end{tikzpicture}          \end{document}      This is very elementary set-up where I found it difficult to make corners of the dendrites smooth. To get a half dendrite and make the smooth corners , I thought to make a periodic function (a parabola e.g.) and make a collection of them shifted by a distance and then rotating the set but I am not able to plot parabolas side by side. ![enter image description here](http://i.stack.imgur.com/JEaPj.gif)


title: IEEE Javadocs Citation

text: I need to cite several Java class documentations in IEEE format in `BiBTeX` using `\bibliographystyle{IEEEtran}`. I currently use `@electronic` in the following format:               @electronic{War13,         author={Malcolm Ware},         year={}, % none provided         title={Class {M}ultilayer{P}erceptron},         language={English},         organization={Machine Learning Group - Waikato Environment for Knowledge Analysis (WEKA)},         address={University of Waikato, New Zealand},         note={Accessed on Sept. 21, 2013},         url={http://weka.sourceforge.net/doc.dev/weka/classifiers/functions/MultilayerPerceptron.html}     }      Is this the format commonly used or is there an existing Javadoc IEEE citation style? This is the closest I got from a Google search.


title: force \today to use EST

text: I'm using ShareLaTeX, which, for those who don't know, is a website that compiles LaTeX on a server. The issue is that when I type `\today`, it gives my the date of the server. So, for example, right now it is 10:00 PM EST on October 8 and it gives me `October 9, 2013`. Is there any way I can force EST? preferably for the entire document.


title: Indenting pseudocode

text: I am very new to TeA, and am having trouble indenting a block of pseudocode within an enumeration. Or perhaps more specifically, the algorithm's pseudocode seems to ignore the enumerations indentation. I am working with the algorithmicx and algpseudocode packages.               \begin{enumerate}      \item Some text...        \begin{algorithm}         \caption{Euclid’s algorithm}\label{euclid}         \begin{algorithmic}[1]         \Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}         \State $r\gets a\bmod b$         \While{$r\not=0$}\Comment{We have the answer if r is 0}         \State $a\gets b$         \State $b\gets r$         \State $r\gets a\bmod b$         \EndWhile\label{euclidendwhile}         \State \textbf{return} $b$\Comment{The gcd is b}         \EndProcedure         \end{algorithmic}         \end{algorithm}     \end{enumerate}      How can I force the algorithm block to follow the same indentation as the enumeration block? Thanks


title: How to rigidly chop long lines in plain TeX

text: I am using plain TeX and want to typeset an appendix that contains several hundred URLs. When a URL goes past the right margin, I would like TeX to stop printing (i.e. not carry into the margin, not print a warning black rectangle) and then pick up the rest of the URL on a new (non-indented) line where it left off. Something like this, where 1, 2, 3 are akin to footnote numbers:               1: http://www.aaa.com/rem     ainder 2: http://www.bbb.     com/remainder_again  3: h     ttp://www.ccc.com/ending      Is this possible? I am using a Python script to generate the .tex files, so, if worst comes to worst, I can have Python estimate the content of each line. Unfortunately, I am not using a mono-spaced font, so that could turn pretty ugly. Thanks in advance.


title: Changing the way figure reference appears in LaTeX

text: How can one make LaTeX insert `Figure` into `\ref` calls automatically, i.e. instead of writing: `See data in Figure ~\ref{fig:JobInformationDialog}` simply write: `See data in \ref{fig:jobInformationDialog}` and have LaTeX insert `Figure [fignum]` when it gets compiled?


title: Selective URLs in bibliography using alpha or alphaurl

text: Is there a way to selectively adding URLs to bibliorgraphy elements? I use Mendeley and it automatically adds URLs to the DOI entries but I dont want these. I don't want to eliminate all URLs though, as I quote a couple of documents from the web (specifications and RFCs). Is there a way to mark the entries that should display the URLs differently from the rest?


title: Navigating arguments with AUCTeX

text: Is there a key combination to move the insertion point backward and forward through arguments using AUCTeX? For example, where "|" is my insertion point:               \frac{|}{}      Then I would want a command to move it:               \frac{}{|}      And perhaps another command to move it back:               \frac{|}{}      And another to move it out:               \frac{}{}|


title: Lyx minted environment layout

text: Before I resolved a problem to set up a `minted` environment in LaTeX. Now, I would like to add this environment as a LyX layout. I have tried with               Style MatlabCode     Category              MainText     Margin                Static     LatexType             Environment     LatexName             matlabcode     NextNoIndent          1     LeftMargin            MMM     RightMargin           MMM     ParIndent             MM     ParSkip               0     ItemSep               0     TopSep                0.5     BottomSep             0.5     ParSep                0     Align                 Block     AlignPossible         Block, Left, Right, Center     Preamble         \usepackage{minted}         \newminted{matlab}{mathescape,linenos=true}     EndPreamble      End Everything works and pdflatex gives me a nice PDF. The problem is that, when I use the environment, which is similar to a quotation layout in LyX, in the output I get blank lines, like this ![enter image description here](http://i.stack.imgur.com/Knduc.png) And those weird brackets, since it should be just `[2;3]` Does anyone know about this?


title: How to detect overfull and underfull hbox without triggering the warning?

text: I need a LaTeX macro which can be used by this:               \IfFull{TEXT}{THEN}{ELSE}      It would typeset TEXT in a `\vbox` (which it will discard), and if there was an overfull hbox or an underfull hbox, it would run THEN, otherwise it would run ELSE. It wouldn't report the `Overfull \hbox` or `Underfull \hbox` warnings on the console or in the log file. Is there such a macro already? If not, how could it be defined? If this is too complicated, it would be enough to do it for a single paragraph. Minimal working example, which gives the wrong result, because it always executes `#3`, but in the example it should have executed `#2`:               \documentclass{article}     \def\IfFull#1#2#3{#3}     \begin{document}     \IfFull{\hsize1pt\noindent zzzzz xxxxx}{CORRECT}{BAD}     \end{document}      This should create document with the word `CORRECT` in it, because `#1` has an overfull hbox.


title: Font warning using memoir

text: I am getting the following font warning using memoir:               LaTeX Font Warning: Font shapre `T1/cmss/bx/sc`undefined (Font) using `T1/cmss/bx/n'instead on input line 14      where line 14 points to where I have `\mainmatter` in my source file. Here is the source code               \documentclass[oneside,12pt]{memoir}     \usepackage{graphicx}     \usepackage[T1]{fontenc}     \usepackage{mathpazo}        \begin{document}          \chapterstyle{madsen}          \frontmatter     \tableofcontents     \mainmatter          \chapter{Introduction}     Introduction          \end{document}      which should select the Palatino font. # Update If I use the sniplet below from egreg's answer:               \sbox0{\sffamily x}     \DeclareFontShape{T1}{cmss}{bx}{sc}{<->ssub*cmss/bx/n}{}      \chapterstyle{madsen}      the warning goes away, but I get some font artifacts:       ![enter image description here](http://i.stack.imgur.com/tDjFP.png) With this, is there a way to force `\chapterstyle{madsen}` to use `palatino`?


title: Multiple alignment points in equations and no curly brackets for correcting spacing

text: Consider the following example:               \documentclass{article}          \usepackage{amsmath}     \usepackage{siunitx}          \begin{document}          \begin{alignat*}{5}       &\text{Honning:}\qquad       &&\frac{\SI{16710}{\g}}{\SI{33075}{\g}} \cdot \SI{360}{\degree}       &&= {\mkern -6mu}\left(\frac{\num{16710} \cdot 360}{\num{33075}}\right){\mkern -6mu}\,\si{\degree}       &&\approx{} &\SI{182}{\degree}&;\\       &\text{Pollen:}       &&\frac{\SI{10155}{\g}}{\SI{33075}{\g}} \cdot \SI{360}{\degree}       &&= {\mkern -6mu}\left(\frac{\num{10155} \cdot 360}{\num{33075}}\right){\mkern -6mu}\,\si{\degree}       &&\approx{} &\SI{111}{\degree}&;\\       &\text{Vand:}       &&\frac{\SI{6210}{\g}}{\SI{33075}{\g}} \cdot \SI{360}{\degree}       &&= {\mkern -6mu}\left(\frac{6210 \cdot 360}{\num{33075}}\right){\mkern -6mu}\,\si{\degree}       &&\approx{} &\SI{68}{\degree}&.     \end{alignat*}          \end{document}      ![output](http://i.stack.imgur.com/0SqiL.jpg) Is it possible to get the same alignment and spacing without putting `{}` after `\approx`? **Update** After simplifying Werner's answer even further, I've come up with the following solution:               \documentclass{article}          \usepackage{amsmath}     \usepackage{siunitx}          \ExplSyntaxOn       \cs_new_eq:NN \calculate \fp_eval:n     \ExplSyntaxOff          \newcommand*\pieSlice[1]{%       \dfrac{\SI{#1}{\g}}{\SI{\total}{\g}} \cdot \SI{360}{\degree}       & {\mkern -3mu}\biggl(\dfrac{\num{#1} \cdot 360}{\num{\total}}\biggr){\mkern -3mu} \si{\degree}       & \calculate{round(#1*360/\total)} \si{\degree}       &     }     \newcommand*\total{\calculate{\honning+\pollen+\vand}}               \begin{document}          \begin{equation*}     \def\honning{16710}     \def\pollen{10155}     \def\vand{6210}      \renewcommand*\arraystretch{2.2}       \begin{array}{l@{\qquad} l@{{}={}} l@{{}\approx{}} r@{} l}         \text{Honning:} & \pieSlice{\honning}; \\         \text{Pollen:}  & \pieSlice{\pollen}; \\         \text{Vand:}    & \pieSlice{\vand}.       \end{array}     \end{equation*}          \end{document}


title: Biblatex, Biber, and LaTeX: citations undefined

text: I get "There were undefined references" errors and can't fix it after two days of trying. I have tried switching editors from Sublime Text 3 to TeXStudio on a Mac, then trying both on a PC. I am willing to try anything at this point. My `test.tex` file:               \documentclass{article}     \usepackage[style=numeric,backend=biber]{biblatex}     \addbibresource{\Username\Dropbox\test.bib}     \begin{document}       Hello\cite{greenwade93}.       \printbibliography     \end{document}      My `test.bib` file:               @ARTICLE{greenwade93,       author  = "George Greenwade",       title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",       year    = "1993",       journal = "TUGBoat",       volume  = "14",       number  = "3",       pages   = "342--351"     }      The pdf shows: Hello[greenwade93 ] TeXStudio log shows the following errors:               "Citation 'greenwade93' on page 1 undefined.     "Empty bibliography"     "There were undefined references"     "Please (re)run Biber on the file:(biblatex)test(biblatex) and rerun LaTeX afterwards.      I have read about doing a compilation trick but I'm not sure how to do this in either SublimeText or TexStudio. I don't know how to use command line. I have run into many problems and taken many detours that led to other problems. I'm at a loss. Can someone please give me a few hints or keywords I can search for to fix these problems, or a complete solution? I can't even get a minimum working example up. I will install anything.


title: box around entries in xymatrix

text: I would like to reproduce the result of the following code               \documentclass[a4paper,11pt]{article}          \usepackage{amsmath,amsfonts}          \usepackage{xypic}          \begin{document}     \[\xymatrix{     &&&& \mathcal{T}\ar@{-}[dr]\ar@{-}[dl]\\     &&&\mathcal{A}^\perp\ar@{-}[dr]\ar@{-}[dl] && **[r] \mathcal{A} = \mathcal{A}_3\\     &&\mathcal{B}^{\perp, \mathcal{A}^\perp}\ar@{-}[dr]\ar@{-}[dl] && **[r] \mathcal{B} = \mathcal{A}_2\\     & \mathcal{C}^{\perp, \mathcal{B}^\perp}\ar@{-}[dr]\ar@{-}[dl] && **[r] \mathcal{C} = \mathcal{A}_1 \\     \mathcal{D}^{\perp, \mathcal{C}^\perp} & & **[r] \mathcal{D} = \mathcal{A}_0     \ar@{.}(55,-10);(127,-10)     \ar@{.}(55,-18);(127,-18)     \ar@{.}(55,-18);(55,-10)     \ar@{.}_{=t_3}(127,-18);(127,-10)      %     \ar@{.}(35,-23);(107,-23)     \ar@{.}(35,-32);(107,-32)     \ar@{.}(35,-23);(35,-32)     \ar@{.}^{=t_2}(107,-23);(107,-32)     %     \ar@{.}(10,-38);(82,-38)     \ar@{.}(10,-47);(82,-47)     \ar@{.}^{=t_1}(82,-38);(82,-47)     \ar@{.}(10,-38);(10,-47)     %     \ar@{.}(-7,-52);(66,-52)     \ar@{.}(-7,-61);(66,-61)     \ar@{.}^{=t_0}(66,-52);(66,-61)     \ar@{.}(-7,-52);(-7,-61)     }\]     \end{document}      in a more efficient and smart way (y'know, I have a life to live and stuff to do :) ). More precisely, how can I draw the boxes you see, telling xypic only a minimum informations (e.g. the nodes that the box has to cover) and more importantly in a uniform manner (same size, same length, etc.)? Here is the output I want: ![enter image description here](http://i.stack.imgur.com/yL7eI.png)


title: How can I align two split environments at the equal signs?

text: \documentclass{scrartcl}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}     \usepackage{amsmath,  amsthm,  amssymb}     \usepackage{mathtools}          \begin{document}         \begin{align}             \begin{split}                 \label{eq:lines}                 Q_{1x} &= C_{1x} + \mu_1 \vec{h_{1x}} \\                 Q_{1y} &= C_{1y} + \mu_1 \vec{h_{1y}} \\                 \vdots \\                 Q_{3z} &= C_{3z} + \mu_3 \vec{h_{3z}}             \end{split} \\             \begin{split}                 \label{eq:distances}                 \overline{Q_1 Q_2}^2 &= (Q_{1x}-Q_{2x})^2 + (Q_{1y}-Q_{2y})^2 + (Q_{1z}-Q_{2z})^2\\                 \vdots             \end{split}         \end{align}     \end{document}      I want to align the equations in both split-environments along the "="-Symbol in the same way. Any ideas?


title: How to align text without two column?

text: I want to have the following text alignment and I don't wanna use any "two column" and table because a environment i use doesn't support them. :( The text format looks like below picutre. Basicly i want to split a line from middle, and for a line text there will be 2 parts, and 1st part is in left and 2nd part is in right. however, there are some lines which have long text and i don't want to split them to two part, thus they will not split. Thanks a lot for help! ![enter image description here](http://i.stack.imgur.com/ieLJM.png)


title: How to replicate the layout options specified in 'geometry' package when using 'pdfpages'?

text: I'm preparing a document in latex and using the following parameters for the `geometry` package:               \usepackage[twoside,margin=1in,bindingoffset=0.6in]{geometry}      I'd like to use the pdfpages package to include some extra material, but I'm having trouble using the layout options to replicate the margins in the main document: Here's what I've tried:               \includepdf[pages={-}, offset=1.6in 1]{doc.pdf}      The result of this was that the included pages, literally had an alternating offset of 1.6in on the left and right margins. Then based on the answer here, I tried the following:               \makeatletter     \includepdf[       pages={-},       width=\Gm@layoutwidth,       height=\Gm@layoutheight,       offset={\dimexpr(\Gm@layoutwidth-\paperwidth)/2\relax}              {\dimexpr(\paperheight-\Gm@layoutheight)/2\relax},       keepaspectratio       ]{doc.pdf}     \makeatother      Which results in the included document just being centered on the page, no bindingoffset is included.


title: Texstudio on Mac, cannot view multiple pdf

text: [Noob Alert] I am new to texstudio, having shifted from texshop due to lack of tabs and code folding. I need to compile two (or more) documents side by side with the tabs. I am unable to view (go to pdf) for one of them if the pdf of the other is active. Using internal pdf viewer. The solution to this question preseneted in the link below did not work for me TeXstudio and viewing multiple pdf files


title: Setting default distance between subfigures

text: I use a lot of subfigures in my thesis. What I realize now is that the captions between adjacent subfigures are very close together, which makes them hard to read. My two questions are therefore: (1) How can the default distance between two subfigures be increased? or (2) How can the default width of a subfigure caption be decreased? Example code:               \usepackage{subfigure}     ...     \begin{figure}[h!t]     \centering     \subfigure[long long caption]{         \includegraphics{filename1}     }     \subfigure[another long caption]{         \includegraphics{filename2}     }     \caption{two subfigures}     \end{figure}      Thx


title: How to build macros for vector-matrix operators?

text: Can anybody build macros for doing the following vector operations? Or are there already such macros? For example,               1) Example data: \def\a{(5,3,0)}                      \def\b{(5,1,6)}                      \def\A{(1,0,1\\0,2,0\\0,0,3)}     2) Vector addition: $\a+\b$ returns (10,4,6)     3) Vector subtraction: $\a-\b$ returns (0,2,-6)     4) Vector matrix multiplication: $\A*\a$ returns (5,6,0)      Thanks to the David's code, I expanded the followings for 1) vector addition, 2) vector subtraction, 3) vector multiplication, 4) vector division. What I'm going to do is to expand the code to 5) \car and \cdr for list processing. The following is the first step.               \documentclass{article}          \makeatletter          %main macros     \def\rvecadd#1#2{\edef\tmp{\noexpand\@rvecadd+#1,\relax#2,\relax}\tmp}     \def\rvecsub#1#2{\edef\tmp{\noexpand\@rvecadd-#1,\relax#2,\relax}\tmp}     \def\rvecmul#1#2{\edef\tmp{\noexpand\@rvecadd*#1,\relax#2,\relax}\tmp}     \def\rvecdiv#1#2{\edef\tmp{\noexpand\@rvecadd/#1,\relax#2,\relax}\tmp}     \def\rcar#1{\edef\tmp{\noexpand\@rcar#1,\relax}\tmp}     \def\rcdr#1{\edef\tmp{\noexpand\@rcdr#1,\relax}\tmp}          %recursive macros     \def\@rvecadd#1#2,#3\relax#4,#5\relax{%     \the\numexpr#2#1#4\relax     \ifx\@#3\@\expandafter\@gobble     \else\expandafter\@firstofone     \fi{,\@rvecadd#1#3\relax#5\relax} }          \def\@rcar#1,#2\relax{%     #1\relax     \ifx\@#2\@\expandafter\@gobble     \else\expandafter\@firstofone     \fi}          \def\@rcdr#1,#2\relax{%     #2\relax     \ifx\@#2\@\expandafter\@gobble     \else\expandafter\@firstofone     \fi}               \begin{document}     %Data     \def\a{5,3,0,100,1}     \def\b{5,1,6,1000,1}     \def\A{1,0,1\\0,2,0\\0,0,3}     \def\aT{5\\3\\0}          %Test     $(\a) + (\b) = (\rvecadd\a\b)$\par     $(\a) - (\b) = (\rvecsub\a\b)$\par     $(\a) * (\b) = (\rvecmul\a\b)$\par     $(\a) / (\b) = (\rvecdiv\a\b)$          %car test:     \rcar\a          %cdr test     (\rcdr\a)          \end{document}


title: Sort .bib file from within TexShop

text: Is there a way to sort a BibTeX file from within TexShop? For instance, I would like to have all items of type `@proceedings` at the end of the file, and the items otherwise sorted alphabetically (say by the name of the first author). I'm not referring to sorting the references in a compiled document (using a `.bst` style), but rather the BibTeX entries themselves in a `.bib` source file. I used to be able to do this on Windows using WinEdt. Can I achieve something similar in TexShop on Mac OS X?


title: TikZ node in normal text

text: I would like to place a TikZ node inside normal text to get the fancy boxes. But the box is on the same baseline. I would like to get the text on the baseline. What can I do?               \documentclass{article}          \usepackage{tikz}          \begin{document}          Not all characters are at the same baseline \tikz{\node [rounded corners,draw] {X};}          \end{document}


title: Errors compiling a presentation with beamer class

text: Can anyone tell me the error(s) in this code??               \documentclass{beamer}     \usetheme{Madrid}     %\usepackage{geometry}     %\usepackage{multimedia}     \usepackage{pifont}     \usepackage{xcolor}     \definecolor{myblue}{RGB}{89,1,10}     %\geometry{verbose,letterpaper}     \newcommand{\bwarrow}{\item[\color{myblue}\ding{227}]}     \newcommand{\barrow}{\item[\color{myblue}\ding{228}]}     \usepackage{media9}     \usepackage{graphicx}     \usepackage{hyperref}     \setbeamercovered{invisible}     \setbeamertemplate{navigation symbols}{}     \title[Method of Presentation]{Beautiful Presentation using Beamer}     \author{Shreeja and Rageeni}      \begin{document}     \begin{frame}     \titlepage     \end{frame}     \begin{frame}      \frametitle{Motivation}      \begin{block} {Why Beamer????}     \end{block}      \begin{itemize}     \barrow portability     \barrow Ease of collaboration     \barrow Free licence and community support     \barrow Content before style     \barrow Reuse LATEX code     \end{itemize}     \hyperlink{https://www.tug.org/pracjourn/2005-2/miller/miller.pdf#}]{\beamergotobutton{for detail click here}     \end{frame}     \end{document}


title: If mathcode is used to typeset e and i upright, how to force it italics again?

text: I'm using `\mathcode"69"69` in the preamble, as proposed in a comment in this question, to automatically typeset e and i upright in mathematical equations. The question is, is there a way to get an italics _i_ f.ex. as an index in math mode later? If so, how? I tried `$\mathit{i}$`, which doesn't work.


title: Problem with fancyref, babel and equation references

text: I am using fancyref and babel together in a LaTeX document and redefine the label for the equation references by `\renewcommand{\frefeqname}{Eq.}`, so that they look something like "Eq. (3.4)". However, when I have a foreign language section somewhere like `\begin{otherlanguage}{german} ... \end{otherlanguage}` then `\frefeqname` is reset to its default value for English, namely `equation`. Of course, I can redefine `\frefeqname` afterwards again, but is quite ugly and I would prefer a clean solution to this problem.


title: Align inside align

text: I have a list of equations with annotations like the one below:               \documentclass{scrartcl}     \usepackage{amsmath}     \begin{document}     \begin{align*}       aaaa &= 1  &&\text{for $X$} \\       bbbb &= 1  &&\text{for $Y$} \\       c    &= 1  &&\text{for $Z$} \\       d    &= 12 &&\text{for $Z$}     \end{align*}     \end{document}      Since the last two lines have the same annotation, I'd like to add a brace there and put the annotation next to the brace. I know that I can do that like this:               \documentclass{scrartcl}     \usepackage{amsmath}     \begin{document}     \begin{align*}       \left. \begin{aligned}         c &= 1 \\         d &= 12 \\       \end{aligned} \right\} &&\text{for $Z$}     \end{align*}     \end{document}      But how to join the two? The last two lines will only be aligned among themselves, not with the first two. Is there a way out of this? Thanks in advance.


title: \addplot3 in pgfplots plots data beyond axis limits

text: When using `pgfplots` for a 3D graph and reading the data from a table, is there a way to truncate the data at the _axis limits_ specified in the `axis` environment ? Here is a MWE:               \documentclass[tikz]{standalone}          \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \usepackage{amsmath}          \begin{document}     \begin{tikzpicture}         \begin{axis}[%             width=16cm,height=8cm,             view={-45}{65},             scale only axis,             xmin=200,xmax=500,             xlabel={data1},             ymin=0,ymax=80,             ylabel={data2},             zmin=0,zmax=1,             zlabel={data3},         ]         \addplot3 table[row sep=crcr] {                 250 0 0\\                 250 25 0.2\\                 250 50 0.3\\                 250 75 0.2\\                 250 100 0\\             };         \addplot3 table[row sep=crcr] {                 450 0 0.5\\                 450 25 0.1\\                 450 50 0\\                 450 75 0.1\\                 450 100 0.5\\             };         \end{axis}     \end{tikzpicture}%     \end{document}      In this example, the `ydata` of each table goes up to `100`, while the `ymax` value specified in the `axis` options is `80`. In this case, the output looks like: ![Output for MWE](http://i.stack.imgur.com/QSmYw.png) Note how the plotted lines go beyond the prescribed axis limits. Is there a way either to read the data up to a certain value (in this case `ymax`) or an option that can be specified in the `axis` environment to avoid displaying curves beyond axis limits ?


title: Add equation name besides equation number (so that \eqref inserts only the number)

text: I am trying to add equation names besides the equation numbers but, in addition, in such a way that `\eqref` inserts just the number. Inspired by the top answer in Add equation name underneath equation number, I tried the following solution:               \documentclass{article}     \usepackage{amsmath}     \newcommand\mylabel[2]{\label{#1} \\[-\baselineskip] \tag*{#2\ \hphantom{(\ref{#1})}}}          \begin{document}          \begin{align}     f(x) = a \mylabel{eq:a}{Constant} \\     h(x) = ax^2+bx+c \mylabel{eq:b}{Quadratic}     \end{align}          Equations \eqref{eq:a} and \eqref{eq:b} look OK\dots           \begin{align}     j(x) = \varinjlim_{C_j} \mylabel{eq:c}{Way too low!}     \end{align}          \dots but the method fails in style for Equation \eqref{eq:c}.          \end{document}      ![enter image description here](http://i.stack.imgur.com/JgzoJ.png)         As you can see, the trick I used is to write the equation name in a new line and then lift it by `-\baselineskip`. For simple equations as (1) or (2) I get exactly what I want. But indeed, this is shoddy work and it fails as soon as the equation gets a little more complicated, e.g. for (3). I don't know whether I could use another length instead of `-\baselineskip` so that I always get the correct lift, or whether there is a more elegant (and not too complicated) way to achieve what I want.


title: parametric plot 3D, helix and astroidal sphere

text: Can somebody help me and write code for this 2 picture in WinEdt (latex) (this is from Mathematica, I write in Mathematica, but I don't know write this code in WinEdt). I tried with "parametricplotThreeD" and I don't know how write code. Help :( Sorry, I don't speak english very well.. ![enter image description here](http://i.stack.imgur.com/qcnpj.png) ![enter image description here](http://i.stack.imgur.com/uO6NK.png)


title: Change pgfplot auto tick distance

text: I have data that is measured in a seconds scale. If I plot the data using pgfplots, the automatic tick labes are multiples of 100. Because the axis is "time", I would like to be the ticks multiples of 60 (or maybe 120 if too large). I know, I can manually define this using `xtick={0,60,...,420}`, but that requires me to know the size of the data sample. As I have many samples that also may change in the future I would like to do this automatically. **My question is** : How do I change the automatic tick distance to a different value?               \documentclass{standalone}     \usepackage{amsmath,tikz,pgfplots}     \begin{document}       \begin{tikzpicture}         \begin{axis}[xtick={0,60,...,420}]           \addplot coordinates {             (0,0)             (90,0)             (110,10)             (150,60)             (170,70)             (220,90)             (300,120)             (430,150)           };         \end{axis}       \end{tikzpicture}%     \end{document}


title: Kile syntax highlighting: A single dollar sign in the preamble

text: I'm using `Kile` to edit my LaTeX documents. I define my own custom environment to hightlight LaTeX code named `lstLaTeX` with the following code:               \documentclass[a4paper]{scrartcl}     \usepackage[usenames,dvipsnames]{xcolor}     \usepackage[latin1]{inputenc}     \usepackage[ngerman,english]{babel}          \usepackage{listings}          \definecolor{lightgrey}{rgb}{0.9,0.9,0.9}     \definecolor{darkgreen}{rgb}{0,0.6,0}          \lstnewenvironment{lstLaTeX}       {       \lstset{language=[LaTeX]TeX,         keepspaces=true,         texcsstyle=*\bf\color{blue},         basicstyle=\ttfamily,         numbers=none,         breaklines=true,         keywordstyle=\color{darkgreen},         commentstyle=\color{red},         morekeywords={},         otherkeywords={$, \{, \}, \[, \]},         frame=none,         tabsize=2,         columns=fullflexible,         backgroundcolor=\color{lightgrey},         escapechar=°         }       }       {}               \begin{document}     The actual document.     Here some LaTeX code:     \begin{lstLaTeX}     Brackets should be {\bf highlighted}.     The dollar sign: $x=5$     \end{lstLaTeX}          \end{document}      The problem is that Kile cannot deal with the single dollar sign in the preamble and marks all following text green (because it thinks there should be a math environment). ![enter image description here](http://i.stack.imgur.com/FcNM9.png) I already read how to teach Kile to ignore dollar signs when used inside custom environments here: disable syntax highlighting in kile But this post doesn't solve my problem. So it would be nice if I could tell Kile to ignore this single dollar sign. I already tried to add `%$` at the end of the line with the single dollar sign but Kile ignores this.


title: BibTeX not compiling

text: On a recent document, I could not get the BibTeX file to compile and populate my citations and references. The log returned an error, which I attempted to fix by changing the encoding of my .bib file, and moving it to the parent director. Neither of these fixes were successful. Below is the code and warning message               \documentclass[12pt]{article}     \usepackage{fullpage}     \usepackage{setspace}     \usepackage{graphicx}     \usepackage{natbib}     \title{Judicial Resonsiveness to Other Branches and the Public}     \author{xxx}     \begin{document}     \maketitle     \doublespacing          Hello world \citep{Gely1990}          \bibliographystyle{apsr}     \newpage     \singlespacing     \bibliography{POLSlibrary3.bib}     \end{document}      This is the error:               "This is BibTeX, Version 0.99d (MiKTeX 2.9 64-bit) The top-level auxiliary file: GARseparation.aux The style file: apsr.bst I couldn't open database file POLSlibrary3.bib.bib ---line 4 of file GARseparation.aux : \bibdata{POLSlibrary3.bib : } I'm skipping whatever remains of this command I found no database files---while reading file GARseparation.aux Warning--I didn't find a database entry for "Gely1990" (There were 2 error messages)"      Thanks in advance for your help. Update, just moving things from my replies to the original documentation.               @ARTICLE{Gely1990, author = {Rafael Gely and Pablo T. Spiller}, title = {A Rational Choice Theory of Supreme Court Statutory Decisions with Applications to the 'State Farm' and 'Grove City' Cases}, journal = {Journal of Law, Economics, and Organization}, year = {1990}, volume = {6}, pages = {263-30}, owner = {Phillip}, timestamp = {2013.11.11} }           @BOOK{Watson1969, title = {The Politics of The Bench and The Bar: Judicial Selection Under the Missouri Nonpartisan Court Plan}, publisher = {Wiley and Sons}, year = {1969}, author = {Richard A. Watson and Rondal G. Downing}, address = {New York}, owner = {Phillip}, timestamp = {2013.11.24} }


title: biblatex translation with wrong ligature

text: I'm playing around with `biblatex` at the moment. It works nice, but there is a problem with a translation of "Ed." (edition) to "Aufl." (Auflage). The translation is correct but it has a wrong ligature there. It should be "Auf"|l.". Can I override the translation somehow? Or is this ligature correct because the rules for ligatures do not apply to abbrevations? Here is a MWE:               \documentclass{article}          \usepackage[german]{babel}     \usepackage[babel, german=quotes]{csquotes}     \usepackage[natbib=true, style=phys, articletitle=false,biblabel=brackets,%             chaptertitle=false,pageranges=false%             ]{biblatex}     \addbibresource{lit.bib}          \begin{document}         \nocite{*}         \printbibliography[env=bibliography, title=Literaturverzeichnis]     \end{document}      and `lit.bib`:               @book{Seeger1997,       edition = {6},       title = {{Semiconductor Physics. An Introduction.}},       isbn = {3540615075},       publisher = {Springer Berlin Heidelberg},       author = {Seeger, Karlheinz},       month = jan,       year = {1997}     }      ![enter image description here](http://i.stack.imgur.com/YxSEf.png)


title: Landscape and page numbers with pdfpages

text: I am using `pdfpages` to insert PDFs into a master file. Some of the PDFs are portrait and some are landscape. I am using `pagecommand=\thispagestyle{plain}` so that the page numbers are in sequence throughout the final document. However, on PDFs included as landscape, the page numbers appear on the left side of the page (i.e. as they would if the page were not landscape). How can I get them to appear on the bottom of the page? MWE where `one.pdf` is included in portrait and `two.pdf` is included in landscape:               \documentclass[12pt,english]{article}     \usepackage{pdfpages}     \includepdfset{pagecommand=\thispagestyle{plain}}     \usepackage{geometry}          \begin{document}          This is the text in the master file.          \newpage{}          \includepdf[pages=-,landscape=false]{one}          \newpage{}          \includepdf[pages=-,landscape=true]{two}          \end{document}


title: borders around page using pgfornament

text: EDITED: I know this example ornaments in pgfornament to be at the corners at every page but how to add ornament in horizontal and vertical/top bottom /? I need this only on titlepage of memoir class. Here is a code from answers i have found/including answer on this page/:                   \documentclass{article}         \usepackage[paper=a4paper, verbose, centering]{geometry}         \usepackage{pgfornament}         \usetikzlibrary{calc}         \newcommand{\pageborders}[3]{%           \begin{tikzpicture}[remember picture, overlay]               \node[shift={(1cm,-1cm)},anchor=north west](CNW)           at (current page.north west)            {\pgfornament[width=1.75cm]{#1}};           \node[shift={(-1cm,-1cm)},anchor=north east](CNE)           at (current page.north east)            {\pgfornament[width=1.75cm,symmetry=v]{#1}};           \node[shift={(1cm,1cm)},anchor=south west](CSW)           at (current page.south west) {\pgfornament[width=1.75cm,symmetry=h]{#1}};           \node[shift={(-1cm,1cm)},anchor=south east](CSE)           at (current page.south east)            {\pgfornament[width=1.75cm,symmetry=c]{#1}};           \pgfornamenthline{CNW}{CNE}{north}{#2}           \pgfornamenthline{CSW}{CSE}{south}{#2}           \pgfornamentvline{CNW}{CSW}{west}{#3}           \pgfornamentvline{CNE}{CSE}{east}{#3}           \end{tikzpicture}%         }              \title{Title}         \author{Author}         \date{}              \usepackage{kantlipsum,titling}% for demo only              \begin{document}              \maketitle\pageborders{61}{84}{87}\thispagestyle{empty}         \clearpage%              \end{document}      Questions:   1. How to adjust ornaments in 'ornamentlines' (like node shifts for corners) to make ornaments link together?   2. how to use multiple ornaments on vertical/horizontal lines?/lets say same ornament multiple times linked together from corner to corner   3. how to change symmetry of ornament, which is used in 'ornamentlines'   4. how to scale ornaments used in 'ornamentlines'/let say ornament used in vertical border scaled by width and ornament used in horizontal scaled by height/ ![enter image description here](http://i.stack.imgur.com/1QQPa.png) and here is a webomint's example..sorry i can not find source file right now: ![enter image description here](http://i.stack.imgur.com/eGP2S.jpg) related question using webomints is here fancyhdr page decorations and page numbering


title: Can I use \input inside an \include?

text: I know it is not possible to nest one `\include` inside another, but what about `\input`? Is it possible to have something like:               \documentclass{article}          \begin{document}          \include{file1}          \end{document}      and then in `file1.tex`:               \section{samplesection}     \input{file2}      in `file2.tex`;               \section{samplesection2}     Hello


title: Scientific workplace piecewise constant function

text: I want to sketch a piecewise constant function. Ie S(t) on y axis, time on x axis. The values of S(t) are arbitrary, I just want a piecewise constant function with time partition 1/10 to use: > S(t)=10 for 0≤t<1/10 > > S(t)=3 for 1/10≤t<2/10 > > and so forth up to t=1. I want to have a closed circle at the left endpoint and an open one at the right endpoint to indicate the discontinuity, ie open circle at t=0, closed circle at t=1/10 for S(t)=10,and a line connecting the two points, open circle at t=1/10 for S(t)=3 open cicle at t=2/10 and so forth. I can't figure out how to do this.


title: cool package derivative and eulervm \mathbold fails with 'Missing control sequence inserted.'

text: Compiling               \documentclass{article}          \usepackage{cool}     \usepackage{eulervm}          \begin{document}          $\D{a}{T}$     $\pderiv{a}{T}$          $\mathbold{T}$          $\D{a}{\mathbold{T}}$     $\pderiv{a}{\mathbold{T}}$          \end{document}      works until the derivatives are evaluated for bold euler letters. It fails with               ! Missing control sequence inserted.     <inserted text>                    \inaccessible      l.13     $\D{a}{\mathbold{T}}                              $      Perhaps this is related to Basic use of derivative with cool package fails with “Missing \endcsname inserted” but the fix proposed there does not work.


title: Why is \str_if_eq_p:nn not evaluating to true?

text: In the following MWE, `\str_if_eq_p:nn` is not evaluating to true when `\l_aepoly_presentation_style_tl` is set to `ABC`. Why?               \documentclass{article}     \usepackage{xparse}     \ExplSyntaxOn     \tl_new:N \l_aepoly_presentation_style_tl     \NewDocumentCommand{\mqpoly}{ D(){ABC} m }       {\aepoly_parse_polynomial:nn {#1} {#2} }     \cs_new:Npn \aepoly_parse_polynomial:nn #1#2 {       \tl_set:Nn \l_aepoly_presentation_style_tl {#1}       \bool_if:nTF {           %% other possible boolean expressions to evaluate           \str_if_eq_p:nn { \tl_to_str:N \l_aepoly_presentation_style_tl } { ABC }         }           { \iow_term:n { string ~ is ~ "ABC" } }           { \iow_term:x { NOT ~ EQUAL -> ~ "\l_aepoly_presentation_style_tl" } }     }          \ExplSyntaxOff     \pagestyle{empty}     \begin{document}          \mqpoly(MNP){hello}          \mqpoly{hello}          \end{document}


title: Vector font for suetterlin

text: I want to use the old German "Kurrentschrift" in equations. In LaTeX, this is already integrated in the package `suetterl`:               \documentclass{article}     \usepackage{suetterl}          \begin{document}          \textsuetterlin{A}          \end{document}      BUT this isn't a vector font, and now I'm searching for very, very long time to find a suitable vector font which implements all the letters in a similar look. I found the way to implement other fonts with the package `fontspec`, but till now I didn't find a suitable font... It would be great, if someone has a hint for a suitable font, or for LaTeX commands to use `suetterlin` as a vector font (but i don't think this is possible)...


title: Count chars with xstring

text: I have the following code, which was provided by the `xstring` author Christian Tellechea, thank you very much. The idea is to count the number of character inside a structure that do belong to a predefined list.               \documentclass{article}     \usepackage{xstring}     \usepackage{blindtext}     \makeatletter     \def\countoccurs#1#2{%         \saveexpandmode\expandarg         %\exploregroups         \expandafter\def\expandafter\tmp@list\expandafter{\list,}%         \let\nboccur\z@         \loop             \unless\ifx\empty\tmp@list                 \StrCut\tmp@list,\tmp@cs\tmp@list                 %\StrCount{\noexpand#2}\tmp@cs[\tmp@cs]%                 \StrCount{#2}\tmp@cs[\tmp@cs]%                 \edef\nboccur{\number\numexpr\nboccur+\tmp@cs}%         \repeat         \restoreexpandmode     }     %\def\list{12,a,bc,9} % list can also be defined as this     \def\list{%     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,%     A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,S,X,Y,Z,%     1,2,3,4,5,6,7,8,9,0,%     }     \def\countenv#1{#1\countoccurs\list{#1}}     \makeatother          \begin{document}     \countenv{\begin{tabular}{ll} a & b \\ a & c \end{tabular}}\par     I counted: \nboccur.          \noindent\hrulefill          \countenv{\textbf{D}2345}\par     I counted: \nboccur.          \noindent\hrulefill          \countenv{\blindtext}\par     I counted: \nboccur.          \noindent\hrulefill          %\countoccurs\list{12987d bc abcabc999}     \countenv{12987d bc abcabc999}\par     I counted: \nboccur.          \noindent\hrulefill     \end{document}      As you can see in the output, the first and last counts are correct, but the others don't. I tried to use the `\exploregroups` and `\noexpand#2` but luck with all presented examples. For example, the `\noexpand#2` corrects the second output, but badly influences the first and third. Is there a away that works for all?


title: How does \uput determine the touching point between the object box and the hypothetical circle?

text: > This question offers 4 bounties of 500 each only for a single answer that > fit this question best. I am interested in describing the behavior of `\uput` for non-zero dimensional objects. Non-zero dimensional objects are objects with prepared containers at TeX level. Zero dimensional objects have zero containers at TeX level. For zero dimensional objects, its behavior has been known as follows and now it is no longer interesting to me. ![enter image description here](http://i.stack.imgur.com/ShJbP.png) Lets consider the 2 cases below: ## Case 1: ![enter image description here](http://i.stack.imgur.com/l9K7s.gif)               \documentclass[pstricks,border=12pt]{standalone}      \SpecialCoor     \usepackage{multido}           \def\NonZeroDimenObject{%         \pspicture(2,1)             \psframe(2,1)             \psline[linecolor=blue]{->}(1,.5)(2,.5)         \endpspicture}          \SpecialCoor          \begin{document}           \multido{\i=0+15}{24}{%     \begin{pspicture}[showgrid](8,8)         \pscircle(4,4){2}         \psline[origin={4,4}](3.5;\i)         \rput(4,4){\i}         \uput{2}[\i]{0}(4,4){\NonZeroDimenObject}     \end{pspicture}}          \end{document}      ## Case 2: ![enter image description here](http://i.stack.imgur.com/nQ74a.gif)               \documentclass[pstricks,border=12pt]{standalone}      \SpecialCoor     \usepackage{multido}           \def\NonZeroDimenObject{%         \pspicture(2,1)             \psframe(2,1)             \psline[linecolor=blue]{->}(1,.5)(2,.5)         \endpspicture}          \SpecialCoor          \begin{document}           \multido{\i=0+15}{24}{%     \begin{pspicture}[showgrid](8,8)         \pscircle(4,4){2}         \rput(4,4){\i}         \uput{2}[0]{\i}(4,4){\NonZeroDimenObject}     \end{pspicture}}          \end{document}      ## Questions: I have 3 questions:   1. For the given `\alpha` (or the second argument), a line from `(i_x,i_y)` to `(i_x,i_y)+(r;\alpha)` does not always point to the touching point between the object box and the hypothetical circle of radius `labelsep`. How does `\uput` determine the touching point? Explaining the internal algorithm should be fine.   2. The pivot seems not to be static. How does `\uput` determine the touching point? Explaining the internal algorithm should be fine.   3. When do we really need `\uput`? Please give me at least 2 practical unique examples that cannot be replaced by other put macros.


title: Is there a way to convert an image to grayscale?

text: Is there a way to convert a colored image to grayscale both for printing as well as screen viewing through pdfLaTeX?


title: Vertical space before and after align environment

text: I am wondering if it is possible in LaTeX to generally adjust the spacing before and after math in the `align` environment from `amsmath`. From the Mathmode-guide (by Herbert Voss) I gather that `\belowdisplayskip` and friends should do the job, but manipulating them doesn't yield any visible results.


title: Asymptote code integration into Beamer format

text: I'm wondering anyone else has experienced compatibility issues between Asymptote and Beamer format, and what the fixes are. For example, I'm able to get a pdf output when I compile the following:               \documentclass{beamer}     \usepackage{amsmath,amssymb,amsthm,asymptote,graphicx}     \mode<presentation>          \begin{document}          \begin{frame}     \frametitle{Outline}     \begin{itemize}     \pause\item Something something something something.     \pause\item Something else something else.     \end{itemize}     \end{frame}          \begin{frame}     \frametitle{Diagram}     %\begin{center}     %\begin{asy}     %import graph;     %size(150,150,Aspect);     %scale(true);     %draw((-2,-2)--(2,2),gray);     %dot("$(-2,-2)$",Scale((-2,-2)),S);     %dot("$(2,2)$",Scale((2,2)),N);     %\end{asy}     %\end{center}     \end{frame}          \end{document}      But not when I take out the comments on the Asymptote portion. I found useful the "Beamer All The Way" presentation, where I noticed near the end of the presentation he included an Asymptote animation of a drawing of a polar graph. I also currently have my version of TeXnicCenter 2 Alpha set up the way described in the Advanced Configuration of the Art of Problem Solving Wiki. I'd also like to point out that (I think...) the Asymptote compiler in LaTeX needs the \end{asy} argument to not be indented. The error I'm getting has to do with the "scanning error of \next", which is typically some violation of environment rules in compilation. Is it true that the Beamer installation "needs" the \end{frame} to not be indented, and this is where the error is occurring? Thanks ahead of time for your input.


title: Is \algorithmicand a standard command in the algorithmic package?

text: I have a tex file created by someone else which redefines commands of the algorithmic package to translate them to the Portuguese language. For example:               \renewcommand{\algorithmicwhile}{\textbf{enquanto}}      Is used to replace the word **while** by **_enquanto_** , which is the translation of while to Portuguese. However, I am getting errors when I invoke `\renewcommand` for the following lines:               \renewcommand{\algorithmicand}{\textbf{e}}     \renewcommand{\algorithmicor}{\textbf{ou}}     \renewcommand{\algorithmicto}{\textbf{até}}      Here's the error for the first line:               ! LaTeX Error: \algorithmicand undefined.      Do I get this error because `\algorithmicand`, `\algorithmicor`, and `\algorithmicto` are not included the algorithmic package? Is it ok for me to use the `\newcommand` instead of `\renewcommand` in this case?


title: Numbering of subsections using memoir

text: > **Possible Duplicate:**   >  Turn on subsection numbering in memoir I'm writing a thesis using **memoir** as my class. I've noticed it only includes numbering on chapters and sections, not subsections. However **I would like numbers on my subsections etc**. I have tried the `\setcounter{secnumdepth}{3}` but it doesn't seem to work :/ Can anyone help me?


title: Beamer grey out items after pause

text: I'm making a presentation in Beamer and I've been having some trouble getting exactly the effect I want. I have three blocks, one that stretches across the entire width of the slide, and two that are side by side in a `\columns` environment. The top block should be always visible, but on the first slide I don't want to see the either two. The next slide should show the top block and the left block, but not the right block. The third and last slide should show all three blocks, but the left block should be greyed out. I have tried using `\visible` and `\pause` but everything I try I can make work only if I duplicate a lot of my text, which I don't think should be necessary. Here is an example that almost works, it just needs to grey out the left block on the second slide               \documentclass{beamer}     \usetheme{Darmstadt}     \begin{document}     \begin{frame}{example}       \begin{block}{Top Block}         Should be visible on all slides       \end{block}       \begin{columns}[C]         \begin{column}{0.5\textwidth}           \begin{block}<2>{left  block}             Should be visible on slide 2 and greyed out on slide 3           \end{block}         \end{column}         \begin{column}{0.5\textwidth}           \begin{block}<3>{right block}             Should only be visible only on slide 3           \end{block}         \end{column}       \end{columns}     \end{frame}     \end{document}