title: Dazzled and confused about xparse and LaTeX3 Booleans

text: I'm just starting my journey with `LaTeX3/expl3`, and although fascinated by the great work that the `LaTeX3` team is doing, and by the enormous difference it brings about with respect to "classical" (La)TeX programming (to me it's such a nice experience that I'll try to stay within its domains as much as possible), I'm still a bit confused on some points. One of those has to do with the `\*DocumentCommand` family introduced by the `xparse` package. So far I had been using the members of this family embedded in a conventional `LaTeX2e` setting, just toying around with their rich parameter-setting structure and, some mishaps out of lack of practice aside, had no trouble. But now I'm getting eager at having `LaTeX3` in my TeX-based work, and I'm trying to embed `expl3` code in commands created resorting to the `xparse` facilities. This is where my trouble starts. Well, maybe this particular issue is not related at all with `xparse` but with `LaTeX3` Booleans, or expansion, or whatever... Banter enough. This is a small snippet from a real-life working project (not pretending by any means that what follows is good `LaTeX3/expl3` practice):               \documentclass{memoir}          \usepackage{xparse,l3keys2e}           \ExplSyntaxOn          \cs_generate_variant:Nn \bool_new:N {c}     \cs_generate_variant:Nn \bool_if:NTF {cTF}     \cs_generate_variant:Nn \bool_set_true:N {c}          \tl_const:Nn \c_prefix_tl {g_amod}      \tl_const:Nn \c_postfix_tl {_bool}           % Booleans making     \NewDocumentCommand\MakeBool { m }      {          \bool_new:c          { \tl_use:N \c_prefix_tl { #1 } \tl_use:N \c_postfix_tl }      }          % Setting Booleans to True     \NewDocumentCommand\SetTBool { m }       {         \bool_set_true:c         { \tl_use:N \c_prefix_tl { #1 } \tl_use:N \c_postfix_tl }      }          % Typing Boolean value     \NewDocumentCommand\ShowValBool { m }       {          \bool_if:cTF          { \tl_use:N \c_prefix_tl { #1 } \tl_use:N \c_postfix_tl }          { true } { false }      }          \MakeBool{columns} % Create a Boolean \g_amod_columns_bool          % l3keys defining and setting     \keys_define:nn { amod }      {         columns .bool_set:N = \g_amod_columns_bool      }          \NewDocumentCommand\DocumentSetup { +m }      { \keys_set:nn { amod } {#1} }          \AtBeginDocument{%         \DocumentSetup{ columns = false }     }          \begin{document}     \ShowValBool { columns }% False from l3keys      \par     \SetTBool { columns }% set to True      \ShowValBool { columns }% True from above command      \par % Yes, what comes is ugly enough, but just to check...     \bool_if:cTF% raw expl3 code to check Boolean value. Should return True          { g_amod_columns_bool }        { True } { False }     \end{document}          % And, for a terrible ending...     \ExplSyntaxOff      The problem is that I'm gettting `False True False`, whereas I would expect `False True True`. What is going on here? What is it that I'm missing or skipping?


title: Are there any subfloat package that works with tufte-latex?

text: I'm trying a lot of subfloat-like packages with tufte-latex and all of them seem to interact badly with tufte-latex in the matter of labels, refs and captions. To captions I could find solutions thanks to you guys, but refs are still elusive. Originally no numbering was appearing in the figures, but now the numbers appear but can't be referenced by the labels. The following minimal examples show what's wrong. Both results in undefined references for the `tufte-handout` class and work perfectly with `article`.               \documentclass{tufte-handout}          \usepackage[demo]{graphicx}     \usepackage[caption=false]{subfig}          \begin{document}     \begin{figure}     \centering       \subfloat[Subfigure 1] % caption for subfigure 1       {         \label{fig:sub1}         \includegraphics[scale=0.5]{subfig1.eps}       }       \subfloat[Subfigure 2] % caption for subfigure 2       {         \label{fig:sub2}         \includegraphics[scale=0.5]{subfig2.eps}       }       \caption{Results for subfigure}       \label{fig:results}       \end{figure}       In the text, you can refer to subfigures of figure \ref{fig:results} as \ref{fig:sub1}, \ref{fig:sub2}, \subref{fig:sub1}, \subref{fig:sub2}.     \end{document}      This one also works ok with captions but mess up references (gives undefined references with tufte-handout, but works ok with article).               \documentclass{tufte-handout}          \usepackage{caption}     \usepackage{subcaption}     \usepackage[demo]{graphicx}     \captionsetup{compatibility=false}          \begin{document}     \begin{figure}     \centering       \begin{subfigure}[b]{0.5\textwidth}         \includegraphics{subfig1.eps}         \caption{Subfigure 1}         \label{fig:sub1}          \end{subfigure}       ~       \begin{subfigure}[b]{0.5\textwidth}         \includegraphics{subfig2.eps}         \caption{Subfigure 2}         \label{fig:sub2}          \end{subfigure}       \caption{Results for subfigure}       \label{fig:results}     \end{figure}          In the text, you can refer to subfigures of figure \ref{fig:results} as \ref{fig:sub1}, \ref{fig:sub2}, \subref{fig:sub1}, \subref{fig:sub2}.     \end{document}      Are there any other subfloat packages that would work with tufte-latex? Or maybe a way to make the above packages work.


title: Greek alternate/variant letters

text: Some letters of the greek alphabet include alternative letters. For instance, we have `\Phi`, `\phi` and `\varphi`. What is the purpose of the variant versions of these letters? Why are these not available for the entire greek alphabet? Information about these symbols: https://en.wikibooks.org/wiki/LaTeX/Mathematics#Greek_letters. The Comprehensive LaTeX Symbol List from CTAN does not mention their purpose either.


title: Fontspec transparency problems

text: I'm using this minimal document to test transparency:               \documentclass[11pt]{article}     \usepackage{xunicode, xltxtra}     \defaultfontfeatures{Mapping=tex-text}     \usepackage{fontspec}     \usepackage[usenames]{xcolor}          \begin{document}     \fontspec[Color=red,Opacity=0.1,Scale=12]{Helvetica}Test     \end{document}      The rendered text is fully opaque when typeset through TeXShop with TeXLive 2011 on a MacOS Lion. Is this a known issue?


title: Make one author's name bold every time it shows up in the bibliography (continued)

text: The solution provided here Make one author's name bold every time it shows up in the bibliography does unfortunately not work, as soon as the Author's name contains special characters, e.g. `Hans M{\"u}ller`? How can this problem be solved?


title: Asymmetric quoting in LyX

text: In LyX, when I enter quoted text, the generated LaTeX source has uses different quotes for left and right: ```` for the former and `''` for the latter so that               "Ugly quotes"      produces               ``Ugly quotes''      which (for some fonts and engines) produces corresponding (unacceptable) output for the left quotes. Is there a way to prevent this? Are there packages that I can use to "repair" the left quotes? [OS X 10.7.3; LyX 2.0.3]


title: breqn: specifying the characters at which equations can be broken

text: Is there a way to force `breqn` to break at a certain character in favor of another. For instance, in the following example, one might prefer that the line be broken at a `+` sign rather than at a `\cdot`. Can one instruct `breqn` the exact point at which an equation should be broken? ![enter image description here](http://i.stack.imgur.com/eOHrq.png)               \documentclass{article}     \usepackage{amsmath}     \usepackage{breqn}     \begin{document}     \begin{dmath*}     x = \left( y + \frac{1}{2}y^2z^3 \int_{-\infty}^{+\infty} xy^2\exp(z+xy)\,\mathrm{d}y  + \frac{9\pi}{7} \int_{-\infty}^{+\infty} xy^3\cdot\ln z \,  \mathrm{d}z \cdot \int_{-\infty}^{+\infty} \frac{x}{(1-y)^2} \cdot \mathrm{e}^{-3z} \,\mathrm{d}y \right)     \end{dmath*}     \end{document}


title: horizontal and vertical image alignment with subfigure package

text: I have 5 images : A,B,C,D and E, all are different size. They need to be set up like this:               ------- ----------- ------- -------     |     | |         | |     | |  D  |     |     | |         | |     | -------     |  A  | |     B   | |  C  |      |     | |         | |     | -------     |     | |         | |     | |  E  |     ------- ----------- ------- -------      How do I set this up with the subcaption\subfigure package in latex? I have managed to get A,B,C working like this:               \centering         \begin{subfigure}[t]{0.246\textwidth}                 \centering                 \includegraphics[height=0.18\textheight]{tease5_a.jpg}         \end{subfigure}%         \centering         \begin{subfigure}[t]{0.18\textwidth}                 \centering                 \includegraphics[height=0.18\textheight]{tease5_b.jpg}         \end{subfigure}%                 \centering         \begin{subfigure}[t]{0.18\textwidth}                 \centering                 \includegraphics[height=0.18\textheight]{tease5_c.jpg}         \end{subfigure}%      .. which is pretty much a constant height for all images, but different width allocations for each, as otherwise I have too much extra space or overlaps. But how do I set it up so that the last 2 images are aligned vertically like the image shows?


title: TeXnicCenter, the placement specifier shows up in printed pdf

text: I am using the jfm document class, and I tried to use a placement specifier to adjust my figure as follows.               \begin{figure}[ht]          \centerline{\includegraphics[scale=0.11]{figure3.eps}}          \caption{Averaged streamwise velocity field of (a) 0.2$\delta$ case and (b) 0.4$\delta$ case, normalized by \emph{U}$_\infty$=0.508 m s$^{-1}$. Blue is slow, white is fast.}          \label{fig:48d}          \end{figure}      However, the `[ht]` keeps showing up in the printed pdf right in front of the figure. ![enter image description here](http://i.stack.imgur.com/C22cF.png) Could anyone tell me why this is happening?? Thanks! ;D


title: Block indentation in TeXMaker

text: Is it possible to indent whole paragraphs of source code in TeXMaker (or alternatively, in any LaTeX editor), so that intentation applies to all rows in paragraphs when the text is wrapped over several lines is the editor? By default, TeXMaker intents the source code like the first code snippet below, whereas I would like indentation as in the second snippet, i.e. applied to the whole paragraph.               \begin{abstract}         Lorem ipsum dolor sit amet, consectetur adipisicing elit,      sed do eiusmod tempor incididunt ut labore et dolore      magna aliqua. Ut enim ad minim veniam, quis nostrud      exercitation ullamco laboris nisi ut aliquip ex ea commodo      consequat.     \end{abstract}      vs.               \begin{abstract}         Lorem ipsum dolor sit amet, consectetur adipisicing elit,          sed do eiusmod tempor incididunt ut labore et dolore          magna aliqua. Ut enim ad minim veniam, quis nostrud          exercitation ullamco laboris nisi ut aliquip ex ea commodo          consequat.     \end{abstract}


title: Do mathdesign sans serif and monospaced fonts "fake" small caps?

text: The manual for mathdesign explains how to ensure "true" small caps are used for the main type family selected as an option, but it says nothing about whether the small caps used in other fonts are "faked". For example               \usepackage[bitstream-charter,expert]{mathdesign}     \renewcommand{\sfdefault}{phv}      will use true small caps for Charter only if additional fonts are purchased and installed, but it is unclear if the sans serif font specified in the second line (Adobe Helvetica) will use true small caps. Do the fonts available to mathdesign for sans serif1 and monospaced2 type support true small caps? * * * 1 Computer Modern Sans Serif, Bera sans, Adobe Helvetica   2 Bera mono, Computer Modern Typewriter, Adobe Courier


title: TikZ: Re-arranging the hierarchical diagram

text: I was quite impressed by the solution given by "cfr" for the question posted here. Can you suggest a method to change the two main children (labelled Projection matrix Theory and Reconstruction Algorithms) to position on the north and south of the root node (Compressed Sensing Theory)? That is, I would like the two main children nodes to open out towards north and south of the root node. The main child node "Reconstruction Algorithm" should appear just below the root node and the child node "Projection matrix Theory" should appear above the root node. The child nodes of "Projection matrix Theory" should open upward whereas the child nodes of "Reconstruction Algorithm" can remain intact. I had made a comment on cfr's answer, requesting the same. As he suggested I am posting again it as a new question. Thanks. EDIT: I tried to change it, but I landed up in getting this figure! ![enter image description here](http://i.stack.imgur.com/GLl0q.jpg) The code I modified is given here:                    \documentclass[border=5pt]{standalone}     \usepackage{tikz,pgf}     \usepackage{forest}     \usetikzlibrary{arrows.meta, shapes.geometric, calc, shadows}          \colorlet{mygreen}{green!75!black}     \colorlet{col1in}{orange!30}     \colorlet{col1out}{orange!40}     %\colorlet{col1in}{red!30}     %\colorlet{col1out}{red!40}          \colorlet{col2in}{mygreen!40}     \colorlet{col2out}{mygreen!50}     \colorlet{col3in}{blue!30}     \colorlet{col3out}{blue!40}     \colorlet{col4in}{mygreen!20}     \colorlet{col4out}{mygreen!30}     \colorlet{col5in}{blue!10}     \colorlet{col5out}{blue!20}     \colorlet{col6in}{blue!20}     \colorlet{col6out}{blue!30}     \colorlet{col7out}{red!10}     \colorlet{col7in}{red!50}     \colorlet{col8out}{red!40}     \colorlet{col8in}{red!20}          %\colorlet{col7out}{orange}     %\colorlet{col7in}{orange!50}     %\colorlet{col8out}{orange!40}     %\colorlet{col8in}{orange!20}     \colorlet{linecol}{blue!60}          \begin{document}     \pgfkeys{/forest,       rect/.append style={rectangle, rounded corners=2pt, inner color=col6in, outer color=col6out},       ellip/.append style={ellipse, inner color=col5in, outer color=col5out},       orect/.append style={rect, font=\sffamily\bfseries\LARGE, text width=325pt, text centered, minimum height=10pt, outer color=col7out, inner color=col7in},       oellip/.append style={ellip, inner color=col8in, outer color=col8out, font=\sffamily\bfseries\large, text centered},     }     \begin{forest}       for tree={           font=\sffamily\bfseries,           line width=1pt,           draw=linecol,           ellip,           align=center,           child anchor=north,           parent anchor=south,           drop shadow,           l sep+=12.5pt,           edge path={             \noexpand\path[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]               (!u.parent anchor) -- +(0,-5pt) -|               (.child anchor)\forestoption{edge label};             },           where level={3}{tier=tier3}{},           where level={0}{l sep-=15pt}{},           where level={1}{             if n={1}{               edge path={                 \noexpand\path[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]                   (!u.north) -| (.child anchor)\forestoption{edge label};                 },             }{               edge path={                 \noexpand\path[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]                   (!u.south) -| (.child anchor)\forestoption{edge label};                 },             }           }{},       }       [Compressed Sensing\\Theory, inner color=col1in, outer color=col1out,          [Projection Matrix\\Theory, inner color=col2in, grow'=north, outer color=col2out,           [Optimise Projection\\Matrix, inner color=col4in, outer color=col4out, grow=south]           [Reduce Number of\\Measurements, inner color=col4in, outer color=col4out,grow=south]         ]         [Reconstruction\\Algorithms, inner color=col3in, outer color=col3out           [Convex Relaxation \\ Methods             [Sparse Signal\\Estimate, rect, name=sse1             ]           ]           [\hspace{1em} Greedy \hspace{1em} \\ Pursuits             [Sparse Signal\\Estimate, rect, name=sse2             ]           ]           [, phantom, calign with current             [A\\B, phantom               [Our Work, orect, name=us                 [{Improved Sparse Signal Estimate!}, oellip                 ]               ]             ]           ]           [Non-Convex\\ Methods             [Sparse Signal\\Estimate, rect, name=sse3             ]           ]           [Combinatorial\\Algorithms             [Sparse Signal\\Estimate, rect, name=sse4             ]           ]         ]       ]     %  \begin{scope}[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->]     %    \draw (sse2.south) -- (us.north -| sse2.south);     %    \draw (sse3.south) -- (us.north -| sse3.south);     %    \coordinate (c1) at ($(sse1.south)!2/5!(sse2.south)$);     %    \coordinate (c2) at ($(sse3.south)!2/5!(sse4.south)$);     %    \draw (sse1.south) -- +(0,-10pt) -| (us.north -| c1);     %    \draw (sse4.south) -- +(0,-10pt) -| (us.north -| c2);     %  \end{scope}     \end{forest}     \end{document}      I was unable to place the node "Projection Matrix Theory" above the root node "Compressed Sensing". Similarly the arrows from the node "Projection Matrix Theory" are not ending at the intended place. Where am I going wrong?


title: Add background colour to margin notes area

text: I want to delimit margin note area by a **background color for all the document** like in some nice books. I tried with `marginnote` and `todonote` packages without success. You are my last hope...


title: MikTeX does not use TEXMFLOCAL environment variable

text: I use TEXMFLOCAL, TEXINPUTS and TEXFONTMAPS to tune tex compilation. Everything works fine under Linux and Mac OS X, but MitTeX under Windows breaks my expectations.               c:\tmp\tex> type test.bat     set TEXMFLOCAL=some;thing     kpsewhich --var-value TEXMFLOCAL          c:\tmp\tex> test.bat          c:\tmp\tex>set TEXMFLOCAL=some;thing          c:\tmp\tex>kpsewhich --var-value TEXMFLOCAL     C:/Documents and Settings/user/Application Data/MiKTeX/2.9      Why the value of the environment variable TEXMFLOCAL is ignored? Do I set it wrong, or is it a feature of MikTeX? How to affect MikTeX's TEXMFLOCAL, TEXINPUTS and TEXFONTMAPS from a script (.bat or .py)?


title: Which symbols need to be escaped in ConTeXt?

text: When writing "$" or "%" in a document, one must used `\$` and `\%` so that they will be interpreted as symbols which should be displayed along with the text.   * What other symbols need to be escaped in ConTeXt? Where can I obtain a complete list? I have also observed that documents containing "|" cannot be compiled, but `\|" does not help. Why does this prevent compilation and how can this be displayed as text?


title: How to change the date format in termcal?

text: I'd like to remove the ordinal numbering and month names in `termcal` but have been unsuccessful so far. The original code, according to the package documentation is:               \newcommand{\calprintdate}{%     \ifnewmonth\framebox{\monthname\ \ordinaldate}%     \else \ordinaldate\fi     }      Which yields dates like "Oct 1st" or "Aug 26th." My goal is to change these to "10/1" and "8/26," respectively. Since I am new to LaTeX, my attempt is a bit embarrassing:               \renewcommand{\calprintdate}{%         \ifnewmonth\framebox{\c@month\ \c@date}%         \else \ordinaldate\fi     }      This outputs gibberish like "@month @date," which confuses me, because the documentation does state that `\c@month` is the month counter (Jan = 1). I also haven't changed `\ordinaldate` in the `\else` line, and I don't know what `\fi` means. Here's a minimal working example without `\renewcommand`:               \documentclass[12pt]{article}     \usepackage{termcal}          \begin{document}          \begin{calendar}{8/31/2014}{5}     \setlength{\calboxdepth}{.3in}          % Description of the Week.     \calday[Sun]{\noclassday} % Sunday     \skipday\skipday % Monday, Tuesday     \calday[Wed]{\noclassday} % Wednesday     \skipday\skipday % Thursday, Friday     \calday[Sat]{\noclassday}          \caltext{8/31/2014}{Exam 1}     \caltext{9/7/2014}{Exam 2}          \end{calendar}          \end{document}      ![Output of MWE](http://i.stack.imgur.com/ORrmc.jpg) I also don't understand why "Sep 3rd" is printed, if, as according to `\calprintdate`, only dates for new months should be printed.


title: Wrong vertical alignment using mdframed with tight margins

text: When using the `mdframed` environment with absolutely tight margins (all set 0pt), there is too much negative vertical space of split md-frames that are placed at the top of a page. To illustrate this, the minimal working example creates two text pages, the second of which contains text in an md-frame, clearly not aligned with the text in the first page. I created the example using a command `\FOO`, which calls an environment `valignFOO` that contains the actual mdframed environment named `mdframedFOO`, the latter of which has margin sizes of zero and a small frame for visual reference. `valignFOO` is responsible for Making mdframed paragraph behave like normal paragraphs in terms of spacing. But even by using that improvement with respect to vertical spacing, I still observe extra space as described above.               \documentclass[12pt,a6paper]{scrbook}          \usepackage[framemethod=tikz]{mdframed}     \usepackage{lipsum}          % New mdframed environment called mdframedFOO:     \newmdenv[leftmargin        = 0pt,               rightmargin       = 0pt,               innerleftmargin   = 0pt,               innerrightmargin  = 0pt,               innertopmargin    = 0pt,               innerbottommargin = 0pt,               skipabove         = 0pt,               skipbelow         = 0pt,               splittopskip      = 0pt,               splitbottomskip   = 0pt,               outerlinewidth    = 1pt,               middlelinewidth   = 0pt,               innerlinewidth    = 0pt,               topline           = false,               bottomline        = false              ]{mdframedFOO}          % Correct vertical alignment of mdframedFOO:     % (This is for making mdframed behave like a normal paragraph,     %  see http://tex.stackexchange.com/questions/88525/making-mdframed-paragraph-behave-like-normal-paragraphs-in-terms-of-spacing)     \newenvironment{valignFOO}      {\par\vskip\dimexpr\dp\strutbox-\prevdepth\relax\mdframedFOO\strut\ignorespaces}      {\par\xdef\notetpd{\the\prevdepth}\endmdframedFOO\vskip-\notetpd\relax}          % FOO:     \newcommand{\FOO}[1]{%       \begin{valignFOO}         #1       \end{valignFOO}     }                         \begin{document}       \lipsum[2]       \FOO{\lipsum[2]}     \end{document}


title: Emulate a "tuple" data structure (when you are free to choose the syntax)

text: How can a "tuple" data structure be implemented in LaTeX? The idea is to store several elements (possibly a predefined number) in one macro and then be able to extract each of these elements by index (numeric or otherwise).               \documentclass{article}          % HOW TO IMPLEMENT THIS?     \newcommand{\definetuple}[...]{...}     \newcommand{\extractfromtuple}[...]{...}     % HOW TO IMPLEMENT THIS?          % YOU ARE FREE TO CHANGE SYNTAX HERE     \definetuple{first}{Alice}{Munich}{Germany}     \definetuple{second}{Bob}{London}{United Kingdom}          \begin{document}       \extractfromtuple{first}{1} lives in \extractfromtuple{first}{2}       which is located in \extractfromtuple{first}{3};       this may or may not be true for \extractfromtuple{second}{1}.     \end{document}     % YOU ARE FREE TO CHANGE SYNTAX HERE      I'd like to split the original question so that nice solutions with a new API have a place to live. Should this be community wiki?


title: Make plural in small caps acronyms distinguishable

text: ## The problem Small caps are commonly used to typeset acronyms (see _e.g._ , #9534). I personally think that this is good typographic style and makes acronyms less obtrusive. However, using small caps raises an issue. A lower case “s” to indicate the plural of an acronym is now not easily distinguishable from a small caps “s” that might be part of an acronym anymore. Here is an example that is typeset in Minion Pro: ![Problematic acronyms...](http://i.stack.imgur.com/DyLvO.png) (Note that in other fonts, such a CMR, this is less of an issue). ## The question My question consists of two parts:   1. How would you recommend to solve this problem? ( _N.B.:_ I will admit that this is rather a design issue than directly TeX related, but it suits the scope of the page well.   2. How can I implement this automatically using the `glossaries` package? ## MWE               \documentclass{article}          \usepackage{textcase}     \usepackage{fontspec}         \setmainfont{Minion Pro}          \usepackage[%         xindy,         acronym,         smallcaps,         shortcuts,         nomain,         ]{glossaries}         % Automatically use smallcaps in lower case for acronyms!         \renewcommand*{\firstacronymfont}[1]{\MakeTextLowercase{\textsc{#1}}}         \renewcommand*{\acronymfont}[1]{\MakeTextLowercase{\textsc{#1}}}          \newacronym{ode}{ODE}{ordinary differential equation}     \makeglossaries          \begin{document}          \printglossaries          Acronyms, such as \ac{ode}, blend in well with the text when typeset in small     caps. Doesn't this \ac{ode} look good? Surely it is less obtrusive than ODE.     However, we now have the problem with the plural: \acp{ode}. Is the ``s'' part of     the acronym or not? My professor doesn't see the difference between a lower     case ``s'' and a small caps ``\textsc{s}''. Maybe this becomes more clear when     adding a thin space, as in: \ac{ode}\,s. Or is there a better solution?          \end{document}      ## Your solution →


title: How to create this diagram with boxes and arrow?

text: How to create this diagram with boxes and arrow ? Thanks a lot. ![How to create this diagram with boxes and arrow ?](http://i.stack.imgur.com/nV7VY.jpg)


title: How to do Three column Addition?

text: I want to write a primary school sheet of exercices (additions in columns) with big digits in LaTeX. When i want to do two columns, it is easy with `xlop`, but i can't to do three columns! How to do Three column Additions? Like this: ![1](http://www.amsi.org.au/teacher_modules/B6/B6t7.png) **I only need format it** , it isn't necessary to solved it.


title: Exam Class : Multicolumn : Symbol (displaystyle) into two lines

text: How can we break formula mentioned below into into two lines?               $\displaystyle \boldsymbol{{\left( {x\log x} \right)^{\log \log x}}\left\{ {\frac{1}     {{x\log x}}\left( {\log x + \log \log x} \right) + \left( {\log \log x} \right)\left( {\frac{1}{x} + \frac{1}{{x\log x}}} \right)} \right\} }$      FYI: I'm using two column layout and this symbol is getting overlapped over next column. EDIT: Added sample tex file having issue mentioned above:               \documentclass[addpoints,answers,10pt]{exam}     \usepackage[margin=0.7in,headheight=3.5\baselineskip,headsep=1\baselineskip,includehead]{geometry}     \usepackage{multicol}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{tabularx}     \usepackage{nonfloat}     \usepackage{caption}     \usepackage{amsmath,amssymb}     \usepackage{lmodern}     \usepackage{textcomp}     \usepackage{ifpdf}     \usepackage{chemfig}     \usepackage[export]{adjustbox}     \begin{document}   \begin{multicols}{2} \begin{questions}     \question[4] Ref: (111)\\If\ $\displaystyle \boldsymbol{y = {\left( {x\log x} \right)^{\log \log x}} }$ , then\ $\displaystyle \boldsymbol{\frac{{dy}}     {{dx}} =  }$     \begin{choices} \choice $\displaystyle \boldsymbol{{\left( {x\log x} \right)^{\log \log x}}\left\{ {\frac{1}     {{x\log x}}\left( {\log x + \log \log x} \right) + \left( {\log \log x} \right)\left( {\frac{1}     {x} + \frac{1}     {{x\log x}}} \right)} \right\} }$     \choice $\displaystyle \boldsymbol{{\left( {x\log x} \right)^{x\log x}}\log \log x\left[ {\frac{2}     {{\log x}} + \frac{1}     {x}} \right] }$     \choice $\displaystyle \boldsymbol{{\left( {x\log x} \right)^{x\log x}}\frac{{\log \log x}}     {x}\left[ {\frac{1}     {{\log x}} + 1} \right] }$     \choice none of these      \end{choices}     \end{questions}     \end{multicols}     \end{document}


title: How to write a cite command that never fails (avoid [??])

text: When writing small documents and drafts for my own reference or quick sharing I often leave the bibliography building for a later stage. In this intermediate stage I still want to use the `\cite` (or variants of it) to keep track of bibliography, that will later reference the appropriate entry. The problem is that when I compile the document I get "[??]" as placeholders. This is distracting and it doesn't even give any information of what is missing. **Is is possible to get a reasonable content in this placeholder that is not "[??]" from the`\cite` command?** For example if the code is `bla \cite{Einstein1905} bla`, and `Einstein1905` is not in the bibliography yet, I would like to get at least "bla [Einstein1905] bla", until more information is available in the bibliography database (after which it may just appear as "bla [3] bla" o "bla [Eins05] bla" depending on the style. Also (and ideally) the fallback result "[Einstein1905]" could be typeset in typewriter style or something to still indicate that something is missing. I know of the package `showkeys` but it doesn't do exactly this, not at least by default.


title: Driving the Options of a Given Package from Another Package or Class in LaTeX3/expl3

text: I'm afraid I still don't get how I'm supposed to handle the communication of options among packages in a `LaTeX3/expl3` context. Let us say I have a package `pkg1` where I define an option `opt_pkg1` that is set in the document, but which is actually used just to drive the options (`opt1_pkg2`,`opt2_pkg2`...) with which another package `pkg2` is loaded from the first (`pkg1`). What's a correct way to do this by using `l3keys`? I'll try to make my point clear by way of a small example, something akin to a semiMnotWE: There are missing declarations for some Booleans, besides other tidbits making it a not working example... It is supposed just to be able to convey my point. Observe that I have switched from `pkg1(2)` to `pkgA(B)` due to syntax requirements. The basic message behind it is: In `pkgA` I define the options that allow me to set the typeface and the separate possibility to choose a sans face in the main document. Setting the typeface leads `pkgA` to load one or another extra package (`pkgB`) and, in this case, my choosing a sans face leads to loading `pkgB` with one or another option. Hope I've been able to make my point clear... This is `pkgA.sty`, although in general -- in my case -- this will be a class file:               \ProvidesExplPackage{pkgA}{2013/08/20}{0.0}       {LaTeX2e/LaTeX3 package}          \RequirePackage{xparse,l3keys2e}% Needed?          \NewDocumentCommand\SetTBool { m }      {         \bool_set_true:c { g_pkgA_#1_bool }      }          \keys_define:nn { pkgA }     {         typeface .choice_code:n =             { \SetTBool { \tl_use:N \l_keys_choice_tl } },         typeface .generate_choices:n = { lucida, libertine },         typeface .initial:n = libertine,              sans-face .choice_code:n =             { % Watch out!                % The next switch does not work as it is, but I guess it conveys my point                \tl_if_eq:NnT \l_keys_choice_tl { sansbiolinum }                 {                     % In this branch I set or pass (???) the { sansbiolinum = true } option to pkgB                  }             },         sans-face .generate_choices:n = { sansbiolinum, sansmyriad },      }           \DeclareDocumentCommand\DocumentSetup { +m }      { \keys_set:nn { pkgA }{ #1 } }          \ProcessKeysOptions { pkgA }          \bool_if:NT \g_pkgA_lucida_bool { \RequirePackage{pkgB} }      Next comes `pkgB.sty`:               \ProvidesExplPackage{pkgB}{2013/08/20}{0.0}       {LaTeX2e/LaTeX3 package}          \RequirePackage{lucimatx}          \keys_define:nn { pkgB }      {         sansbiolinum .bool_set:N = \g_pkgB_sansbiolinum_bool,      }          \ProcessKeysOptions { pkgB }              \bool_if:NT \g_pkgB_sansbiolinum_bool        { \RequirePackage[osf]{biolinum} }      Lastly, in the "document" (.tex file), I have something like:               \documentclass{memoir}          \usepackage{pkgA}          \DocumentSetup{        typeface = lucida,        sans-face = sansbiolinum,     }           \ProcessKeysOptions { pkgA }           \begin{document}      Blah, blah, blah.      \end{document}


title: Auctex: bug in LaTeX-mark-environment?

text: Before I send this on to the developers, I'd like to know if others can confirm this problem. Consider these two environments:               \begin{flalign*}     sdfsdf       \end{flalign*}          \begin{flalign*}        && A \rightarrow \End_{B}(M) && {; B=\End_{A}(M)}     \end{flalign*}      If I set the cursor in the first one and execute `LaTeX-mark-environment` (`C-c .`), then I get the expected result, i.e. marked the `flalign*` environment, including the `\begin/end` lines. However if I do the same in the other one, it never covers the env. What ever is marked depends on where the cursor is. It is clearly having an issue with the `\End`, presumably because it is ignoring case. Can others confirm? (`LaTeX-mark-environment` together with `narrow-to-region` is a really nice feature to have when writing macros).


title: Intersection of straight line and circle

text: Why does this example only partially work?               \documentclass{minimal}     \usepackage{etex}     \usepackage{tikz}     \usetikzlibrary{shapes,calc,arrows,trees,positioning,through,intersections,fadings}     \begin{document}         \begin{tikzpicture}[scale=0.5]     \coordinate (a) at (0,0);     \coordinate (b) at (6,0);     \coordinate (c) at (9,6);     \node(A)[label=$A$] at (a) {$\bullet$};     \node(B)[label=50:$B$] at (b)  {$\bullet$};     \node(C)[label=$C$] at (c) {$\bullet$};     \draw[thick] (a)--(b)--(c)--cycle;     %           \node(c1) at (a)[draw,circle through=(b)] {};     %           \coordinate(ac) at(intersection 1 of c1 and a--c);     %                %           \node(c2) at (ac)[draw,circle through=(b)] {};     %           \node(c3) at (b)[draw,circle through=(ac)] {};     %           \coordinate(bta) at(intersection 1 of c2 and c3 );     %           \node(xx)[label=$C$] at (bta) {$\bullet$};     %       \coordinate(bisa) at(intersection 1 of a--bta and b--c);     %       \draw (a)--(bisa);     %%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%%             \node(c4) at (b)[draw,circle through=(a)] {};                 \coordinate(bc) at(intersection 1 of c4 and b--c);                 \node(xx)[label=$prova$] at (bc) {$\bullet$};                 \node(c5) at (bc)[draw,circle through=(a)] {};                 \node(c6) at (a)[draw,circle through=(bc)] {};                 \coordinate(btb) at(intersection 1 of c5 and c6 );             \node(xx)[label=$prova$] at (btb) {$\bullet$};             \coordinate(bisb) at(intersection 1 of b--btb and a--c);             \draw (b)--(bisb);     %%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%% it doesn't work%%%%%%%%%%%%%%%%%%     \node(c7) at (c)[draw,circle through=(b)] {};     \coordinate(ac) at(intersection 2 of c7 and a--c);     \node(xx)[label=$prova2$] at (ac) {$\bullet$};     %%%%%%%%%%%%%%%%%%%%%%%%%%% it doesn't work %%%%%%%%%%%%%%%%%%          \end{tikzpicture}     \end{document}


title: Automatically add a custom url on my bibliography, based on local url rewriting

text: I search a solution to automatically add a custom url on my bibliography, based on local url rewritting. For example, i have a biblatex entry into `library.lib` with local pdf url like this :               @phdthesis{Stonedahl2011a,     author = {Stonedahl, Forrest J.},     file = {:home/srey/TRAVAUX/THESE/REPOSITORY\_PDF/RANGE/Stonedahl\_2011\_Genetic Algorithms for the Exploration of Parameter Spaces in Agent-Based Models.pdf:pdf},     number = {December},     pages = {394},     school = {Evanston, Illinois},     title = {{Genetic Algorithms for the Exploration of Parameter Spaces in Agent-Based Models}},     year = {2011}     }      The latex file :               \documentclass[a4paper, 12pt,twoside, openright]{memoir}     \usepackage{polyglossia}     \setdefaultlanguage{french}     \usepackage{fontspec}     \usepackage[usenames,dvipsnames]{xcolor}     \usepackage[autostyle=true,french=guillemets,maxlevel=3]{csquotes}     \usepackage{xparse}     \usepackage{graphicx}     \usepackage[protrusion=true]{microtype}     \sidecapmargin{outer}     \setsidecappos{t}          \usepackage[backend=biber,backref=true, natbib=true, isbn=false, doi=false, url=false, style=authoryear,maxcitenames=1, maxbibnames=999, sorting=nyt, refsection=chapter, hyperref]{biblatex}          \addbibresource[datatype=bibtex]{library.bib}          \begin{document}          \chapterstyle{bringhurst}          My blabla text with citation. \autocite{Stonedahl2011a}          \printbibliography          \end{document}      How can i add a custom url to my bibliography to download paper from a custom source and how can i translate automatically this url into biblatex file `home/srey/TRAVAUX/THESE/REPOSITORY\_PDF/RANGE/Stonedahl\_2011\_Genetic Algorithms for the Exploration of Parameter Spaces in Agent-Based Models.pdf transform` into `http://mycustomserver.com/Stonedahl_2011_Genetic Algorithms for the Exploration of Parameter Spaces in Agent-Based Models.pdf`


title: Importing plots from MATLAB to LaTeX

text: This is my first time trying to import plots created by MATLAB into LaTeX and it's not turning out very nicely. I have saved my MATLAB plot as a .png file here and an .eps file here. Using the .eps file, I have the following code:               \documentclass[twoside, a4paper, 12pt]{article}     \usepackage{graphicx}         \begin{document}          \begin{center}        \includegraphics[scale=0.6]{graph2.eps}     \end{center}               \end{document}      which turns out to look like: (half the image is missing) ![enter image description here](http://i.stack.imgur.com/2PL9o.jpg) So then I changed the scale to 0.4:                \includegraphics[scale=0.4]{graph2.eps}      which produces the output: ![enter image description here](http://i.stack.imgur.com/Iphr9.jpg) However now the image is way too small to be eligible (and it doesn't feel like it's centered properly). Does anyone have a good solution for this? How can I get the image to look "good" when imported into LaTeX? Thanks. **EDIT:** I have saved the three plots separately: The first graph is called g1 and can be found here g2 can be found here and g3 can be found here How can I combine them into one figure using the tabular environment? Could someone provide a template code?


title: eps import wrong title in graphic \pi looks like \neq

text: Need to import a figure from Matlab. I export it as an eps and use `epstopdf` to import it in latex for some unknown reasons the greek pi in the title of the plot that looks ok in the .eps does not look ok anymore in the output pdf and I don't know why.               \documentclass[a4paper, pt=9]{article}     \usepackage[utf8]{inputenc}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{float}          \title{Dum De Dum}          \author{Irene}          \begin{document}     \maketitle          \begin{figure}[H]     \includegraphics[scale=0.7]{11eps}     \caption{Confronto MSE e CRB nella stima della frequenza di $\omega_1$, $NF=200$}     \end{figure}          \end{document}      EDIT: ![Output pdf](http://i.stack.imgur.com/FHRfJ.png) EDIT2: With matlab2tikz (as suggested in the comments)it works properly. It seems not to work fine for me running pdflatex as it is but the reason is to me totally mysterious.


title: flow chart page size issue

text: I have been doing this since from last month. I want to draw this flow chart using               \documentclass[a4paper,11pt]{report}      but if I use above configuration (which I want to use) the flow chart does not show in one page, how do I fix that issue? please help me to complete the flow chart. 1) How do I write a caption for that? 2) Is there any other easy latex package to do that? ![enter image description here](http://i.stack.imgur.com/qKyAZ.png) Code               \documentclass[a4paper,10pt]{article}     \usepackage[margin=1cm]{geometry}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{matrix,shapes,arrows,positioning,chains,calc}          \begin{document}          % Define block styles     \tikzset{     desicion/.style={         diamond,         draw, thick,         text width=4em,         text badly centered,         inner sep=0pt     },     block/.style={         rectangle,         draw, thick,         text width=10em,         text centered,         rounded corners     },     cloud/.style={         draw,         ellipse,         minimum height=2em     },     descr/.style={         fill=white,         inner sep=2.5pt     },     connector/.style={         -latex,         font=\scriptsize     },     rectangle connector/.style={         connector,         to path={(\tikztostart) -- ++(#1,0pt) \tikztonodes |- (\tikztotarget) },         pos=0.5     },     rectangle connector/.default=-2cm,     straight connector/.style={         connector,         to path=--(\tikztotarget) \tikztonodes     },     line/.style={>=latex,->,thick}     }          \begin{tikzpicture}     \matrix (m)[matrix of nodes, column  sep=3cm,row  sep=8mm, align=center, nodes={rectangle,draw, anchor=center} ]     {      |[block]| {Start}       &   & \\      |[block]| {Assume that $a=c$ the optimilalty cretierin given by }  &  &                                  \\         |[desicion]| {Locally optimal}          &           &                                 \\        |[block]| {Assume that $a=d$ the optimilalty cretierin given by}    &                                            & \\         |[desicion]| {Locally optimal}         &               &                           \\      |[block]| {Assume that $a=e$ the optimilalty cretierin given by}    &       |[block]| {$A=c^2$ \\ $A=b^2$}           &        |[block]| {Globsl \\  Optimal \\ Configuration}                 \\      |[desicion]| {Locally optimal}         &    &                       \\      |[block]| {Assume that $a=f$ the optimilalty cretierin given by}    &   &   \\      |[desicion]| {Locally optimal}               & &  |[block]| {Stop}  \\      |[block]| {Assume that $a=k$ the optimilalty cretierin given by}    &    |[desicion]| {Locally optimal}    &     \\     };     \foreach \f/\t[evaluate=\f as \t using int(\f+1)]  in {1,2,3,4,5,6,7,8,9}{     \path [line] (m-\f-1) edge (m-\t-1);     }     \path [line,red] (m-10-1) edge (m-10-2);     \draw[line,red] (m-10-2) -- (m-6-2) node[pos=0.3,right,text=black]{ Yes, Pass (a,c)};     \draw [line] (m-6-2) --node[midway,below,text=black]{Yes, Pass (a,c)} node[midway,above,text=black]{Step 6} (m-6-3);     \path [line,red] (m-6-3) edge (m-9-3);     \draw [line,red] (m-10-2) -| (m-9-3);          \foreach \f/\l[evaluate=\f as \t using int(\f+1)] in {3/a,5/b,7/c,9/d}{     \draw [line,red] (m-\f-1.east) --node[midway,above,text=black]{Yes, Pass (a,c)} ++ (2.5cm,0)coordinate[](\l);     \draw [line,red] (m-\f-1.east) -| ([xshift=1.5cm]m-\t-1.north);     }          \node[xshift=-2cm] at (m-3-1){Step 1(4)};     \node[xshift=-2cm] at (m-5-1){Step 2 (7)};     \node[xshift=-2cm] at (m-7-1){Step 3 (9)};     \node[xshift=-2cm] at (m-9-1){Step 4 (3)};     \node[xshift=-2cm,above] at (m-10-2){Step 5};     \draw [>=latex,-,red,thick] (a) --(d);     \draw [line,red] ($(a)!0.5!(d)$) -- (m-6-2);     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/4QBPi.png)


title: Understanding how references and labels work

text: I'm trying to understand why I cannot effectively reference figures or equations that I have defined with labels. For example:               \begin{figure}             \label{fig:area_Treasuries}             \caption{Treasuries as a portion of total financial flows.}               \centering                 \includegraphics[width=0.75\textwidth]{graphs/Area_Treasuries.png}         \end{figure}              \paragraph{}Figure~\ref{fig:area_Treasuries} presents Treasuries (both flowing into and out of the United States) as a share of total financial flows.  From 1985 to 2010, Treasuries account for, on average, 53.2\% of total financial flows.        With the above code, I get this warning: > LaTeX Warning: Reference `fig:area_Treasuries' on page 37 undefined on input > line 477. The result is "Figure ?? presents Treasuries..." Why is this happening? Related, I don't understand why I can't reference, say, an equation before (I mean physically above in the text) the actual equation. Isn't this what compiling multiple times and cross references is supposed to take care of?


title: Broken algorithm reference number

text: My code is as follows:               \documentclass[12pt,letterpaper]{book}           \usepackage{graphicx}     \usepackage[ruled,vlined]{algorithm2e}     \usepackage{subfig}          \begin{document}     \pagestyle{plain}     \chapter{Introduction}     \label{chap_introduction}          Broken Algorithm \ref{alg:scandec}          \begin{algorithm}     \label{alg:scandec}      \DontPrintSemicolon      \SetAlgoLined         Ctrl-C, Ctrl-V     \caption{The Ultimate Algorithm}     \end{algorithm}     \end{document}      The result is a broken Algorithm ?? in the document. ![Output](http://i.stack.imgur.com/N3pWd.jpg) My attempts:   1. I changed the order of package loading.   2. My compile order is latex.exe (3 times) -> dvips -> psd2pdf.   3. If I remove the package subfig, the reference works. Can anyone please tell me how to fix this?


title: LaTeX numbering one figure incorrectly (Figure 2 instead of Figure 2.1)

text: All of my figures seem to be referencing correctly except for one. I have               Text text text \ref{fig:label}.     \begin{figure}         \begin{center}             <TikZ Drawing>         \end{center}     \label{fig:label}     \end{figure}      The figure ends up being Figure 2.1 in the document body, however the reference only shows up as Figure 2 whereas other figures in the chapter show up referenced correctly (e.g. Figure 2.2). EDIT: Did some more googling and found that I shouldn't be using the center environment for floats but using \centering instead. Removing \begin and \end{center} and replacing with a single \centering within the figure definition fixes the problem. EDIT2: Not allowed to answer my own question for 8 hours.


title: Strange reference number for main figure label containing subfigures

text: I have problem in referencing number for main figure label. I have this code :               \begin{figure}[t]     \centering          \subfigure[11a's signal strength]{         \includegraphics[scale =0.25] {fig/cdf_sig11a.eps}         \label{cdf_sig11a}     }     \hspace{0.2cm}     \subfigure[11n's signal strength]{         \includegraphics[scale =0.25] {fig/cdf_sig11n.eps}         \label{cdf_sig11n}     }          \label{coverage_comparison}     \caption{Coverage comparison in various location}     \end{figure}      When I use Fig. \ref{coverage_comparison}, it shows Fig. II-C. It should be Fig. 4. This only happens when I use subfigure and use main figure label but if I use Fig. \ref{cdf_sig11n}, it shows correct reference number Fig. 4(b). How to solve this problem?


title: How to start a curvilinear bezier curve at a specific point?

text: I'm currently fiddling around with the pgf library `curvilinear`. What I want to do is make a shape bending like the shape of a `grid`, a `grid` very similar to this one: Canvas transformation of grid to curvilinear grid One issue however, is that I cannot seem to spawn this `grid` at a designated place in my `tikzpicture`. How can I spawn the `grid` at say, point (0,-5) in my `tikzpicture`? So basically, I want to create a flat amount of offset on the nonlinear transformation to then use it as a reference to make a rectangular curve wrapped across the grid (but that shouldn't be too much of an issue). Code:               \documentclass[landscape,svgnames]{article}     \usepackage[a3paper]{geometry}     \usepackage{tikz}     \usetikzlibrary{fadings,shapes.arrows,shadows,arrows,positioning,shapes}     \usepgflibrary{curvilinear}     \usepgfmodule{nonlineartransformations}          \makeatletter       \pgfkeys{%     /polargrid/.cd,     rmin/.code ={\global\def\rmin {#1}},     rmax/.code ={\global\def\rmax {#1}},     amin/.code ={\global\def\amin {#1}},     amax/.code ={\global\def\amax {#1}},     rstep/.code={\global\def\rstep{#1}},      astep/.code={\global\def\astep{#1}}}          \def\polargrid{\pgfutil@ifnextchar[{\polar@grid}{\polar@grid[]}}%     \def\polar@grid[#1]{%     \pgfkeys{/polargrid/.cd,     rmin ={0},     rmax ={10},     amin ={0},     amax ={180},     rstep={1},      astep={10}}        %     \pgfqkeys{/polargrid}{#1}%     \pgfmathsetmacro{\addastep}{\amin+\astep}      \pgfmathsetmacro{\addrstep}{\rmin+\rstep}       \foreach \a in {\amin,\addastep,...,\amax}  \draw[gray] (\a:\rmin) -- (\a:\rmax);        \foreach \r in {\rmin,\addrstep,...,\rmax}  \draw[gray] (\amin:\r cm) arc (\amin:\amax:\r cm);          }      \makeatother            \begin{document}     \begin{tikzpicture}[scale=2,node distance=1cm, auto,baseline=-.5ex]          \polargrid[rmin=4,rmax=8,amin=180,amax=360] at (5,0)          \end{tikzpicture}     \end{document}


title: Minimize automatically the page size of the PDF outputs

text: I would like to produce the PDF version of the following TEX code without margins. How can I achieve this automaticcaly, even if it needs tricky code (I'm a regular user of Python) ? I would like to that so as to show examples of small LaTeX codes without wasting storing spaces on my web site.               \documentclass[10pt,a4paper]{article}         \usepackage[utf8x]{inputenc}         \usepackage{ucs}         \usepackage{amsmath}         \usepackage{amsfonts}         \usepackage{amssymb}               \begin{document}          \section{One document to display}          How to produce an output without any margin.          \noindent     $ E = m c^2 $ but it seems that we can have $ v > c $.          \end{document}


title: No index is generated while using makeindex of latex

text: I have Java code and each time I run the pdflatex and makeindex, the following output is produced: ![enter image description here](http://i.stack.imgur.com/rKU67.png) The last output in the console is: ![enter image description here](http://i.stack.imgur.com/rUMZY.png) I don't know why this happens. The .idx file looks okay and the resulting PDF file contains all content, but no index.


title: Subgraph node overlaps with regular - tikz

text: I'd like to have beautiful state machine without any thinking of it's layout. I also need some node grouping with description of the group. So, I wrote the following:               \documentclass{article}          \usepackage{tikz}          \usetikzlibrary{backgrounds, positioning, fit, graphdrawing, graphs, automata, shapes.geometric}     \usetikzlibrary{shapes, snakes, petri}     \usetikzlibrary{arrows, decorations.pathmorphing}     \usegdlibrary{trees, layered, force}          \begin{document}     \begin{tikzpicture}       \graph[tree layout, grow' = right,              nodes = {ellipse, draw}]       {         s -> {s1, s2, s3};         s1 -> s1v2;         s1v2 -> s1v1 ->[bend right] s1v2;         s1v2 -> s1v3t;         s2 -> s2v1 -> s2v2 ->[bend right] s2v1;         s2v2 -> s2v3t;         s2 -> s2v3 -> s2v2t;         s3 -> s3v2 -> {s3v3t, s3v1t};         NS1[draw, rectangle] // {s1v2, s1v1};         NS2[draw, rectangle] // {s2v1, s2v2}       };     \end{tikzpicture}     \end{document}      However, subgraph nodes is overlapping with the regular ones. (If you want to see it for yourself, compile code with `lualatex` \- it's required for TikZ 3 graph lay out algorithms). I think it's a consequence of them being created after graph has been laid out (see `pgf` manual). What can I do?


title: How can I increase the size of integral inside tikz and the length of the arrow

text: Code:               \documentclass[a4paper,10pt]{article}     \usepackage{tikz}     \usepackage{amsmath}     \usetikzlibrary{arrows,chains,positioning,scopes}     %     \makeatletter     \tikzset{join/.code=\tikzset{after node path={%     \ifx\tikzchainprevious\pgfutil@empty\else(\tikzchainprevious)%     edge[every join]#1(\tikzchaincurrent)\fi}}}     \makeatother     %     \tikzset{>=stealth',every on chain/.append style={join},              every join/.style={->}}     \tikzstyle{labeled}=[execute at begin node=$\scriptstyle,        execute at end node=$]     %     \begin{document}     \begin{tikzpicture}[start chain] {         \node[on chain] {$\int \cos^3(2x) dx$};         \node[on chain, join={node[above]               {$dx \leftarrow \frac{1}{2} d2x$}}] {$\int \cos^3(2x) \frac{1}{2} d2x$} ;       }     \end{tikzpicture}     $$     \int \cos^3(2x) dx     $$     \end{document}      Output: ![enter image description here](http://i.stack.imgur.com/Qd68J.png)   1. How can I make the integral symbol bigger in tikz picture?   2. How can I make the arrow, that shows the transformation to auto-adjust it's length to the size of the expression above it? Currently it's much shorter, making the text overlap.


title: Problem with ntheorem, align and \qedhere

text: I would like to use the `align` environment inside a proof with `ntheorem`, but I have trouble with `\qedhere`. I was guided by this (http://tex.stackexchange.com/a/2280/30325) code, and replaced `\[` by `align` \- please consider this:               \documentclass{article}      \usepackage[english]{babel}     \usepackage{amsmath}     \usepackage[amsmath,amsthm,thmmarks]{ntheorem}     \begin{document}          \begin{proof}        \begin{align*}        f(x) & = 1 \\             & = \frac{22222222222222222222222222222222222222222222222}{22222222222222222222222222222222222222222222222}      \end{align*}     \end{proof}          \begin{proof}       \[\frac{22222222222222222222222222222222222222222222222}{22222222222222222222222222222222222222222222222}\]      \end{proof}            \end{document}        which gives ![enter image description here](http://i.stack.imgur.com/rpwsJ.png) In the `align` example, `\qedhere` is placed a bit too high. How can this be fixed?


title: How to refer Bibliography items in appendix?

text: I am referring bibliography items in the appendix. In my thesis Bibiliography is appearing after appendix. Everywhere in the text bibliography is properly referred but in appendix latex diaplays "[?]" in place of cited references. Jatin


title: pgfplots: coordinate dropped

text: Consider the following graph:               \documentclass{standalone}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}         \begin{axis}[            xmin=1.1,xmax=1.5,            xlabel={$Q^2$},            ylabel={$\alpha_{\textrm{eff}}\left(Q^2\right)$},            axis on top,            ticks=none,            scaled ticks=false,             legend style={at={(0.5,1.)},anchor=north,legend cell align=left,legend plot pos=left, font=\small,draw=none,fill=none} ,           ]       \addplot[color=red,samples=300] {1/(1 - 2 * ln x)};       \addlegendentry{$\alpha$}       \addplot[color=blue,samples=300] {1/(2 * ln x)};       \addlegendentry{$\alpha_s$}     \end{axis}     \end{tikzpicture}     \end{document}      The two functions used to not have any any discontinuity in the regime used for the plot - they should behave regularly. However, I get lots of these:               NOTE: coordinate (2Y1.6876381e-2],3Y0.0e0]) has been dropped because it is unbounded (in y). (see also unbounded coords=jump)      Can somebody explain me what is going on here and how I can avoid these messages? I'm not interested in merely suppressing them - I would like to understand what's the reason for them to appear in the first place. Also I have noticed that changing the number of samples affects the plot in a surprising way: `samples=300` ![with 300 sampling points](http://i.stack.imgur.com/MgHvf.jpg) `samples=200` ![with 200 sampling points](http://i.stack.imgur.com/LCdQQ.jpg) `samples=100` ![with 100 sampling points](http://i.stack.imgur.com/oNa0k.jpg) `samples=50` ![with 50 sampling points](http://i.stack.imgur.com/Nr3t2.jpg) I am suprised by the extreme jumps in the last graph - it looks like there are only 2-3 points used... what is the reason for this?


title: When is a word processor better than LaTeX?

text: I've read about the benefits of LaTeX for creating high-quality typography in documents, but I'm wondering in what situations a word processor (e.g., Word) is better. For instance, are reports with multiple graphics better suited to something like Word? And what about resumes?


title: Font in tikz figures

text: I would like to use the same font that I'm using in the whole document (Gentium Plus) for any text in figures (at the moment I only have tikz- figures) in the document. So far the standard font is used there. A minimal example that I'm compiling with xetex (I took the picture from texample.net and simplified it a bit):               \documentclass{scrbook}     \usepackage{fontspec}     \setmainfont[Renderer=ICU,Mapping=tex-text]{Gentium Plus}     \usepackage{tikz}     \usepackage{pgfplots}     \begin{document}          \begin{figure}          \begin{tikzpicture}     \begin{axis}[         xlabel=$Example label$,         ylabel=$Example label$]     \addplot plot coordinates {         (0,2)         (2,3)         (3,1)     };     \addlegendentry{Example text}          \end{axis}     \end{tikzpicture}          \end{figure}     This is some example text in Gentium Plus. Looks quite cool, doesn't it?          \end{document}      I only found answers on how to use sans serif fonts in tikz pictures, but none seemed to asked my question before, although I think it should be easy to do.


title: Can the standalone document type be made compatible with tikzexternalize?

text: Code:               \documentclass[tikz]{standalone}     \usetikzlibrary{external}     \tikzexternalize     \begin{document}     \begin{tikzpicture}     \node[circle,draw] at (2, 3) {};     \end{tikzpicture}     \begin{tikzpicture}     \node[circle,draw] at (2, 3) {};     \end{tikzpicture}     \end{document}      Yields > ! Missing } inserted. Something is wrong with standalone when used with tikzexternalize. Can this be made to work?


title: Reducing space in pgfplots xtick label number format?

text: With the following MWE:               \documentclass{standalone}     \usepackage{pgfplots}     \usepackage{tikz}     \usetikzlibrary{intersections} %% named intersections     \usetikzlibrary{fit}     \usetikzlibrary{calc}               \begin{document}          \begin{tikzpicture}     \begin{axis}[       width= 400pt,       ymin = 0,       ymax = 5,       xmin = 0,       xmax = 7,       xtick = {0,1,...,7},       scaled x ticks=real:2324823,       xtick scale label code/.code={}, % this to not show extra scale label     ]          \addplot [] coordinates {(0,0)};          \end{axis}     \end{tikzpicture}          \end{document}      ... I'm getting xtick label formatting like this: ![test_pdf](http://i.stack.imgur.com/mwTYP.png) I would prefer less spacing between the numbers and the central dot - this is the previous image edited in Gimp to show my preference: ![test_pdf2](http://i.stack.imgur.com/bcLup.png) Is this possible to do somehow - maybe through some settings for `/pgf/number format/sci`?


title: Hide an environment and show it later in the document

text: I am trying to set up an environment for making exercises with corresponding answers for students. ## Idea I would like to be able to write the text for an exercise in an environment, and directly after write the answer (preferably in another environment). The exercise should show up where it is written, but the answers should remain hidden until a command, e.g. `\listofanswers`, is issued. This command would then output the answer to every question at the very place the command is issued (just like inserting e.g. `\listoffigures` or a bibliography). The answers should appear with the same numbering as the exercises they provide answers to. In this way, I could collect every answer and only show them at the end of the document instead of right after their corresponding exercise. ## Current status This is what I have been able to hack together so far:               \documentclass{scrartcl}          % Exercise environment:     \newcounter{exercise}     \newenvironment{ex}[1]{\refstepcounter{exercise}\par\medskip\noindent%        \textbf{Exercise~\theexercise\ #1\quad} \rmfamily}{\medskip}          % Basic answer environment that should take care of formatting:     \newenvironment{ansenv}{\par\medskip\noindent%        \textbf{Answer to exercise~\theexercise\quad} \rmfamily}{\medskip}          % Create a new answer environment that will store the answer for outputting later:     \usepackage{etoolbox}     \usepackage{environ}     \newcommand{\listofanswers}{}     \NewEnviron{answer}{         \xappto{\listofanswers}{             \begin{ansenv} \BODY \end{ansenv}         }     }          \begin{document}          \section{Exercises}     \begin{ex}{Exercise title 1}         This is the first exercise.     \end{ex}     \begin{answer}         This is the answer to the first exercise, and should only show up when and where \verb!\listofanswers! is used.     \end{answer}          \begin{ex}{Exercise title 2}         This is the second exercise.     \end{ex}     \begin{answer}         This is the answer to the second exercise, and should only show up when and where \verb!\listofanswers! is used.     \end{answer}          This is something that is neither an exercise nor an answer.          \section{Answers}     % Output all answers right here at the very end of the document:     \listofanswers          \end{document}      ## Expected result I would like to see something like the below: ![Expected output when using my custom exercise and answer environment.](http://i.stack.imgur.com/msYPv.png) ## Actual result Compiling gives me the following error:               ! Argument of \@firstoftwo has an extra }.     <inserted text>                      \par      l.32 \end{answer}      Can someone help me track down the bug or know of a better way to accomplish my exercise and answer environments?


title: biblatex - multileveled bibliography with shorthands

text: I'm pretty new with LaTeX, BibLaTex & co. In fact I'm trying to write my first text with it and already have a special request for citation and bibliography. 1) I want to use shorthands in my cites, like [Catalogue 1], so I use `style=verbose-ibid` 2) My bibliography should (partially) be "multileveled", so it looks a bit like a TOC: > [Catalogue 1] > >   * Content 1 >   * Content 2 >   * Content 3 > > > [Catalogue 2] > >   * Content 1 >   * Content 2 >   * Content 3 > **Example** Cite (Footnote): > DudeA, B.: Supertext. In: [Catalogue 1], p.4 <\- using only shorthand, no > year or something! Cite (Footnote) on next page: > DudeA, "Supertext". In: [Catalogue 1], p.5 <\- using shortTITLE Bibliography: > [Catalogue1] Catdude, D.: Big Catalogue of something. Montana, 1988. > >   * DudeA, B.: Supertext, p.5-8. <\- no shorthand, no year, nothing more > printed! > How can I manage that?


title: The power cut while I am running my code, and all the code is erased even the one I already saved!!! .. How can I get the code back?

text: The power cut while I am running my code, and all the code is erased even the one I already saved!!! .. How can I get the code back ?


title: Enhancing images

text: Can someone please help me with enhancing images and increasing dpi in Latex? I have come a long way, but took FOREVER to figure out how to format a table, and then format equations and matrices - I don't feel like getting stuck all over again. So far this is my figure and code:               \begin{figure}     \includegraphics[width=\linewidth]{Excel_Graphs.eps}     \end{figure}      ![enter image description here](http://i.stack.imgur.com/DDHgg.jpg)


title: Why Latex does not start a new line automatically?

text: Here is the preamble of my latex file:               \documentclass{article}     \usepackage[margin=.5cm]{geometry}     \usepackage{lipsum}     \begin{document}     \lipsum     \end{document}      My problem is the text in the document won't be started in a new line in the generated PDF file and just overflow out of the page. I find this is caused by my personal definition for margin of 0.5cm by using the geometry package. Is there any solution for this while we still use the geometry package?


title: Breakable period

text: LaTeX will not insert a line break before or after a period `.` I understand why you'd want to avoid line break before a period, since you'd otherwise get stranded periods at the end of sentences. I assume there are good reasons for not allowing breaks after a period also (perhaps to avoid splitting abbreviations such as `e.g.`) But sometimes you _do_ want to be able to break a line after a period, or at least allow the line to be broken at that juncture. In linguistics, for example, words in foreign languages are commonly glossed with the morphology explicitly explained with grammatical codes separated by periods without space, as in e.g. `f.dat.sg.indef`. In the following example, the line should be broken as `'f.dat.sg. - indef'.` Is there a way to use such "breakable periods" in LaTeX?               \documentclass{article}     \usepackage{lipsum}     \begin{document}     \lipsum[1]     Abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd ab `f.dat.sg.indef'.     \end{document}      ![enter image description here](http://i.stack.imgur.com/1C694.png)


title: Overfull hbox using biblatex

text: Here's my MWE (this is an actual bibliography item, the draft option is there to show the overfull hbox):               \documentclass[draft]{article}          \usepackage{filecontents}     \begin{filecontents*}{x.bib}     @BOOK{LV12,       title = {Algebraic operads},       publisher = {Springer},       year = {2012},       author = {Loday, Jean-Louis and Vallette, Bruno},       volume = {346},       pages = {xxiv+634},       series = {Grundlehren der Mathematischen Wissenschaften [Fundamental Principles         of Mathematical Sciences]},       address = {Heidelberg},       doi = {10.1007/978-3-642-30362-3},       isbn = {978-3-642-30361-6},     }     \end{filecontents*}          \usepackage{biblatex}     \addbibresource{x.bib}          \begin{document}     \nocite{*}     \printbibliography     \end{document}      This produces: > Overfull \hbox (15.12822pt too wide) in paragraph at lines 27--27 I'm generally aware of how to fix overfull hbox from text I wrote myself, but not when the text is produced by a package. What is the best course of action here? Altering the entry is not an option.


title: pgfplots cannot read table from file

text: I am trying to plot using `pgfplots` from a file containing two colums separated by tabs.               Tweak   Probability     4   0.0065935332     5   0.0006670277     6   0.0002015741     7   6.31090951863062E-005     8   0.000012437     9   0.000003721     10  1.02492049264844E-006     11  2.40164808733254E-007     12  0.000000056     13  1.525040714335E-008     14  0.000000003     15  9.31322573422856E-010     16  4.65661286657218E-010     17  5.82076609134674E-011     18  7.27595761413049E-012     19  7.27595761407755E-012      When I do `\addplot table[x=Tweak, y=Probability] { myfile.dat };`, I get this error:               ! Package pgfplots Error: Could not read table file '" img/doubletweak.dat "'. In case you intended to provide inline data: maybe TeX screwed up your end-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the pgfplotstable manual for details).      I tried doing what it says, to no avail. When I copy and paste the table and use it in-line, the plot works fine. What might be wrong?


title: Internal pdf viewer after having connected an external screen

text: Last week i used texmaker and its internal viewer to see my thesis on an external screen. Now i have the external screen disconnected but everytime i re-run my .tex file to see my thesis in the internal viewer again, it appears on my icons but i can't reach it so i can't see it... Don't know if it's clear but in my taskbar i see the small icon which should lead me to the pdf file but when i click on it, nothing shows up. I tried right clicking and "moving" on the small icon, but doesn't work neither.. Please help me, i don't have another screen to see it again :(


title: How can we change allowframebreaks numbering in the title?

text: \documentclass{beamer}     \begin{document}          \section{Proposed Methods}     % motivation for creating this theme     \begin{frame}[allowframebreaks]{Proposed Methodology}     \renewcommand{\baselinestretch}{1.5}  % Add line spacing ..     \begin{itemize}        \item Datasets : \insertcontinuationtext             \begin{enumerate}                        \item $\text{{Multi Domain Sentiment}}^\text{{[5]}}$ Dataset contains product reviews taken from Amazon.com.                           \begin{itemize}                               \item BOOKS : 1000 Positive reviews and 1000 Negative reviews.                             \end{itemize}                       \item $\text{{Movie Reviews}}^\text{{[6]}}$ : \\                           \begin{itemize}                                \item All html files we collected from the $\text{IMDb archive}^{[7]}$. \\                                 \item 770 Positive reviews and 703 Negative reviews. \\                           \end{itemize}              \end{enumerate}         \item Preprocessing :                   \begin{enumerate}                     \item \textcolor{violet}{Upper to lower conversion}: All reviews are converted to lower case.                          \item \textcolor{violet}{Normalization} : All word with apostrophies should be replace with its orginal form.                          \\ eg :$\textcolor{red!=70}{\text{don't} \rightarrow \text{do not}}$                          \item \textcolor{violet}{Non ASCII removal} :  All non ASCII characters are removed from the reviews. \\ eg :$\textcolor{red!=70}{\bigstar \spadesuit \clubsuit \blacklozenge}$                          \item \textcolor{violet}{Remove new lines} : Blank lines are removed from the reviews.                          \item \textcolor{violet}{Stopword removal } : Stopwords in English language are \\ \textcolor{red}{an,are,the,a} etc.To remove all such words we are using Natural Language Toolkit$\text{(NLTK)}^{[8]}$. \\                          \item \textcolor{violet}{Stemming} : A processing of interface for removing morphological affixes from words. eg:$\text{\textcolor{red!=70}{beauty,beautiness,beautiful}}\Rightarrow \text{\textcolor{red!=70}{beauti}} $                        \end{enumerate}           \item Dataset Partitioning :               \begin{enumerate}                   \item {\scriptsize {\textbf{MOVIES}}}:                     \begin{figure}                       \centering                       \includegraphics[height=1.8cm,width=4cm]{example-image-a}                       \caption{\scriptsize {Fig 1:Dataset Partitioning of MOVIE reviews}}                     \end{figure}                   \item \scriptsize {\textbf{BOOKS}}:                   \begin{figure}                       \centering                       \includegraphics[height=1.8cm,width=4cm]{example-image-b}                       \caption{\scriptsize {Fig 2: Dataset Partitioning of BOOK reviews}}                     \end{figure}                  \end{enumerate}              \item Feature Selection:                 \begin{enumerate}                                   \item Mutual Infromation :                       Selects features that are not uniformly distributed among the classes.                          \begin{equation}                               \begin{split}                               MI(F,C_{k})=(\frac{N_{F,C_{k}}}{N}).log(\frac{N.N_{F,C_{k}}}{N_{F}.N_{C_{k}}})+\\                               (\frac{N_{F,\bar{C_{k}}}}{N}).log(\frac{N.N_{F,\bar{C_{k}}}}{N_{F}.N_{\bar{C_{k}}}})+\\                               (\frac{N_{\bar{F},C_{k}}}{N}).log(\frac{N.N_{\bar{F},C_{k}}}{N_{\bar{F}}.N_{C_{k}}})+\\                               (\frac{N_{\bar{F},\bar{C_{k}}}}{N}).log(\frac{N.N_{\bar{F},\bar{C_{k}}}}{N_{\bar{F}}.N_{\bar{C_{k}}}})\;                               \end{split}                               \end{equation}                               \textit{F} depicts the presence of feature \textit{F} \\                               \textit{$\bar{F}$} is the absence of feature \textit{F} \\                               \textit{$C_{k}$} is the Positive class \\                               \textit{$\bar{C_{k}}$} represents Negative class \\                               \textit{N} depicts Total samples                                     \end{enumerate}          \end{itemize}          % \hyperlink{Architecutre for Sentimental Classification}{\beamerbutton{Diagram}} % Hyperlink...     \end{frame}     \end{document}      Each frame displays Proposed Methodology I, Proposed Methodology II, etc.. I want to change it to Proposed Methodology [1/2], Proposed Methodology[2/2], etc. How can I achieve this output?


title: Drawing circular paths in random locations (TikZ)

text: How can I draw circular paths as shown below in random locations (randomly spaced in the `x` and `y` directions)? MWE:               \documentclass[border = 0.12cm,tikz]{standalone}     \usetikzlibrary{decorations.pathmorphing,snakes}     \usepackage{amsmath}     \begin{document}     \begin{tikzpicture}[x = 4.5in, y = 2in]     \fill [blue!20] (0,0) -- (1,0) -- (1,0.5) -- (0,0.5) -- cycle;          \foreach \x in {0.05,0.075,0.25,0.35,0.45,0.55,0.65,0.85}       \draw [>=stealth,->] (\x,0.1) arc (280:0:.1cm) -- +(283:0.05cm);          \end{tikzpicture}     \end{document}      ![](http://i.stack.imgur.com/JsH5P.png)


title: Add arrows to a smooth tikz function

text: Using this answer here I have been able to draw smooth curves using tikz Easy curves in TikZ but I also wanted arrows along my curves, after a bit of fiddling I came up with the following               \documentclass[a4paper,12pt]{standalone}      \usepackage{tikz}     \usetikzlibrary{arrows}     \input{arrowsnew}     \usetikzlibrary{decorations.pathreplacing,decorations.markings}     \tikzset{arrow data/.style 2 args={%           decoration={%              markings,              mark=at position #1 with \arrow{#2}},              postaction=decorate}           }%     \begin{document}     \begin{tikzpicture}     \begin{scope}[scale=2]     \node[label=below:$A$] (A) at (0,0) {};     \node[label=below:$B$] (B) at (2,0.25){};     \draw [red,arrow data={0.25}{stealth},                arrow data={0.5}{stealth},                arrow data={0.75}{stealth}] plot [smooth,tension=1] coordinates {(A) (1,0) (1.14,-0.6) (0.5,-0.5) (0.5,0.5) (1.5,0) (B)};     \draw [black] plot [smooth,tension=1] coordinates {(A) (1,0) (1.14,-0.6) (0.5,-0.5) (0.5,0.5) (1.5,0) (B)};     \end{scope}     \draw [fill=black] (A) circle (1pt);     \draw [fill=black] (B) circle (1pt);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/PtnKk.png) This seems somewhat hacky and I am looking for a solution improving a few parts about the code. Optimally I would like   * _that the arrow scales along with the scaling of the figure (or specify size, not really wanted)._   * _different colors for the curve and the arrow heads. Something along the lines of_ `\draw[color = black,arrow color = red,...]`   * _to specify number of arrows along the curve OR use the number of points. Eg_ `\draw[arrow number=10]` and `\draw[arrow number=points]` For the colors I used the same plot function twice, ugh. Optimally the arrows should be in front of the figure and not behind. I have seen a post about scaling arrow heads, for an example Is it possible to change the size of an arrowhead in TikZ/PGF? but I was not able to implement the solution... Adding arrowhead=10mm to the `\draw` command did nothing. I also found a question regarding several arrows along a curve deppendant on the number of points, TikZ: How to draw an arrow in the middle of the line? However this is using the `\path` option in tikz instead of `\plot` as I am using. Blindly implementing the solution Latex decided to throw me a couple of `dimensions to large` errors, so I guess one has to use a bit more finesse to implement this. Any help or ideas for implementing the bulleted items would be much appreaciated. I really tried solving these issues on my own, but my tikz abilities are somewhat limited.


title: LaTeX \usepackage{datetime} and \usepackage{scrtime} are off by an hour

text: I want to print the current time in my LaTeX file but both `\usepackage{datetime}` and `\usepackage{scrtime}` show the wrong time. Can I correct to a different time zone? Adjust for daylight savings? I am writing in `https://www.sharelatex.com/` so I suppose it is the server time that is being shown.


title: Table width with multicolumn

text: I am producing lots of tables automatically with Stata (perhaps its useful to know that the top, content and bottom of the table are produced separately and then pasted together into one file I `\input`}. All of these tables have notes at the bottom which I insert using `\multicolumn`. In order to get the notes to wrap I need to define a fixed column width which I do in Table 2 below using `{p{\linewidth}}`. Does anybody have a suggestion how I can limit the width of the second table to the width of the first table?               \documentclass{article}          \usepackage{booktabs}          \begin{document}          % Table 1      \begin{table}[htbp]     \centering      \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}      \caption{bla \& table}      \begin{tabular}{l*{3}{c}} \hline \addlinespace     1 & 2 & 3 \\       4 & 5 & 6 \\       7 & 8 & 9 \\       \addlinespace \hline      \end{tabular}      \end{table}                    % Table 2      \begin{table}[htbp]     \centering      \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}      \caption{bla \& table}      \begin{tabular}{l*{3}{c}} \hline \addlinespace        1 & 2 & 3 \\      4 & 5 & 6 \\      7 & 8 & 9 \\      \addlinespace \hline \addlinespace      \multicolumn{3}{p{\linewidth}}{\footnotesize Standard errors in parentheses with       \sym{*} indicating significance at 10\%, \sym{**} at 5\%, and \sym{***} at 1\%.        All reported standard error use the robust or sandwich estimator of variance.}      \end{tabular}      \end{table}          \end{document}


title: Drawing and labeling a triangle for a demonstration for the Law of Cosines

text: I have provided the code for a triangle having vertices A, B, and C. The lengths of the sides are to be labeled a, b, and c. The altitude of the triangle is to be drawn as a dashed line segment from A to line segment BC, the foot of the altitude is to be labeled P, the height is to be labeled h, and a right angle mark is to be put at the foot. The length of PC is to be labeled x, and the length of PB is to be labeled b-x, and these labels are to be inside the triangle. There are now two smaller triangles that are similar to each other. One pair of angles that have equal measure are to be labeled with an arc having a "peg" through it; the other pair of angles that have equal measure are to be labeled with an arc having two "pegs" through it.               \documentclass[10pt]{amsart}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{mathtools,array}     \usepackage{tikz}          \tikzset{     mydot/.style={       fill,       circle,       inner sep=1.5pt       }     }          \begin{document}               \begin{tikzpicture}[>=latex]          % the coordinates of the vertices     \coordinate (C) at (0,0);     \coordinate (A) at (100:4cm);     \coordinate (B) at (20:5cm);          % the edges of the triangle     \draw (C) -- (A) -- (B) -- cycle;          % labelling the vertices     \node[mydot,label={left:$A$}] at (A) {};     \node[mydot,label={right:$B$}] at (B) {};     \node[mydot,label={below left:$C$}] at (C) {};          \end{tikzpicture}          \end{document}


title: Can we imitate the behavior of \pscurve in TikZ?

text: Here it is with the pictures. PSTricks has the very neat command `\pscurve`. The manual gives the example               \pscurve[showpoints=true]{<->}(0,1.3)(0.7,1.8) (3.3,0.5)(4,1.6)(0.4,0.4)      which yields ![pscurve example](http://i.stack.imgur.com/SQ4Kr.png) Does somebody knows how to get the same behavior in TikZ? I have tried using all sorts of techniques including               \tikz \draw plot[smooth] coordinates {(0,1.3) (0.7,1.8) (3.3,0.5) (4,1.6) (0.4,0.4)};      which gives me ![tikz plot example](http://i.stack.imgur.com/dQ38q.png) (I did try to play with the tension!). The resulting curve always looks like a succession of straight segments with rounded corners. Thank you for the points!


title: Concatenating book chapters at the PDF level

text: There are some LaTeX packages which conflict with each other. When assembling a book from different chapters provided by different contributors, it might be not too easy to resolve these conflicts. In such cases, a possible workaround is to compile the chapters in isolation, adjusting page and chapter offsets, and then to concatenate at the PDF level. Obviously, chapter cross-references, a global index, glossary, list of pictures, table of contents, bibliography, ... need extra work, which could be automated to a certain extent. Given such an automation, the merging then might be much easier than trying to merge at the TeX level. The only thing that would require manual (?) labor is to add hyperlinked chapter cross- references, a non-issue for a printed book. Would this be a feasible workflow for a publisher? Is anyone aware of an implementation, perhaps as "intellectual property" of a publisher? Would there be other drawbacks? The following questions are similar, but not the same: Compile separate document chapters into book w/o duplicate references? How do I create a book with separately produced chapters?


title: Hyperref links linking to the wrong label.

text: I'm currently trying to write up some solutions to a set theory text, but some of my labels don't seem to be working correctly. I've uploaded it here, if it's perhaps helpful to look at. Anyway, I have two sections so far, Introduction and Axioms and Operations. In Axioms and Operations after the third exercise, I have \label{exer3}. Later in exercise 6, I reference it twice with \ref{exer3}, however, the hyperlink instead links one back to exercise 3 of the Introduction section, not exercise 3 of the Axioms and Operations section. The label of exercise 3 in the Introduction section is \label{pwrsetex}. I've also noticed that I have several warnings when building, saying > pdfTeX warning (ext1): destination with the same identifier > (name{exercise.1}) has already been used, duplicate ignored. I have one of these for (ext1) through (ext5). Not sure if it's pertinent, but at the beginning of the section Axioms and Operations, I reset the Exercise counter with \setcounter{exercise}{0}. Could someone please show me what I'm doing wrong here? Thanks! I can include the actual code, if that makes my question any more clear. * * * This is the code for exercise 3 of Axioms and Operations:               \begin{exercise}\label{exer3} Show that every member of a set $A$ is a subset of $\bigcup A$.      \begin{proof}[\bf Solution.] If $A=\emptyset$, then the statement is vacuously true. So suppose $A$ is nonempty, and take some $b\in A$. Again, if $b$ is empty, then the statement holds. So suppose $b$ is nonempty. Then for any $t\in b$, $t\in\bigcup A$ by the Union Axiom. In other words,      $$     \forall t(t\in b\Rightarrow t\in\bigcup A).     $$     This is precisely the definition that $b\subseteq\bigcup A$.        \end{proof}     \end{exercise}      For exercise 6 of Axioms and Operations:               \begin{exercise}      \begin{enumerate}     \item Show that for any set $A$, $\bigcup\mathscr{P}A=A$.      \item Show that $A\subseteq\mathscr{P}\bigcup A$. Under what conditions does equality hold?     \end{enumerate}     \begin{proof}[\bf Solution.] For $(a)$, take $x\in\bigcup\mathscr{P}A$. So there exists some $b\in\mathscr{P}A$ such that $x\in b$. Since $b\in\mathscr{P}A$, $b\subseteq A$, and thus $x\in A$. Also, since $A\subseteq A$, by definition of the power set, $A\in\mathscr{P}A$. Then by Exercise \ref{exer3}, it follows that $A\subseteq\bigcup\mathscr{P}A$.     For $(b)$, take $x\in A$. Again by Exercise \ref{exer3}, $x\subseteq\bigcup A$, so by definition of the power set, $x\in\mathscr{P}\bigcup A$. Equality holds when $A$ has form $\{\emptyset\}$ or $\{a,\emptyset\}$. If $A=\{\emptyset\}$, then $\bigcup A=\emptyset$, and so $\mathscr{P}\bigcup A=\{\emptyset\}$.      \end{proof}     \end{exercise}      For exercise 3 of the Introduction:               \begin{exercise}\label{pwrsetex} Show that if $B\subseteq C$, then $\mathscr{P}B\subseteq\mathscr{P}C$.     \begin{proof}[\bf Solution.] Suppose $A\in\mathscr{P}B$. Then $A\subseteq B$, and thus $A\subseteq C$, as containment is transitive. Hence $A\in\mathscr{P}C$.     \end{proof}     \end{exercise}      My preamble is:               \documentclass[11pt]{article}     \input{other/packages.tex}     \input{other/theoremdef.tex}      where packages.tex is               \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{amscd}     \usepackage{url}     \usepackage[top=1.3in, bottom=1.3in, left=1.3in, right=1.3in]{geometry}          % header and footer     \pagestyle{headings}          \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{stackrel}     \usepackage{mathrsfs}     \usepackage{verbatim}     \usepackage{enumerate}     \usepackage{hyperref}     \usepackage{xy}     \input xy     \xyoption{all}      and theoremdef.tex is               \newtheorem{exercise}{\bf Exercise}


title: Ending sentences in an aligned equation

text: This is more of a general "mathematical english/punctuation" question, but I figure TeX users will know the answer. The following sentence seems natural:               We define the $xyz$ constant via $xyz=\int_0^\infty f(y)dy$.      Note the period at the end, which is of course correct. What if I decide to align the equation for $xyz$?               We define the $xyz$ constant via           \begin{align}         xyz=\int_0^\infty f(y)dy      \end{align}        Should I still place a period at the end of this sentence (in the aligned equation)? Is it considered bad form to end sentences in the middle of aligned equations like this? Thanks!


title: Different fonts per language

text: I am using Greek, English babel. For some reason when I generate the pdf there are different fonts for greek and different for english. How can I use the same fonts and are the fonts machine dependent? See image: ![enter image description here](http://i.stack.imgur.com/dr1kw.png)


title: How to avoid unwanted Spaces in \NewDocumentEnvironment?

text: I tried to make my own "quote"-Environment and I wanted the first Letter to be bold and a little bit bigger than the rest. As `\lettrine` doesn't work the way i wanted, i tried to code it on my own. Everything works as intended, except one thing: I get a white space between the `L` and the `orem Ipsum` and i don't know where it comes from               \documentclass[12pt,a4paper,listof=totoc,oneside]{scrreprt}     \usepackage[ngerman]{babel}          \usepackage{xcolor}     \definecolor{citecolor}{HTML}{6495ED}           % Weil ich parameter im end-teil haben will     \usepackage{xparse}          % Eigene Quotes     \usepackage{csquotes}     \NewDocumentEnvironment{myquote}{m o}{%         \begin{samepage}%             \list{}{%                 \setlength{\leftmargin}{1.5em}%                 \setlength{\rightmargin}{1.5em}%                 \setlength{\topsep}{0em}%                 \setlength{\parsep}{0pt}%                 \setlength{\partopsep}{0pt}%                 \setlength{\parskip}{0pt}%             }%             \item\relax%             \begin{itshape}%                 % Anführungszeichen                 \begin{large}\textbf{\textcolor{citecolor}{\flqq}}\end{large}                 % Großer Buchstabe (wenn angegeben)                 \IfNoValueTF{#2}{}{{\Large{\textbf#2}}}%     }{%                 \begin{large}\textbf{\textcolor{citecolor}{\frqq}}\end{large}             \end{itshape}%             \endlist%             % Quelle             \hspace*{\fill}\mbox{\footnotesize\textcolor{citecolor}{\cite{#1}}}%             \vspace{1.5em}%         \end{samepage}%     }%                    \begin{document}          % Calling the Environment     \begin{myquote}{WIKI1}[L]     orem Ipsum...     \end{myquote}          \end{document}


title: How to write \LaTeX properly?

text: I just started learning LaTeX, and I'm having trouble to write a symbol, LaTeX. ![enter image description here](http://i.stack.imgur.com/8pa9K.png)


title: How to detect the length of the tallest letter and that of the deepest letter of the current font size?

text: My idea is to redefine the `\strut` to be as short as possible. It means the length of strut is the sum of the tallest letter length and the deepest letter length.


title: How to draw a line passing through a point and perpendicular to another?

text: I'm having a bit of a headache right now as I can't draw this basic figure: **A straight line goes through points A and B. Another line is perpendicular to AB and goes through an arbitrary point P.** I fiddled with the |- operator but it only seems to work with horizontal or vertical lines. Is this even possible? Bonus question: when drawing AB, is it possible to let the line poke out a little? For example, when writing **\draw (A) -- (B);** the line strictly goes from A to B. I'd rather have a line passing through these points but starting 1cm in front of A and ending 1cm after B (for example). Thank you for your help :)


title: Changing Orientation of Tick Marks

text: I had a question about changing the orientation of an tick mark. For example doing something as so: 'u' Both are pointing to the left, but for the tick mark on the left side of the object, I want to point inward towards the object, say for instance the alphabet `u` and the tick mark on the right side of the object, I want it to point inwards towards the object, say also the alphabet `u`. I thought I used to know how to do this, but I must of forgot. If anyone needs me to clear up what I am asking, let me know in a comment.


title: Dash in labels (Was: Labeling and citations issues with spell checker)

text: I try to separated my LaTeX files into content files, and macro files. In content files, I minimize the use of macros, trying to restrict these to markup only, e.g., `\section`, `\caption`. The benefit is that you can spell check only content files, and allow the spell checker to check everything except for words which begin with a backslash. The main difficulty is with labels and citation. It is customary to use words separated with columns as labels for figures, sections, etc. Even if all words are spelled correctly, my spell checkers gets confused by these. Is there another convention which is friendlier to spell checkers? A related question is that of citations. Author names are typically a problem, but I guess one should add the main author names to the user defined dictionary, but perhaps someone has a better scheme? * * * Does it makes sense to place dash (minus symbol) or slash characters in labels? E.g., something as simple as `label{Figure/time/series}`? * * *


title: How to control column/page breaks in multicols environment with nested lists?

text: I've a nested list within a multicolumn like this:               \begin{multicols}[2]       \begin{list}         \item main item1           \begin{list}             \item this is a very long item              \item this is a short item           \end{list}         \item main item2           \begin{list}             \item short item here           \end{list}         \item main item3           \begin{list}             \item this is a long item              \item this is a short item           \end{list}         \item ....       \end{list}     \end{multicols}      However, it happens that the multicol package or LaTeX breaks the column or the page immediately after the first level `\item` and before the `\begin{list}`. This really looks bad. It also happens, that the `\item` is on the last line of a page and the nested list starts on the next page. Does anyone know how that could be changed, so that there is no longer a column/page break at that not so nice position (without having to manually insert `\columnbreak` every time), cause the document is really long and auto- generated from a database. Shortest possible example (but just a special case):               \documentclass{article}     \usepackage{multicol}          \begin{document}         \begin{multicols}{2}             \begin{list}{}{}             \item{Item 1}             \begin{list}{}{}                 \item{Sub Item 1}             \end{list}         \end{list}     \end{multicols}     \end{document}


title: Numbering of compounds in the order it appears in the schemes (bpchem or similar)

text: I am using `chemstyle` and `bpchem` to number my compounds. I save my chemdraw drawings as eps and use TMP and TMP2 as markers that will replaced by the compound numbers. As long as `\CNlabel` is used before the scheme is inserted, it works fine, but if the text is below the picture as in the following example, the labeling in the text is different from the labeling in the schemes.               \documentclass{article}      \usepackage[runs=2]{auto-pst-pdf}     \usepackage{bpchem}     \usepackage[journal=rsc, tracking=bpchem]{chemstyle}     \usepackage[version=3]{mhchem}           \begin{document}          \begin{scheme}         \begin{center}             \schemeref[TMP]{1}             \schemeref[TMP2]{2}             \includegraphics{Reactions_MSC/I010}         \end{center}     \end{scheme}          \begin{scheme}         \begin{center}             \schemeref[TMP]{3}             \schemeref[TMP2]{4}             \includegraphics{Reactions_MSC/I012}         \end{center}     \end{scheme}                Text where I mention the compounds in a different order than in the schemes: \CNlabel{2}, \CNlabel{3}, \CNlabel{4}, \CNlabel{1}          \end{document}       Additionally, I would prefer to have the numbering in the order the compounds appear in the schemes instead of in the order they appear in the text. Is there a good solution to do this? One possible workaround I can think of would be to add a list like this in the beginning of the document:               \CNlabelnoref{1}     \CNlabelnoref{2}     \CNlabelnoref{3}     \CNlabelnoref{4}      To do this manually, however, would be quite tedious. Is there a way I could generate such a list automatically?


title: Pgfplots: plot graph inside table

text: I would like to plot a table with a graph inside it. I am trying to use this example as a guide. This is the current hand-constructed version. ![1](http://i.stack.imgur.com/lI4jj.png) **UPDATE:** I don't have enough reputation to answer my own question, but I'm getting there: I have got this far, using `\multirow` So with a little tweaking I may be able to get it to work? I will come back and edit if I do. ![attempt](http://i.stack.imgur.com/hYhGn.png)               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usepackage{dcolumn}     \usepackage{multirow}     \usepackage{booktabs}     \usepackage{lscape}     \usepackage{verbatim}     \usepackage{pgfplots}     \begin{document}     \newcommand{\errplot}{%     \begin{tikzpicture}     \begin{axis}%[xmin=-1.5,xmax=1.5, ymin=-.5,ymax=23,grid=both]      \addplot+[only marks][error bars/.cd,x dir=both, x explicit]     coordinates {     (-0.42,22)+-(0.86,-1.7)     (0.04,21)+-(0.9,-0.81)     (0.1,20)+-(0.69,-0.49)     (0.3,19)+-(0.7,-0.1)     (0.8,18)+-(0.72,0.88)     (0.37,17)+-(0.7,0.04)     (-0.03,16)+-(0.68,-0.75)     (-0.3,15)+-(0.53,-1.13)     (0.32,14)+-(0.54,0.1)     (-0.38,13)+-(0.55,-1.31)     (0.12,12)+-(0.54,-0.3)     (-0.1,11)+-(0.53,-0.73)     (0.12,10)+-(0.55,-0.32)     (-0.2,9)+-(0.57,-0.97)     (-0.39,8)+-(0.58,-1.36)     (-0.35,7)+-(0.57,-1.27)     (0.09,6)+-(0.56,-0.37)     (-0.53,5)+-(0.55,-1.62)     (0.23,4)+-(0.56,-0.11)     (0.18,3)+-(0.58,-0.21)     (0.05,2)+-(0.57,-0.47)     (0.02,1)+-(0.55,-0.52)     };     \addplot[dashed] coordinates {(0,-1) (0,24)};     \end{axis}     \end{tikzpicture}%     }               \begin{table}[h!]     \centering                               \begin{tabular}{c c c c c}                \hline     & & & & Standardised \\      & & z & \emph{p} & Mean (95\% CI) \\ [0.5ex]       \hline     Afear & \multirow{22}{8cm}{\errplot} & -0.96 & 0.33 & -0.42 (-1.28 to 0.44) \\     Anofear & & 0.09 & 0.93 & 0.04 (-0.85 to 0.94) \\     B+2 & & 0.29 & 0.78 & 0.10 (-0.59 to 0.79) \\     B+1 & & 0.84 & 0.40 & 0.30 (-0.40 to 1.00) \\     B1:1 & & 2.19 & 0.03 & 0.80 (0.08 to 1.52) \\     B-1 & & 1.02 & 0.31 & 0.37 (-0.33 to 1.07) \\     B-2 & & -0.10 & 0.92 & -0.03 (-0.72 to 0.65) \\     C+2 & & -1.11 & 0.27 & -0.30 (-0.83 to 0.23) \\     C+1 & & 1.15 &  0.25 & 0.32 (-0.22 to 0.86) \\     C1:1 & & -1.34 & 0.18 & -0.38 (-0.93 to 0.17) \\     C-1 & & 0.43 & 0.67 & 0.12 (-0.42 to 0.66) \\     C-2 & & -0.37 & 0.71 & -0.10 (-0.63 to 0.43) \\     D+2 & & 0.41 & 0.68 & 0.12 (-0.44 to 0.67) \\     D+1 & & -0.69 & 0.49 & -0.20 (-0.77 to 0.37) \\     D1:1 & & -1.33 & 0.18 & -0.39 (-0.97 to 0.19) \\     D-1 & & -1.21 & 0.23 & -0.35 (-0.92 to 0.22) \\     D-2 & & 0.32 & 0.75 & 0.09 (-0.46 to 0.65) \\     E+2 & & -1.89 & 0.06 & -0.53 (-1.09 to 0.02) \\     E+1 & & 0.78 & 0.44 & 0.23 (-0.34 to 0.79) \\     E1:1 & & 0.62 & 0.53 & 0.18 (-0.39 to 0.76) \\     E-1 & & 0.17 & 0.86 & 0.05 (-0.52 to 0.62) \\     E-2 & & 0.06 & 0.95 & 0.02 (-0.54 to 0.57) \\ [1ex]             \hline     \end{tabular}     \end{table}               %\end{landscape}     \end{document}