title: PGFplots ybar patterns not showing

text: I have a bar plot graph and I want to use patterns to fill the columns. However it seems that patterns are not working. For compiling I use `pdflatex` or `lualatex`. I also wanted to use pattern width different fill color. Is that possible?               \documentclass[10pt,border=0pt]{standalone}          \usepackage{xcolor}     \usepackage{tikz}     \usepackage{tikzscale}     \usepackage{pgfplots}          \usetikzlibrary{patterns}          \pgfplotsset{every tick/.style={black,}}          \pgfplotsset{%         compat=1.8,         compat/show suggested version=false,         ybar,         tick label style={font=\footnotesize},         label style={font=\footnotesize},         legend style={%             font=\footnotesize,             at={(0.5,-0.15)},             anchor=north,             legend columns=2             legend cell align=left,             nodes={inner xsep=2pt,inner ysep=0.4pt,text depth=0.15em},         },     }          \begin{document}     \begin{tikzpicture}     \begin{axis}[%         ylabel={y-axis},         symbolic x coords={AAA,BBB},         xtick=data,         bar width=16pt,         enlarge x limits=0.4,         nodes near coords,         font=\footnotesize,         legend entries={C,D,E,G},     ]              \addplot[pattern=horizontal lines] coordinates {(AAA,0.32) (BBB,0.43)};         \addplot[pattern=vertical lines] coordinates {(AAA,0.91) (BBB,0.93)};         \addplot[pattern=north east lines] coordinates {(AAA,0.19) (BBB,0.16)};         \addplot[pattern=north west lines] coordinates {(AAA,0.74) (BBB,0.72)};     \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/ArANp.png)


title: how to make this circles?

