title: Printing a handout of a Beamer presentation, the resulting pdf is shrunk!

text: I use the code below to produce handouts of my presentations. When I open the resulting pdf with any pdf viewer, it is viewed correctly, but when I print it, it is always printed very small, no matter the program I use (Okular, Evince, Acrobat...). I guess that the pdf produced is bigger than the printing area, so it is shrinked... I have tried using more margins, a4paper or letterpaper, and removing margins from the programs I use to print before printing... but it is always shrinked. What can happen? Why is the pdf produced bigger than the printing area? Bonus to anyone that can make the pdf be printed correctly by Okular under Ubuntu! Thanks! MWE here:               \listfiles          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%% For normal presentations WITHOUT NOTES     %\documentclass[ignorenonframetext, xcolor={dvipsnames,table}]{beamer}     %\usepackage{etex}     %\reserveinserts{28}     %\setbeameroption{hide notes}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%% For presentations WITH NOTES     %\documentclass[ignorenonframetext, xcolor={dvipsnames,table}]{beamer}     %\usepackage{etex}     %\reserveinserts{28}     %\usepackage[utf8x]{inputenc}     %\usepackage{pgfpages}     %\setbeameroption{show notes on second screen=left}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%% For handouts with lots of extra notes     \documentclass[handout, ignorenonframetext, xcolor={dvipsnames,table}]{beamer}     \usepackage{etex}     \reserveinserts{28}     \usepackage{pgfpages}     \pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] % could also use letterpaper     \setbeameroption{show notes on second screen=bottom} % Beamer manual, section 19.3     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%               \setbeamercolor{background canvas}{bg=pink}          \usepackage{lmodern}          \setbeamertemplate{note page}[plain] % Beamer manual, section 19.1     \newlength{\parskipbackup}     \setlength{\parskipbackup}{\parskip}     \newlength{\parindentbackup}     \setlength{\parindentbackup}{\parindent}     \newcommand{\baselinestretchbackup}{\baselinestretch}          \usetemplatenote{            \insertslideintonotes{0.3}%            \rmfamily \scriptsize%       \setlength{\parindent}{1em} \setlength{\parskip}{1ex}%       \renewcommand{\baselinestretch}{1}%            \insertnote%            \setlength{\parskip}{\parskipbackup}%       \setlength{\parindent}{\parindentbackup}%       \renewcommand{\baselinestretch}{\baselinestretchbackup}%     }                              \begin{document}               \begin{frame}     Title slide     \note{this is a note}     \end{frame}          \begin{frame}     This is the first slide     \note{this is another note}     \end{frame}          \end{document}      **EDIT:** If I place the line "\pgfpagesuselayout{2 on 1}" after the line "\setbeameroption{show notes}" I do not experience the printing problem anymore!! However, the slide preview and notes that appear at the bottom belong to the NEXT SLIDE, instead of to the CURRENT SLIDE!! What is going on with that?


title: Why IEEEtran is blurry with XeLaTeX but not with PDFLaTeX, and how to fix it?