text: I would like to make in LaTeX these circles.![enter image description here](http://i.stack.imgur.com/D3kaR.gif) How can we add the words in them? The color for the big one?


title: What is the best book with american typography rules?

text: There is russian book Reference book of editor and author which is well-known and considered the best comprehensive guide to typography and writing of text in russian (formatting, margins, font sizes and so on). You can get the idea if you peek my link (even everything is in Russian).


title: Subfigures with Captions Above AND Below

text: I'm using               \usepackage{subfig}     \captionsetup[subfigure]{labelformat=empty}       Is this possible?


title: No checked Checkbox on hyperref package

text: Look at the following MWE. A checked `checkbox` should appear, but it isn't.               \documentclass{article}     \usepackage{hyperref}          \begin{document}     \begin{Form}[action={http://your-web-server.com/path/receiveform.cgi}]     \begin{tabular}{l}         \TextField{Name} \\\\         \CheckBox[checked=true,width=1em]{Check} \\\\         \CheckBox[checked,width=1em]{Check} \\\\         \CheckBox[width=1em]{Check} \\\\         \Submit{Submit}\\     \end{tabular}     \end{Form}     \end{document}      Compiling with **MiKTeX** command-line twice:               pdflatex formularta.tex     pdflatex formularta.tex      Where is my fault? Did I forget anything? EDIT1: I have reported this information to acrobat now (14.08.2014 14:01)


title: The correct way to type tilde?

text: So, I know there are a lot of posts about this already, with answers like `\textasciitilde`, `\texttildelow` and `$\sim$` and they all seam to work in their own way. But what I've found is that they look like tilde when typeset, but when you highlight the character, copy it and paste it into a terminal window, it's a completely different character. I've found that `\texttildelow` is the only command that creates an "actual" tilde-character, when copied and pasted into a terminal. However, it is printed very low in the pdf when used, and it looks like something else. I need help managing all these ways to type tilde. I want to type tilde in both verbatim text and in normal text mode. What I would like is for the characters to look like a normal tilde when typeset, and also be the "real" tilde when copied into the terminal window. This is to simplify the process of using the commands I write. I don't think a sample text is necessary in this particular post, but if needed I can edit that in.               \documentclass[11pt]{paper}     \usepackage{hyperref, xcolor, graphicx, textcomp}          \hypersetup{colorlinks=true, urlcolor=blue}     \setlength\parindent{0pt}          \newenvironment{accs}     {\color{black}     \begin{tt}     \fontsize{11pt}{11pt}\selectfont}     {\end{tt}}          \title{Resequencing Analysis}          \begin{document}     \maketitle          ~/glob/gatk          \begin{accs}         $ mkdir ~/glob/gatk     \end{accs}\\          \end{document}      I have now solved a part of the problem by using the environment               \newenvironment{vtim}     {\verbatim     \fontsize{11pt}{11pt}\selectfont}     {\endvarbatim}      instead, but the tilde character still looks weird in the .pdf as it is raised up... If I use the $\sim$ it can't be copied into the terminal :/


title: How to run a program inside LuaLaTeX?

text: Is it possible to run a simple script inside LuaLaTeX or LaTeX? For example, I need to use the calculator from the terminal. I'd like to write > $echo "100.83*4.53" | bc and obtain the result in LuaLaTeX or LaTeX. Is there a command (called `\runscript`, for instance) that runs a script from within LuaLaTeX or LaTeX and that I could use as follows: > \runscript{echo "100.83*4.53" | bc} and get "456.7599" as result? Is it possible, perhaps with some Perl or Python script?


title: Start chapter numbering at the third chapter

text: I use the report class. I have a total of 8 chapters, however I only want 6 chapters to have a number. So I want to start the numbering at the third chapter, and the first 2 chapters should only show the title in the table of contents. so basically i have the chapters: abbreviations preface theoretical background etc. and i want the abbreviations and preface to show up in the TOC as only the title and start the numbering at theoretical background. Any suggestions on how to do this?


title: Equation to show less than sign for multiple points

text: I want to show in my article a mathematical equation to express following expression               for i=1 to n     Pi < qi      How can I write this expression as an equation of proper form in LaTeX ?


title: How to typeset programming code syntax with annotations?

text: If possible I would like to know how to this on latex/tikz to add this like (environment and graph) on my ebook. Thanks a lot!!! ![How to do this on latex or tickz ?](http://i.stack.imgur.com/oi2qo.png) Code im trying to implement:               \documentclass[11pt,fleqn]{book}           \usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry} % Page margins          \usepackage{xcolor} % Required for specifying colors by name     \definecolor{ocre}{RGB}{243,102,25} % Define the orange color used for highlighting throughout the book          % Font Settings     \usepackage{avant} % Use the Avantgarde font for headings     %\usepackage{times} % Use the Times font for headings     \usepackage{mathptmx} % Use the Adobe Times Roman as the default text font together with math symbols from the Symbol, Chancery and Computer Modern fonts          \usepackage{microtype} % Slightly tweak font spacing for aesthetics     \usepackage[utf8]{inputenc} % Required for including letters with accents     \usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs                    % Index     \usepackage{calc} % For simpler calculation - used for spacing the index letter headings correctly     \usepackage{makeidx} % Required to make an index     \makeindex % Tells LaTeX to create the files required for indexing          \usepackage{titlesec} % Allows customization of titles          \usepackage{graphicx} % Required for including pictures     \graphicspath{{Pictures/}} % Specifies the directory where pictures are stored          \usepackage{lipsum} % Inserts dummy text          \usepackage{tikz} % Required for drawing custom shapes          \usepackage[brazil]{babel} % English language/hyphenation          \usepackage{enumitem} % Customize lists     \setlist{nolistsep} % Reduce spacing between bullet points and numbered lists          \usepackage{booktabs} % Required for nicer horizontal rules in tables          \usepackage{eso-pic} % Required for specifying an image background in the title page          %----------------------------------------------------------------------------------------     % Default fixed font does not support bold face     \DeclareFixedFont{\ttb}{T1}{txtt}{bx}{n}{12} % for bold     \DeclareFixedFont{\ttm}{T1}{txtt}{m}{n}{12}  % for normal          % Custom colors - http://get-software.net/info/colour/chroma/chroma.pdf     \usepackage{color}     \definecolor{deepblue}{rgb}{0,0,0.5}     \definecolor{deepred}{rgb}{0.6,0,0}     \definecolor{deepgreen}{rgb}{0,0.5,0}     \definecolor{Keywords}{rgb}{0,0,1}     \definecolor{functions}{rgb}{0.75,0,0.5}     \definecolor{boolean}{rgb}{1,0.4,0}          %\usepackage{listings}     \usepackage[procnames]{listings}          % Python style for highlighting     \newcommand\pythonstyle{\lstset{     language=Python,     basicstyle=\ttm,     otherkeywords={self},             % Add keywords here     keywordstyle=\ttb\color{deepblue},     %% keywords     emph={MyClass,__init__},          % Custom highlighting     emphstyle=\ttb\color{deepred},    % Custom highlighting style     %% keywords     stringstyle=\color{deepgreen},     frame=tb,                         % Any extra options here     %% keywords     emph={[2]or,and,not,def,for,in,if},                 % Custom highlighting     emphstyle=[2]\ttb\color{boolean},       % Custom highlighting style     %% keywords     emph={[3]input,print,range,int,float,str},                  % Custom highlighting     emphstyle=[3]\ttb\color{functions},     % Custom highlighting style     %%     procnamekeys={def,class},     procnamestyle=\color{blue}\ttb,     %%     commentstyle=\color{red}\ttm,     numbers=left,     numberstyle=\footnotesize,     numbersep=1em,     showstringspaces=false,            %     %%     rulecolor=\color{ocre}, % Cor da linha de borda     framexleftmargin=1mm, framextopmargin=1mm,     }}               % Python environment     \lstnewenvironment{python}[1][]     {     \pythonstyle     \lstset{#1}     }     {}          % Python for external files     \newcommand\pythonexternal[2][]{{     \pythonstyle     \lstinputlisting[#1]{#2}}}          % Python for inline     \newcommand\pythoninline[1]{{\pythonstyle\lstinline!#1!}}          %----------------------------------------------------------------------------------------     %----------------------------------------------------------------------------------------               \begin{document}          \begin{python}[backgroundcolor=\color{black!5}]     Python sintax: test of arguments          print('bla bla',234)          \end{python}          \end{document}      Result: ![enter image description here](http://i.stack.imgur.com/c9hLX.png)


title: Why is % the comment character?

text: I was reading a book about TeX macros and related features and I came across this rather _trivial_ question... Can anyone explain to me why `%` is the comment character in LaTeX? Why this one and not another one, is there a particular (historical?) reason for that? This leads me to another related question: are you using intensively comments in your TeX code? And if yes, for which purpose(s)? _Bonus Question:_ In the same spirit, why is `$` the character for the maths mode?


title: Forbidding/requiring certain pgfkeys?

text: I have some commands whose named arguments are processed by pgfkeys               \dog[breed=Labrador, name=Fido]     \human[name=John, car owned=Porsche]      How can I arrange that               \dog[breed=Labrador, car owned=Rover]      gives the error message `Invalid key 'car owned'`, and               \dog[name=Fido]      gives the error message `Missing required key 'breed'`? Here is a MWE to use as a starting point.               \documentclass{article}     \usepackage{pgfkeys}          \makeatletter     \pgfkeys{/wickerson/.cd,       breed/.store in =     {\wickerson@breed},       name/.store in =      {\wickerson@name},       car owned/.store in = {\wickerson@carowned}     }          \newcommand*\dog[1][]{%       \pgfkeys{/wickerson/.cd, name=noName, breed=noBreed, #1}       Dog is a {\wickerson@breed} and is called {\wickerson@name}.\par     }          \newcommand*\human[1][]{%       \pgfkeys{/wickerson/.cd, name=noName, car owned=noCar, #1}       Human is called {\wickerson@name} and owns a {\wickerson@carowned}.\par     }     \makeatother          \begin{document}          \dog[breed=Labrador, name=Fido]       % GOOD     \human[name=John, car owned=Porsche]  % GOOD     \dog[breed=Labrador, car owned=Rover] % BAD (irrelevant key given)     \dog[name=Fido]                       % BAD (required key missing)          \end{document}


title: Can't get nomenclature to work

text: I'm trying to use the `nomencl` package in my thesis, but I'm have some difficulties in getting it to work. I've downloaded a copy of the `nomencl` guide written by Bernd Schandl, and am currently trying to use his code example as a MWE before applying it to my thesis. This is the code he gives in his MWE, but I've had to change `\makeglossary` and `\printglossary` to `\makenomenclature` and `\printnomenclature`, respectively, as the glossary commands no longer seem to work (I read this here).               \documentclass{article}     \usepackage{nomencl}     \makenomenclature     \begin{document}     \section*{Main equations}     \begin{equation}     a=\frac{N}{A}     \end{equation}%     \nomenclature{$a$}{The number of angels per unit area}%     \nomenclature{$N$}{The number of angels per needle point}%     \nomenclature{$A$}{The area of the needle point}%     The equation $\sigma = m a$%     \nomenclature{$\sigma$}{The total mass of angels per unit area}%     \nomenclature{$m$}{The mass of one angel}     follows easily.     \printnomenclature     \end{document}      So after creating my document and saving it as `Nomenclature.tex` I've followed the next set of commands, which is to `makeindex`. I'm using Windows 7, so it's a case of `Start > Run > cmd > pushd <directory>` which takes me to the directory where `Nomenclature.tex` is stored. I then type `makeindex Nomenclature.glo -s nomencl.ist -o Nomenclature.gls`, which creates the .gls file. Then, when I compile the document using Texmaker via `MakeIndex` from the `QuickBuild` drop down box, followed by `QuickBuild` (mine is currently set to LaTeX + dvips + ps2pdf + View PDF) I just get the document without any nomenclature, as below: ![enter image description here](http://i.stack.imgur.com/WzeQR.png) As you can see, I get an output of 1 page, with the formula and text, but no nomenclature. Can anyone explain where I'm going wrong? Many thanks, Chris


title: How to encapsulate row predicates in `pgfplots`

text: I'm trying to encapsulate some `pgfplotstable` code that involves setting up a `row predicate`. If you are checking table values amongst the predicate code you need access to the table and the only thing that seems to work here is hardwiring the command name of the loaded table, which does not lend itself to code reuse, and there are also other other aspects of the style that change on a case by case basis. But, if you put this stuff inside a macro, there ends up being confusion about whose `#1` is whose, given that writing the code for a row predicate involves distinguishing between the immediate parameter `#1` for the style and the delayed parameter '##1' for the row number when the code is actually used.


title: Undefined control sequence \Hy@MakeCurrentHrefAuto when using tex4ht

text: I'm producing a small encyclopedia with the memoir class which relies fairly heavily on \nameref. If it's relevant, I have my project directory set up so that I have a folder called articles/ which contains a bunch of .tex files, each beginning with a \section{} and then containing the article. I then have a build script which scans through all the files in the directory, adds chapters for each initial letter, and places these and \input{} statements in a tex file in the compile/ directory (adding "top" and "bottom" files around them), which is then compiled by pdflatex. (See the input file below if that doesn't make sense.) As I say, this works perfectly for pdflatex. Now I want to produce an html version as well. latex2html, which I've used before, does not seem to support \nameref, so I went looking around and came upon tex4ht. I ran `htlatex compile.tex`, but it gets stuck when it reaches the first subsection:               /home/soren/current/maudiverse/./articles/history_abandonment.tex:4: Undefined      control sequence.     <argument> \Hy@MakeCurrentHrefAuto                                         {section*}\setlength {\Hy@SectionHShift }...     l.4 \subsection{Departure}      (I tried a couple of other commands that I found around the Web, since there seem to be a lot of different ways of calling tex4ht; they all gave the same error.) MWE:               \documentclass[twocolumn]{memoir}     \usepackage[utf8x]{inputenc}     \usepackage{hyperref}          % headers     %\copypagestyle{maudcyclo}{plain}     %\createmark{section}{both}{shownumber}{\sectionname}{}          \begin{document}          % the dot in the middle of some paths is a funky consequence of how the build     % script combines paths; it does the same thing with it removed     \chapter{C}     \input{articles/communications.tex}     % ...and so on         \end{document}      When I uncomment the headers lines (which I use in the document), a somewhat different error occurs on the first section:               ./compile.tex:11: Undefined control sequence.     <argument> \sectionname                              \@nameuse {thesection}     l.11 \section{Section}      At some earlier point, though, before I had pruned it down to this little code, it was giving the same error as the subsection. It looks like there's some problem with hyperref -- any idea what's making it unhappy? (Hopefully the solution would continue working with pdflatex as well.) If useful, here's the full output before the error message I showed earlier (if other log files would be useful, let me know).               soren@Emily:~/current/maudiverse/compile$ htlatex compile.tex     This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)      restricted \write18 enabled.     entering extended mode     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo     aded.     (./compile.tex (/usr/share/texlive/texmf-dist/tex/latex/memoir/memoir.cls     Document Class: memoir 2011/03/06 v3.6j configurable book, report, article docu     ment class     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)     (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)     (/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty)     (/usr/share/texlive/texmf-dist/tex/latex/memoir/mem10.clo)     (/usr/share/texlive/texmf-dist/tex/latex/memoir/mempatch.sty))     (/usr/share/texmf/tex/generic/tex4ht/tex4ht.sty)     (/usr/share/texmf/tex/generic/tex4ht/usepackage.4ht)     (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty     (/usr/share/texlive/texmf-dist/tex/latex/ucs/utf8x.def))     (/usr/share/texlive/texmf-dist/tex/latex/ucs/ucs.sty     (/usr/share/texlive/texmf-dist/tex/latex/ucs/data/uni-global.def))     (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))     (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)     (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty)     (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def)     (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg)     (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)          Package hyperref Message: Stopped early.          ) (/usr/share/texlive/texmf-dist/tex/latex/memoir/memhfixc.sty)          Package hyperref Message: Driver: htex4ht.          (/usr/share/texlive/texmf-dist/tex/latex/hyperref/htex4ht.def)     (/usr/share/texmf/tex/generic/tex4ht/tex4ht.4ht     ::::::::::::::::::::::::::::::::::::::::::      TeX4ht info is available in the log file      ::::::::::::::::::::::::::::::::::::::::::     ) (/usr/share/texmf/tex/generic/tex4ht/tex4ht.sty     (/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty     (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg)     (/usr/share/texlive/texmf-dist/tex/latex/graphics/dvips.def)     (/usr/share/texlive/texmf-dist/tex/latex/graphics/dvipsnam.def))     --- needs --- tex4ht compile ---     (./compile.tmp) (./compile.xref) (/usr/share/texmf/tex/generic/tex4ht/html4.4ht     ) (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht)     (/usr/share/texmf/tex/generic/tex4ht/latex.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/fontmath.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/memoir.4ht     (/usr/share/texmf/tex/generic/tex4ht/book.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/verse.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/mempatch.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/inputenc.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/utf8x.4ht)     (/usr/share/texmf/tex/generic/tex4ht/ucs.4ht)     (/usr/share/texmf/tex/generic/tex4ht/hyperref.4ht     (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))     Redoing nameref's sectioning     Redoing nameref's label     (/usr/share/texmf/tex/generic/tex4ht/nameref.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/pd1enc.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/url.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/color.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/dvips.4ht     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/dvipsnam.4ht     (/usr/share/texlive/texmf-dist/tex/latex/graphics/dvipsnam.def)     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht))     (/usr/share/texmf/tex/generic/tex4ht/html4.4ht)     (/usr/share/texmf/tex/generic/tex4ht/html4-math.4ht)) (./compile.aux)     (/usr/share/texlive/texmf-dist/tex/latex/ucs/ucsencs.def)     (/usr/share/texmf/tex/generic/tex4ht/utf8x.4ht) [1]     l.68 --- TeX4ht warning --- \halign translated into linear text ---     [2] [3] (./compile.4ct) [4]     (/home/soren/current/maudiverse/articles/communications.tex     /home/soren/current/maudiverse/articles/communications.tex:1: Undefined control      sequence.     <argument> \Hy@MakeCurrentHrefAuto                                         {section*}\setlength {\Hy@SectionHShift }...     l.1 \section{Communications}          ?


title: Folding braces in Emacs/AucTeX

text: I have some code looking like this:               142  \newcommand*\john[2]{     143    blah blah blah blah     144    blah blah     145    blah blah blah     146    blah     147  }     148     149  \newcommand*\peter[3]{     150    blah blah     151  }      It would be great if I could double-click (or ctrl-click, or whatever) on the `{` on line 142, or the `}` on line 147, to make the definition of `\john` "fold up", like so:               142  \newcommand*\john[2]{ ... }     148     149  \newcommand*\peter[3]{     150    blah blah     151  }      Does (or could) this feature exist? It would be rather handy when working with large files.


title: \LaTeX logo too compressed with microtype and defined \SetExtraKerning

text: I have, perhaps, a slightly odd problem. I have used `microtype` to define some special spacing rules. This is the relevant bit of the preamble (and I will have hopefully not forgotten anything --- if I have, please forgive).               \documentclass[12pt]{article}          \usepackage[a4paper,headheight=72pt,bottom=3cm,right=2.5cm,left=3cm]{geometry}     \usepackage[onehalfspacing]{setspace}          \usepackage[T1]{fontenc}     \usepackage{charter}     \usepackage[expert]{mathdesign}     \usepackage[british]{babel}     \usepackage{amssymb,amsmath,array,color,epigraph,floatflt,graphicx,marvosym,multirow,subcaption,siunitx,tabu,titlesec,tocbibind,tocloft}     \usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}     \usepackage{fancyhdr}          \microtypecontext{spacing=nonfrench}     \DeclareMathVersion{mathchartertext}     \SetSymbolFont{letters}{mathchartertext}{OML}{mdbch}{m}{n}          \SetExtraKerning[unit=space]     {encoding={*}, family={bch}, series={*}, size={footnotesize,small,normalsize}}     {\textendash={400,400}, % en-dash, add more space around it      "28={ ,150}, % left bracket, add space from right      "29={150, }, % right bracket, add space from left      \textquotedblleft={ ,150}, % left quotation mark, space from right      \textquotedblright={150, }      } % right quotation mark, space from left          \SetExtraKerning[unit=space]     {encoding={*}, family={qhv}, series={b}, size={large,Large}}     {1={-200,-200}, \textendash={400,400}}          \SetTracking{encoding={*}, shape=sc}{40}     \begin{document}     This is a bad \LaTeX     \end{document}      Now, everything looks fine -- that is, everything except the LaTeX command itself (which was a pain to reference in the keywords section here by the way -- I thought of a not-very-good workaround, but what would have been the proper way?). This is how it looks: ![Example of how it looks](http://i.stack.imgur.com/aZlod.png) As you can see, the entire bit in that command is far too compressed than what it should be. I figure that \SetExtraKerning can do the job, but I am not entirely certain what's the responsible way of going about it since I need to enter the space in the command/between the characters in the command. Can anyone help me with this, please? Regards


title: How to mimic LINQ's query method for macro's key-value?

text: Inspired by LINQ's query method, such as               deck.Take(randomCount)         .Where (card => card.Suit == "Hearts")         .Skip(2)         .Take(5)         .OrderBy (card => card.FaceValue);      The `deck` which is an object of a class that inherits `IEnumerable` will have the LINQ's query methods. I want to apply this to LaTeX macros, for example, `\includegraphics` as follows.               \documentclass[preview,border=12pt]{standalone}     \usepackage{graphicx}     \begin{document}     \includegraphics[viewport={10cm 10cm 10cm 10cm},clip,width=3cm]{example-image-a}     \includegraphics         .viewport{10cm 10cm 10cm 10cm}         .clip{}         .width{3cm}         .file{example-image-a}     \end{document}      ## Questions   1. How to create a macro that behaves as follows?              \includegraphics         .viewport{10cm 10cm 10cm 10cm}         .clip{}         .width{3cm}         .file{example-image-a}      Remember that we can omit some of the keys if not needed. For example,              \includegraphics         .width{3cm}         .file{example-image-a}      can be invoked. And the order is not important, for example,              \includegraphics         .file{example-image-a}         .width{3cm}      can be invoked as well. But at least one is mandatory, in this case, `file`.   2. What is the disadvantage of implementing this style of coding?


title: Range of a piano: keyboard vs staves

text: This is a kind of follow-up to this question. I'd like to reproduce with tikz the following image. ![piano scale](http://i.stack.imgur.com/tfycb.png) I have no idea of how I could "synchronize" the output of `musictex` and `tikz`. Maybe I'd better stick with `tikz` but then I don't know how to draw realistic notes, staves and keys (borrowing them from `musictex`)? Here is what I've done so far in tikz. ![tikz piano](http://i.stack.imgur.com/1NN4r.png)               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{positioning}     \begin{document}     \begin{tikzpicture}       \tikzset{%         White/.style = {%           node distance = 0cm and 0cm,           draw,           minimum width = .25cm,           minimum height = 1.25cm,           inner sep = 0pt},         Black/.style = {%           fill = black,           minimum width = .15cm,           minimum height = .75cm,           inner sep = 0pt,           anchor = north},       }            \node[White] (White--1-6) {};            \node[font = \tiny,above] at (White--1-6.north)       {$\mathrm{A}_{-1}$};             \node[font = \tiny,below] at (White--1-6.south)       {1};            \pgfmathsetmacro\frequency{round(440 * 2^(((1)-49)/12))}       \node[font = \tiny,above,rotate = 90,transform shape,anchor = west] at       (White--1-6.south) {\frequency};                 \node[White,right = of White--1-6] (White--1-7) {};            \node[font = \tiny,above] at (White--1-7.north)       {$\mathrm{B}_{-1}$};             \node[font = \tiny,below] at (White--1-7.south)       {3};            \pgfmathsetmacro\frequency{round(440 * 2^(((3)-49)/12))}       \node[font = \tiny,above,rotate = 90,transform shape,anchor = west] at       (White--1-7.south) {\frequency};                 \def\noteindex{4}%            \foreach \octave [remember = \octave as \lastoctave (initially -1)]                         in {0,...,6}{%         \foreach \White/\note [remember = \White as \lastWhite (initially 7)]                        in {1/C,2/D,3/E,4/F,5/G,6/A,7/B} {%           \ifnum\White=1\relax             \node[%                   White,                   right = of White-\lastoctave-\lastWhite]                   (White-\octave-\White) {};           \else             \node[%                   White,                   right = of White-\octave-\lastWhite]                   (White-\octave-\White) {};           \fi           \node[font = \tiny,above] at (White-\octave-\White.north)           {$\mathrm{\note}_{\octave}$};                 \node[font = \tiny,below] at (White-\octave-\White.south)           {\noteindex};                \pgfmathsetmacro\frequency{round(440 * 2^(((\noteindex)-49)/12))}           \node[font = \tiny,above,rotate = 90,transform shape,anchor = west] at           (White-\octave-\White.south) {\frequency};                \ifcase\White\relax           \or% next is D             \xdef\noteindex{\number\numexpr\noteindex+2\relax}%           \or% next is E             \xdef\noteindex{\number\numexpr\noteindex+2\relax}%           \or% next is F             \xdef\noteindex{\number\numexpr\noteindex+1\relax}%           \or% next is G             \xdef\noteindex{\number\numexpr\noteindex+2\relax}%           \or% next is A             \xdef\noteindex{\number\numexpr\noteindex+2\relax}%           \or% next is B             \xdef\noteindex{\number\numexpr\noteindex+2\relax}%           \or% next is C             \xdef\noteindex{\number\numexpr\noteindex+1\relax}%           \fi              }       }            \node[White,right = of White-6-7] (White-7-1) {};            \node[font = \tiny,above] at (White-7-1.north)       {$\mathrm{C}_{7}$};             \node[font = \tiny,below] at (White-7-1.south)       {\noteindex};            \pgfmathsetmacro\frequency{round(440 * 2^(((\noteindex)-49)/12))}       \node[font = \tiny,above,rotate = 90,transform shape,anchor = west] at       (White-7-1.south) {\frequency};                 \begin{scope}[every node/.style = {%                       Black,                     }]       \node at (White--1-6.north east) {};            \foreach \octave in {0,...,6}{%         \foreach \White in {1,2,4,5,6} {%           \node at (White-\octave-\White.north east) {};           }         }       \end{scope}     \end{tikzpicture}     \end{document}


title: Citations as nouns in biblatex-Chicago

text: I'm trying to get started with biblatex-chicago, and have got stuck on how to refer to citations as nouns in the footnote style (that is, I want to say 'as \citeasnoun{lamport} says...'). [I _think_ the short version of this question is: "why doesn't my `\smartcite` expand to `\parencite` in a footnote?"] If I start off as the biblatex-chicago manual suggests               \usepackage[authordate,strict,backend=biber,babel=other]{biblatex-chicago}      then everything's fine: I can use `\textcite{foo}` as a noun, and `\autocite{foo}` parenthetically. If, however, I start off with the manual's suggested alternative               \usepackage[notes,strict,backend=biber,babel=other]{biblatex-chicago}      then I don't have `\textcite` (that's slightly surprising, since the biblatex manual says that '[`\textcite`] commands are provided by all non-verbose styles which ship with this package,' and I would have guessed that the 'notes' style was a 'non-verbose' style). That's OK, since I can apparently fake it with `\def\textcite#1{\citeauthor{#1}\autocite{#1}}`. That almost works: in the text I get 'as Lamport^1 says ...', and a reasonable footnote with the full reference. If, however, I try this within a footnote, I get 'as LamportLeslie Lamport ... says ...' -- that is, the `\autocite` appears to act like plain `\cite` in a footnote, whereas I would have expected something more like 'as Lamport (Leslie Lamport ...) says ...'. Things I've tried:   * I can specify `autocite=footnote` and `autocite=inline` in the `\usepackage` command, but that changes it in both contexts -- the body text and the footnotes.   * I could potentially look in the `biblatex.sty` for clues, and hack up something which is somehow sensitive to its context so that `\autocite` acts like `\parencite` in a footnote, but (a) that style is ... quite clever in places, and (b) I'm doing this on behalf of someone else, so a partial goal is to say 'look, LaTeX can do this more easily than doing it by hand' -- an argument which 'use the source, Luke' would rather undermine. And anyway (c) I thought this was supposed to happen automatically.   * `\DeclareAutoCiteCommand` looks like it could help, but doesn't have the footnote/bodytext alternative I'd have expected.   * Replacing `\autocite` with `\smartcite` effects no change, even though `\smartcite` is '[l]ike \parencite in a footnote and like \footcite in the body,' according to the biblatex manual (`\parencite` by itself does produce a citation in parentheses). I've been through the manual enough times now that I believe I'm missing something obvious, or else I'm asking the wrong question.   * Perhaps the answer is to use `\parencite` explicitly in footnotes. Perhaps, but I rather got the impression that that was what `\autocite` was supposed to take care of.   * Perhaps the answer is that I shouldn't want to do this. I'm not in the Humanities, so perhaps Everyone Knows (except me) that one simply doesn't refer to references like this, in footnotes. Example:               \documentclass{scrartcl}          \iftrue       \usepackage[notes,strict,backend=biber,babel=other]{biblatex-chicago}       \def\textcite#1{\citeauthor{#1}\smartcite{#1}}     \else       \usepackage[authordate,strict,backend=biber,babel=other]{biblatex-chicago}     \fi     \addbibresource{bib.bib}          \title{Document}     \author{Me}          \begin{document}     \maketitle          The primary aim of this essay is to refer to \textcite{wittgenstein53}     in the text.\footnote{And refer to \textcite{wittgenstein53} in a footnote}          \printbibliography     \end{document}      I get "Wittgenstein^1" in the first case, and "Wittgensteinibid." in the footnote. I'm using biblatex version 1.7, biber version 0.9.9 (and up-to-date versions of pdftex and xetex).


title: Collapse range in x-axis with pgfplots? (break x-axis)

text: I want to plot data from a table file. The data has quite big gaps in the x-axis, making the actual data barely readable. Is it possible to tell pgfplots to kind of collapse the x-axis in a given range? I added an image of the current plot with the sometimes huge gaps. ![data plotted with huge gaps in the x-axis](http://i.stack.imgur.com/PkzNw.png) \documentclass[border=5mm]{standalone}               \usepackage{pgfplotstable}     \begin{document}         \begin{tikzpicture}             \begin{axis}[                 xlabel={x--Axis},                 ylabel={y--Axis},                 tick label style={/pgf/number format/fixed}]                 \addplot[black,only marks,mark=+]                    table[x index=0,y index=1]{data.dat};             \end{axis}          \end{tikzpicture}     \end{document}


title: How can I find out what pages my floats are on (without looking at every page of the document)?

text: > **This question led to a new package:**   >  `chkfloat` Making small tweaks to my (two-column) document can result in my floats (both single and double columns) moving all over the place. I know that my document is more likely to look good if float `F` is on page `P` say, than if it is on page `P+1`. However, I have a long document and it is tiresome to check every page after each build to see if my floats have moved. Therefore, I would like LaTeX to raise an error (or at least alert me in some way) if float `F(n)` is not on page `P(n)` where `F(n)` and `P(n)` are specified for some subset of my floats (I'd be happy with an answer that can deal with tracking one float to begin with though!). However, it is not possible to put checking code inside the floats themselves, because this code is executed when the floats are "read" rather than when they are "placed". Even if I can tweak the float parameters so that the floats appear in locations I prefer, this would still be a useful automated test, so the focus of my question is not intended to be about float parameters, unless there are some magic parameters that force LaTeX to put the floats in approximate places that I specify (that is, floating places! --- not just 'here', which I assume is not possible for two column floats anyway). Clearly, LaTeX does keep track of which floats appear on which page, as the `\listoffigures` can show this information. But I am not sure what's the best way of accessing that information myself to do the testing; is there a hook that gets called when a float is placed? Preferably the test would work in one run (note that the list of figures takes two runs to update), but this is not essential. I've included a single-column MWE with a single float to play with. Changing the `\lipsum` range changes where the float gets placed. (If the double column nature makes a big difference, I can try to supply a modified MWE.)               \documentclass{article}     \usepackage[a4paper]{geometry}%don't trust MikTeX's defaults!     \usepackage{lipsum}     \begin{document}         % choose which of the following two lines to use to configure where the float appears.         \lipsum[1-5]% figure appears on page 2 if this line is used         %\lipsum[1-4]% figure appears on page 1 if this line is used         \begin{figure}             \centering             Hello world. I was typeset on page \thepage, but that may not be where I appear!                  \rule{4cm}{4cm}                  \caption{fig}         \end{figure}         ***Figure appeared in the text just above here.***              \lipsum[5-8]         \listoffigures     \end{document}


title: What is the cleanest way to adjust the dimensions (height, depth, width to the left and right) of a symbol?

text: Every once in a while the nominal (i.e. declared) dimensions of a symbol are not identical to the actual ones. This can be intentional or not, but sometimes it is inconvenient. * * * The dimensions of the double dagger (`\ddag`) from the `cm` fonts seem to be slightly inaccurate. Using `\kern` one can adjust the horizontal dimensions. The vertical dimensions can be changed with Steven B. Segletes' useful `verbatimbox` package: ![adjusting the double dagger from the cm fonts](http://i.stack.imgur.com/b12eQ.png) ( _Disclaimer:_ Note that the horizontal extensions are intentional and less likely to cause any problems. Barbara Beeton pointed out that "the Metafont definition, which clearly includes the generous sidebearings, appears on pp. 536-537 of the book _Computer Modern Typefaces_ , volume E of Knuth's _Computers & Typesetting_ series". Nonetheless, my adjustment shall serve illustrative purposes. A better case for adjustments of the side spacing might be the slash `/` from `txfonts`; see below.) * * * ( _Disclaimer:_ `txfonts` is superseded by `newtx`, i.e. `newtxtext` and `newtxmath`. When I compile with it instead, the same glyphic problems appear. So I will let my question stand the way it is now. To what extent the metrics from the `newtx` packages are still in need of improvement I don't know.) Looking at some symbols from `txfonts`, the symbol `\ncong` seems to have correct dimensions (I assume here that the horizontal spacing on both sides is fine and beneficial): ![\\ncong from txfonts is fine](http://i.stack.imgur.com/pWG9o.png) * * * But some other symbols from there seem to be slightly miscalibrated: ![some symbols from txfonts which could benefit from adjustment](http://i.stack.imgur.com/ZBvNC.png) Here, `\dag`, `\ddag`, `\Vert`, `\#`, and `\equiv` can benefit from vertical adjustment at the top (the declared height of `\equiv` is a tiny bit too small, though this is hard to see from the picture here). This is somewhat true for symbol `/` too, but horizontal adjustment is more needed for it to create equal spacing on both sides. (The slash from the `cm` fonts doesn't have such asymmetric horizontal spacing.) * * * Here is the code used for generating the above examples:               \documentclass{article}     \usepackage{txfonts} % comment out for "cm" font symbols     \usepackage{verbatimbox}          \newcommand*{\ddagMod}{\kern-0.060em\addvbuffer[0.025ex 0.025ex]{\ddag}\kern-0.062em}               \begin{document}          {     \Huge     \fboxsep=0pt\fboxrule=.02pt     % \fbox-trick taken from Steven B. Segletes' answers here:       % http://tex.stackexchange.com/a/121946/14996       % http://tex.stackexchange.com/a/123108/14996               % cm fonts ("\usepackage{txfonts}" commented out):     \fbox{\ddag}     \fbox{\ddagMod}               % with "\usepackage{txfonts}":     \fbox{\(\ncong\)}       \par     \fbox{\dag}     \fbox{\ddag}     \fbox{\(\Vert\)}     \fbox{\#}     \fbox{\(\equiv\)}       \par     \fbox{/}     }          \end{document}      * * * **How can one adjust a symbol's vertical and horizontal dimensions in the cleanest way? Let's assume we have a symbol`\symb` and would like to adjust it in a way that is likely to work at different font sizes and in the different math mode styles.** My `\ddagMod` does what I want for `\ddag` in text mode, but a robust, general approach is needed.


title: Automatic beamer presentation with one slide generated for each image in a directory?

text: I would like a simple script to "scrape" every image in a directory into a single beamer presentation as follows:               $ ls           %img1.jpg          %img2.jpg          %img3.jpg               $ *run script*      %OUTPUT SOMETHING LIKE THIS:               \documentclass{beamer}          % for themes, etc.     \mode<presentation>     { \usetheme{boxes} }          \usepackage{times}  % fonts are up to you     \usepackage{graphicx}          \section{Images in this Directory}          \begin{frame}     \frametitle{img1.jpg}     \begin{center}             \includegraphics[width=4in]{img1.jpg}     \end{center}     \end{frame}          \begin{frame}     \frametitle{img2.jpg}     \begin{center}             \includegraphics[width=4in]{img2.jpg}     \end{center}     \end{frame}               \begin{frame}     \frametitle{img3.jpg}     \begin{center}             \includegraphics[width=4in]{img3.jpg}     \end{center}     \end{frame}          \end{document}


title: Side by side tables as one figure

text: \begin{figure}     \begin{minipage}{0.5\textwidth}     \centering     \caption{***}     $\begin{array}{cccccccc}     T_1: & c_{12} &          & c_{23} &          & c_{34} &          & c_{45}\\     T_2: &        & c_{13|2} &        & c_{24|3} &        & c_{35|2} & \\\hline     T_3: &        &          &\pi_{14|23}&        &\pi_{25|34}&         &  \\     T_4: &         &        &         &\pi_{15|234}&        &        & \\     \end{array}$     \end{minipage}     \begin{minipage}{0.5\textwidth}     \caption{***}     $\begin{array}{cccccccc}     T_1: & c_{12} &          & c_{23} &          & c_{34} &          & c_{45}\\     T_2: &        & c_{13|2} &        & c_{24|3} &        & c_{35|2} & \\     T_3: &        &          &c_{14|23}&        &c_{25|34}&         &  \\\hline     T_4: &         &        &         &\pi_{15|234}&        &        & \\     \end{array}$     \end{minipage}     \end{figure}      This is my code, what's the problem? (1) I want to have 1 figure (number). So I need a way to place those minipage in 1 environment (table doens't work). (2) The 2 arrays are a bit to wide. Can I change the distance between the columns?


title: Bibliography style (vancouver)

text: I'm quite new with LaTeX, but am trying to write my master's thesis with it. I'm running into a problem with the bibliography style. This is what the school asks for the reference style (with the abbreviation of journal names): > Gibson J.P. (1989) Selection strategies and artificial evolution. Theor. > Appl. Genet. 78,87-92. And in the text, the citation has to be "author, year" form. I think that it's Vancouver style without numeration. I used the `natbib` package. However, when I downloaded the Vancouver `.bst` file from CTAN after compiling, I cannot get the abbreviation of the Journal name. The `.bst` file I downloaded from Elsevier doesn't work either. Does anybody have any ideas about how I can abbreviate journal names?


title: Error compiling modiagram

text: **EDIT:** This question has been identified as a bug * * * Consider the following MWE as `t.tex` from the `modiagram` manual:               \documentclass[border=3mm]{standalone}     \usepackage{modiagram}     \begin{document}     \begin{MOdiagram}         \atom{left}{ 1s = {0;up} }         \atom{right}{ 1s = {0;up} }         \molecule{ 1sMO = {.75;pair} }     \end{MOdiagram}     \end{document}      I am trying to compile using `pdflatex` with the call               $ pdflatex t.tex      But compilation fails with the following error:               ! Undefined control sequence.     <argument> ...:Nn \l_tmpa_tl { }\prg_case_str:onn                                                        {\l_tmpa_tl }{{up}{\MOdiag...     l.7     \atom{left}{ 1s = {0;up} }          ?      I don't understand this error message (looks like LaTeX 3). I have installed `modiagram` version `0.2b`.


title: Why are manual offsets needed in the ticket package?

text: When I use the `ticket` package, the boxes it prints are significantly shifted towards (and past) the right and bottom margins. It seems that the package author itself had the same problem. He introduced the parameters `\hoffset` and `\voffset` and in his examples sets them to negative values. Is there a good reason to have to set this offsets manually, or is the package simply badly written? Why can't it align its output with the left and top margins of the page? (I suspect it has something to do with the fact that `ticket` uses `picture` under the hood, but I'd like to know more details.)


title: Errors and alignment of subfigures

text: I want to put two pictures side by side in a two-column conference paper. The LaTeX code is as follows:               \documentclass[conference]{IEEEtran}     % Add the compsoc option for Computer Society conferences.     % *** GRAPHICS RELATED PACKAGES ***     %     \ifCLASSINFOpdf        \usepackage[pdftex]{graphicx}       % declare the path(s) where your graphic files are       % \graphicspath{{../pdf/}{../jpeg/}}       % and their extensions so you won't have to specify these with       % every instance of \includegraphics        \DeclareGraphicsExtensions{.pdf,.jpeg,.png,.eps}     \else       % or other class option (dvipsone, dvipdf, if not using dvips). graphicx       % will default to the driver specified in the system graphics.cfg if no       % driver is specified.        \usepackage[dvips]{graphicx}       % declare the path(s) where your graphic files are       % \graphicspath{{../eps/}}       % and their extensions so you won't have to specify these with       % every instance of \includegraphics        \DeclareGraphicsExtensions{.eps}     \fi          % correct bad hyphenation here     \hyphenation{op-tical net-works semi-conduc-tor}     \usepackage{lscape}     \usepackage{subfigure}          \begin{document}     %     % paper title     % can use linebreaks \\ within to get better formatting as desired     \title{0000}          \author{\IEEEauthorblockN{00000}}          % make the title area     \maketitle               \begin{abstract}     \end{abstract}          \IEEEpeerreviewmaketitle          \section{0000}          \begin{figure}     \centering     \begin{subfig}{.5\textwidth}       \centering       \includegraphics[width=.4\linewidth]{pic/interest.png}       \label{packet:interest}     \end{subfig}     \begin{subfig}{.5\textwidth}       \centering       \includegraphics[width=.4\linewidth]{pic/data.png}       \label{packet:data}     \end{subfig}     \caption{CPI packet structure}     \label{packet}     \end{figure}          \begin{thebibliography}{1}          \end{thebibliography}          \end{document}      I used a `.cls`file `IEEEtran.cls`:               www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/IEEEtran.cls      I got the following errors:               There's no line here to end.     Missing number, treated as zero      and the result is like this: ![enter image description here](http://i.stack.imgur.com/CaBns.png) there are two unexpected `.5` besides the subfigures and these 2 subfigures are aligned on the bottom, but I hope to align them on the top. How to modify the code?


title: Problem setting margins in memoir

text: I'm trying to setup the layout of my thesis and margins seems to be a little off what I'm expecting, I'm using `memoir` and I'm trying to setup all the variables of page layout so nothing wont go wrong... The specs are simple: 2.54cm margin all around the page except for the printing side which should be 3.54cm. the page is A4 29.7x21cm.... here is my code:               \pagestyle{plain}     \setlength{\trimtop}{0cm}     \setlength{\trimedge}{0cm}     \setlength{\oddsidemargin}{1cm}     \setlength{\evensidemargin}{0.0cm}     \setlength{\parindent}{18pt}     \setlength{\parskip}{6pt}     \setlength{\uppermargin}{2.54cm}     \setlength{\headheight}{0cm}     \setlength{\headsep}{0cm}     \setlength{\footskip}{0.80cm}     \setlength{\spinemargin}{2.54cm}     \setlength{\marginparwidth}{0cm}     \setlength{\marginsep}{0cm}     \setlength{\paperheight}{29.7cm}     \setlength{\paperwidth}{21.0cm}     \setlength{\stockheight}{\paperheight}     \setlength{\stockwidth}{\paperwidth}     \setlength{\textheight}{24.6cm}     \setlength{\textwidth}{14.9cm}      the problem with the above code is that the top margin is always stuck at 3.54cm leaving only 1.54cm to the bottom margin no matter how I change it, even if I change the `\trimtop` to -1cm! When I add the following line to the code, it fixes the top/bottom margins but the left/right margin in odd pages only is messed-up and stuck at 4.54cm / 1.54cm to left/righ margins respectively...               \checkandfixthelayout      Any advice?


title: Floating Point multiplication in custom commands

text: I'd like to create a custom command which creates an underscore of a given length. However, this length should be the argument of the command multiplied be a floating point constant. How can I multiply the argument of a command within the command's definition? The code without the multiplication looks like this:               \newcommand{\utext}[2]{$\underset{\mbox{\tiny #1}}{\underline{\hspace{#2cm}}}$}      Instead of the `\hspace` of `#2cm` it should be something like `(0.75 * #2)cm`


title: How to move one y label to the right

text: As you see the image below, the label "4" on y-axis gets in the way with the plot. How do I move it to the right? I tried adding the following statement:               psyTick[ylabelPos=right](4){4}      But doesn't work. ![enter image description here](http://i.stack.imgur.com/OPWig.png) Here is the whole code:               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pst-plot}          \begin{document}          \psset{xunit=2,            yunit=0.5,            linewidth=0.03,            tickwidth=0.03}          \begin{pspicture}(-1.775,-2)(1.775,6.8)     \psaxes[Dx=1,labels=x,xticksize=-4pt,Dy=2]{->}(0,0)(-1.77,0)(1.7,6.4)[$t$,0][$$,90]     \psyTick[ylabelPos=left](2){2}     \psyTick[ylabelPos=right](4){4}     \psline[linecolor=blue,linewidth=0.05](-1.7,0)(-1,0)(-1,4)(0,4)(0,2)(1,2)(1,0)(1.6,0)     \rput(-0.6,4.5){$x_1(-2(t-1))$}     \end{pspicture}          \end{document}


title: How to add dictionary in texstudio?

text: I am newbie to both latex and Ubuntu-linux 14.04. I already installed texlive and texstudio for latex environment. Everything works fine. When I am trying to use spell check option it is giving error as "no dictionary available ". So always my document is having spelling mistakes. Please help me with this. What packages have to install to get English dictionary. With spell check automatically.


title: How to shift graphics/adjust placement of figure with \includegraphics

text: I composed a diagram that takes up the entire sheet of paper in _landscape_ mode, called diagram.tex (compiled it to generate pdf). I'm trying to include that into an article, but only half of it is showing; the bottom half is cut off by the right end of the paper. I was able to get it in the proper orientation by using `\includegraphics[angle=90]{diagram.pdf}` But because the bottom half of it is cut off, I need some sort of option where I can do something like this: `\includegraphics[angle=90, shift left = 5cm]{diagram.pdf}` to pull the rest of the image left (or up, depending on how you're looking at it). > So how can I move the figure around? I'm not sure if this is relevant, but I'm using the following `documentclass` and packages in my paper:               \documentclass[11pt,a4paper,twoside]{article}     \usepackage{tikz, graphicx}      * * * **Edit:** This is not an issue with pushing it past the margins. Half of the picture is not on the paper (sort of like if you stuck half of your left hand behind the left side of your monitor). I need to pull the paper left (just like you would shift your hand left to see it).


title: How do you modify LaTeX's sectioning hierarchy?

text: I am trying to create a new command, so I could use a new hierarchy level in a book document class. The table of Contents should look like this: > # Part I > > ## Theme I > > ### 1\. Chapter 1 > > ### 2\. Chapter 2 > > 2.1 Section 1 > > 2.1.1 Subsection > > ## Theme II > > ### 1\. Chapter 1### and so on. I guess I have to use `\newcommand`, but I don't know how to modify the hierarchy number to include "Theme" between "Part" and "Chapter". If you know a document class with a more complete hierachy than books and implementing a similar hierarchy, it will solve my problem as well.


title: Automatic three digit numbers in subsections

text: I'm a newbie in LaTeX, please forgive me if this is too stupid. I have some code like this:               \documentclass{article}     \newcounter{qnumber}     \newcommand{\autossection}{\stepcounter{qnumber}\subsection{\theqnumber}}          \begin{document}          \section{A}     \autossection     test     \autossection     test     \autossection     test     \autossection     test          \end{document}      Used to automatically print a progressive number as subsection name. What I want is the subsection number to be formatted like 001, 002, ... 010, 011, ... 100, 101, etc. Now I only have 1, 2, ... 10, 11, ... 100, 101, etc. Is this possible?


title: List of all control sequences let to primitives in common formats

text: I would like to know a list of all control sequences which are let equal to primitives in common formats. For plain TeX for instance, we would get the list               \endgraf % = \par     \endline % = \cr     \repeat  % = \fi     \bgroup  % = { so not quite a primitive     \egroup  % = }     \sp      % = ^     \sb      % = _     ^^M      % (active character) = \par in \obeylines              % (active space) = space in \obeyspaces     % (the \if... defined by \newif) = \iftrue or \iffalse     % (various control sequences) = \relax      while for other formats we would get longer lists (such as `\@@par` being `\par` in LaTeX2e, or `\normalunexpanded` being `\unexpanded` in ConTeXt). I am more particularly interested in control sequences (and active characters) let equal to primitives which perform assignments (`\def`, `\edef`, `\gdef`, `\xdef`, `\let`, `\futurelet`, `\chardef`, `\mathchardef`, `\countdef`, `\dimendef`, `\skipdef`, `\muskipdef`, `\toksdef`, `\read`, `\readline`, `\font`), prefixes (`\protected`, `\long`, `\outer`, `\global`), and `\afterassignment`. I can further restrict myself to control sequences (and active characters) which are equal to one of the primitives in this list when TeX starts up with these formats preloaded. Here is why I care: I just wrote some code which redefines the primitives listed above in order to track down assignments. This lets me list all commands defined in a document, and I have ideas on how to extract from that a list of all commands actually used in the document. However, a requirement is that I should hook into all commands which assign a new meaning to a token, that is, all control sequences and active characters let to one of the primitives in the list above. If I miss an alias for one of those primitives, all tokens defined using it will be missed.


title: Sans serif math with corrected spacing

text: With the `sfmath` package I find that there is too little space between some symbols. In an expression like `$n_1$` for instance the subscript is too close to the base. Although the space between the symbols seems to be the same as with the computer modern font the space will look larger with the latter font because of the serif of the n which pushes the subscript a little to the right. Does anyone know if there is a space corrected version of sans serif math?


title: Citation with DOI that has underscore breaks functionality in BibDesk

text: One functionality of BibDesk that is nice is the ability to click on a link at the end of the `Doi` entry field, which will open up the link `http://dx.doi.org/DOI-HERE` in a browser. ![enter image description here](http://i.stack.imgur.com/QZ3SQ.png) One problem I've just run into with bibliography styles that display DOIs in the References section (e.g., `unified`) is that a `Doi` entry that contains an underscore will be printed as a subscript in the References section. For example, this code:               \documentclass{article}          \usepackage{natbib}          \begin{document}          \citet{chomsky1977b}     \citet{chomsky1977b-test}          \bibliographystyle{unified}     \bibliography{master}          \end{document}      produces this output ![enter image description here](http://i.stack.imgur.com/WfGKP.png) where `chomsky1977b` is               @article{chomsky1977b,         Author = {Chomsky, Noam and Lasnik, Howard},         Doi = {10.1007/978-94-015-6859-3_4},         Journal = {Linguistic Inquiry},         Keywords = {control theory, syntax},         Number = {3},         Pages = {425-504},         Title = {Filters and Control},         Volume = {8},         Year = {1977}}      and `chomsky1997b-test` is               @article{chomsky1977b-test,         Author = {Chomsky, Noam and Lasnik, Howard},         Doi = {10.1007/978-94-015-6859-3{\_}4},         Journal = {Linguistic Inquiry},         Keywords = {control theory, syntax},         Number = {3},         Pages = {425-504},         Title = {Filters and Control},         Volume = {8},         Year = {1977}}      Of course, the `Doi` entry in `chomsky1997b-test` breaks the BibDesk functionality of opening the link in a browser, as it opens `http://dx.doi.org/10.1007/978-94-015-6859-3{\_}4` rather than `http://dx.doi.org/10.1007/978-94-015-6859-3_4`. Is there a way to retain this functionality yet still ensure that the DOI is printed correctly in the References section when using a style that prints the DOI?


title: Wrap Figure Pushes Text Around

text: I have code like               \begin{wrapfigure}{r}{0.5\textwidth}     \centering     \includegraphics[width=0.4\textwidth]{Data/Graphs/shot.JPG}     \caption{Testing Apparatus}     \label{apparatus}     \end{wrapfigure}      Then on the next pages the text is pushed to the left, for the size of the wrapfigure, even though the figure does not appear there. How can I prevent this?               \documentclass[12pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{wrapfig}     \pagestyle{empty}     \usepackage[top=1.0in, bottom=1.0in, left=1.0in, right=1.0in]{geometry}     \usepackage{indentfirst}     \author{Ashvin Nair}     \title{Camera as Distance Sensor}     \begin{document}     \begin{flushleft}     Camera as Distance Sensor\\     Ashvin Nair\\     Winchester High School\\     nair.ashvin@gmail.com     \end{flushleft}          \begin{huge}         \begin{center}             \textbf{Camera as Distance Sensor}         \end{center}     \end{huge}          \section*{Introduction}     The camera is easily Botball's most versatile and useful sensor.  Color recognition enables many of the Botball tasks to be completed.  We decided that along with knowing \textit{what} things are, knowing \textit{where} those things are is just as important.  The distance sensors provided with the kit are easily distracted, sometimes unpredictable and limited, and generally hard to trust.  With the camera, objects can generally be tracked smoothly and predictably.          Our approach to using the camera to find distance to objects is deriving a statistical model based on controlled trials.  In the past, we have used simple algorithms to close in on objects by manipulating the speeds of the wheels based on their position on the camera.  However, we wanted to know the distance to objects, mainly to  constantly map objects while the robot is moving so that the robot always has the most accurate idea of where objects are located.  Additionally, fixed objects can be used for the robot to localize itself.          \begin{wrapfigure}{r}{0.5\textwidth}     \includegraphics[width=0.4\textwidth]{Data/Graphs/shot.JPG}     \caption{Testing Apparatus}     \label{apparatus}     \end{wrapfigure}          \section*{Process}     Trials were conducted on large graph paper.  The CBC was placed on one side and the height and angle of the camera were measured.  The paper was marked into 6-inch boxes, and in each individual trial, a pompom was placed on the corner of a box.  Multiple trials were strung together in one program which performed several trials in a pattern and emptied the data into a comma-separated-values file.          With this data, specific situations were used to obtain a model.  In practice, each time the camera is adjusted on the robot (height or angle is changed), a new model may be required.  Of course, the next step in analysis is to model the camera generally, incorporating height and angle.          \pagebreak          \section*{Model}     To analyze the data, we used the statistics package R \cite{stats}.  The model above is specifically for a camera height of 20 cm and an angle of elevation of $55^{\circ}$.  The original data showed an inverse relationship so the inverse of the distance values was taken and a linear model was obtained.  To use this model, one would  first get the value of a blob's bbox\_bottom from the camera.  Say that the value was 70.  First, plug in 70 for the value of p, then evaluate the expression and take the inverse:     \begin{align*}     \frac{1}{d} &= 0.01158 + 0.0004387p \\     \frac{1}{d} &= 0.01158 + 0.0004387(70) \\     \frac{1}{d} &= 0.04229 \\     d &= 23.6     \end{align*}          \begin{figure}[t]     \begin{center}     \includegraphics[width=0.8\textwidth]{Data/Graphs/dvpx0.png}     \caption{Model For Distance}     \label{model1}     \end{center}     \end{figure}          The model was taken in a straight line in front of the camera, but later data showed that the value of pixels of bbox\_bottom varied very little when the object was moved horizontally with respect to the camera.          \section*{Dealing with Variables}     Intuitively, as the camera is raised, the model is affected linearly.          \section*{Conclusion}     Although being able to use the camera to approximate distances to objects is infinitely useful, the usefulness is limited by the camera hardware and drivers.  Still, using this process, a lot more information can be gathered by the robot.          \begin{thebibliography}{9}          \bibitem{stats}       R Development Core Team (2011). R: A language and environment for       statistical computing. R Foundation for Statistical Computing,       Vienna, Austria. ISBN 3-900051-07-0, URL http://www.R-project.org/.          \end{thebibliography}          \end{document}


title: How to make a new command similar to \author

text: I'm preparing a new template for our students' projects based on `memoir`. All this projects are supervised (directed) by one or more professors so I would like to declare a command like `\author` but called `\director`. This way the student can declare `\director{My professor}` and the template will place and format the name. I would like to be like `\author` and not just a simple `\newcommand` because it can include affiliation, several names, etc. I don't know where is `\author` declared, where should I look?


title: A critique of TeX?

text: Is there any informative critique of TeX along one or all the lines below:   * TeX, the typesetting engine (including its algorithms)   * TeX, the typesetting language   * TeX, the programming language   * TeX, the program (I'm not looking for a discussion of these features here; I'm looking for published references.)


title: Install Vim and Latex suite

text: Good Afternoon All, I am trying to install Vim and Latex suite to work on my latex project. I need help with installing this properly on Mac OS X Lion. I have already installed MacVim. To setup Vim-Latex I am using instructions provided here. According to instructions   1. I have downlaoded vim-latex-1.8.23-20120125.768-git8b62284.tar and extracted to ~/.vim directory.   2. I have created file ~/.vimrc with content from recommended settings   3. I have created file ~/.vim/ftplugin/tex.vim with content from recommended settings. **Install the help files** To install the included latex-suite.txt and latexhelp.txt files as vim help files, start vim and do the following: helptags ~/.vim/doc How do I do this step, because from terminal I get following error               Khurrams-MacBook:.vim kmajeed$ helptags ~/.vim/doc/       -bash: helptags: command not found     Khurrams-MacBook:.vim kmajeed$       **How can I make sure LATEX is setup and working fine for me?**


title: Errors when compiling PGF/TikZ generated by GeoGebra

text: I was trying to use GeoGebra to produce a Normal distribution plot and then export it to PGF/TikZ. I got the following LaTex codes. But when I pasted them in TexStudio and compiled, I got an error message `line 19: Dimension too large \end{frame}`. How should I do? Thank you! ![enter image description here](http://i.stack.imgur.com/4q0OY.png)               \documentclass[10pt]{beamer}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows}     \pagestyle{empty}     \begin{document}     \begin{frame}     \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]     \draw[->,color=black] (-4,0) -- (4,0);     \foreach \x in {-4,-3,-2,-1,1,2,3}     \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt);     \draw[->,color=black] (0,-0.01) -- (0,0.46);     \foreach \y in {,0.2,0.3,0.4}     \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt);     \clip(-4,-0.01) rectangle (4,0.46);     \onslide<2->{       \draw[smooth,samples=100,domain=-4.0:4.0] plot(\x,{2.718281828^((-((\x))^2)/(1^2*2))/(abs(1)*sqrt(3.1415926535*2))});     }     \end{tikzpicture}     \end{frame}     \end{document}


title: Reproducing a tabular form

text: I am trying to reproduce the following tabular form layout: ![Certificate.](http://i.stack.imgur.com/nM4XY.jpg) **Fig. 1:** Desired output (found on the internet). **First question:** I can merge multiple cells into a single one both horizontally and vertically (using `\multicolumn` and `\multirow`), but I do not know how to split a single cell into multiple ones. How can I do that? Minimal working example:               \documentclass[11pt, a4paper]{article}     \usepackage{lmodern}     \usepackage{array}     \usepackage{tabularx}     \begin{document}          \scriptsize     \setlength{\extrarowheight}{0.2em}     \noindent\begin{tabularx}{\textwidth}{!{\vrule width 1pt}p{4cm} | X !{\vrule width 1pt}}     \noalign{\hrule height 1pt}     Question one & Question two\\[0.5cm] \hline     Question three & Question four\\[1cm] \noalign{\hrule height 1pt}     Question five & Question six\\[0.5cm] \hline     \multicolumn{2}{!{\vrule width 1pt} l !{\vrule width 1pt}}{Question seven}\\[1cm]     \noalign{\hrule height 1pt}     \end{tabularx}          \end{document}      I am able to seamlessly connect two tables using `\vskip-0.7mm`, but it would have to be adjusted after many various changes, e.g. font size, so I prefer a single table solution. **Edit (31 July 2011):** ![Tabularx inside.](http://i.stack.imgur.com/QoCOz.png) **Fig. 2:** Another `tabular` or `tabularx` inside a cell does not give a satisfying result. ![Vertical alignment problem.](http://i.stack.imgur.com/I9Nsi.png) **Fig. 3:** Problem with vertical alignment of the `X` column of `tabularx`. The relevant part of the code:               \begin{tabularx}{\textwidth}{|p{4cm}|X|}     \hline     {\begin{tabularx}{\linewidth}{@{} l | X @{}}     Some text & Other text\\[1cm]     \end{tabularx}} & Something else\\     \hline     \end{tabularx}


title: How do I include eps files using XeLaTeX?

text: According to everything I can find on Google, eps files in `xelatex` should work out-of-the-box. But that's not what I'm seeing (using TeX Live 2010 on Arch Linux). Consider the following simple input:               \documentclass{article}         \usepackage{graphicx}          \begin{document}     Some text.          \includegraphics{flower.eps}          Some more text.     \end{document}      I put this into a `.tex` file and place it in the same directory as an EPS file called "`flower.eps`". Now, if I run `xelatex`, it outputs a pdf file, but the eps file doesn't appear (although space is reserved for it). On the other hand, latex+dvips works just fine. Edit: I should mention that `pdflatex` works if I add `\includepackage{epstopdf}`. But that doesn't help for `xelatex`. There's a related question[1], but it doesn't apply in this case because the solution was to apply the patch here[2], but it's already there in my TeX installation. Does anyone have other ideas? [1] can't \includegraphics eps files anymore with xelatex (used to work fine) [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=485071


title: Same mathematical fonts with LuaTeX and ConTeXt

text: I use LuaLaTeX to compile my documents with this in the preamble :               \documentclass[12pt,a4paper]{article}     \usepackage{etex}     \usepackage[no-math]{fontspec}     \usepackage[urw-garamond,uppercase=upright,greeklowercase=upright]{mathdesign}     \usepackage{garamondx}     \usepackage[frenchb]{babel}     \begin{document}      $f(x)=x^2+2x+4$     \end{document}      I try to do the same with ConTeXt, but the result is not quite the same, in particular the letter x :                \setuppapersize[A4]      \loadtypescriptfile[mathdesign]      \setupbodyfont[garamond]      \starttext      Some random text and \math{f(x)=x^2+2x+4}      \stoptext      The compilation gives me this :                  system          > 'cont-new.mkiv' loaded       (/home/fab/texlive/2013/texmf-dist/tex/context/base/cont-new.mkiv)       system          > files > jobname 'demo1', input './demo1', result 'demo1'       fonts           > latin modern fonts are not preloaded       languages       > language 'en' is active       (/home/fab/demo1.tex (/home/fab/texlive/2013/texmf-dist/tex/context /base/type-imp-mathdesign.mkiv)       fonts           > typescripts > unknown library 'loc'       fonts           > typescripts > unknown library 'garamond'       fonts           > preloading latin modern fonts (third stage)       {/home/fab/texlive/2013/texmf-dist/fonts/map/dvips/lm/lm-math.map}{/home  /fab/texlive/2013/texmf-dist/fonts/map/dvips/lm/lm-rm.map}{/home/fab/texlive /2013/texmf-dist/fonts/map/pdftex/context/mkiv-base.map}       fonts           > 'fallback modern rm 12pt' is loaded


title: Extra space due to \patchcmd

text: It seems that `\patchcmd` from `etoolbox` adds three unwanted spaces, as shown below:               \documentclass{minimal}     \usepackage{etoolbox}     \begin{document}     \tracingall%                            3 spaces in log file     \def\test{1}]\patchcmd\test{1}{2}{}{}[% 3 spaces between brackets in output     \end{document}      How can I fix this?


title: Making custom currency

text: I've been using Prawn (Ruby) to make signs for beer distributors. Working great except that making currency look how I want is becoming _extremely_ cumbersome and I'm afraid of inflexibility (and head pounding) later on when expanding. Enter LaTeX. Here's what I'm shooting for: ![Price example](http://i.stack.imgur.com/wDPxZ.png) Being a complete newbie with LaTeX, I thought about               \textsuperscript{\$}5\textsuperscript{99}      and maybe resize the cents and dollar symbol along with changing the baseline to lower them? What's best way to accomplish this? And for a bonus question: looking at what I'm making, would LaTeX be a good choice? Resizing different types text to fit a certain area is also a huge pain with my current setup. Thanks and sorry for all the questions!


title: TikZ edges to/from center of nodes

text: Normally a edge drawn between two nodes starts and stops and the boundary of the nodes. How can one draw an edge to the center of a node?               \documentclass[12pt]{article}     \usepackage{tikz}     \begin{document}     Current result:           \begin{tikzpicture}       \node (0)              {};       \node (1) [right of=0] {};       \node (2) [above right of=1] {};       \draw (0) -- (1);       \draw (1) -- (2);      \end{tikzpicture}          Desired result (looks like):           \begin{tikzpicture}       \draw (0,0) -- (1,0);       \draw (1,0) -- (1.5,.5);      \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/VNb1h.png) I want my TikZ code to be readable, so want I first place the nodes with relative positions and then draw the edges. I created the desired result without using the relative placement of nodes. This is not an acceptable solution.


title: Biblatex enumerating sorted bibliography (using authoryear-ibid style)

text: How can I set biblatex to insert "1. " before first bibliography item and so on? The bibliography is sorted by author and the numbers are not meant to be used anywhere else.


title: thmtools - issue with head number style

text: I'm using thmtools to define a custom example environment. I'm styling the head as italic, but the number is not being styled correctly: it appears in normal mode instead of italic (the dot after the number is being styled correctly). If I style the head as bold, then the number is styled correctly. Am I missing something or is it a bug? Minimal working example:               \documentclass[11pt,twoside]{article}          \usepackage{amsthm,thmtools}          \declaretheoremstyle[        name=Example,        spaceabove=\topsep, spacebelow=\topsep,        headindent=0pt, postheadspace=1ex,        headfont=\normalfont\itshape, headpunct=.,        bodyfont=\normalfont,        qed=$\diamond$     ]{example}     \declaretheorem[style=example]{example}          \begin{document}     \begin{example}     test     \end{example}     \end{document}


title: Show chapter name in fancyhdr when no section is available

text: The following code shows only section names in the headers.               \documentclass[12pt,a4paper,oneside]{report}     \usepackage{fancyhdr}     \usepackage{lipsum}     \pagestyle{fancy}     \fancyhf{}     \fancyhead[R]{\rightmark}          \begin{document}          \chapter{Uno}     \section{Ducks}     \lipsum          \chapter{Dos}     \lipsum          \chapter{Tres}     \section{Frogs}     \lipsum          \end{document}      However some of my short chapters (like Chapter 2 in the example) don't have sections in them. In this case, the header on the page is empty. If there is no section, I would like the chapter name to appear at the same place. How could I achieve this? Please note that I don't want both chapters and sections to show. I want section title to show as a priority, and if they're not available, I want the chapter title.


title: I am trying to shade in-between the two lines

text: The lines were created from points, can anyone give any suggestions on how to do this. Thanks!                   \documentclass{article}              \usepackage{graphicx}         \usepackage{siunitx}         \usepackage{pgfplots}              \begin{document}         \begin{center}         \begin{figure}         \begin{tikzpicture}              \begin{axis}         [         scale only axis,         width=1\textwidth,         height=8cm,          xlabel={Deflection (\si{in{.}})},         ylabel={Load (\si{kips})},         xmin=0,         xmax=1.5,         ymin=0,         ymax=2,         ytick={0,0.5,1.0,1.5,2.0},         %ymajorgrids,         grid=major,         xtick pos=left,         ytick pos=left,         y tick label style={    /pgf/number format/fixed,                 /pgf/number format/fixed zerofill,                 /pgf/number format/precision=1},         ]             \addplot[mark=none, color=blue, line width=1pt] coordinates {        (0.00000,    0)        (0.04972, 0.112328)        (0.10042,    0.249996)        (0.14986,    0.378274)        (0.20003,    0.539127)        (0.24985,    0.741852)        (0.30036,    1.009286)        (0.35022,    1.311160)        (0.40011,    1.557292)        (0.44918,    1.738888)        (0.46000,    1.750000)        (0.47000,    1.760000)        (0.50046,    1.876879)        (0.636507,   1.863208)        (0.701572,   1.873752)        (0.800000,   1.88)        (0.884833,   1.823338)        (1.24,           1.370000)        (1.40,           1.210000)         };                             \addplot[ mark=none, color=green, line width=1pt, dashed] coordinates {        (0.00,   0)        (0.05,   0.054535)        (0.10,   0.116885)        (0.15,   0.22159)        (0.20,   0.361565)        (0.25,   0.499317)        (0.30,   0.703649)        (0.35,   0.976836)        (0.40,   1.293226)        (0.41,   1.347)        (0.42,   1.33)        (0.45,   1.444132)        (0.47,   1.537)        (0.48,   1.56)        (0.49,   1.55)        (0.50,   1.55)        (0.50,   1.576024)        (0.511176,   1.60428)        (0.512776    ,  1.603344)        (0.590467,   1.534579)        (0.839806,   1.479985)        (1.124547,   1.247752)         };                    \end{axis}         % Make axis on other side for metric description         \begin{axis}[         scale only axis,         width=1\textwidth,         height=8cm,          xmin=0,         xmax=38.1,         ymin=0,         ymax=8.896,         axis y line*=right,         axis x line*=top,         ylabel near ticks,         ylabel={Load (\si{\kilo\newton})},         xlabel near ticks,         xlabel={Deflection (\si{\milli\meter})},         %major grid style={dashed,red},         %grid=major,            y tick label style={                 /pgf/number format/fixed,                 /pgf/number format/fixed zerofill,                 /pgf/number format/precision=1}          ]         \end{axis}              \end{tikzpicture}         \caption{Load deflection curve for GFRP}         \end{figure}         \end{center}


title: Export eps figures modified by psfrag

text: I am not an expert on figure exports and, although I have been searching around quite a lot, I can't find the answer to my problem. During the writing of a journal article, I had the idea of using psfrag to replace text on my .eps figures generated with Matlab. That works fine, as long as the main text .tex file is compiled as a whole. The problems start when one tries to generate the figures separately (since almost all journals require the figures to be uploaded as separate files). I have been trying to find a way to compile each figure into an .eps file with the psfrag labels added, so that I can submit these files separately. Maybe my problem is ill-posed to begin with (for example, even if one manages to compile a single eps file with the psfrag substitutions, how can one control the relative sizes of figure and text?). If this is the case, I would appreciate if someone could provide a correct workflow for ending up with .eps figures whose text has the same font with the article. Note: the only solution that I have managed to find and seems to be what I want, is the fragmaster.pl script, which however I do not how to operate in windows.


title: How to avoid this undesired horizontal space?

text: In the following output, why do I get the undesired space before the `(`, and how to get rid of it globally?   Here is my code:               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{align*}     &a=b\\     &\left(a\right)=b     \end{align*}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Ncv2F.png)


title: Arrow with a point on it and cancelled arrow

text: I stumbled over this kind of arrows and can't find any reference to it (since I not even know how they're called). ![enter image description here](http://i.stack.imgur.com/Figpv.png) ![enter image description here](http://i.stack.imgur.com/puG8e.png) Does anyone know the right command for those? Or are this constructed elements?


title: Table of contents like

text: I have a list of "mini-paragraph" for example:               id:Object1:     Title:xxxx     Author:yyyy     ecc..          id:Object2:     Title:xxxx     Author:yyyy     ecc..      I don't need to put the id in tableofcontent but i need to create a list, like tableofcontent, of all id, for example:               Obect1: page 3 (with link to the page)     Object2: page.      If I only put a `\label` tag then I need to insert all `\ref` tags but I need something to do it automatically. Any suggestion? **EDIT1:** An example is this:               \noindent\makebox[\linewidth]{\rule{\textwidth}{1pt}}     \begin{list}{}{\textbf{Modifica Tag}}         \item {\textbf{Identificativo:}} \texttt{RF-ADMIN-Tag.edit}         \item {\textbf{Descrizione:}} L’amministratore vuole modificare il nome di un tag esistente. Accede quindi alla sezione relativa ai tag negli strumenti di amministrazione, seleziona il tag di interesse e ne modifica il nome.      Il sistema visualizza la lista dei tag aggiornata.         \item {\textbf{Precondizioni:}} Login come utente amministratore. Questo stato è verificato in seguito all’applicazione del requisito RF-Login.         \item {\textbf{Input:}}         \begin{itemize}             \item Nome tag             \item tag da modificare         \end{itemize}         \item {\textbf{Output:}}         \begin{itemize}             \item Lista dei tag aggiornata in ordine alfabetico         \end{itemize}         \item {\textbf{Priorità:}} Alta     \end{list}      In the second line I have `\textbf{Modifica Tag}`, the "id" of object is "Modifica Tag" (the title of the list). I need to get this "id" from all object and put in a table of contents like. My document class definition is this:               \documentclass[a4paper,12pt,oneside,hidelinks]{article}     \usepackage{graphicx} % For images     \usepackage{multirow} % For multirow tables     \usepackage[italian]{babel}     \usepackage[utf8]{inputenc}     \usepackage{amssymb} % Per le classi di numeri     \usepackage{amsmath} % Per le frazioni     \usepackage{hyperref} % Per i link     \usepackage{eurosym} % Per usare il simbolo dell'euro     \usepackage{acronym} % Per gli acronimi          \graphicspath{{./immagini/}}     \AtBeginDocument{\renewcommand\refname{Riferimenti}} % con pacchetti lingue          \begin{document}     [..]     \end{document}


title: Beamer slides and tufte-handout

text: I have been experimenting with a setup for slides and handouts with one main.tex file that is `\input{}` into a "slides" and a "handout" file (as described in the beamer user guide 21.2.1, or this example. This setup allows the handout to be typeset using different documentclasses (i.e. report, article - which I am able to produce). However, I have been trying to use the tufte-handout class, but the compilation comes to a halt, without giving any particular error messages. I noticed the compilation halted on `amsthm` so I used the `[noamsthm]{beamerarticle}` class option. Then the compilation halted on `beamerbasetheorems.sty`so I used `[notheorems]{beamerarticle}` in the class option, but then it once again halted on `amsthm`. I then tried to give both in the class options (i.e. `[notheorems,noamsthm]{beamerarticle}`), but this appears to ignore the `[notheorems]{beamerarticle}` option resulting in the same error message as when only giving the `[noamsthm]{beamerarticle}` option. So, my question is, has anyone successfully used this setup to produce beamer slides and handouts using the tufte-handout class? Minimal examples provided as requested: File1 (slides.tex):               \documentclass[ignorenonframetext]{beamer}       \input{main.tex}       File2 (handout.tex):               \documentclass{article} % This class works       %\documentclass{tufte-handout} % Whish to use this documentclass       \usepackage{beamerarticle}       \input{main.tex}      File3 (main.tex):               \usetheme{Singapore}       \title{Title here}       \author{Some author}       \date{}       \begin{document}       \maketitle       \begin{frame}       \titlepage       \end{frame}       \section{One section}       \begin{frame}       \frametitle{One frame}      \end{frame}       Text out of frame. Should print on handout only.       \end{document}


title: Workflow for reviewing PDFs generated from TeX?

text: I am currently letting friends and family spellcheck my thesis written with LaTeX. Since my markup is macro-heavy and not all of them have ever used another editor but MS Word, I cannot let them work with the source files directly. What is the best way for them to review the PDF and send me comments, so that I can quickly integrate them back into my .tex files? Some of them have Adobe Acrobat at work and can send me annotated PDFs, but at least 50% of the time of fixing the changes is searching the exact position of the missing comma or mistake. Is there a (preferably cross-plattform) solution that would make their and my life easier?


title: How to make sense of font metrics?

text: If I have a Tex font, and I want to really understand how it will be laid out by Tex, and what features of the font to bear in mind when tuning my output to be beautiful, what tools are useful for this?   1. I've heard that the usual measure of font size, points per em, is tricky. Is there a good overview of how these measurements are used in font design? One that relates this information to Metafont and True/Open Type fonts?   2. I'd like to see where baselines and the em square are on the glyphs of a font. Are there tools to do that?   3. Where can I get summary information about fonts? How do I understand the content of .tfm files? Are there tools that generate these summaries?   4. Is there relevant information in fontspec? I've asked this question as a generalisation of How to determine the true size of a font, because the narrow discussion there didn't really settle all the issues.


title: `h' float specifier changed to `ht' warning when not attempting to specify a float

text: I'm new to LaTeX and trying to understand the reason why I'm getting the warning:               `h' float specifier changed to `ht'      I'm not attempting to change the float property of anything - the warning is showing up if I attempt to simply encapsulate some words in quotation marks:               ``highly distributed''      As far as I'm aware, there's no open sections anywhere and the file seems to render properly. So realistically it doesn't matter if the issue gets solved or not; but I'd like to know the reason I'm getting the warning. Thanks in advance.


title: Vector notation in siunitx

text: I'm trying to use the `siunitx` package to format a number which is a vector (using `\hat{x}` to represent a vector in the x direction). Using `\hat{x}` leads to complaints about invalid tokens. After seeing this question, I tried including               \sisetup{input-symbols=\hatx\haty}          \protected\def\hatx{\ensuremath{\hat{x}}}     \protected\def\haty{\ensuremath{\hat{y}}}      to my preamble. Then, I get `siunitx error: "misplaced-sign-token" Misplaced sign token '+'.` For completeness, here's what I am trying now:               \documentclass{article}     \usepackage{siunitx}          \sisetup{input-symbols=\hatx\haty}          \protected\def\hatx{\ensuremath{\hat{x}}}     \protected\def\haty{\ensuremath{\hat{y}}}          \begin{document}          \begin{equation}     \vec{F} = \SI{-3.24e-20\hatx + 4.56e-18\haty}{\newton}     \end{equation}          \end{document}      Any ideas how I can get this kind of thing to work properly?


title: \pause messes up the page layout

text: I'm having a frame in beamer which compiles just right when I do not use pauses (\pause). However, when I pause the different list items, the last items do not appear on the frame anymore (actually, they are outside the frame viewable part). It seems in some way beamer has some problem calculating how to fit the different items on the page when pauses are included. Any idea how to avoid this problem? EDIT : Some source code exhibiting the problem :               \documentclass[slidetop,11pt]{beamer}     \linespread{1.2}     \begin{document}          \begin{frame}{Kubo-Greenwood Transport Formalism : Derivation}     Mott Method :     \begin{itemize}     \pause \item Electric field :     \footnotesize     \begin{equation*}     E(t) = E_0 cos(\omega t) u_x     \end{equation*}     \normalsize     \pause \item Coulomb gauge ($E=\delta A / \delta t$) :     \footnotesize     \begin{equation*}     A(t) = -\frac{E_0}{2 i \omega} (e^{i \omega t} - e^{-i \omega t}) u_x     \end{equation*}     \normalsize      \pause \item First order perturbation of H :     \footnotesize     \begin{equation*}     \delta \widehat{H} (t) = \frac{2e \widehat{P}.A(t)}{2 m} = e \widehat{V}.A(t) = -\frac{e     E_0}{2 i \omega}(e^{i\omega t} - e^{-i \omega t}) \widehat{V}_x     \end{equation*}     \normalsize     \pause \item Transition from a state at t=0 to a state at t :     \footnotesize     \begin{equation*}     p_{nm} (t) = \frac{1}{\hbar^2} \left |\int_0^t d\tau e^{i(E_m-E_n) \tau / \hbar} \langle    m|\delta \widehat{H}(\tau)|n \rangle \right |^2     \end{equation*}     \normalsize     \pause \item At long times :     \footnotesize     \begin{equation*}     \frac{p_{nm}(t)}{t}  = \frac{2 \pi}{\hbar} \left(\frac{e2E_0}{2 \omega}\right)^2 \langle m|\widehat{V}_x|n \rangle \left[ \delta(E_m-E_n+\hbar \omega) +  \delta(E_m-E_n-\hbar     \omega)\right]     \end{equation*}     \normalsize     \end{itemize}     \end{frame}          \end{document}      And actually, thanks to your comment vanden to give a minimal amount of packages and comments, I managed to find the cause to this compilation error. It is the "\linespread{1.2}" command that messes things up when using \pause. If no fix available, I'll just comment it out I guess.


title: Right aligning text while underlining entire line

text: For the record, I've spent about five hours endlessly looking here and elsewhere on the Internet, looking for an answer. I'm relatively new to using LaTeX and am trying to create right aligned text that is underlined, but the underline spans the entire length of the line. I've spent several hours on this and this is the closest I've gotten To demonstrate the problem I've run into, I created this example:               %%%%%%%%%%Begin example%%%%%%%%%%     \usepackage{ulem}          %This creates a dashed underline     \dashuline{This is a test}          %This right align our dashed underlined text     \raggedleft\dashuline{This is a test}           %This creates a dashed underline that spans the entire line     \dashuline{This is a test\hspace*{\fill}}           %This should create a dash underline that spans the entire line and right aligns our text,      %but the text ends up left aligned. Why is this?     \raggedleft\dashuline{This is a test\hspace*{\fill}}           %%%%%%%%%%%End example%%%%%%%%%%%%%%      As far as I can tell, something to do with the `\hspace*{\fill}` is causing this, since everything works just fine, sans underlining the entire line. Is there a way to fix this or another way to accomplish this that will work?


title: Is the introduction chapter 0 or 1?

text: I know this question, is not directly about tex: What is the norm in science: Is the introduction the 1st or 0st chapter?


title: Multi-Document Thesis in Lyx Across Many Computers

text: I've recently migrated to LyX from LaTeX, recognizing some of the tradeoffs. There is one however I can't seem to work with. I have a multi document LyX project, it's my thesis. I have a main file that only contains child documents. I keep my entire thesis under careful version control, and so it has its own directory structure that I keep consistent to minimize manual edits (e.g. I edit a code that is included as a listing, then when I checkout the new version on a new computer it should automatically compile with the new code wherever I have included it) However LyX keeps maintaining a static directory structure: the one associated with my laptop (e.g.: `/users/me/temp/temp2/checked_out_thesis/`). I however move around a lot and often edit on different machines. This presents frustrating compilation issues, and often I manually have to go through and change the paths on all the figures and listings. Is there a way to use only one path, independently of what machine I might be on?


title: memoir: sections as chapters, reference numbering

text: In the following example, I've hacked the numbering of sections in the memoir class so that I can use "sections" as "chapters". This makes them show up nicely in the table of contents. However, numbering for `\label` and `\ref` is off by one. Can this be fixed without massively revising my code?               \documentclass[article, a4paper, 12pt, oneside]{memoir}          \setlrmarginsandblock{23mm}{63mm}{*}     \setulmarginsandblock{23mm}{28mm}{*}     \setheadfoot{\onelineskip}{2\onelineskip}     \setheaderspaces{*}{1mm}{*}     \chapterstyle{plain}     \checkandfixthelayout          \setsecnumformat{\addtocounter{section}{-1} \addtocounter{chapter}{1}}          \renewcommand*\thesection{\arabic{chapter}}          \begin{document}          \tableofcontents          \section{Introduction} \label{beginning}     Beginning.  Just wait til you see the end, that's in Chapter \ref{end}.          \section{Conclusion} \label{end}     End.  Hopefully you read the beginning! (Chapter \ref{beginning})          \end{document}      ![Numbers appear differently](http://metameso.org/~joe/tocref.png)


title: How to type Chinese characters in ShareLaTeX?

text: I'm going to type a few of Chinese characters among a bunch of English sentences, for example: > Note: the first ":" introduces an extensive description of the sememe > "tool|用具", describing what kind of tool it is; the second ":" introduces a > lower-level extensive description of the sememe "wash|洗涤", indication what > is washed and what is its relation with the tool, agent, method, time or > instrument. What should I do?


title: Running pdflatex does not update file in Adobe Reader

text: I am using Adobe Reader 9 to display PDF files in Ubuntu. When I run the `pdflatex` command, the file itself is updated as usual. But if the file is currently open in Adobe Reader, then the displayed file is not updated, and the result is that I have to close Adobe Reader and reopen the file. As you can imagine, this becomes annoying pretty fast. How can I make it so that the displayed file is automatically updated?