text: The question is pretty simple. Compiling this code with PDFLaTeX               \documentclass{IEEEtran}     \usepackage{lipsum}     \begin{document}         \lipsum     \end{document}      gives me back ![](http://i.stack.imgur.com/suc1U.png) whereas compiling the same code with XeLaTeX gives me back ![](http://i.stack.imgur.com/s6MDl.png) I'm curious why this happens, but more importantly, I'd like to know:   _How can I force XeLaTeX to avoid doing whatever it does that makes its output render differently like this from the PDFLaTeX output?_ In case it matters, I'm running this on MiKTeX 2.9 (Windows).


title: How to get the string with \

text: Apologized for my unclear description. I wish I could explain my problem more clearly. In document, I wish I can just write something as               "how to use \cmd \mbox in xxx" or "what is \cmd minipage xxx".      The string with/without \ is the argument of \cmd. \cmd reads      token until meeting space or .,; (any char except a-zA-Z)      Following `\def` taking next word as argument? I can try to do this. Next, in the definition of `\cmd`, I wish there's a variable to store the string (without `\`), that is, `\def\cmd#1{\def\A{} xxx}`, then `\A` would store `{mbox}` (without `\`) or `{minipage}`. So I can use `\A` in `index`/`toc`/ etc. I'm trying to write a manual of some commands of LaTeX (in Chinese). So, it's more easily to maintain the code by this way. (I use `\verb` and others to do this. But it becomes more and more difficult to maintain the code now). So, I hope I can just type               "even though you specify \cmd \pagestyle to force an empty xxx"      rather than "even though you specify \bscmd{mbox} to force xxx"      (\bs for backslash) and "even though you specify \cmd{minipage} to      force xxx" (\cmd for normal none-backslash)      Then, because of `index`/`hyperref`/`footnote`/etc, so I need something stores `\mbox` or `minipage`.


title: babel - define language synonym

text: I use `\usepackage[english]{babel}`, but I am keeping getting error:               Package babel Error: You haven't defined the language EN yet.      while parsing bibliography with `\bibliographystyle{apsrev4-1}` (curiously enough, for some other bibliography styles I don't get this problem). I've discovered that in some `bib` entries there are lines               language = {en},      Changing `en` to `english` does solve the problem. However, as I get the `bib` file generated from other tool (Mendeley) it would be annoying. Is there a way to define language `en` as a synonym of `english`? Note: There is a similar question Unable to get rid of error babel: You haven't defined the language en yet?, but it is closed as unclear. Example:               \documentclass{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}          \usepackage{hyperref}          \usepackage{natbib}     \bibliographystyle{apsrev4-1}     \usepackage{doi}          \begin{document}              \cite{Renyi1961}              \bibliography{notwrk}          \end{document}      And `notwrk.bib`               @inproceedings{Renyi1961,     author = {R\'{e}nyi, Alfr\'{e}d},     booktitle = {Proceedings of the Fourth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Contributions to the Theory of Statistics},     issn = {0097-0433},     language = {en},     publisher = {The Regents of the University of California},     title = {{On Measures of Entropy and Information}},     url = {http://projecteuclid.org/euclid.bsmsp/1200512181},     year = {1961}     }


title: Creating Direct Limits and Inverse Limits using Tikz

text: I am trying to make something that looks like ![enter image description here](http://i.stack.imgur.com/istAG.png) I am trying to go from here (works):               \begin{tikzcd}     A \arrow{r}\arrow{rd}     &B \arrow{d}\arrow[leftarrow]{r}     &C \arrow{ld}\\     &D     \end{tikzcd}      to here (doesn't work):               \begin{tikzcd}     A \arrow{r}\arrow{rd} \arrow{rdd}     &B \arrow{d}\arrow[leftarrow]{r}     &C \arrow{ld} \arrow{ldd} \\     &D     &E\\     \end{tikzcd}      I try many combinations but don't see how the tikz@x-y-z values work. Any help is appreciated. Thanks, Brian


title: How to write a title/abstract spanning 2 columns in 3-column page using multicol?

text: My article requires that I put the title and a small abstract spanning the left 2 columns in a 3-column page, that is, the 3rd column to the right of the title/summary block must follow with the body text from the second column at the end of the page. I'm using `multicol` package. This problem is easy and has been solved for 2-column page, either with `twocolumn` option in `\documentclass` or `multicol`.


title: LaTeX beamer fixed vertical alignment

text: I am building a presentation in Beamer. The presentation contains a slide where an image should be displayed on the top of the frame. Underneath some text should be displayed containing information about the image. The text should change frame by frame (other information, no overlays). Therefore the image needs to stay on it's initial place of course. Are there any ways to do this, or is there some workaround (elegant solution)?


title: AC source symbol in TikZ circuits.ee.IEC library

text: I can draw an AC source manually:               \begin{tikzpicture}       \draw (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0);       \draw (2,0) circle (2.5);     \end{tikzpicture}      ![alt text](http://i.stack.imgur.com/f02nW.png) How do I declare an `ACsource` symbol so that I can just write the following, or something similar and more correct:               \draw (0,5) to [ACsource={volt=220}] (5,5);      Also, when I am able to declare it as a symbol, will it already behave the same way as the other default symbols in the `circuits` library? To illustrate, will it behave like this `resistor`, drawing connector lines and labels in the appropriate places? I also want the `ACsource` to be the proper size that obeys keys like `small circuit symbols`, `huge circuit symbols`, etc.               \draw (0,0) to [resistor={ohm=5}] (5,0);      * * * **In response to @morbusg'sanswer:** I'm using LaTeX. Here's my MWE:               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{circuits.ee.IEC}     \tikzset{circuit declare symbol = ac current source}     \tikzset{%               ac current source IEC graphic/.style={%                 circuit symbol lines,                 circuit symbol size = width 2 height 2,                 shape = generic circle IEC,                 /pgf/generic circle IEC/before background={%                   \pgfpathmoveto{\pgfpoint{-0.8pt}{0pt}}                   \pgfpathsine{\pgfpoint{0.4pt}{0.4pt}}                   \pgfpathcosine{\pgfpoint{0.4pt}{-0.4pt}}                   \pgfpathsine{\pgfpoint{0.4pt}{-0.4pt}}                   \pgfpathcosine{\pgfpoint{0.4pt}{0.4pt}}                   \pgfusepath{stroke}                 },                 transform shape               }     }     \tikzset{%               circuit ee IEC/.append style={%                 {set ac current source graphic = ac current source IEC graphic}               }     }          \begin{document}       \begin{tikzpicture}[circuit ee IEC]         \draw node [ac current source, info=230V] {};       \end{tikzpicture}     \end{document}      When I try to compile that, I'd get the following error: > Package `pgfkeys` Error: I do not know the key `'/tikz/set ac current source > graphic = ac current source IEC graphic'` and I am going to ignore it. > Perhaps you misspelled it. @morbusg's solution works perfectly with Plain TeX, but I'm using LaTeX. Perhaps I'm missing something?


title: Problems with referencing to tables A1, A2 etc in appendix(with IEEEtran class)

text: I'm trying to refer to some tables in the appendix of my paper, the following command have been used to number the tables as A1, A2 etc.:               \setcounter{table}{0}     \renewcommand{\thetable}{A\arabic{table}}      but when I use the \ref command for cross reference, It only shows table A, not Table A1 as I wanted, will someone help figure out why the reference goes wrong? I'm using the IEEETran class, and whit the following code:               \appendix     \setcounter{table}{0}     \renewcommand{\thetable}{A\arabic{table}}               some text here and refer to Table \ref{tab:app-flexible}.               \begin{table}[!htbp]     \centering     \begin{threeparttable}     \label{tab:app-flexible}     \caption{Parameters balabala}     \begin{tabular}{cccc}     \toprule     table contents...     \bottomrule     \end{tabular}     \end{threeparttable}     \end{table}


title: How to switch from one sided to two sided document?

text: I have been writing a thesis that is currently in one sided layout, but I would like to switch everything except for contents, abstract, acknowledgement and dedication into two sided layout. Is it possible? Here is a simple document that uses my current preamble                \documentclass[11pt,a4paper,oneside]{report}       \usepackage[pdftex]{graphicx}      \usepackage[T1]{fontenc}       \usepackage{fouriernc}      \usepackage{mathtools}      \usepackage{amsfonts,amsmath,amssymb,amsthm}       \usepackage[a4paper, hmargin={3.5cm,3cm}, vmargin={2.5cm,2.5cm}]{geometry}       \usepackage{multicol}      \usepackage{chngcntr} % reset footnote for each chapter      \usepackage{fancyhdr} % headline      \usepackage{enumerate}      \usepackage{wasysym} % symbols      \usepackage{faktor}%for factor rings       \usepackage{ marvosym }      \usepackage{ragged2e}      \usepackage{blindtext}      %%-------------------footnotes-------------------------------------      \counterwithout{footnote}{chapter}% reset footnote for each chapter      \usepackage[hang]{footmisc} %align text of footnotes      \setlength{\footnotesep}{0.4cm}      %---------------------note--------------------------------------      \newtheoremstyle{note}% hnamei          {3pt}% hSpace abovei          {3pt}% hSpace belowi note         {}% hBody fonti          {}% hIndent amounti1         {\itshape}% hTheorem head fonti          {\spacedlowsmallcaps}%         {:}% hPunctuation after theorem headi          {.5em}% hSpace after theorem headi2         {}%       \theoremstyle{note}      \newtheorem{note}{Definition}      %------------------------theorem-------------------------------      \theoremstyle{plain}      \newtheorem{thm}{Theorem}[chapter] % reset theorem numbering for each    chapter      \newtheorem{defn}[thm]{Definition} % definition numbers are dependent on    theorem numbers      \newtheorem{exmp}[thm]{Example}      \newtheorem{cor}[thm]{Corollary}      \newtheorem{lem}[thm]{Lemma}      \newtheorem{prop}[thm]{Proposition}      \renewcommand\arraystretch{1.2}      \DeclareMathOperator{\disc}{disc}      \DeclareMathOperator{\order}{\mathcal{O}_{K}}       \DeclareMathOperator{\z}{\mathbf{Z}}       \DeclareMathOperator{\q}{\mathbf{Q}}       \DeclareMathOperator{\C}{\mathbf{C}}      \DeclarePairedDelimiter{\Span}{\langle}{\rangle}      \DeclarePairedDelimiter{\bs}{\lvert}{\rvert}      \DeclareMathOperator{\discr}{disc}      %--------------------proof-------------------------------------      \newcommand\prosto{\rule{1ex}{2.6ex}}      \renewcommand\qedsymbol{\prosto}      \makeatletter % ''proof''from italic to bold      \renewenvironment{proof}[1][\proofname]{\par      \pushQED{\qed}%      \normalfont \topsep6\p@\@plus6\p@\relax      \trivlist      \item[\hskip\labelsep         \bfseries      #1\@addpunct{.}]\ignorespaces      }{%      \popQED\endtrivlist\@endpefalse      }      \makeatother      %-------------------headline-------------------------------      \pagestyle{fancy}      \lhead{\empty} %left headline      \rhead{\normalfont \small \itshape \rightmark}       \cfoot{\empty}       \rfoot{\thepage}      \renewcommand{\chaptermark}[1]{\markboth{#1}{}}      \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}      \fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}       \def\headrulewidth{0pt}       \setlength{\headheight}{14pt}       %-------------------------------------------------------------      \usepackage[pdftex]{hyperref}           \begin{document}      \chapter{1}      \blindtext      \blindtext      \chapter{2}      \blindtext      \blindtext      \section{1}      \blindtext      \blindtext      \end{document}


title: clines stop working after using the tabularx key in tcolorbox

text: I suspect this may be a bug but I'm not completely sure, so I posted here before contacting the relevant package mantainer to ask your opinion.               \documentclass{beamer}     \usepackage{tcolorbox}     \usepackage{tabularx}     \usepackage{colortbl}     \begin{document}     \begin{frame}           \begin{tcolorbox}[tabularx={X|X}]      1 & 2 \\      3 & 4      \end{tcolorbox}           \begin{tabularx}{\textwidth}{X|X}      \hline       1 & 2 \\\cline{2-2}       3 & 4 \\      \hline      \end{tabularx}           \end{frame}     \end{document}      In the above code the `\cline` command does not work as expected. This happens when a `tabularx` key is used in a tcolorbox and only happens in `beamer`. If you switch the class to, say, `article`, the cline works. Is this a bug or am I missing something?


title: ledpar ignores \startstanzahook (not able to put extra space between stanzas)

text: The ledmac/-par manual says that I may use `\startstanzahook` to get extra space between stanzas. But it works only in _normal_ verses an not in parallel typsetting. The following example may give a better idea what I mean:               % XETEX-DOCUMENT     \documentclass{scrartcl}     \usepackage{xltxtra}     \usepackage{ledmac,ledpar}         \maxchunks{100}         \newcommand*{\startstanzahook}{\vspace{\baselineskip}}     \begin{document}     % works (vspace between stanzas):     \beginnumbering     \setstanzaindents{2,0,0}     \stanza          Non ego Caesareas, non arma virumque, &          sed chitaram plectrumque cano nec inutile numen      \&      \stanza          Doctus in Arcadiis vivebat musicus oris, &          clarus circa urbes et famae voce lyraeque.     \&     \endnumbering          % doesn't work (no vspace):     \begin{pages}     \begin{Leftside}         \beginnumbering         \setstanzaindents{2,0,0}         \stanza              Non ego Caesareas, non arma virumque, &              et lyricam poterit, nisi centum vocibus, artem?          \&          \stanza              Doctus in Arcadiis vivebat musicus oris, &              vicina quondam late celebratus in urbe          \&          \endnumbering     \end{Leftside}     \begin{Rightside}         \beginnumbering         \setstanzaindents{2,0,0}         \stanza              Non ego Caesareas, non arma virumque, &              et lyricam poterit, nisi centum vocibus, artem?          \&          \stanza              Doctus in Arcadiis vivebat musicus oris, &              vicina quondam late celebratus in urbe          \&          \endnumbering     \end{Rightside}      \Pages      \end{pages}      \end{document}      Is there any way to instert extra space between stanzas in parallel-mode?


title: Exercises in lecture notes without predetermined placement

text: I'm writing up some lecture notes for a math course in LaTeX (using the book class so far, but I may change that), and as I do so possible homework exercises occur to me which I want to include in the notes. I haven't decided whether to put exercises at the end of each section or the end of each chapter, and in either case exercises may need to move along with associated text if I change my mind about the organization of topics. (I _don't_ want to intersperse the problems throughout the text, which would of course be the technically simplest solution.) Ideally, it would be nice to be able to handle this in more or less the following way: in the .tex file, immediately after the text about topic A, I write `\exercise{Problem about A}`, which produces no immediate output. At some later point, I write `\exerciseshere`, which produces an enumerated list, with a heading like "Exercises", of all the exercises since the previous `\exerciseshere`. Alternatively, a command in the preamble allows me to set whether a list of exercises is produced automatically at the end of each section or the end of each chapter (keeping in mind that if there are no exercises, nothing should be done). **Added:** It would also be good to be able to include a `\label` in an exercise, which could be used to refer to its counter in the enumerated list. How can something like this be implemented? Or is there even already a package that does it? P.S. I couldn't come up with a very informative title or tag for this question. Please feel free to retitle or retag.


title: Remove chapter number from Bibliography

text: MWE:               \documentclass[english]{scrreprt}          %%% PAGE DIMENSIONS     \usepackage{geometry}      \geometry{verbose,a4paper,tmargin=3.5cm,bmargin=2.5cm,lmargin=2.6cm,rmargin=2.6cm,headheight=1.3cm,headsep=1cm}     \pagestyle{headings}          %%% PACKAGES     \usepackage{array}     \usepackage{paralist}     \usepackage{verbatim}     \usepackage{subfig}     \usepackage{amsmath, amsthm, amssymb, url}     \usepackage{enumitem}     \usepackage{mathrsfs}     \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{tabu,longtable,booktabs,caption}     \usepackage[pdftex]{graphicx,color}     \usepackage{scrpage2,datetime,tikz}     \usepackage{hyperref}     \usepackage[nottoc,numbib]{tocbibind}     \usepackage{bookmark}     \usepackage[toc,page]{appendix}          %%% OPTIONS     \bibliographystyle{plain}     \setcounter{secnumdepth}{3}     \setlength{\parindent}{1em}     %\setlist{nolistsep}     \tabulinesep=^1.5mm_1.5mm     \tikzset{>=latex}     \hypersetup{         colorlinks,         citecolor=black,         filecolor=black,         linkcolor=black,         urlcolor=black     }          %%% DEFINITIONS     \newenvironment{myfont}{\fontfamily{phv}\selectfont}{\par}     \renewcommand{\dateseparator}{.}     \DeclareMathOperator{\sgn}{sgn}     \DeclareMathOperator{\Wrap}{Wrap}     \addto\captionsenglish{  \renewcommand{\contentsname}  {Table of Contents} }          %%% HEADERS     \makeatletter     \pagestyle{scrheadings}     \setkomafont{pagehead}{\sffamily\bfseries\small }     \clearscrheadfoot     \rohead{line1 \linebreak \@normalcr[-9pt] line2 \linebreak\@normalcr[-2pt] \normalfont\sffamily\footnotesize{line3 \linebreak\@normalcr[-49pt]}}     \lohead{\rule{1.5cm}{1.5cm}\vspace{0.05cm}}     \setheadsepline{0.4pt}     \makeatother          %%% FOOTERS     \lofoot [docname.pdf] {docname.pdf}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \pdfbookmark[section]{\contentsname}{toc}     \tableofcontents           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \chapter{chapter}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{appendices}     \chapter{appendix1}     \end{appendices}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \bibliography{mybib}          \end{document}      I end up having "Bibliography" as second chapter. How can I prevent it? Have I messed up something with those packages?


title: Multiple text layouts in one LyX document

text: In general I want to use a 3mm spacing as my text layout for space between paragraphs. However, this produces an extremely spaced out Table of Contents. Hence, I would like to use an indent paragraph text layout just for the few pages that are my list of figures and table of contents. I have tried selecting the region of text that I want it to be paragraph and go to Document --> Settings --> Text Layout to change the text layout, but this changes the text layout for the entire document. Is there a way to change between two forms of text layouts within a single LyX document easily?


title: Equivalent to TeXLive's --restricted-shell-escape for MiKTeX?

text: I often work on Windows, so need to use MiKTeX. I recently found the `minted` package, which needs to call the external command `pygmentize`. I currently call `xelatex` with the `-shell-escape` option to support this, but I'd rather not give malicious latex files complete access to my system. TeXLive has the `\--restricted-shell-escape` option, which is what I want, but it doesn't seem to be available on MiKTeX. I did find a passing reference to `\--shell- restricted`, but I don't know if that's what I want, and if it is what I want I don't know how to use it. Is `\--shell-restricted` a way to tell XeLaTeX to run `pygmentize` but not `del /F /S /Q C:\\*.*`? If so, how do I use it? If not, is there such a way and how do I use it? If you can, could you also link me to the official documentation on the subject?


title: high and low CJK codepoints in a single XeLaTeX document

text: I often require a combination of CJK characters with both low and high codepoints in the same line of text. (Here "low" means "in the Basic Multilingual Plane" or BMP, with codepoint lower than hex 10000.) I do not own a single typeface that contains all the CJK characters in forms I like, so I use two typefaces that look the same and together cover (apparently) all the CJK characters. In a line of text containing both types of character, TeX requires explicit instructions as to which typeface to use: if a particular typeface does not contain a desired character, the only way to display the corresponding glyph is to specify a different typeface for that character. My practice has been to assign my normal (BMP) font with `\setCJKmainfont` and then a secondary font, which contains all of the high-codepoint characters, with `\setCJKsansfont`. The nuisance is that in composing my document, I must manually assign the CJK sans font to the high-codepoint characters. My question is whether there is a simple procedure that would choose the correct typeface, depending on which of them actually contains the required characters — without my manually changing the typeface.


title: ledpar vs. polyglossia: Problem with \begin{⟨lang⟩}…\end{⟨lang⟩}

text: I got a little Problem with the combination of `polyglossia` and `ledpar`. First the example               \documentclass[11pt,a4paper]{scrartcl}     \usepackage{xltxtra}     \usepackage{libertine}     \usepackage{polyglossia}         \setmainlanguage[spelling=new,babelshorthands=true]{german}         \setotherlanguage{latin}         \setotherlanguage[variant=poly]{greek}     \usepackage{ledmac,ledpar}% PROBLEM-LINE     \begin{document}     \minisec{german}     Weit hinten, hinter den Wortbergen, fern der Länder Vokalien und Konsonantien     leben die Blindtexte. Abgeschieden wohnen Sie in Buchstabhausen an der Küste     des Semantik, eines großen Sprachozeans.          \minisec{latin}     \begin{latin}     Ulpianus libro primo institutionum pr Iuri operam daturum prius nosse oportet,     unde nomen iuris descendat. est autem a iustitia appellatum: nam, ut eleganter     Celsus definit, ius est ars boni et aequi.     \end{latin}          \minisec{greek}     \begin{greek}     μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς ἄλγε'     ἔθηκε, πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων     \end{greek}          \minisec{short-versions}     Hier steht etwas griechisches: \textgreek{Πηληϊάδεω}     \end{document}      Without the _problem-line_ , which includes `ledpar`, every thing works fine but with it the foreign-language-environments I get the problem which leads to some extra-text (`]latin` or `]greek`) in the PDF at the beginning of environment’s content. There’s no problem with the short-versions `\text⟨lang⟩`.


title: htlatex interrupted at '\:temp{rm}'

text: Using TL2013, I cannot compile documents with htlatex anymore. For example, using:               \documentclass{scrbook}          \begin{document}     test          \end{document}      I get:               $ htlatex test.tex      This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)     ... output ...     (/usr/local/texlive/2013/texmf-dist/tex/generic/tex4ht/scrbook.4ht     ! Missing \endcsname inserted.     <to be read again>                         \MessageBreak      l.201 \:temp{rm}      Is that a known bug? Am I missing something (it used to work fine with TL2012)?


title: Custom geometry for a first chapter page?

text: On normal pages I have header and no footer. On first chapter page -- I have footer (with page number) and no header. Hence I need:               \newgeometry{top=2cm, bottom=1.2cm, left=1.5cm, right=1.7cm}      for normal pages, and               \newgeometry{top=1.2cm, bottom=2cm, left=1.5cm, right=1.7cm}      for first chapter page. In the book document class the first chapter page is of the `plain` page style. I thought I could do something like:               \usepackage[top=2cm, bottom=1.2cm, left=1.5cm, right=1.7cm]{geometry}     \newcommand\pagewithheader{       \newgeometry{top=2cm, bottom=1.2cm, left=1.5cm, right=1.7cm}       \renewcommand{\headrulewidth}{0.6pt}     }     \newcommand\pagewithfooter{       \newgeometry{top=1.2cm, bottom=1cm, left=1.5cm, right=1.7cm}       \renewcommand{\headrulewidth}{0pt}       \fancyhf{}       \fancyfoot[C]{\thepage}     }          \usepackage{afterpage}          \fancypagestyle{plain}{       \pagewithfooter       \afterpage{\pagewithheader}     }      But I get all links messed up and floats gone mad. I tried to build an MWE:               \documentclass[a5paper,twoside]{book}          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{Arial}     \setsansfont{Arial}     \setmonofont{DejaVu Sans Mono}          \usepackage{kantlipsum}          \usepackage[top=2cm, bottom=1.2cm, left=1.5cm, right=1.7cm]{geometry}     \newcommand\pagewithheader{       \newgeometry{top=2cm, bottom=1.2cm, left=1.5cm, right=1.7cm}       \renewcommand{\headrulewidth}{0.6pt}     }     \newcommand\pagewithfooter{       \newgeometry{top=1.2cm, bottom=1cm, left=1.5cm, right=1.7cm}       \renewcommand{\headrulewidth}{0pt}       \fancyhf{}       \fancyfoot[C]{\thepage}     }          \usepackage{fancyhdr}     % page style for a non-chapter pages:     \renewcommand{\rightmark}[1]{\markboth{#1}{}}     \renewcommand{\leftmark}[1]{\chaptername{}\thechapter}     \fancyhf{}     \fancyhead[LO]{\leftmark}     \fancyhead[RE]{\rightmark}     \fancyhead[LE,RO]{\thepage}     \pagestyle{fancy}          \usepackage{afterpage}     \fancypagestyle{plain}{       \pagewithfooter       \afterpage{\pagewithheader}     }          \begin{document}          \chapter{foo}          \kant[1-12]          \chapter{bar}          \kant[1-12]          \chapter{baz}          \kant[1-12]          \end{document}      But unforunetly it works. While I have a complex document with tens of links and floats -- and it doesn't (I think because of floats). What could it be? Perhaps somebody have a recipe to make the first chapter page to be of different geometry.


title: Longtable fill entire page

text: I'm using the `longtable` environment inside the `landscape` environment, as I have a large table, which spans several pages. However, I would like my table to fill out the entire page with little to no margin. Is this possible with longtable or another environment? Current version below.               \begin{landscape}         \begin{longtable}{|p{4cm}|p{4cm}|p{4cm}|p{1cm}|p{4cm}|p{5cm}|}             \hline             Interessent & Mål/interesse(r) & interesse/aktivitetsniveau & Magt & Konfliktpunkter & Håndtering/indragelse \\ \hline            ...            \\ \hline         \end{longtable}     \end{landscape}


title: Why doesn't my italics work?

text: Why doesn't my XeLaTeX document turn this word into italics? I simply can't figure it out.               \documentclass[12pt,letterpaper]{article}     \usepackage{ifpdf}     \usepackage{mla}     \usepackage[T2A]{fontenc}     \usepackage{setspace}     \usepackage[utf8]{inputenc}     \singlespacing     \usepackage{endnotes}     \usepackage{hyperref}     \begin{document}     \emph{hi}     \end{document}


title: italic doesn't admit line break latex

text: I am really new in Latex, I have the problem with italic, when I am using `\emph{.}` to make words italic, it doesnt admit to line break: ![enter image description here](http://i.stack.imgur.com/dvA5o.png) How can I use this problem? **UPDATE**               könnten in vier Bereichen klassifiziert werden: \emph{Beschreibung, Erklärung, Vorhersage} und \emph{Kontrolle}.\\\\     \textbf{Beschreibung:}\\


title: How can I use times fonts in Plain TeX?

text: I'd like to use Times fonts in Plain TeX. What would be the Plain-TeX equivalent of the LaTeX command `\renewcommand{\rmdefault}{ptm}`?


title: Uncover parts of a tree in TikZ

text: I'm trying to apply Daniel's method to uncover the bottom right part of the tree in the following MWE. However, when I pass the option `[visible on=<2->]` to one of the children, it appears to affect all the codes that follow: the children drawn after disappeared (which is what I wanted), the label `e` on the right edge disappeared (not what I wanted), and the next path (the dashed line) also disappeared (not what I wanted). What's the reason for this, and how can I fix it?               \documentclass{beamer}          \usepackage{tikz}       % Two node styles for game trees: solid and hollow       \tikzset{         solid node/.style={circle,draw,inner sep=1.0,fill=black},         hollow node/.style={circle,draw,inner sep=1.0}       }            % use option [visible on=<+->] to uncover parts of a tikzpicture       \tikzset{         invisible/.style={opacity=0},         visible on/.style={alt=#1{}{invisible}},         alt/.code args={<#1>#2#3}{%           \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path         },       }          \begin{document}          \begin{frame}          \centering     \begin{tikzpicture}[font=\scriptsize]       \tikzstyle{level 1}=[sibling distance=30mm]       \tikzstyle{level 2}=[sibling distance=12mm]       \tikzstyle{level 3}=[sibling distance=10mm]       \node(0)[hollow node,label=above:1]{}         child{node[solid node]{}           child{node[solid node,label=below:{$\binom{2}{1}$}]{}edge from parent node[left]{$c$}}           child{node[solid node,label=below:{$\binom{-1}{0}$}]{}edge from parent node[right]{$d$}}           edge from parent node[left]{$a\phantom{b}$}         }         child{node[solid node]{}           child{node[solid node,label=below:{$\binom{0}{0}$}]{}edge from parent node[left]{$c$}}           child{node[solid node,label=below:{$\binom{0}{1}$}]{}edge from parent node[right]{$d$}}           edge from parent node[left]{$b$}         }         child{node[solid node,label=right:2]{}     %%%%% The following part of the tree to be uncovered in slide 2 %%%%%           child[sibling distance=20mm,visible on=<2->]{node[solid node,label=left:1]{}             child{node[solid node,label=below:{$\binom14$}]{}edge from parent node[left]{$h$}}             child{node[solid node,label=below:{$\binom03$}]{}edge from parent node[right]{$i$}}             edge from parent node[left]{$f$}           }           child[sibling distance=20mm]{node[solid node,label=right:1]{}             child{node[solid node,label=below:{$\binom04$}]{}edge from parent node[left]{$j$}}             child{node[solid node,label=below:{$\binom23$}]{}edge from parent node[right]{$k$}}             edge from parent node[right]{$g$}           }           edge from parent node[right]{$\phantom{b}e$}         }       ;       \draw[dashed](0-1)--(0-2)node[midway,above]{2};     \end{tikzpicture}          \end{frame}          \end{document}      ![enter image description here](http://i.stack.imgur.com/tmrrz.jpg)


title: Accessing Mac (mactex) install folder

text: I am forced to use a Mac for a while. My log-file says my class file is in:               /usr/local/texlive/2010/texmf-dist/tex/latex/base/report.cls      Does this mean my packages are in this folder?               /usr/local/texlive/2010/      Also, the latex/base folder how do I access it? I can't find it in my finder. Sorry for this stupid questions but I'm not used to working on a Mac. Second question: what I have to do to get my class working? I am used to click the _Refresh DNB_ button on Miktex but that won't work on OS X.


title: Plotting multivariable functions with dependent variables in domain

text: Trying to plot a hyperboloid with domain `x^2+y^2 <= 50`. For now I have set the domain to [-5,5], but this yields ugly plots, see below. Any advice on how to get around this? I tried setting the domain in terms of x and y (and x domain in terms of y and vice versa), but to no avail. Ideally I would like to apply the same solution to the gradient vector field, should there be one.               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \begin{document}     \xdefinecolor{lightgrey}{RGB}{220,220,220}     \xdefinecolor{goldenrod}{RGB}{255,223,66}     \xdefinecolor{newblue}{RGB}{57,106,177}     \xdefinecolor{newred}{RGB}{204,37,41}     \xdefinecolor{newgreen}{RGB}{132,186,91}     \xdefinecolor{newpurple}{RGB}{144,103,167}     \begin{tikzpicture}[scale=1.2]     \begin{axis}[axis equal, view={0}{90}]     \addplot3[surf,shader=interp,opacity=0.5,domain=-5:5]     {(1/100)(50-x^2-y^2)};     \addplot [domain=0:2*pi,samples=50]({cos(deg(x))},{sin(deg(x))});     \addplot [domain=0:2*pi,samples=50]({2*cos(deg(x))},{2*sin(deg(x))});     \addplot [domain=0:2*pi,samples=50]({3*cos(deg(x))},{3*sin(deg(x))});     \addplot [domain=0:2*pi,samples=50]({4*cos(deg(x))},{4*sin(deg(x))});     \addplot [domain=0:2*pi,samples=50]({5*cos(deg(x))},{5*sin(deg(x))});     \addplot [domain=0:2*pi,samples=50]({6*cos(deg(x))},{6*sin(deg(x))});     \addplot [domain=0:2*pi,samples=50]({7*cos(deg(x))},{7*sin(deg(x))});     \addplot[newpurple,double=newpurple,->] plot coordinates {         (0,0)         (-1,3)     };     \addplot[newblue,double=newblue,->] plot coordinates {         (0,0)         (7,-1)     };     \addplot[newred,double=newred,->] plot coordinates {         (7,-1)         (-1,3)     };     \addplot+[newred,double=newred] plot coordinates {         (1,2)     };     \addplot[newgreen,double=newgreen] plot coordinates {         (-3,-6)         (3,6)     };     \addplot3[blue,/pgfplots/quiver,         quiver/u=-x/50,         quiver/v=-y/50,         quiver/scale arrows=0.1,         -stealth,samples=10] {1};               \end{axis}     \end{tikzpicture}     \end{document}      ![Plot](http://i.stack.imgur.com/uFA7g.png)


title: LaTeX XY positioning

text: I have not been using latex in a while and I would like to try to implement the tips & tricks given in this video during the TUG conference by Jean Luc Doumont : http://www.youtube.com/watch?v=vkBCeOBbAmM I tried to implement the first trick: xy positioning               \documentclass[a4paper,11pt]{article}     \usepackage[utf8]{inputenc}     \begin{document}          \def\xy#1#2#3{\setbox0=\hbox to\z@{%     \kern#1\raise#2\hbox{#3}\hss}%     \ht0=\z@\dp0=\z@\box0}               %testing the command     \xy 1 5 b               \end{document}      unfortunately I get the following error log               ! Undefined control sequence.     \xy #1#2#3->\setbox 0=\hbox to\z                                       @{\kern #1\raise #2\hbox {#3}\hss }\ht 0=\z...     l.29 \xy 1 5 b          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Missing number, treated as zero.     <to be read again>                         @     l.29 \xy 1 5 b          A number should have been here; I inserted `0'.     (If you can't figure out why I needed to see a number,     look up `weird error' in the index to The TeXbook.)          ! Illegal unit of measure (pt inserted).     <to be read again>                         @     l.29 \xy 1 5 b          Dimensions can be in units of em, ex, in, pt, pc,     cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!     I'll assume that you meant to say pt, for printer's points.     To recover gracefully from this error, it's best to     delete the erroneous units; e.g., type `2' to delete     two letters. (See Chapter 27 of The TeXbook.)          ! Missing { inserted.     <to be read again>                         @     l.29 \xy 1 5 b          A left brace was mandatory here, so I've put one in.     You might want to delete and/or insert some corrections     so that I will find a matching right brace soon.     (If you're confused by all this, try typing `I}' now.)          ! Illegal unit of measure (pt inserted).     <to be read again>                         \raise      l.29 \xy 1 5 b          Dimensions can be in units of em, ex, in, pt, pc,     cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!     I'll assume that you meant to say pt, for printer's points.     To recover gracefully from this error, it's best to     delete the erroneous units; e.g., type `2' to delete     two letters. (See Chapter 27 of The TeXbook.)          ! Illegal unit of measure (pt inserted).     <to be read again>                         \hbox      l.29 \xy 1 5 b          Dimensions can be in units of em, ex, in, pt, pc,     cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!     I'll assume that you meant to say pt, for printer's points.     To recover gracefully from this error, it's best to     delete the erroneous units; e.g., type `2' to delete     two letters. (See Chapter 27 of The TeXbook.)          ! Undefined control sequence.     \xy ...{\kern #1\raise #2\hbox {#3}\hss }\ht 0=\z                                                        @\dp 0=\z @\box 0     l.29 \xy 1 5 b          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Missing number, treated as zero.     <to be read again>                         @     l.29 \xy 1 5 b          A number should have been here; I inserted `0'.     (If you can't figure out why I needed to see a number,     look up `weird error' in the index to The TeXbook.)          ! Illegal unit of measure (pt inserted).     <to be read again>                         @     l.29 \xy 1 5 b          Dimensions can be in units of em, ex, in, pt, pc,     cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!     I'll assume that you meant to say pt, for printer's points.     To recover gracefully from this error, it's best to     delete the erroneous units; e.g., type `2' to delete     two letters. (See Chapter 27 of The TeXbook.)          ! Undefined control sequence.     \xy ...raise #2\hbox {#3}\hss }\ht 0=\z @\dp 0=\z                                                        @\box 0     l.29 \xy 1 5 b          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Missing number, treated as zero.     <to be read again>                         @     l.29 \xy 1 5 b          A number should have been here; I inserted `0'.     (If you can't figure out why I needed to see a number,     look up `weird error' in the index to The TeXbook.)          ! Illegal unit of measure (pt inserted).     <to be read again>                         @     l.29 \xy 1 5 b          Dimensions can be in units of em, ex, in, pt, pc,     cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!     I'll assume that you meant to say pt, for printer's points.     To recover gracefully from this error, it's best to     delete the erroneous units; e.g., type `2' to delete     two letters. (See Chapter 27 of The TeXbook.)          ! Missing } inserted.     <inserted text>                      }     l.32 \end{document}      and I can't figure out what is the mistake since I never programmed macros before.


title: ConTeXt: Part, chapter, section, and subsection names

text: # Background Looking to include the section within an index. # Problem In LaTeX the `nameref` package allows coding a contextual macro called `\currentname`. This allows users to refer to the current section (or chapter, or part) without needing to type it in explicitly. Ultimately, I'd like to include the current name in the index. For example:               \starttext          \placeindex     \page [yes]          \startchapter[title={Title1},]     \index{item+\currentchaptername}     \input knuth     \stopchapter          \startchapter[title={Title2},]     \index{item+\currentchaptername}     \input knuth     \stopchapter          \stoptext      Being able to reference the chapter title indirectly has other uses than the one given above. # Question What is the equivalent to `\currentname` in ConTeXt? # Ideas I have tried: `\the\chapter`, `\show\thechapter`, `\thechapter`, `\currentchaptername`, etc. I have also looked at `\nameref{marker}`, but that, even if it worked, seems like an obtuse solution. # Related Some related information:   * http://tex.stackexchange.com/a/62252/2148   * http://wiki.contextgarden.net/References   * http://wiki.contextgarden.net/Command/currentheadnumber   * http://www.mail-archive.com/ntg-context@ntg.nl/msg55192.html   * How to place chapter titles in the header only on the first page of each chapter in ConTeXt?


title: siunitx and engineering 'E' notation

text: Is it possible to use the `siunitx` package to typeset numbers with the "E" notation so that the output might look like               1E3      instead of               1 x 10^3


title: \hfill after linebreak

text: I have a simple text. Right after the end of the text I use \hfill to get some words right aligned.                \documentclass[11pt]{article}              \begin{document}             Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est             \hfill             \textbf{some words}         \end{document}      * * * The problem is now that when the text ends at the end of the line, the words after \hfill won't be right aligned anymore.               \documentclass[11pt]{article}          \begin{document}         Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.         \hfill         \textbf{some words}     \end{document}      How can I achieve the words to be right aligned even if the text fits the line?


title: Count number of paragraphs in command argument

text: Is there a way to count the number of paragraphs in a command argument? I would like to make a command doing something like this:               \newcounter{\numberofparagraphs}       \newcommand{\testcmd}[1]{           \setcounter{\numberofparagraphs}{ ???? }           \ifthenelse{\equal{\numberofparagraphs}{1}}             { \testcmdOneParagraph{#1} }             { \testcmdMoreThenOneParagraph{#1} }       }      So if the input argument is only one paragraphs the command will do one thing and otherwise it will do another thing. Is this possible?


title: Does a workaround or solution exists for the label conflict of circuitikz and TikZ?

text: I would like to use circuitikz with TikZ. However, I find that circuitikz modifies or does not recognize TikZ labels. The author of circuitiz has commented that in the "released version of CircuiTikz (0.2.3) the problem has been fixed." But the problem still exists. Does a workaround or solution exists for the label conflict of circuitikz and tikz? Here is a simple example using TikZ v2.10 and circuitikz v0.23. Instead of getting a resistor labeled `R1` below it, I get a resistor labeled info above it when circuitikz is active. It makes no difference which environment is used, tikzpicture or circuitikz.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{circuits.ee.IEC}     \usepackage{circuitikz}     \usepackage{siunitx}     \begin{document}     \begin{tikzpicture}[circuit ee IEC,         set resistor graphic    = var resistor IEC graphic]     \draw (0,0) to[resistor={info'={$R_1$}}] (2,0);     \end{tikzpicture}     \end{document}


title: How to get a picture with text to the right of it

text: what I want is to have a quote like this: > I returned and saw under the sun, that the race is not to the swift, nor the > battle to the strong, neither yet bread to the wise, nor yet riches to men > of understanding, nor yet favour to men of skill; but time and chance > happeneth to them all. Then underneath that quote I want a small picture of god, lets take this one ![enter image description here](https://encrypted- tbn3.gstatic.com/images?q=tbn%3aANd9GcSDNYZPAfpK3Tn2BS5_zcpfMR-D8Z3L3YM- LiiS2CwKSPbbdXaAEw) And to the right of that image of god I want the reference of the quote (above **both** the image and the reference) > Ecclesiastes 9:11 I can obviously quote the text, and I can put the reference to the right of the image with the `sidecap` package, and I can position the figure under the quote with the `[H]` property. I can also wrap text around images. But apparently `SCfigure` does not accept `H`, and then I get that ugly `Figure. 1` next to the reference, and if there are multiple images there is no guarantee of the outcome. Word wrap also does not guarantee that the reference is next to the correct image. How Can I achieve this in some meaningful way.


title: Add an asterisk in front of section label in TOC

text: Could you please tell me how to make the table of content like this: > Preface..................................i > > Chapitre 1. Les décisions ................1 > > 1.1 Bla bla bla ........................6 > > 1.2 Bla bla bla ........................7 > > Chapitre 2. Les conférence ...............10 > > 2.1 Bla bla bla ........................16 > > *2.2 Bla bla bla ........................17 > > 2.3 Bla bla bla ........................19 > > *2.4 Bla bla bla ........................21 > > 2.5 Bla bla bla ........................25 > > Conclusion ...............................30 > > Appendix A ...............................35 > > Bibliographie ............................40 The section 2.2 and 2.4 prefix an asterisk to denote a `hard` level. The header mark is same as in TOC.


title: Can I get a \widebar without using the mathabx package?

text: One can use `\bar` to put a bar over a letter in math mode, but often the bar isn't wide enough. An alternative is `\overline`, but this isn't an _accent_ , so it doesn't take into account the skew of the letter. In the following example, the bar extends too far to the left: ![](http://i.stack.imgur.com/MK7Pf.png) Now the `mathabx` package offers a `\widebar` accent, but this has several drawbacks:   1. `mathabx` changes a lot of other things,   2. The `\widebar` sits slightly higher than `\bar` and `\overline`,   3. In previewers (checked with `kpdf` and `acroread`), the `\widebar` appears fuzzy, which `\bar` and `\overline` don't. So my question is: How can I put a wide bar over a letter in math mode without the above drawbacks?


title: Make the enlarged digit vertically centered in normal text (digits almostly) height.

text: I want a digit inside around other digits could centered vertically in height, without affecting by normal font size setting, as image show: ![enter image description here](http://i.stack.imgur.com/cHY1H.png) (The enlarged six is `{\Large6}`) but I couldn't get the result by using the `\raisebox` command and the `ex` length unit to raise. Please help!


title: Remove top and bottom margin in tabular (around lists)

text: If I create a table with several (short) lists, currently I'm using a table construction with enumitem to (almost) remove the left margin. Now I still have a rather large margin at the top and the bottom (above and below) of the itemize lists. Is there any way I can instruct either the itemize list or the table to remove this margin as well? Code example:               \begin{tabular}{|m{3cm}|p{5.5cm}|p{5.5cm}|}        \hline         Category 2 &         \begin{itemize}[leftmargin=*]             \item A             \item B         \end{itemize} &         \begin{itemize}[leftmargin=*]             \item C             \item F         \end{itemize} \\        \hline     \end{tabular}


title: Contour plot: ignored columns, wrong color-assignment, 1D-interpolation

text: This forum has often been of a great help for me, but i never posted myself. So please excuse me, if i won't stick to every formality here perfectly. I will do my best. I hope it's ok that i have 3 different questions on one plot. I try to create a surface plot by means of `\addplots3[surf]` and a coordinate table of the form _x y z_. Whereas _x_ is a more or less continous variable, _y_ contains only 10 columns representing 10 different functions of _x_. _z_ is nothing but an intensity which i want to display via a color map. My source code is the following                \documentclass{article}     \usepackage{pgfplots}     \usepackage{tikz}     \pagestyle{empty}          \pgfplotstableread{carvon-contour.txt}\carvon          %data are of the form     %     %282.7  1   0.0007976728     %282.7  2   0.0007010106     %282.7  3   0.0002862722     %282.7  4   0.0010733289     %282.7  5   0.0004453488     %282.7  6   0.0005347549     %282.7  7   0.0006696946     %282.7  8   0.0008733782     %282.7  9   0.0005243997     %282.7  10  0.0005450571     %282.740201005  1   0.0008267864     %282.740201005  2   0.0007236548     %282.740201005  3   0.0002901354     %282.740201005  4   0.0011133781     %282.740201005  5   0.0004554805     %282.740201005  6   0.0005512185     %282.740201005  7   0.0006887026     %282.740201005  8   0.000905994     %282.740201005  9   0.0005406747     %282.740201005  10  0.0005593566     %...          \begin{document}          \begin{tikzpicture}         \begin{axis}         [             view={0}{90},             colormap/bluered,             minor x tick num=3,                      xmin=283.8,             xmax=289.3,             minor y tick num=0,             ymin=0,             ymax=11,             colorbar       ]         \addplot3[surf, mesh/cols=10, shader=flat] table {\carvon};     \end{axis}     \end{tikzpicture}          \end{document}      Whereas the output is this: ![](http://i.stack.imgur.com/NeVRH.png) As one can see the plot displays only 9 of 10 columns. Can someone see a reason for that? Now, the colormap ranges from 0 to about 0.28 just as the data do, but somehow the colors of the plot only reach to about 0.16 (yellow). Does pgfplots perform kind of a binning so that peak values of greater than 0.2 are averaged to lower values? Or did i miss something else? And most important: how to get rid of it? Last but not least: As i said before, the _x_ -axis is continious, whearas _y_ is not. Is there a way of interpolating the data along the x-axis in order to obtain a smoother curve, but not along the y-axis at the same time? `shader=interp` interpolates in both directions. Thanks for your help!!


title: Keycommand package - \commandkey{mykey} doesn't expand

text: _UPDATED, see edit history for completeness_ I'm trying out the keycommand package but it's not working as expected. There seems to be some incompatibility with tables, but I've read and re-read the documentation and I can't figure out what it is. I've built a minimal example of what I'm doing. It's using `longtable`, since those seem to work a little better than regular ones and since that is what I need it to work with (for now):               \documentclass{article}     \usepackage{longtable}      \usepackage{keycommand}          \newkeycommand\mycommand[first=one,second=2][1]{%     #1 \\         First: \commandkey{first} & second: \commandkey{second}%     }          \begin{document}     \begin{longtable}{ll}     \mycommand{hello} \\     \mycommand[first=1,second=two]{world!}     \end{longtable}     \end{document}      The problem is that instead of outputting the parameter values, it outputs the parameter _names_ :               EXPECTED OUTPUT                      ACTUAL OUTPUT     ***************                      *************     hello                                hello     First: one    second: 2              first: first        second: second     world!                               world!     First: 1      second: two            first: first        second: second      Why does it do this? What can I do about it?


title: How to align TikZ picture and text side by side

text: I want to add a `TikZ` picture beside a text block               \documentclass{article}     \usepackage{lipsum}     \usepackage{tikz}     \begin{document}       \lipsum[1]     \begin{tikzpicture}[color=white]     \node[fill=blue!70,rotate=90] at (0,0) {Vertical Text on Left};     \end{tikzpicture}       \lipsum[2]       \lipsum[3]     \end{document}      but with this structure, the TikZ` picture is inserted at the first line of text, instead of placing side by side. ![enter image description here](http://i.stack.imgur.com/LetAU.png) One solution can be using packages like `wrapfig` to wrap the text around picture. Isn't there any easier solution to place `TikZ` figure beside text?


title: Getting classicthesis to fit within required margins

text: Our university's formatting requirements for dissertations require us to use the following margins (A4 format):   * left: 4.3 cm   * right: 4.3 cm   * top: 5 cm   * bottom: 4.7 cm These pages in A4 format will then be cropped again to fit into a 17cm x 24 cm format with 2 cm margins on the left, right, top and bottom side. I got this to work by adding the following to `ClassicThesis.tex`:               \usepackage[left=4.3cm,right=4.3cm,top=5cm,bottom=4.7cm,includehead,includefoot]{geometry}      I also used the `linedheaders` option to get the chapter number to fit nicely within the margin. However, I was wondering if there's a better way to do this? For one, given these margins, the overal font size seems a bit big now. Thanks!


title: LyX & MiKTeX installation problems on Windows 7

text: I'm having problems installing LyX on Windows 7. It gets to the point of alerting me that it's going to install MiKTeX, and after I've hit OK it aborts with the following error: > No LaTeX-distribution could be found!   >  LyX cannot be used without a LaTeX-distribution like "MiKTeX"!   >  The installation will therefore be aborted. Then, it proceeds to delete all the files it had already extracted, but hangs at deleting the LyX subfolder under Program Files (x86). Figuring I might be able to work around this by manually installing MiKTeX, I downloaded the latest version of MiKTeX and ran _that_ installer. Near the end of this installation, the MiKTeX Setup Wizard throws an error: > The operation could not be completed for the following reason:   >  Windows API error 5: Access is denied.   >  Details: C:\Program Files\MiKTex 2.9\miktex/bin/x64\initexmf.exe I am logged in as an Administrator, and I've tried running both installers with Administrator rights. I've tried disabling all security software during the installation, and tried both the "all users" and "only for me" installation options. I switched to trying the 32-bit version of MiKTeX and still got the same error. This is the end of the install log: > "C:\Program Files (x86)\MiKTeX 2.9\miktex/bin\initexmf.exe" --common- > install="C:\Program Files (x86)\MiKTeX 2.9" --rmfndb --admin --log- > file="C:\Program Files (x86)\MiKTeX 2.9\miktex\config\uninst.log" --verbose: > > An error occurred: source file: Libraries\MiKTeX\Core\win\winProcess.cpp > source line: 366 message: Windows API error 5: Access is denied. > > info: C:\Program Files (x86)\MiKTeX 2.9\miktex/bin\initexmf.exe I also tried the Registry permissions hack suggested here to no avail. While I am (obviously) willing to try installing MiKTeX separately, I'd much rather get everything installed via the LyX bundle. I have had Lyx installed on this system previously (though it has been reformatted since), and don't recall having this much trouble.


title: Compiling same project gives different result after 2 months

text: Ok, here's the deal. In December I finished writing a long document. I compiled it and went on vacations. I get back and after 2 I months compiled **the exact same project** with absolutely nothing changed and I get a different output. Trust me, I've changed **nothing** , not even the steps I use to compile. This is what the different versions look like: ![WTF!](http://i.stack.imgur.com/5PHah.png) The one on the left is the old version and the one on the right the new one. The only thing I can recall that changed in between both these files being created is that I upgraded from Ubuntu 12.04 to Ubuntu 12.10, nothing more. The files are being displayed in `Okular` by the way. You'll notice that now every hyperlink has its own rectangle around it. Now where in god's name this came from I have **absolutely no idea**. The pages now begin a little lower in the page (ie: the top margin has somehow increased), which made the total number of pages go from 194 to 203. What the hell is happening here?? Please help. I can't upload all the files because the whole project is humongous but I can upload the file which contains the bulk of the packages and options being used: here. I'm getting this warning related to `hyperref` which I swear wasn't an issue before:               Package hyperref Warning: Invalid value `0'     (hyperref)                for option `pdfborder'.     (hyperref)                Option setting is ignored on input line 3941.          )          Package hyperref Message: Driver (autodetected): hpdftex.      PS: Also (for those of you who use Linux) the text inside the file is only searchable through Adobe Reader. `Okular` will only search text _inside_ images (WTF!)


title: How does \pgfdecoratedpathlength work?

text: I am trying to understand how it works the decoration pgf module, in order to solve the unanswered question Fiber-Optic-Style decoration. I am having an hard time with some macros, for example `\pgfdecoratedpathlength`. Look the following MWE, from what I read on the pgfmanual version 2.10, the options (1), (2) and (3) should be equivalent, but only (2) works, while I get 100 errors for the others.               \documentclass[a4paper]{article}          \usepackage{pgf,pgfsys,pgffor}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{tikz}     \usepgfmodule{decorations}     \usetikzlibrary{intersections,arrows,decorations,snakes}               \pgfdeclaredecoration{fiber}{initial}     {         \state{initial}[             switch if less than=\pgfdecoratedpathlength/2 to final %% (1)             %width=\pgfdecoratedpathlength/2 %% (2)             %width=.5\pgfdecoratedpathlength %% (3)             ]{             \pgflineto{\pgfpoint{5pt}{15pt}}             \pgflineto{\pgfpoint{5pt}{-15pt}}         }         \state{final}{             \pgfpathlineto{\pgfpointdecoratedpathlast}         }     }          \begin{document}     \begin{tikzpicture}[decoration={fiber, amplitude=1cm}, draw=red]     \draw[->,decorate] (3, 5mm) -- ++(4,0); %% ERROR! Undefined control sequence. <argument> \pgf@decorate@width     \draw[->,decorate] (3,0)    -- ++(3,0);     \draw[->,decorate] (3,-5mm) -- ++(2,0);     \draw[->,decorate] (3,-1cm) -- ++(1,0);     \draw[->,decorate] (3,-1.5cm) -- ++(0.5,0);     \end{tikzpicture}          \end{document}      The first error is `Undefined control sequence. <argument> \pgf@decorate@width` , in the first draw. Any ideas?


title: How do I tell which version of a command to use?

text: So LaTeX has a lot of commands that do very similar things. Often this is a result of some of these being old. For example: `$x^2$` vs `\\(^2\\)`; As I understand it, the second example is the more modern version and should be used when possible. Other examples: `\it` vs the more modern `\itshape` and the one I'm actually supposed to use `\textit{}` I've heard enough mention of these that I think I know which one I'm supposed to use; however, there are also things like `\begin{center}` vs `\centering` where it is contextual (Due to vertical spacing) These are examples I picked off the top of my head; `$$...$$` vs `\\[...\\]` vs `\begin{equation}...\end{equation}` is another one that someone mentioned below. Is there an easy way to tell which command I'm supposed to use when? For stuff from packages, it is usually easy to look at the manuals and see which is more up to date, but what about core LaTeX stuff? Is there a list of when to use various versions of commands? Or better yet, a general rule of thumb so I can tell if I should be learning a new way to do things?


title: PGFPlots: line opacity gradient?

text: Imagine a very simple PGFPlot, e.g.:               \begin{tikzpicture}     \begin{axis}         \addplot+[no marks]{x^2};     \end{axis}     \end{tikzpicture}      How can I have the line "fade out" from the left to the right of the axis? I.e., how can I gradually vary the opacity of the line depending on the position on the x-axis? I have managed to achieve this with the markers on a scatter plot with the following code:               \begin{tikzpicture}     \begin{axis}[         scatter/@pre marker code/.code= {\expandafter\scope\expandafter[opacity=0.1+\pgfplotspointmetatransformed/1000]},         scatter/@post marker code/.code={\endscope},     ]         \addplot+[scatter, only marks] {x^2};     \end{axis}     \end{tikzpicture}      But I cannot do it with a "no marks" line plot. Ideally, I would like the colour of the line to be defined by the cycle list (rather than having to use a custom made gradient).


title: LuaTeX hpack_filter callback not triggering on certain hlist creations

text: **EDIT: The hpack_filter is triggered and my question pointless. Consult my answer on why I missed the callback invocation.** I am using LuaTeX to analyze the creation process of math expressions in a document. To this effect, I use the `mlist_to_hlist` callback to insert a `whatsit` node into the node list. When the math expressions are assembled into their final form by packing various node lists into horizontal and vertical lists, I hook into this process with `hpack_filter` and `vpack_filter` callbacks. This allows me to follow the creation path from the raw math expression all the way to the final page. I encounter an issue with a specific part of this process. It seems that the rows of an `align`-math-environment, are added to the main vertical list as horizontal lists with a specific subtype. These `hlist` nodes have subtype 4, which is described as 'alignment column or row' in the LuaTeX documentation. My problem now is that the creation of exactly these `hlist`s is not filtered with the `hpack_filter` callback. For all other `hlist` types I get the expected invocation of `hpack_filter` but not for these. For my purposes, it already suffices to check the input arguments of this process for the occurrence of certain `whatsit` node and then completely cancel the packing. The goal is to not have this content transferred to the main vertical list. This leads to my **questions** :   * Why is `hpack_filter` not called for the creation of an `hlist` with subtype 4?   * Is it possible to enable such a behavior or to somehow obtain an equivalent callback mechanism by other means?


title: How to remove space between a specific image and its caption

text: In this post (How to reduce space between image and its caption?) there is an excellent explanation about the way you can reduce space between figures and its captions. The problem is it works for every figure in the document. How could I change the space between a specific image (just one) and its caption? Thanks.


title: How to have aligned equations in a caption?

text: The following is my MWE, inspired from the answer to this question (where my query seemed to merit a separate question, so here it is!):               \documentclass{article}     \usepackage{caption}     \usepackage{amsmath}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows,shapes,calc,intersections,through,backgrounds}          \begin{document}     \begin{figure}[b]        \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]                       % More stuff here - not relevant I think...            \end{tikzpicture}        \caption{\label{q}\leavevmode\\\begin{minipage}{\linewidth}              \begin{align*}                 a &= b \\ c &= d              \end{align*}           \end{minipage}        }     \end{figure}     \end{document}      With the above, I'm getting the following error:               ! Argument of \@caption has an extra }.     <inserted text>                     \par     l.19    }      I'm not sure how to debug this!


title: Table in a mathematical paper

text: I write a paper for a course and have some trouble with a table. As you can see the table fits not well into the document: ![enter image description here](http://i.stack.imgur.com/ESEb3.png) It would be appreciated if someone could tell me how to fix this problem. Here is a test code:               % /usr/local/doc/tex-inputs/latex/notes/paper.tex          % An example showing how to prepare an article using AMSLaTeX.     % Stephen G. Simpson, Fall 1995.     % Please send any comments or questions to simpson@math.psu.edu.          % Lines beginning with a percent sign are comments.  LaTeX ignores them.          % Begin by declaring a document class and options.          \documentclass[12pt,oneside]{amsart}          % \documentclass{amsart} says to use the AMS article document class.     % [12pt,oneside] says to use the 12pt and oneside options.     % If you don't want these options, just say \documentstyle{amsart}.          % After the document class declaration comes the preamble.     % The preamble begins here.             % First we activate any packages that we may need.        %        % The amssymb package provides \mathbb and other        % math symbols.  The amsmath package provides sophisticated math        % constructions.  The amsthm package provides \theoremstyle and        % the \proof environment.        %        % The amsmath and amsthm packages are automatically activated by        % \documentclass{amsart}, so there is no need to activate them here.                \usepackage{amssymb}           \usepackage{graphicx}   % if you want to include graphics files           \usepackage{amsmath}           \usepackage{amsthm}           \usepackage{amsfonts}           \usepackage[english]{babel}           \usepackage[utf8]{inputenc}           \usepackage{enumerate}           \usepackage{color}           \usepackage[pdftex,citecolor=green,linkcolor=red]{hyperref}           \usepackage{aliascnt}           \usepackage{tikz}                       % Next we use \newtheorem to specify our theorem-like environments        % (theorem, definition, etc.) and how to display and number them.        %        % Note: The \theoremstyle declarations affect the appearance of the        % Theorems, Definitions, etc.                \theoremstyle{plain}           \newtheorem{theorem}{Theorem}[section]           \newtheorem{lemma}[theorem]{Lemma}           \newtheorem{corollary}[theorem]{Corollary}                \theoremstyle{definition}           \newtheorem{definition}[theorem]{Definition}            \theoremstyle{proposition}           \newtheorem{proposition}[theorem]{Proposition}                \theoremstyle{remark}           \newtheorem{remark}[theorem]{Remark}             % The preamble is also a good place to define new commands and macros.        % This part of the preamble is strictly optional according to your taste.                \newcommand{\R}{{\mathbb R}}           \newcommand{\nil}{\varnothing}             % The following mysterious maneuver gets rid of AMS junk at the top        % and bottom of the first page.                \makeatletter           \def\@setcopyright{}           \def\serieslogo@{}           \makeatother          % This ends the preamble.  We now proceed to the document itself.          \begin{document}                            \section{Test code}                    \begin{proof}           Together with the inductive result of Lemma \ref{induction} this implies in all cases that $\mathcal{P}$ is one of optimal, unbounded, or feasible:     \begin{table}[htbp]     \begin{tabular}{|cc|p{2cm}cccp{2cm}|}     \hline     \textbf{}               &            &                                                 & $\mathcal{P}/e$              & \multicolumn{1}{c|}{}                                                   \\                             &            & optimal                                         & \multicolumn{1}{|c|}{unbonuded}      & \multicolumn{1}{|c|}{infeasible}                                        \\ \hline                             & optimal    & optimal Lemma \ref{induction} i)                & \multicolumn{1}{|c|}{(not possible)} & \multicolumn{1}{|c|}{optimal or infeasible Lemma \ref{induction} ii)}   \\ \cline{2-5}      $\mathcal{P}\backslash e$ & unbounded  & unbounded or optimal Lemma \ref{induction} iii) & \multicolumn{1}{|c|}{unbounded}      & \multicolumn{1}{|c|}{unbounded or infeasible Lemma \ref{induction} iv)} \\ \cline{2-5}                              & infeasible & (not possible)                                  & \multicolumn{1}{|c|}{(not possible)} & \multicolumn{1}{|c|}{infeasible}                                        \\ \hline     \end{tabular}     \end{table}     \end{proof}      \bibliographystyle{plain}        \bibliography{references}          \end{document}      You will get unresolved citation which doesn't matter.


title: On arrows in Tikz cd

text: So I am getting used to using tikz-cd package to draw relatively straightforward commutative diagrams. I have two questions. **Question 1** Here is the code:               \documentclass[10pt, draft]{amsart}     \usepackage{pgf}     \usepackage{tikz}     \usepackage{tikz-cd}     \usetikzlibrary{arrows, matrix}     % With tons of other packages not relevant here I guess     \begin{document}      % With some text ....     \[      \begin{tikzcd}     Y \arrow[dashrightarrow]{d} \arrow{rd} &  \\     Y_{0} \arrow{r}{\pi_{0}} & X \\     \end{tikzcd}     \]     \end{document}       What happens here is that the arrow tips for the diagonal arrow is extremely light compared to the other two, you can see that in the picture below. I would like to know how to fix that. ![enter image description here](http://i.stack.imgur.com/61oZC.png) **Question 2** In the following diagram, (which also suffers from the same issues of question 1 above), I would want to fix the hook on the arrow labelled i so that it points the correct way (and perhaps make it more prominent). ![enter image description here](http://i.stack.imgur.com/0kyVU.png) Here is the code I am using for that part.                 \[       \begin{tikzcd}[column sep =small]              &  (X_{0},x) \arrow[hookrightarrow]{dl}{i}    \arrow[hookrightarrow]{dr}{i^{\prime}}   &   \\             (X,x) \arrow{dr} \arrow{rr}  &      & (X^{\prime}, x) \arrow{dl} \\                          & (U,u)   &                      \end{tikzcd}           \]      Thanks for the help!


how can i make the marginpar note have a number like footnote command does? just like this picture show, ![this picture is going to show the marginpar note have the auto numbered label like footnote command does](http://i.stack.imgur.com/yaEKU.png)


title: Bad layout with both lettrine module and builtin initals in two column setup in ConTeXt

text: I am seeing broken positioning of letters produced by the `lettrine` module. Here is my MVE:               \setuppapersize[A4][A4]     \usemodule[lettrine]          \definehead[recipe][section]     \setuphead[recipe][       beforesection={\startcolumns[n=2, rule=on]},       aftersection={\stopcolumns}]          \definenumber[stepnum][way=bytext,prefix=no]          \definestartstop[steps][       before={\startsubsubsubject[title={Příprava}]\setnumber[stepnum]{1}},       after={\stopsubsubsubject}]          \definestartstop[step][       before={\lettrine[Lines=3]{\getnumber[stepnum]}{}},       after={\incrementnumber[stepnum]}]          \starttext     \startrecipe[title={Bábovka}, reference={babovka}]       \startsteps         \startstep           A word word word word.         \stopstep              \startstep           Another word word word word word word word word word word word           word word word word word word word word word word word word word           word word word word word word word word word word word word word           word word word.         \stopstep              \startstep           Yet another word word word word word word word word word word           word word word word word word word word word word word word word           word word word word word word word word word word word word word           word word word word word word word word.         \stopstep       \stopsteps     \stoprecipe          \stoptext      And here is a screenshot: ![Lettrine problem](http://i.imgur.com/wJTFcid.png) Can I fix it anyhow or is this the `lettrine` module problem? * * * **UPDATE** The `\setnumber[stepnum]{1}` in the source should be `\setnumber[stepnum][1]`. But this does not fix the problem. * * * **UPDATE 2** While using `\placeinitial` works better, it still has some problems in the two column layout: ![Imgur](http://i.imgur.com/CMOEvLl.png?1) Please notice the **2** and the extra vertical space at the beginning of the second column. Here is my updated MVE:               \setuppapersize[A4][A4]     \usemodule[lettrine]          \definehead[recipe][section]     \setuphead[recipe][       beforesection={\startcolumns[n=2, rule=on]},       aftersection={\stopcolumns}]          \definenumber[stepnum][way=bytext,prefix=no]          \definestartstop[steps][       before={\startsubsubsubject[title={\bf Příprava}]\setnumber[stepnum][1]},       after={\stopsubsubsubject}]          \definestartstop[step][       before={\lettrine[Lines=2]{\getnumber[stepnum]}{}},       after={\incrementnumber[stepnum]}]          \setupinitial[font=Regular sa 2.5,distance=1pt,state=start,n=2]          \definestartstop[xstep][       before={\placeinitial {\getnumber[stepnum]}{}},       after={\incrementnumber[stepnum]}]          \starttext     \startrecipe[title={Bábovka}, reference={babovka}]       A word word word word. A word word word word. A word word word       word. A word word word word. A word word word word. A word word word       word. A word word word word. A word word word word.            \startsteps         \startxstep           A word word word word.         \stopxstep              \startxstep           Another word word word word word word word word word word word           word word word word word word word word word word word word word           word word word word word word word word word word word word word           word word word.         \stopxstep              \startxstep           Yet another word word word word word word word word word word           word word word word word word word word word word word word word           word word word word word word word word word word word word word           word word word word word word word word.         \stopxstep       \stopsteps     \stoprecipe          \stoptext


title: mdframed is causing wrong alignment at the bottom of pages

text: If you would be so kind to compile this LaTeX document:               \documentclass[a4paper,11pt]{book}          \usepackage[paper=a4paper,twoside=true,lmargin=4cm,     rmargin=4cm,bindingoffset=0cm]{geometry}          \usepackage{mdframed,lipsum,kantlipsum}     \mdfsetup{font=\small}          \begin{document}     \kant[1-8]               \begin{mdframed}     \kant[1-5]     \end{mdframed}          \end{document}      You will find that the bottoms of pages 2 and 3 are misaligned as follows: ![misaligned pages](http://i.stack.imgur.com/W2QKZ.png) Questions:   1. Shouldn't the space between the paragraph and the frame on page 3 expand such that the bottoms align? Why does this not take place?   2. How would you add a flexible (zero, plus something flexible if needed, just like for paragraph spacing) space above the mdframed box too? That would put a less strain on the space between the paragraphs, assuming I resolve question 1 above.


title: Remove the ugly borders and set different colors to hyperlinks using elsarticle template

text: I am using the `elsarticle` template to write something. I want to remove the ugly border and use different colors instead. My setting is as follows:               \usepackage[colorlinks=true,linkcolor=red,citecolor=green]{hyperref}      The results is that ugly borders disappear but the all of `linkcolor` and `citecolor` are blue despite of no blue setting. Any suggestion is greatly appreciated. Thanks in advance!


title: Reduce spacing between citations with unsrt bibliography style

text: I am using `\bibliographystyle{unsrt}` with LaTeX (using TeXShop on a Mac) in a document with `\documentclass{article}` and I find that my bibliography is taking up a lot of space because there is a blank line between every bibliographic entry. How can I most easily remove these blank lines between entries? Do I have to use a custom .bst file? Placing the `\bibliography` command in a `singlespacing` environment does not help, and changing the value of `parskip` there doesn't do anything. My problem is similar to the one described here, except the solution posted there isn't working for me.


title: Restricting the length of a line of text while allowing line breaks

text: While attempting to answer this question, I re-read Chapter 14 of The TeX Book (on how TeX breaks paragraphs into lines). It got me thinking: Is there a way to restrict the length of a string of text while still allowing that text to be broken across lines? For example, let's say I want to typeset "Lorem Ipsum Dolor" and I want it to be exactly 3cm in length. I could do `\hbox to 3cm{Lorem Ipsum Dolor}` (with an optional `\hfill` at the end if I just want to pad the extra length with whitespace). The problem with that is that the `\hbox` will not be broken across lines. Is there a way to do something similar while allowing for line breaks? In other words, I would be okay with "Lorem Ipsum" being at the end of one line and "Dolor" being at the begging of the next, as long as their total length equals 3cm. **Edit:** I don't think I was very clear about for what I'm looking. Consider the line _"Ut fermentum pharetra lacus, id ornare dolor pretium tempor"_ in this example: ![Line break example](http://i.stack.imgur.com/8YrNI.png) In this example, that sentence was broken over two lines. I want to be able to explicitly set the total length of the _"Ut fermentum..."_ sentence, regardless of how it is broken across lines. In this example, I might want the sum of the lengths of s_1 and s_2 to be equal to, say, 5in. This could be accomplished by adding glue between words or padding the end with glue. This is easy to do if we know that there will be no line breaks in the string; we can then use either `\hbox spread 5in{}` or `\hbox to 5in{}`. The problem occurs when a line break does occur in the string, since the `\hbox` method would likely force the string to be on a single line. Furthermore, if the natural length of the string is greater than `\textwidth`, then the `\hbox` would overfill.


title: Layers don't work in an `overlay` picture

text: I have the following two `tikzpicture`, where the second needs the `overlay`. However, with that option, the line drawn from `A` to `C` goes through `B`, despite the `\begin{pgfonlayer}{back}…\end{pgfonlayer}`. What can I do to make the line appear below B (appart from redrawing B after, which is not practical since it has a random xshift and yshift). ![minimal example](http://i.stack.imgur.com/T21jn.png)               \documentclass{article}     \usepackage{tikz}     \pgfdeclarelayer{back}     \pgfsetlayers{back,main}     \begin{document}          \begin{tikzpicture}[remember picture]       \node[draw=red!50,  fill=red!10]   (A) at (0,0) {A};       \node[draw=green!50,fill=green!10] (B) at (1,0) {B};       \node[draw=blue!50, fill=blue!10]  (C) at (2,0) {C};     \end{tikzpicture}          \begin{tikzpicture}[remember picture, overlay]       \begin{pgfonlayer}{back}         \draw (A) -- (C);       \end{pgfonlayer}     \end{tikzpicture}          \end{document}      A more complete example justifying the use of `remember picture` and `overlay`: ![Complete example](http://i.stack.imgur.com/p2X9X.png)               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix,chains,trees}     \pgfdeclarelayer{back}     \pgfsetlayers{back,main}     \begin{document}          \begin{figure}[h]       \centering       \begin{tikzpicture}[remember picture]         \matrix[matrix of nodes, every node/.style={anchor=center}] {           \begin{tikzpicture}[start chain=going below, every node/.style={on chain}]             \node[draw=red!50,  fill=red!10]   (A1) {A};             \node[draw=red!50,  fill=red!10]   (A2) {AA};             \node[draw=red!50,  fill=red!10]   (A3) {AAA};           \end{tikzpicture} &           \begin{tikzpicture}[grow cyclic, sibling angle=360/7, edge from parent/.style={draw=none}]             \node {} child foreach \i in {1,...,7} {               node[draw=green!50,fill=green!10] {B\i};             };           \end{tikzpicture} &           \begin{tikzpicture}[start chain=going below, every node/.style={on chain}]             \node[draw=blue!50, fill=blue!10]  (C1) {C};             \node[draw=blue!50, fill=blue!10]  (C2) {C};           \end{tikzpicture} \\           Label A & Label B & Label C\\         };       \end{tikzpicture}       \caption{Foo}     \end{figure}          \begin{tikzpicture}[remember picture, overlay]       \begin{pgfonlayer}{back}         \draw[thick] (A1) -- (C2);       \end{pgfonlayer}     \end{tikzpicture}          \end{document}