title: Using longtable inside xparse \NewDocumentEnvironment

text: I am trying to create a wrapper for the `longtable` environment and it works fine with the standard `\newenvironment` command. Now I want to use `\NewDocumentEnvironment` from the `xparse` package to allow more optional arguments. But the result looks different, there appears an additional cell below the table. Maybe it's caused by a linebreak from the `\NewDocumentEnvironment` command because the error doesn't appear when I move the `\end{longtable}` from the end-code-block to the start-code-block of the environment definition (like I did in the example in `myxparsetable2` environment). I created a minimal example. The error appears with `myxparsetable1`.               \documentclass{scrartcl}     \usepackage{xparse}     \usepackage{longtable}          \NewDocumentEnvironment{myxparsetable1}{m}     {\begin{longtable}{#1}}     {\end{longtable}}          \NewDocumentEnvironment{myxparsetable2}{}     {%       \begin{longtable}{|c|c|c|} \hline%         col1 & col2 & col3 \\ \hline%       \end{longtable}%     }     {}          \newenvironment{mytable}[1]     {\begin{longtable}{#1}}     {\end{longtable}}          \begin{document}            Normal longtable:       \begin{longtable}{|c|c|c|} \hline         col1 & col2 & col3 \\ \hline       \end{longtable}            Custom mytable       \begin{mytable}{|c|c|c|} \hline           col1 & col2 & col3 \\ \hline       \end{mytable}            Custom myxparsetable1       \begin{myxparsetable1}{|c|c|c|} \hline           col1 & col2 & col3 \\ \hline       \end{myxparsetable1}            Custom myxparsetable2       \begin{myxparsetable2}       \end{myxparsetable2}          \end{document}      And here is the output: ![Output from minimal example](http://i.stack.imgur.com/5Dqdf.jpg)


title: very long table - 31 columns to fit page

text: I'm a bit desperate after hours of trying without any success. I have an ouput from R, but the tables are way too wide, having 31 columns. Is there anyway of automatically splitting the table? Maybe split in three parts and put together below each other? Thanks a lot for any answers! edit: Hi, I put here code I played with, but not very much. The original is one of those, I can compile it without any errors in TeXStudio:               %latex.default(tstats <- rbind(tstats1, tstats2, tstats3), "tradestats.tex")%     \begin{table}[!tbp]     \begin{center}     \begin{tabular}{lllrrrrrrrrrrrrrrrrrrrrrrrrrrrr}     \hline\hline     \multicolumn{1}{l}{RSI $n=15, (70,30)$}&\multicolumn{1}{c}{Portfolio}&\multicolumn{1}    {c}{Symbol}&\multicolumn{1}{c}{Number of transactions}&\multicolumn{1}{c}{Number of     trades}&\multicolumn{1}{c}{Net Trading Profit Loss}&\multicolumn{1}{c}{Average trade Profit Loss}&\multicolumn{1}{c}{Median trade Profit Loss}&\multicolumn{1}{c}{Largest Winner}&\multicolumn{1}{c}{Largest Loser}&\multicolumn{1}{c}{Gross Profits}&\multicolumn{1}{c}{Gross Losses}&\multicolumn{1}{c}{Standard deviation trade Profit Loss}&\multicolumn{1}{c}{Percent Positive}&\multicolumn{1}{c}{Percent Negative}&\multicolumn{1}{c}{Profit Factor}&\multicolumn{1}{c}{Avgerage Winning Trade}&\multicolumn{1}{c}{Median Winning Trade}&\multicolumn{1}{c}{Avgerage Losing Trade}&\multicolumn{1}{c}{Median Losing Trade}&\multicolumn{1}{c}{Average Daily Profit Loss}&\multicolumn{1}{c}{Median Daily Profit Loss}&\multicolumn{1}{c}{Standard deviation Daily Profit Loss}&\multicolumn{1}{c}{Annual Sharpe ratio}&\multicolumn{1}{c}{Maximal Drawdown}&\multicolumn{1}{c}{Profit To Maximum Drawdown}&\multicolumn{1}{c}{Average Win-Loss ratio}&\multicolumn{1}{c}{Median Win-Loss ratio}&\multicolumn{1}{c}{Maximum Equity}&\multicolumn{1}{c}{Minimal Equity}&\multicolumn{1}{c}{End Equity}\tabularnewline     \hline     RUT&RSI&RUT&$147$&$45$&$-152938$&$-1694.044$&$1501.0$&$25170$&$ -66450$&$188535$&$     -264767$&$15877.4407$&$62.2222$&$37.7777$&$0.7120$&$ 6733.3928$&$ 4334$&$-15574.5294$&$-10703.0$&$-1694.0444$&$1501$&$15877.4407$&$-1.6937$&$-188375$&$-0.8118$&$0.4323$&$0.4049$&$ 1802$&$-186573$&$-152938$\tabularnewline     GSPC&RSI&GSPC&$ 92$&$28$&$-296677$&$-6695.3214$&$7172.5$&$50523$&$ -91993$&$270323$&$ -457792$&$35639.5768$&$64.2857$&$35.7142$&$0.5904$&$15017.9444$&$11708.9999$&$-45779.2$&$-41431.5$&$-6695.3214$&$7172.5$&$35639.5768$&$-2.9822$&$-358495$&$-0.8275$&$0.3280$&$0.2826$&$10614$&$-347881$&$-296677$\tabularnewline     IXIC&RSI&IXIC&$150$&$44$&$-385478$&$-5133.2045$&$9422.5$&$92099$&$-435298.9999$&$924523$&$-1150384$&$91064.1625$&$68.1818$&$31.8181$&$0.8036$&$30817.4333$&$25309.4999$&$-82170.2857$&$-30425.0$&$-5252.5813$&$8319$&$92698.2184$&$-0.8995$&$-888137$&$-0.4340$&$0.3750$&$0.8318$&$11064.9999$&$-877072$&$-385478$\tabularnewline     \hline     \end{tabular}\end{center}          \end{table}


title: How can I get htlatex to work with amsmath's align and cleveref?

text: I have a document `test.tex`:               \documentclass{article}     \usepackage{amsmath}     \usepackage{etoolbox}     \AtEndPreamble{\usepackage{cleveref}}     \begin{document}     \begin{align}     .     \end{align}     \end{document}      It compiles fine under `latex` and `pdflatex`. However, when I run it with `htlatex`, I get               D:\Documents\GitHub\book>htlatex test.tex        D:\Documents\GitHub\book>latex  \makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode .a.b.c.\input  test.tex      This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)     entering extended mode     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar     abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,      croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga     lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland     ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,      lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n     german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman     ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm     an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl     ishmax, welsh, loaded.     (D:\Documents\GitHub\book\test.tex     ("D:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     ("D:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\tex4ht.sty")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\usepackage.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsmath.sty"     For additional information on amsmath, use the `?' option.     ("D:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amstext.sty"     ("D:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty"))     ("D:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty")     ("D:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsopn.sty"))     ("D:\Program Files\MiKTeX 2.9\tex\latex\etoolbox\etoolbox.sty"     ("D:\Program Files\MiKTeX 2.9\tex\latex\misc\etex.sty"))     (D:\Documents\GitHub\book\cleveref.sty)     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\tex4ht.4ht"     ::::::::::::::::::::::::::::::::::::::::::      TeX4ht info is available in the log file      ::::::::::::::::::::::::::::::::::::::::::     ) ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\tex4ht.sty"     --- needs --- tex4ht test ---     (D:\Documents\GitHub\book\test.tmp) (D:\Documents\GitHub\book\test.xref)     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\latex.4ht"     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\fontmath.4ht"     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\article.4ht"     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\amsmath.4ht"     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\amstext.4ht"     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\amsbsy.4ht"     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\amsopn.4ht"     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")     ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))     (D:\Documents\GitHub\book\test.aux)     ! Missing number, treated as zero.     <to be read again>                         \relax      l.8 \end{align}          ?      ! Emergency stop.     <to be read again>                         \relax      l.8 \end{align}          No pages of output.     Transcript written on test.log.     Terminate batch job (Y/N)?


title: How to declare new path commands in TikZ?

text: The TikZ Manual, section 59.5 and some very good questions on this site explain how to declare new shapes for TikZ _nodes_ with `\pgfdeclareshape{myshape} ...` to later use them with               \node[shape=myshape] (name) {text};      But is it also possible to create a new shape to place on a path, which would then be used like this?               \draw (0,0) myshape (5, 7);      How can one declare a new path command?


title: Bookmark Title Page

text: Does anyone know how to hyperref the title page of a pdf file? I mean I want my title to appear as the highest level in the bookmaks and the sections will be the next level etc so that the bookmark will look like a tree with branches. Only the sections appear at the moment and stand on their own. Thank you.


title: How to keep a constant baselineskip when using minipages (or \parboxes)?

text: When a `minipage` is used to box a text paragraph, the first line of the `minipage`d text and the last line of the previous text paragraph are closer than two consecutive lines in a standard text paragraph; analogously, the last line of text inside the `minipage` and the first line of text after the `minipage` are also closer. The following MWE illustrates this:               \documentclass{article}     \usepackage{lipsum}          \newcommand\Text{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,     vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida     mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.\textbullet}          \begin{document}          \Text          \noindent\begin{minipage}{\linewidth}     \Text     \end{minipage}          \Text          \end{document}      How can I guarantee a constant baseline-skip even if `minipage`s (or `\parbox`es) are used? ![enter image description here](http://i.stack.imgur.com/swDeZ.png)


title: Translating titles with ctex

text: As best as I can understand, there are two ways to load the `ctex` package: as a document class (i.e. `\documentclass{ctexbook}` or as a package (i.e. `\usepackage{ctex}`). As I am using another document class, I have selected the later. This means, however, that the document uses English for titles throughout the document (e.g. table of contents, glossary). When I try to rename the titles of parts of the documents, using `\CTEXoptions`, this always fails. E.g.:               \documentclass{book}     \usepackage{ctex}     \usepackage{xeCJK}     \usepackage{fontspec}     \CTEXoptions[contentsname={目录名}]     \begin{document}         \tableofcontents         \chapter{This is a chapter title}     \end{document}      This fails to compile:               ! Package xkeyval Error: `contentsname' undefined in families `CTEX'.          See the xkeyval package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.6 \CTEXoptions[contentsname={目录名}]        * How can I properly set the names of these items in my document? > contentsname 目录名 > > listfigurename 表格目录 > > listtablename 插图目录 > > figurename 图 > > tablename 表 > > abstractname 摘要 > > indexname 索引 > > bibname 参考文献


title: Apparent package bug/conflict

text: Learning about hyphenation, I've encountered something curious. When I code:               \documentclass{article}     \hyphenation{acro-nym}     \begin{document}     \fbox{\begin{minipage}{3cm}     TUG is an acronym. It means \TeX\ Users Group.     \end{minipage}}     \end{document}      I get, as expected: ![Expected_result](http://i.stack.imgur.com/wLnFl.png) However, when I substitute `\hyphenation{acro-nym}` for `\usepackage[none]{hyphenat}`, my outcome remains the same. It's as if the package wasn't recognized. What's going on? Might help: I'm currently using "MiKTeX 2.9", with "TeXnicCenter 1.0 Stable Release Candidate 1" as my editor in a Windows 7 Ultimate SP1. Using `\listfiles`, I can only get an outcome if `\usepackage[none]{hyphenat}` is not written in the preamble. The `.log` for the code above follows:               LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.              Underfull \hbox (badness 2103) in paragraph at lines 7--7     []\OT1/cmr/m/n/10 TUG is an acro-      []           LaTeX Font Info:    External font `cmex10' loaded for size     (Font)              <7> on input line 7.     LaTeX Font Info:    External font `cmex10' loaded for size     (Font)              <5> on input line 7.     [1           ]          *File List*     article.cls    2007/10/19 v1.4h Standard LaTeX document class     size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)     ***********


title: apa6 documentclass makes ugly title-page

text: I have a problem using apa6 class and doc type: since paper has many authors/affiliations etc., title-page is set quite low, leaving only 'Abstract' title and the body of abstract on the next page. This looks quite ugly, and I dunno how to solve it. Please, help!               \documentclass[doc,11pt,a4paper,natbib,floatsintext]{apa6}     \usepackage[german,serbian,american]{babel}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{tabulary}     \usepackage{multirow}     \usepackage{rotating}     \usepackage{xspace}     \usepackage{color}     \usepackage{url}     \usepackage{times}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{csquotes}          \shorttitle{Revision revisited}     \leftheader{Myname, Hername, Hisname, Hername, Hisname}          \title         {Processing parts and a whole:         \protect\\         An information-theoretic approach to some interesting stuffs}     \fiveauthors         {Myname Mysurname}{Hername Hersurname}{Hisname Hissurname}         {Hername Hersurname}{Hisname Hissurname}     \fiveaffiliations         {My affiliation at the University of something \&             My second affiliation at the University of something else}         {Her affiliation at the University of something}         {His affiliation at the University of something}         {Her affiliation at the University of something \&             Her second affiliation at the University of something else}         {His affiliation at the University of something \&             His second affiliation at the University of something else}          \authornote{         Please send correspondence to me: \\         Email: first.author@something.edu \\ \ \\         \noindent         This research was supported some guys.     }          \abstract{         Converting light into matter may sound like alchemy, but it's a natural outcome of physics – one that scientists have been demonstrating to varying degrees for decades. Now, a team of European physicists is proposing a way to do it much more simply.              If the approach works as the researcher's initial calculations suggest, the results are unlikely immediately answer any vexing question, physicists say. The fundamental science behind the process of turning light to matter is already well understood. But it would be a new tool in physicists' toolkit.              Currently, the process of getting packets of light, known as photons, to collide and make particles can be a complicated business, requiring a few tricks. But the new technology might enable a range of new experiments, which could lead to unexpected answers or uses.              The tool is a collider for photons, the subatomic particles associated with visible light and other forms of electromagnetic radiation, such as radio waves and gamma rays. By crashing them head-on, the collider would turn the photons into electrons and their anti-matter counterparts, positrons. Calculations suggesting how this might work appear in the current issue of the journal Nature Photonics.              The theory behind this was first proposed in 1934 by two American physicists, Gregory Breit and John Wheeler. But it wasn't until 1997 that scientists working at the Stanford Linear Accelerator Center (SLAC) in Stanford, Calif., were able to successfully carry out the first true photon-to-photon collision and create the two particles.              They did it by using electrons to ricochet light back into itself. The team accelerated a beam of electrons to high energies, then blasted the beam with a laser. Some of the photons in the laser scattered off these electrons, traveling back toward the laser beam and picking up energy in the process. When these higher-energy photons collided with additional photons the laser was sending out, the collisions produced pairs of electrons and their antimatter counterparts, positrons.     }          \keywords{one, two, three, four, five}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}               \maketitle               \section{Introduction}          Converting light into matter may sound like alchemy, but it's a natural outcome of physics – one that scientists have been demonstrating to varying degrees for decades. Now, a team of European physicists is proposing a way to do it much more simply.          If the approach works as the researcher's initial calculations suggest, the results are unlikely immediately answer any vexing question, physicists say. The fundamental science behind the process of turning light to matter is already well understood. But it would be a new tool in physicists' toolkit.          Currently, the process of getting packets of light, known as photons, to collide and make particles can be a complicated business, requiring a few tricks. But the new technology might enable a range of new experiments, which could lead to unexpected answers or uses.          The tool is a collider for photons, the subatomic particles associated with visible light and other forms of electromagnetic radiation, such as radio waves and gamma rays. By crashing them head-on, the collider would turn the photons into electrons and their anti-matter counterparts, positrons. Calculations suggesting how this might work appear in the current issue of the journal Nature Photonics.          The theory behind this was first proposed in 1934 by two American physicists, Gregory Breit and John Wheeler. But it wasn't until 1997 that scientists working at the Stanford Linear Accelerator Center (SLAC) in Stanford, Calif., were able to successfully carry out the first true photon-to-photon collision and create the two particles.          They did it by using electrons to ricochet light back into itself. The team accelerated a beam of electrons to high energies, then blasted the beam with a laser. Some of the photons in the laser scattered off these electrons, traveling back toward the laser beam and picking up energy in the process. When these higher-energy photons collided with additional photons the laser was sending out, the collisions produced pairs of electrons and their antimatter counterparts, positrons.          \end{document}      The first page looks like this: ![enter image description here](http://i.stack.imgur.com/NP7SS.jpg)


title: LaTeX3 versus pure Lua

text: Reading this site for the last nearly two years I've learned a lot about LaTeX3 (which I had previously understood to be a defunct pipe dream) and LuaTeX (of which I was previously totally unaware). As I have said before, TeX itself is a bad programming language, though a good typesetting engine, but even as a typesetting engine, it is hobbled by its limitations as a language. What I mean by both of these, in short, is that it does not provide an easy way to manipulate its own representations of data. Others have also had this problem, and sometimes it can be solved with LuaTeX, which opens up a lot of the internals to the programming environment. Now, as I understand it, LaTeX3 also provides a lot of programming tools within TeX, with the aim of making package creation and maintenance more robust. Joseph Wright has explained this in at least one place (and therefore probably many more). These are "algorithmic" tools, while the direction of LuaTeX development appears to be "data structure" tools. Of course, Lua is also a general-purpose programming language and as such provides perfectly good algorithmic tools as well. My question: > Why use LaTeX3 programming over Lua, when LuaTex is available? I understand that LuaTeX is very much experimental now, but then, so is LaTeX3. I also understand that as a result, LuaTeX is not necessarily used by anyone "ordinary", but then, it is intended as the ultimate successor to pdfTeX, which is now the default engine in the major TeX distributions. For all the reasons that TeX is a terrible programming language, LaTeX3 will still suffer from irritating expansion issues, lack of arithmetic capabilities, poor (or at least poor man's) variables, and so on. However, Knuth himself has written that he would have used a better language if one had been available. Now that "we" are inserting Lua into the TeX executable it appears that this alternative has been identified (ironically, that link is about PyTeX, based on Python). Now that `\directlua` is feasible, I don't see why it is not better in every way simply to make all "function" macros (those that do not directly store text) hook into that one primitive and then do all their programming in Lua. Loops, variables, recursion, and so on can all be done in a comprehensible way. A lot of effort in the development of LaTeX3 appears to be in managing the programming language and its use. So, I ask again: > Why use LaTeX3 to program at all? Why not turn its development into the > development of a LaTeX-style document design library for LuaTeX, written in > Lua? This suggests a related question to me: > Is the separation of LuaTeX and LaTeX3 a result (or at least an artifact) of > the non-communication among developers that Ahmed Musa described in his > comment to this answer? What kind of cooperation is there between these two > projects to reduce duplication of effort? (An even more fantastical notion is to implement _every_ primitive, except `\directlua` itself, in terms of Lua and various internal typesetting parameters, thus completely divorcing the programming side of TeX from the typesetting side. Then TeX itself would be a "macro package" on top of LuaTeX and one would not be bound to its strange design choices. An answer to why that should or should not be done might be too long for me to request, however.) I don't personally think that this is too bloggy for this site, and I hope others agree. At least, given the confluence of expertise here, it seems to be the best place to ask the question. * * * I have accepted Frank Mittelbach's answer, though all the answers are extremely informative, because I think it hits all the main points most directly. One thing that neither it nor Joseph Wright's answer quite manages to come out and say directly is that ConTeXt _does_ do the Lua-programming thing at least to some extent, and it does not solve all algorithmic problems because LuaTeX does not actually rewrite the underpinnings of TeX so much as stitch in a Lua layer that can interact with them. I guess the one-line answer to my question is that my expectations of LuaTeX are much more grand than its reality, much like my "fantastical" idea.


title: baposter multi-line headerbox

text: I'm preparing a poster with _baposter_ package, and I have a long header in the headerbox so it exceeds the limit. Is there any way to write the header in the headerbox in multi-line?


title: Beamer transitions

text: I am making a presentation in beamer and I would like to make disappear and appear some images. I am using the option \only<> but I obtain different slides like: ![enter image description here](http://i.stack.imgur.com/fdBQL.png) ![enter image description here](http://i.stack.imgur.com/Di0mz.png) When I click on the ouse button it seems like I am chaning the full slides instead of only the figures appearing. The code is :               \begin{frame}     \centering     \textbf{Noise effect}     \begin{columns}     \column{0.4\textwidth}     \begin{itemize}         \item $y_1(t)=\cos(2\pi f_1 t)$         \centering         \includegraphics[scale=0.14]{sineseriesspectrum}\\         \only<1>{\includegraphics[scale=0.7]{noiseeffectsine}}         %\transfade{\includegraphics[scale=0.7]{noiseeffectsine}}         \only<2>{\includegraphics[scale=0.7]{sineeffectresults}}     \end{itemize}     \column{0.5\textwidth}     \begin{itemize}         \item $y_2(t)=\text{white noise}$         \centering         \includegraphics[scale=0.14]{wnseriesspectrum}\\         \only<1>{\includegraphics[scale=0.7]{noiseeffectwn}}         \only<2>{\includegraphics[scale=0.7]{noiseeffectresults}}     \end{itemize}          \end{columns}     \end{frame}


title: How to parse a macro using babel replacements in a class file?

text: I was trying to write a simple class and have the following issue: I need to write some text containg German quotation marks that is staic and thus should be typeset by the class by default. You can see in the MWE below that inside the `document` environment I can use "` and `"'` to achieve the correct markings. In the class file it does not work. I can only use `\glqq` and `\grqq` to get ir right. Is there a way to get it up correctly or is it simply impossible without the explicit macros in class files? Here comes the `myclass.cls` file:               \LoadClass[a4paper,10pt]{scrartcl}     \RequirePackage[ngerman]{babel}     \newcommand{\abc}{"`abc"' \glqq abc \grqq}      And here comes the main tex file:               \documentclass{myclass}     \begin{document}     "`abc"' \glqq abc \grqq          \abc     \end{document}


title: Table is spreading words across the column?

text: In the code below, the entries of the first row get stretched across their respective boxes. I get that there's not enough room for each line to fit exactly across the box, but I'd like for it not to spread it across. I'd just like to keep it flush to the left.               \begin{center}         \small         \begin{table}[h]         \centering         \begin{tabular}{ | p{2.4cm} | p{2.6cm} | p{2.6cm} | p{2.6cm} |   p{2.6cm} | }         \hline          & Volume per Longboard ($\mathrm{in}^{3}$) & Mass per Longboard (lb.) & %                                     Volume for 5,000 units & Cost for 5,000 units (\$)\\ \hline         Polyurethane & 2 & 2 & 2 & 2\\ \hline         Bamboo & 3 & 3 & 3 & 3\\ \hline         Aluminum & 4 & 4 & 4 &4\\ \hline         Steel Alloy & 5 & 5 & 5 & 5\\         \hline         \end{tabular}             \caption{A summary of materials in the longboard with cost calculations.}         \end{table}     \end{center}


title: Sideways text with rule as table label

text: I've been trying to achieve the following vertical sidebar effect in LaTeX for my resume, but turns out it's far more difficult than I thought (created easily in InDesign): ![Sidebar](http://i.stack.imgur.com/3mB31.png) I've tried everything I could think of — sideways `minipage`s, `parbox`es, `table`s, `multirow`s, and on and on, but nothing's been able to replicate it. I've gotten close, but never managed to get the title flush along the top of the table (not to mention the centered horizontal rule). Any insight on implementing this? * * * For reference, here's my latest attempt at implementing this with a table and `multirow` (requires XeLaTeX):               \documentclass{article}     \usepackage{fontspec, multirow, rotating, tabularx, xunicode}     \def\Vhrulefill{\leavevmode\leaders\hrule height 0.7ex depth \dimexpr0.4pt-0.7ex\hfill\kern0pt}          \begin{document}       \begin{tabularx}{\textwidth}{l X}         & \textbf{Spoken Languages} \\         & English, Hebrew (fluent in speaking, reading, and writing) \\         & \\         & \textbf{Programming Languages} \\         & Objective-C, C, Ruby, Java, Python, HTML + CSS/SASS + JavaScript/CoffeeScript \\         & \emph{Familiar with C++, Haskell, PHP} \\         & \\         & \textbf{Technologies} \\         & OS X, iOS, Xcode, Unix/Linux Systems, LaTeX, Shell Scripting, Git, Vim, Jekyll \\         & \emph{Familiar with Windows, Windows Server, MySQL} \\         \multirow{-9}{*}{\begin{sideways}\Vhrulefill~skills\end{sideways}} &     \end{tabularx}     \end{document}      That produces the following output: ![Sample](http://i.stack.imgur.com/WiDWl.png) * * * **Update:** Werner's answer is the one I think I'll go with since it fits my needs well; however, I've been trying to get it in a more general form so I can reuse it easily, and I've run into trouble. I've created a new environment for this, but unfortunately, I can't get the label to align correctly along the top of the body text using the height of the text:               \documentclass{article}     \usepackage{graphicx, tabularx, xcolor}     \usepackage{environ}     \usepackage[margin=1in]{geometry}          \newlength{\sectionheight}     \newlength{\tablewidth}     \NewEnviron{rsection}[3]{%       \setlength{\tablewidth}{#2}       \addtolength{\tablewidth}{-1ex}       \settoheight{\sectionheight}{\begin{tabularx}{\tablewidth}{l #3}\BODY\end{tabularx}}            \begin{tabularx}{\tablewidth}{l #3}         \BODY \\         \raisebox{\normalbaselineskip}{\smash{\rotatebox{90}{%           \color{black!33}\rule[.5ex]{\sectionheight}{.4pt}\llap{\colorbox{white}{\color{black!66}#1}}         }}} &       \end{tabularx}     }          \begin{document}       \begin{rsection}{education}{0.5\textwidth}{X}         & \textbf{Binghamton University, State University of New York} \\         & B.S. — Computer Science · Expected 2016 \\         & \\         & Binghamton University Scholars Program \\         & Binghamton President's Scholars Program       \end{rsection}       \begin{rsection}{skills}{0.5\textwidth}{X}         & \textbf{Spoken Languages} \\         & English, Hebrew (fluent in speaking, reading, and writing) \\         & \\         & \textbf{Programming Languages} \\         & Objective-C, C, Ruby, Java, Python, HTML, CSS, SASS, JavaScript, CoffeeScript \\         & \emph{Familiar with C++, Haskell, PHP} \\         & \\         & \textbf{Technologies} \\         & OS X, iOS, Xcode, Unix/Linux Systems, LaTeX, Shell Scripting, Git, Vim, Jekyll \\         & \emph{Familiar with Windows, Windows Server, MySQL}       \end{rsection}     \end{document}      For some reason, `\settoheight{\sectionheight}{\begin{tabularx}{\tablewidth}{l #3}\BODY\end{tabularx}}` doesn't return the right height for the text, so the result looks like this: ![Result](http://i.stack.imgur.com/5Gg0B.png) I'm expecting the label to look right, and for the tables to align next to each other. Any idea what's going wrong?


title: How to eliminate vertical space before and after verse environment?

text: I'm using the `verse` package to typeset poems inside a `tabular` environment. Is it possible to eliminate the space before and after the verse package?               \usepackage{verse}     ...     \begin{tabular}{p{30mm} | p{30mm} | p{30mm}}       \hline         1.       &     \begin{verse}     AAAA \\     BBBB \\     CCCC     \end{verse}       & QUESTION \\ \hline     \end{tabular}      ![output of MWE](http://i.stack.imgur.com/lWZvR.png) I could manually insert vertical space before and after the `verse` environment,               \vspace{-\baselineskip}     \vspace{-2.6pt}      but this seems to be an ugly solution. There should be a more elegant solution!


title: Strange error bars problem

text: I'm trying to get error bars to show correctly on my plot using `pgfplots`. I am wanting explicit relative error bars in both directions for my y-data, and what I am getting is perplexing. The error bars extend down to the bottom of the graph instead of being symmetric around the data points of interest, and within the relative range I have specified. ![enter image description here](http://i.stack.imgur.com/7zs6K.png) Here is the code:               \documentclass[class=minimal,border=0pt]{standalone}     \usepackage{color}     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \definecolor{darkgreen}{rgb}{0.125,0.5,0.169}          \newcommand{\footnotesize}{\fontsize{7pt}{9pt}\selectfont}          \usepackage{filecontents}     \begin{filecontents*}{Td.dat}     theta   exp          sim          relativeerror   errorbars     10      5439.5       3241.8       -40.4026        0.036212     20      12256.5      10518.1      -14.1832        0.023798     30      18469.5      19819.8      7.3109          0.021885     40      26900        28341.3      5.358122        0.021386     50      40902        44859.2      9.674814        0.021262     60      46348        51647.4      11.43391        0.02124     70      43877        47986.3      9.365563        0.021231     80      41886.5      48017.3      14.63673        0.021239     90      24937        32576.7      30.63588        0.021409     \end{filecontents*}               \begin{document}          \begin{tikzpicture}          \pgfplotsset{every axis legend/.append style={at={(0.5,1.05)},anchor=south}, legend columns=3,         xmin = 0, xmax = 100,         xtick={10,30,...,90},         minor x tick num=1,               y axis style/.style={yticklabel style=#1, ylabel style=#1, y axis line style=#1, ytick style=#1}     }          \begin{axis}[width=3.25in,height=3.25in,         axis y line*=left,         y axis style=black,         minor y tick num=3,         ymin = 0, ymax = 60000,         %ytick={0,10000,...,60000},         xlabel={Valve Angle Opening, $\theta$ (deg.)},         ylabel={Hydrodynamic Torque, $T_{d \theta}$ (lbf-in)},         scaled ticks=false]              \addplot[darkgreen,mark=square, line width=1.0, densely dashed, mark options=solid,mark size=2.5,             error bars/.cd, error mark=-, x dir=none, y dir=both, y explicit relative]                     table[x=theta, y=exp, y error=errorbars] {Td.dat};             \label{expplot}          %    \addplot[blue,mark=o,line width=1.0,mark options=solid,mark size=2.5]      %        table[x=theta,y=sim] {Td.dat};     %        \label{simplot}     \end{axis}               %\begin{axis}[width=3.25in,height=3.25in,     %    axis y line*=right,     %    axis x line=none,     %    minor y tick num=1,     %    ymin=-50, ymax=50,     %    ytick={-50,-40,...,50},     %    ylabel=Relative Difference from Experiment (\%),     %    y axis style=red!75!black,     %    yticklabel style={/pgf/number format/.cd,fixed,fixed zerofill,precision=0,/tikz/.cd},]     %     %    \addlegendimage{/pgfplots/refstyle=expplot}\addlegendentry{Experiment}     %    \addlegendimage{/pgfplots/refstyle=simplot}\addlegendentry{Simulation}     %     %    \addplot[red,mark=x, line width=1.0, densely dashed, mark options=solid,mark size=2.5]      %        table[x=theta,y=relativeerror] {Td.dat};     %        \addlegendentry{Relative Diff.}     %\end{axis}                    \end{tikzpicture}          \end{document}      Anyone have a clue what I might be doing wrong?


title: How to centre the horizontal text in table

text: \documentclass{article}     \usepackage{multicol}     \usepackage{multirow}     \usepackage{array}     \usepackage{rotating}     \usepackage{makecell}           \begin{document}          \begin{table}          \small          \caption{Studies on Highway }          \begin{tabular}{|p{3.4cm}|p{4cm}|p{7.8cm}|}          \hline          Optimization &  Methods &  References \\ \hline          \multirow{3}{*}{\begin{sideways} {Horizontal} \end{sideways}}                                  & Calculus &  Howard  \\  \cline{2-3}                            & Network  & Turner \\  \cline{2-3}                            & Dynamic  &  Nicholson  \\ \cline{2-3}          \hline     \multirow{3}{*}{\begin{sideways} {Vertical alignment only} \end{sideways}}                             & Enumeration & Easa  \\  \cline{2-3}                       & Dynamic & Puy \\  \cline{2-3}                       & Linear  & Canale  \\  \cline{2-3}                       & Numerical & Robinson \\   \cline{2-3}                        & Swarm intelligence & Kazemi \\ \hline               \end{table}          \end{document}


title: Latex matrix not displaying right numbers

text: I've just started writing in latex to expose math problems to a forum.   I am trying to display a matrix:               \[     \begin{align*}      \begin{matrix}       1 & -9 & 3 \\       1 & 2 & -2 \\       -2 & 1 & 1      \end{matrix}     \end{align*}     \]      But I get this: ![Matrix](http://i.stack.imgur.com/le6wf.png) There's 1b1 and there's not the last element that I'm trying to display, why?


title: Rotate figure and caption with floatrow

text: I have a problem with my LaTeX code: I want two things:   1. Besides "normal" figures with the figure in the middle and the caption below, I want some pictures be rotated (because of their size) to fit the page in landscape view and the caption still below the picture, thus also rotated.    2. I also need some pictures on the left or right of the page and the caption on the side of them.  First, I was able to do 1. via `rotatebox`. But to get my captions next to the figures, I added the package `floatrow`, which seems to cause that the captions for case 1. are not rotated anymore. Below you find the reduced code, including the `floatrow` package. Can someone help me and explain, why `floatrow` cancels the rotation of the caption and provide me with a work around?               \documentclass[12pt,a4paper]{scrbook}      \usepackage[latin1]{inputenc}      \usepackage{tgadventor}      \renewcommand*\familydefault{\sfdefault}       \usepackage[T1]{fontenc}      \usepackage[english]{babel}      \usepackage{amsmath}      \usepackage{subfigure}      \usepackage[onehalfspacing]{setspace}      \usepackage{placeins}      \usepackage{caption}      \usepackage{floatflt}      \usepackage{wrapfig}      \usepackage{fancyhdr}      \usepackage{booktabs}      \usepackage{color}      \usepackage{multirow}      \usepackage{geometry}      \usepackage[nottoc]{tocbibind}      \usepackage{appendix}      \usepackage{color}      \usepackage{paralist}      %\usepackage{flafter}      \usepackage{ifthen}      \usepackage{mathptmx}      \usepackage{upgreek}     \usepackage{enumitem}      \usepackage{floatrow}          \begin{document}          \begin{figure}     \rotatebox{90}{%     \begin{minipage}{0.9\textheight}     \includegraphics[width=\linewidth]{picthatshouldberotated.pdf}     \caption[setupt]{text.}     \label{fig:setup}     \end{minipage}}     \end{figure}          \begin{figure}[h]     \floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,top},capbesidewidth=8cm}}]{figure}[\FBwidth]     {  \caption[thingy]{thingy}}     {\includegraphics[width=0.45\textwidth]{picwithcaptionnextoit.png}}     \label{fig:thingy}     \end{figure}               \end{document}


title: Begin/end a logical block?

text: Can I create a logical block (like HTML div element), so I can apply features like `\centering` locally, but not affect the outside environment?


title: template with large left margin and coloured box

text: I'm building for my university a template using the Latex beamer package. I had no problems to build the template for the title slide and for the general slides. However, for the last slide they would like a template that looks as in the image attached. It seems to me to be very simple, but I have not found a way to create just this empty blue box (that should not have any effect on the other parts of the slide) and have the text start with quite a large left margin (I would like to create this as a template and not have the user adjust the margin for the last slide in his document). Could you give me hints on how to realise this? ![Screenshot](http://i.stack.imgur.com/sAmhn.png)


title: how to add arrow between arrows, how to put an arrow on a second arrow

text: I have big problems to get model of evolution. I do not even know how to start. ![enter image description here](http://i.stack.imgur.com/Na9oa.png) **If some one show the sample code of something similar, I would be grateful**               \documentclass{minimal}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage{tikz}     \usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%       decorations.pathreplacing,decorations.pathmorphing,shapes,%       matrix,shapes.symbols}     \usetikzlibrary{decorations.pathmorphing,shadows}      \usepackage{xcolor}     \tikzset{       W/.style={         rectangle,          rounded corners=4pt,          draw=black, thin,         text width=10em,          minimum height=3em,          text badly centered, },       P/.style={         circle,          draw=blue!50!black!50,         top color=white,         bottom color=blue!60!black!10,         inner sep=5pt,         text width=1.75cm,         text badly centered,         minimum height=3em,       }     }     \definecolor{vert}{rgb}{0.15 0.4 0.1}     \definecolor{bleu}{rgb}{0.39, 0.58, 0.93}          \begin{document}          \begin{tikzpicture}            \node[P] (p) {P};       \node[W, below= 3cm of p](w) {W};            \draw[transform canvas={xshift=2ex},->] (p.south) --  ++(0,0) -|     (w.north);       \draw[transform canvas={xshift=-2ex},->] (w.north) -- ++(0,0) -|  (p.south);       \draw[->, dashed,transform canvas={xshift=-2ex},very thick] (w.north) -- ++(0,0) -|  (p.south);     \end{tikzpicture}     \\     \begin{tikzpicture}       \node[at={(0,0)},text=bleu]{\bfseries Objaśnienia};       \node[at={(0,0)},above,yscale=-1,scope fading=south,       opacity=0.5,text=bleu]{\bfseries Objaśnienia};     \end{tikzpicture}     \begin{itemize}     \item[] \tikz {\path[circle, top color=white,         bottom color=blue!60!black!10,]          (0,0) -- (1,0) node[above,pos=0.5,text=vert] {P};} -- frakcja populacji P, która się adaptuje          \item[] \tikz {\path[line width=2pt,->,dashed]          (0,0) -- (1,0) node[above,pos=0.5,text=violet] {W};} some text,       $S_i\,\longrightarrow\,T_j$ non radiative transition.               \end{itemize}     \end{document}      ![enter image description here](http://i.stack.imgur.com/FmOxD.png)


title: \mathfrak{g} not showing up properly in resume

text: I am using document class margin and line               \documentclass[margin,line]{resume}      and for some reason,                \mathfrak{g}      is not showing up properly (it is just showing up as a g). Can anyone give me an advice on what I need to do to get \mathfrak{g} to show up properly? Thank you! Minimal working example:                \documentclass[margin,line]{resume}            \begin{document}       \begin{resume}            \mathfrak{g}       \mathfrak{b}            \end{resume}       \end{document}


title: vertical dashed line between columns in beamer

text: How to draw vertical **dashed** line between columns in beamer? I have found how to make vertical line, but not **dashed** :(


title: Harvard Bibliography

text: I'm currently using the harvard package for the bibliography but I need to add the cite in the bibliography. ## Code               \usepackage{harvard}     \harvardparenthesis{square}      ## Output ![Output](http://i.stack.imgur.com/BAcYJ.png) ## Want How can I obtain the `[Mon05]` part like this: ![Want](http://i.stack.imgur.com/rK9jp.png)


title: Cannot find warnock.sty aller.sty and luximono.sty

text: When running the brochure template from here. Got the error warnock.sty aller.sty and luximono.sty not found. I am using TeXLive 2011 in Debian GNU/Linux


title: Grid of colorful boxes with shade

text: How can I reproduce this in Latex?   ![enter image description here](http://i.stack.imgur.com/2sVWu.png)


title: Several Columns of Figures

text: In the attachment of my dissertation, I would like to add some pictures. They are all .jpg files. For my work it would make sense to place two figures next to each other with a little space between them, using up the whole width of the page except for the boarders. Can anyone tell me how to do this? I know, it's a lot I'm asking for but I've been messing with several methodes and none of them give me the result I want. Thank you very much for your help in advance. Jurg


title: dvi file is not created in texmaker

text: I use texmaker but when I compile the source file normally I get the pdf as result and I did not know that I should received also DVI file but now i need the dvi file for a conference but i cannot get it. what is the problem? is there any command there?


title: Publication list without index in biblatex

text: I'm using the `phys` `biblatex` style of @Joseph Wright for the bibliography of my PhD thesis. At our institute it is common to also include a separated list of the own publications. So I thought I can also use `biblatex` to generate this list, but I do not want the leading index here. How can I omit the index only in the publication list. Here the MWE:               \documentclass{article}          \usepackage[natbib=true, backend=biber, %                 style=phys, articletitle=false,biblabel=brackets,%                 chaptertitle=false,pageranges=false, doi=false%                 ]{biblatex}          \begin{filecontents}{lit.bib}     @ARTICLE{Deal1980,         author = {Deal, B.E.},         journal = {IEEE Transactions on Electron Devices},         year = {1980},         volume = {27},         pages = {606-608},         number = {3},         month = {Mar}     }     @BOOK{Sze1981,         title = {Physics of Semiconductor Devices},         publisher = {John Wiley and Sons (WIE)},         year = {1981},         author = {S.M. Sze}     }     \end{filecontents}     \begin{filecontents}{mypubs.bib}     @ARTICLE{Me2012,         author = {Me, I and One, Some and Boss, My},         journal = {Journal of Nice Physics},         year = {2012},         volume = {5},         pages = {7-8},         number = {5},         month = {Jun}     }     \end{filecontents}          \addbibresource{lit.bib}     \addbibresource{mypubs.bib}          \begin{document}         \textcite{Deal1980} \textcite{Sze1981}         \printbibliography         \begin{refsection}[mypubs.bib]             \nocite{*}               \printbibliography[title=Publications]         \end{refsection}     \end{document}      ![enter image description here](http://i.stack.imgur.com/fux5v.png)


title: Using tikz with both tex4ht and pdflatex

text: I found that in order to use tikz with tex4ht to produce HTML, I need to do the following:               \def\pgfsysdriver{pgfsys-tex4ht.def}     \usepackage{tikz}      I also need to produce PDF from the same tex file using pdflatex, but that gives me an error with the `\def` above. Is there a way to exclude the `def` from pdflatex?


title: 0: file ended while scanning use of \@genfrac

text: The code is here               \documentclass{article}     \usepackage{amsmath}          \begin{document}     \begin{equation}       \begin{array}{ll}         \hat{\mu_1}&=\dfrac{\sum_{i=1}^nX_{i,1}}{n}\\         \hat{\mu_2}&=\dfrac{\sum_{i=m+1}^nX_{i,2}}{n-m}\\         \hat{\sigma_1^2}&=\dfrac{\sum_{i=1}^n(X_{i,1}-\hat{\mu_1})^2}{n}\\         \hat{\sigma_2^2}&=\dfrac{\sum_{i=m+1}^n(X_{i,2}-\hat{\mu_2})^2}{n-m}\\           \hat{p}&=\dfrac{\sum_{i=m+1}^n(X_{i,1}-\hat{\mu_1})(X_{i,2}-\hat{\mu_2})}{n-m}       \end{array}     \end{equation}          \end{document}      I try to reproduce the problem,and check whether missing bracket.But the error is still there.


title: tikz : edge loop and rotate

text: Here is my example :               \documentclass{standalone}     \usepackage{tikz}          \def\test#1{\node[circle,draw](#1) at (0,0) {#1}; \draw[->] (#1) edge[in=40,out=-40,loop] ();}          \begin{document}     \begin{tikzpicture}       \test{A}       \begin{scope}[shift={(2,0)},rotate=90]         \test{B}       \end{scope}     \end{tikzpicture}     \end{document}      And here is what I get : ![enter image description here](http://i.stack.imgur.com/etT0v.png) B is only A inside a scope with rotation. I would like to understand how to fix my loops in such a scope, so they could be shifted/scaled/rotated as expected : I want B to be exactly like a rotated A.


title: Syntax for macro arguments not behaving as expected

text: I'm trying to build some macros for parsing arguments of other macros in which I'm smuggling in hidden arguments. The following code works perfectly:                \documentclass{article}      \makeatletter          \def\ae@w@@{1}     \def\ae@m@@{1}          \def\ae@set@m@@#1/#2\ae@sep@@{\def\ae@m@@{#1}}          \def\ae@sep@wm@@#1/#2\ae@sep@@{%%       \def\ae@w@@{#1}%%       \ifx#2\relax\else         \ae@set@m@@#2\ae@sep@@       \fi     }          \def\aegetWM#1{%%       \bgroup         \ae@sep@wm@@#1/\relax\ae@sep@@         W=\ae@w@@\newline         M=\ae@m@@       \egroup     }          \makeatother     %% to visually emphasize groupings     \setlength{\parskip}{5ex}     \setlength{\parindent}{0pt}     \pagestyle{empty}     \begin{document}          \aegetWM{400}          \aegetWM{234/100}          \aegetWM{300}          \end{document}      ![enter image description here](http://i.stack.imgur.com/DlYmm.png) But if I defined `\ae@set@m@@` as follows:               \def\ae@set@m@@#1/\ae@sep@@{\def\ae@m@@{#1}}      I get the following error:               Runaway argument?     100/\relax \ae@sep@@ \fi W=\ae@w@@ \newline M=\ae@m@@ \egroup       ! Paragraph ended before \ae@set@m@@ was complete.     <to be read again>                         \par      l.35           ?       What's going on here? Why does one of these definitions work and the other not?


title: How to give any figure a caption based on its horizontal size?

text: I have figures in both portrait and landscape and of various sizes. I'm trying to find a leeway to give any figure a caption based on its horizontal size. In my thesis.cls file, I've already set a general form as `\usepackage[centerlast,small,sc,bf]{caption}` and `\setlength{\captionmargin}{20pt}`. Is there a smart way to do that?


title: Prevent itemize from creating newline at end of list

text: I'm using the itemize environment with the enumitem package, and one of the issues I'm having is that the itemize environment seems to create a newline, or at least add vertical spacing at the end of the environment. How can I suppress this newline?


title: Latex Why does the figure print with part of the last figure on the edges

text: I am compiling summary sheets of precise GPS stations. These sheets contain two files showing where the station is. The first file is a cartographic map fragment. The second is a Google Earth Image fragment. Both were initially jpeg files which were converted to EPS to obtain the bounding box as I use latex. I am using the graphicx package. The dimensions of these figures is NOT constant at the sub 100 pixel level. If the previous image is truncated to a height of 70mm and the corresponding width but the current image is narrower than the correct scaled size then the old image fills the left hand and right side. I sometime get the same with a top and a bottom. It is not transparency by an overlay. Here is the code that appears for both the Carto image and the Google earth files. I have some 96 sites.               \begin{figure}[!ht]         \begin{center}             \resizebox{!}{70mm}{\includegraphics {TAREF11_OZ_locations/T01F.eps}}             \caption[]{\textsl {Cartographic image from }}         \end{center}     \end{figure}      Comments on problem resolution sought. Regards Peter


title: How to place a very large image (Size) in a document?

text: I am trying to produce a document which is full of high resolution large images around 60-100Mb each. The document is ok with small images, but with the large ones I get the error                ! Unable to read an entire line---bufsize=200000.please increase buf_fize in tekmf.cnf.**ERROR** file ended prematurely Output file removed.      The problem is I do not get the output pdf file, otherwise regarding some advices I would have ignored this error. So how can I place this sort of figures in my document?


title: hline inside a TikZ node

text: How can I draw a horizontal line inside a TikZ node? I want the name of the state to be seperated from the rest of the node. How can i achieve this?               \documentclass[tikz,border=2pt]{standalone}          \usetikzlibrary{automata}          \begin{document}     \begin{tikzpicture}[%         every node/.style={%             align=center,             state         }         ]              \node (T0)  {             \textbf{State$_1$} \\               \hline \\ % <--- This is not working!             $\overline{A}$      \\              $B$         };          \end{tikzpicture}     \end{document}


title: What is Math Mode

text: I'm new to Tex and tried to enter an equation using \mathbb. I received a prompt               LaTeX Error: \mathbb allowed only in math mode.     See the LaTeX manual or LaTeX Companion for explanation.      I thought I would try here for an explanation


title: American Marketing Association Reference style

text: I searched the www for hours to find someone who created a BibTeX or LaTeX file that looks like the rules of the American Marketing Association (below an example): > Wensley, Robin (1981), "Strategic Marketing": Betas, Boxes or Basics," > _Journal of Marketing,_ 45 (Summer), 173-82. or another example: > Bettmann, James R. and Mita Sujan (1987), "Marketing in Technology-Intensive > Markets", _Journal of Marketing_ , 63 (Special Issue), 78-91 Has anyone experiences or solutions how to create this?


title: How I add the word Print instead of the URL using mla-format bibliography

text: I need to create my workscite page reference, but my English professor is asking to put at the end of each bibliography reference the word print for all my book bibliography according to MLA ed 7th Im using bibdesk as a Bibliography manager and Im using this is file `mla- new.bst` to format my bibliography as MLA, but I cannot find how to add the "Print." string at the end of each bibliography output. my code is               \doublelespacing     \begin{document}          \begin{mla}{First Name}{Last Name}{Professor's Name}{ English 1302}{28 March 2011}{Research Paper}          \bibliographystyle{mla-good}      \doublespacing          \citeauthor{Sizemore:1977rr,Powell:2008cr,Gross:1990wd,Kempf:1994nx,Struc:1986eu,Sharkey:2006oq,Wagner:2006qe,Fleissner:1985kl,Morris:2009ai,Gray:1962tg,Yelin:2010dp,De-La-Durantaye:2007hc,Clarke:2009sp,Gans:1998ij,Spurr:2011th,Parkison:2008bs,Howe:1949fy,Robert:1977fv,Swales:1981la,Krause:2005qy}}     %\begin{mlaquote}\end{mlaquote} \begin{workscited}     %\vspace{-3cm}          \begin{workscited}     %\vspace{-3cm}     \bibliography{bubus}{}      \end{workscited}      %\citeauthor{Literature}     %\citeauthor{Marias}     % (\citeauthor{Marias}).  % cs(\citeauthor{Rozin} 245).  \citeauthor{Fonseca} 245). \citeauthor{Highmore}  \citeauthor{Locher}      \end{document}


title: Problems with multi-page \lstlistings and \footnotes with the liuthesis document class

text: Using the liuthesis document class described at http://www.control.isy.liu.se/student/exjobb/liuthesis/liuthesis.html (download link: http://www.control.isy.liu.se/student/exjobb/liuthesis/liuthesis.zip) the line separating the footnote from the main text picks up the background color of the lstlisting (which crosses a page boundary) in the following example:               \documentclass[12pt,ida]{liuthesis}     \usepackage{listings}     \usepackage{color}          \definecolor{CodeBGColor}{gray}{0.92}     \lstset{      basicstyle=\Huge,      backgroundcolor=\color{CodeBGColor}     }          \begin{document}          \footnote{Lorem ipsum...}     \begin{lstlisting}     a     a     a     a     a     a     a     a     a     a     a     a     a     a     a     a     a     a     a     a     a     a     \end{lstlisting}          \end{document}      Any ideas what could be wrong? Is this a bug in the liuthesis document class? `\listfiles` output:                *File List*     liuthesis.cls   2007/01/13 liuthesis Class v. 1.3      lmodern.sty     2009/10/30 v1.6 Latin Modern Fonts     fontenc.sty     t1enc.def       2005/09/27 v1.99g Standard LaTeX file     inputenc.sty    2008/03/30 v1.1d Input encoding file     latin1.def      2008/03/30 v1.1d Input encoding file       babel.sty       2008/07/06 v3.8l The Babel package     swedish.ldf     2005/03/31 v2.3d Swedish support from the babel system     english.ldf     2005/03/30 v3.3o English support from the babel system     ida.ltd     book.cls        2007/10/19 v1.4h Standard LaTeX document class     bk12.clo        2007/10/19 v1.4h Standard LaTeX file (size option)     graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)       keyval.sty      1999/03/16 v1.13 key=value parser (DPC)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)     trig.sty        1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2009/08/28 v1.8 graphics configuration of TeX Live     pdftex.def      2009/08/25 v0.04m Graphics/color for pdfTeX     geometry.sty    2008/12/21 v4.2 Page Geometry     ifpdf.sty       2009/04/10 v2.0 Provides the ifpdf switch (HO)       ifvtex.sty      2008/11/04 v1.4 Switches for detecting VTeX and its modes (HO)     crop.sty        2003/05/20 v1.9 crop marks (mf)     color.sty       2005/11/14 v1.0j Standard LaTeX Color (DPC)        color.cfg       2007/01/18 v1.5 color configuration of teTeX/TeXLive      amsmath.sty     2000/07/18 v2.13 AMS math features     amstext.sty     2000/06/29 v2.01     amsgen.sty      1999/11/30 v2.0     amsbsy.sty      1999/11/29 v1.2d     amsopn.sty      1999/12/14 v2.01 operator names     amsfonts.sty    2009/06/22 v3.00 Basic AMSFonts support     amssymb.sty     2009/06/22 v3.00     theorem.sty     1995/11/23 v2.2c Theorem extension package (FMi)     thp.sty         1995/11/23 v2.2c Theorem extension package (FMi)     listings.sty    2007/02/22 1.4 (Carsten Heinz)     lstmisc.sty     2007/02/22 1.4 (Carsten Heinz)     listings.cfg    2007/02/22 1.4 listings configuration     t1lmr.fd        2009/10/30 v1.6 Font defs for Latin Modern     supp-pdf.mkii     ot1lmr.fd       2009/10/30 v1.6 Font defs for Latin Modern     omllmm.fd       2009/10/30 v1.6 Font defs for Latin Modern     omslmsy.fd      2009/10/30 v1.6 Font defs for Latin Modern     omxlmex.fd      2009/10/30 v1.6 Font defs for Latin Modern     umsa.fd         2009/06/22 v3.00 AMS symbols A     umsb.fd         2009/06/22 v3.00 AMS symbols B     ***********


title: Has anyone got a LyX 2 precompiled for Windows?

text: I've been trying to compile LyX 2 myself but I can't start the resulting executable (the `Resources` directory is missing a lot of subdirectories). I don't know what the problem is, I exactly followed the instructions from the programmers. The last step, "compile the `INSTALL` project in MSVC" succeeds with 13 successful operations (and none failed). Does anyone know what the problem is or does someone maybe have a working executable that you could send to me (via Yousendit.com or similar)?


title: caption of subfloat not fitting on page

text: In my thesis I have 13 figures I want on a single page. Since the last figure sits at the left side there is some space at the right side I would like to use for the caption. Somehow the caption goes below the figure and some part is chopped off. How can I make the caption use the right side of the last figure. Below is the code and the figure               \begin{figure}[htbp]       %\centering      \subfloat[\tiny\textbf{Ip, 0.00kcal/mol}]     {\label{fig:czar1p}\includegraphics[width=0.33\textwidth]{chap2/figs/czar1p.jpg}}          \subfloat[\tiny\textbf{IIp, 0.57kcal/mol}]{\label{fig:czar2p}\includegraphics[width=0.33\textwidth]{chap2/figs/czar2p.jpg}}         \subfloat[\tiny\textbf{IIn, 0.51kcal/mol}]{\label{fig:czar2n}\includegraphics[width=0.33\textwidth]{chap2/figs/czar2n.jpg}}           :        :     :     :      :      \subfloat[\tiny\textbf{VIIIn, 7.09kcal/mol}]  {\label{fig:czar8n}\includegraphics[width=0.33\textwidth]{chap2/figs/czar8n.jpg}}\\        \caption{ The thirteen conformers of Cs\"{a}sz\"{a}r \cite{csaszar92} using MP2(full)/6-  311++G**. The nomenclature used here is adopted throughout this text for glycine. The representation p indicates that the heavy atom backbone C(=O)(CN)O is planar and n indicates they are nonplanar. The figure is the relative energy with respect to Ip}       \label{fig:czars}      \end{figure}      ![output of figure](http://i.stack.imgur.com/1e8n0.png) Thank you in advance.


title: Is there a standard for automatic line-breaking for text with various alignment types?

text: The context is that I'd like to not have to manually choose newlines and rather eyeball the length of text and possibly specify the number of lines or horizontal width the text should take up. I'm interested in various alignment types (left, center, possibly right). I realize this is a bit of a complex question because I'm not really sure what looks best in terms of different breaks. Take left alignment and the following sentence: _The quick brown fox jumps over the lazy dog_. Here are a few possibilities: 1: The quick brown fox   jumps over   the lazy dog. 2: The quick   brown fox jumps over   the lazy dog. 3: The quick   brown fox   jumps over the lazy dog. 4: The quick   brown fox jumps   over the lazy dog. For left alignment, I personally think a "towers of hanoi" stacking looks best (e.g. #4), but I'm not sure if it makes sense for center alignment. Other considerations may be punctuation in the text. An acceptable answer to this question may very well be: this is a bad idea or very difficult. Alternatively, I can see it being something done with an external scripting language (which I haven't really gotten in to yet). I'm really just curious if there is an existing method for this, as it is currently not a necessity for me. # Here is a more precise example dealing with author addresses and titles:               \documentclass[letterpaper]{article}     \usepackage[affil-it]{authblk}          \usepackage[english]{babel}     \usepackage{blindtext}          \title{An efficient method for exploiting midichlorians in weak life-forms}          \author[1,2]{Darth Vader}%          \author[2,3]{Darth Sidious%       \thanks{Electronic address: \texttt{palpatine@empire.gove}; Corresponding author}}          \affil[1]{Office of the Supreme Commander of the Imperial Foces, The Galactic Empire, The Bridge, Executor}     \affil[2]{Order of the Sith Lords, LiMerge Power Building, The Works, Coruscant}     \affil[3]{Office of the Emperor of the Galaxy, The Galactic Empire, 1000 Imperial Palace, 2 Main St. Coruscant}               \date{\today}          \begin{document}          \maketitle          I ran out of creative energy here ... \blindtext     \end{document}      This results in the following: ![enter image description here](http://i.stack.imgur.com/Rfnic.png) The title itself is a bit unbalanced, and the second author affiliation has only one word on the second line.


title: Where can one find the documentation for texlipse parameters?

text: There are parameter placeholders to configure view tools. Those include "%fullfile", "%line", "%texfile". Usage examples are DDE Commands:               [DocOpen("%fullfile")][FileOpen("%fullfile")]      I want to teach my AcrobatViewR11 do do a limited forward search. I want the document to be opened on the page that corresponds to my cursor position. The following command opens the document on page 4 (page_index 3)               [DocGoTo("%fullfile", 3)]      Obviousely i need to replace the fixed parameter 3 with something like "%page". The following command is ignored and may be wrong:               [DocGoTo("%fullfile", "%page")]      (EDIT: i have a feeling itis not ignored but ragter %page is treated as 0. Meaning it moves the document to pageindex 0.) Where can i find the full list of supported texlipse placeholder parameters?


title: How to insert RTL citations in a LTR article using BibTex?

text: How can I insert a RTL citation (e.g Persian) in a LTR (e.g. English) article using BibTeX?


title: Contour partially hidden by a surface in pgfplots

text: Thank's to SE (and particularly these two questions: Draw a bivariate normal distribution in TikZ and How to fix a contour plot at top of a 3D box), I've been able to draw what I was looking for with pgfplots except for one detail. In this image: ![this image](http://i.imgur.com/wpxGGrY.png) I would like the contour lines drawn on the surface to be hidden by the surface in the foreground but not in the background (like it would be if you were really looking at such a "valley"). Is it possible to do so ? Here is the code (I downgraded the sampling in order to make it run quicker and don't forget the `-shell-escape` option to make it run with LaTeX).               \documentclass{standalone}          \usepackage{pgfplots}          \usepackage{amsmath}          \begin{document}          \pgfplotsset{     colormap={whitered}{color(0cm)=(white); color(1cm)=(orange!75!red)}     }          \begin{tikzpicture}       \begin{axis}[         colormap name=whitered,         3d box,         width=15cm,         view={25}{25},         enlargelimits=false,         grid=major,         domain=-0.5:4.7,         y domain=-2:2,         samples=21,         xlabel=$x$,         ylabel=$\dot{x}$,         zlabel={$\text{E}_{\text{m}}$},         colorbar,         colorbar style={             at={(1,0)},             anchor=south west,             height=0.1*\pgfkeysvalueof{/pgfplots/parent axis height},             title={$\text{E}_{\text{m}}(x,\dot{x})$}             }         ]     \addplot3 [surf] {-0.7+4*exp(-0.5*(x+3))*(3*cos(4*x*180/pi)+2.5*cos(2*x*180/pi)) + 0.5*y*y*4};     \addplot3 [contour gnuplot={number=14,labels={false},draw color=black},         samples=21,         ] {-0.7+4*exp(-0.5*(x+3))*(3*cos(4*x*180/pi)+2.5*cos(2*x*180/pi)) + 0.5*y*y*4};     \addplot3 [domain=-0.5:4.7,samples=31, samples y=0, thick, smooth]         (x,-2,{-0.6+4*exp(-0.5*(x+3))*(3*cos(4*x*180/pi)+2.5*cos(2*x*180/pi))});     \addplot3 [contour gnuplot={number=14,labels={false},draw color=black},         samples=21,         z filter/.code={\def\pgfmathresult{20}},         ] {-0.7+4*exp(-0.5*(x+3))*(3*cos(4*x*180/pi)+2.5*cos(2*x*180/pi)) + 0.5*y*y*4};            \end{axis}     \end{tikzpicture}     \end{document}


title: How to use \cancel command

text: I want to use `\cancel` command in TeXnicCenter but it is giving error while using that.. Basically I want to show cancellation of 2 with 2, using `\frac`. Like: `\frac{2}{2}` but I want to show it like: `\(\frac{\cancel{2}}{\cancel{2}}\)`. And I am unable to do it, can anybody please tell me how to do it..


title: Understand .cls files and working with sig-alternate.cls

text: I'm a day-one LaTex user so bear with me. I need to format a paper I'm writting with the sig-alternate.cls template in LaTex. I've got LaTex installed with TexStudio and MixTeX along with the sig- alternate.cls file downloaded. Assuming I don't need to install that .cls file somehow (I'm honestly not sure from all the documentation I've read so far) I open the .cls file in TexStudio which gives me the 1,600+ line format that I assume is the proper template I need to fill in. Before I start filling in sections like Abstract I want to be sure that the file can compile correctly. I like to make sure that my code works at every stage. I hit "Build & View" and I'm given a slew of errors starting with "Unknown graphics extension .eps" Am I using the sig-alternate.cls file wrong? Do I have LaTex installed wrong? Some help would be greatly appreciated.


title: Why different bra ket notations?

text: Why are bra and ket defined in the official package `braket.sty` in two different ways (`\bra`, `\Bra` and `\ket`, `\Ket`)? I do not understand why there exists the command `\bra` with non-scalable delimiters. For stylistic reasons, I intuitively used the capital letter versions. Were you ever confronted with the second non-scalable version? See the short example for bra:               \documentclass{article}     \usepackage{amsmath}     \usepackage{braket}          \begin{document}          \begin{align*}     \Bra{\frac{1}{\sqrt{2}}\left(\uparrow + \downarrow\right)}       &=\frac{1}{\sqrt{2}}\left(\Bra{\uparrow}+\Bra{\downarrow}\right)\\     \bra{\frac{1}{\sqrt{2}}\left(\uparrow + \downarrow\right)}       &=\frac{1}{\sqrt{2}}\left(\bra{\uparrow}+\bra{\downarrow}\right)\\     &=2 222 22\\     &=2\mathinner{222}22     \end{align*}          \end{document}      ### Understanding of the package's definition For amsmath noobs like myself, the last two lines in the align environment review what `\mathinner` does (if you look at the `braket.sty`'s package source code). The package defined the commands the following way:               \def\bra#1{\mathinner{\langle{#1}|}}     \def\ket#1{\mathinner{|{#1}\rangle}}     \def\Bra#1{\left\langle#1\right|}     \def\Ket#1{\left|#1\right\rangle}


title: How to insert (if possible) an image inside a Metapost figure? (in plain LaTeX environment)

text: I'd like to insert an image into a Metapost figure (I'm using MikTeX/LaTeX, no Metafun). I hopefully tried (also thanks to Aditya's suggestion) the following Metapost code (compiled with `-tex=pdftex` option):               verbatimtex     %&latex     \documentclass{minimal}     \usepackage{graphicx}     \begin{document}     etex          beginfig(1);     picture pct;     pct:=btex \includegraphics{myimage.jpg} etex;     %pct:=btex \includegraphics{myimage.eps} etex;     draw pct;     endfig;     end      but it does not work, giving error `! Unable to make mpx file.` if I use `jpg` format, or no error but neither image if I use `eps` format. Any clue? **UPDATE: trying the Metafun way without ConTeXt** I was told (see egreg comment below) that I can use the `externalfigure` command of Metafun (I use LaTeX, so I do not deal with Metafun, which, if I understand, is ConTeXt specific), using the `mpost -mem=metafun` compiling option of Metapost, but my system (Windows 7, MikTeX/LaTeX) seems to be unaware of Metafun and tells me `Sorry, I can't find the 'metafun' preload file; will try 'plain'.`, the actual error being `! Isolated expression.` referred to `externalfigure`. How can I install Metafun inside MikTeX? Here is my Metapost code compiled with `-mem=metafun` and `-tex=pdftex` options:               verbatimtex     \documentclass{minimal}     \begin{document}     etex          beginfig(1);     externalfigure "myimage.jpg";     endfig;     end


title: ) becomes 9 in print-out

text: I have the following expression `\mathfrak{U}^{(\alpha,N)}`. The pdf output generated with `pdflatex` is all right. But the printer turns the `)` into a `9`. Has probably something to do with the printer driver. Is there any general way to prevent such things (like `\protect` or `{)}` for example)? Further notes and information:   * I can't test possible solutions since the problem doesn't occur with my own printer and I have no access to the printer in question. Also I cannot provide information about the printer in question. The printing was done in a big copy shop and I doubt whether they still know which printer they used for my document.    * My document has almost 300 pages. The expression `\mathfrak{U}^{(\alpha,N)}` appears on average once per page. The problem however occurs on only one single page (or so I believe ... impossible to check all).   * I use `\usepackage[T1]{fontenc}`. Adobe Acrobat however says that there also type 3 fonts in my document, see the following screenshots from the acrobat document properties window ![screenshot 1](http://i.stack.imgur.com/0HWkX.jpg) ![screenshot 2](http://i.stack.imgur.com/bqRoj.jpg) ![screenshot](http://i.stack.imgur.com/M3tDz.jpg) (translation: "In diesem Dokument verwendete Schriften" = "fonts used in this document", "benutzerdefiniert" = "defined by user", "Originalschrift" = "original font", "Kodierung" = "encoding") I can't see any connection with the expression in question (but then I don't know anything about this font business!).   * Consider the following MWE (compile with `pdflatex`). Checking the document properties reveals that there are only type 1 fonts. So again, there doesn't seem to be any connection with type 3 fonts appearing in the original document and my problem. As noted above, I cannot check what happens when I print the pdf (with the printer in question). * * *               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage{amsmath}     \usepackage{amssymb}     \begin{document}     $\mathfrak{U}^{(\alpha,N)}$     \end{document}      * * *   * I load the following packages (just in case that info helps): * * *               \usepackage[ngerman,english]{babel}                     \usepackage[T1]{fontenc}                                \usepackage[latin1]{inputenc}                                              \usepackage{setspace}        \usepackage{amsmath}                                    \usepackage{amssymb}                                    \usepackage{bbm}                                        \usepackage{mathtools}                                  \usepackage{dlfltxbcodetips}                            \usepackage{textcomp}                                   \usepackage{scrtime}                                    \usepackage{enumerate}                                                             \usepackage{fancybox}                                   \usepackage{booktabs}                                   \usepackage{caption}\captionsetup{labelfont=bf}         \usepackage[amsmath,thmmarks,hyperref,framed{ntheorem}                                     \usepackage{color}                                      \usepackage{framed}                                     \usepackage{url}                                        \usepackage{graphicx}                                   \usepackage{subfigure}           \usepackage{pifont}                                     \usepackage{tensor}              \usepackage{xspace}                                     \usepackage{chngcntr}                                                                      \usepackage[titletoc]{appendix}                         \usepackage{titlesec}            \usepackage{titletoc}                                   \usepackage{refcount}            \usepackage{etoolbox}     \usepackage[fit]{truncate}       \usepackage[       a4paper,                                           textwidth=16cm,                                    outer=2cm,       textheight=45\baselineskip,       headheight=\baselineskip,       includehead=true,       heightrounded,     ]{geometry}       \usepackage{fancyhdr}     \usepackage{emptypage}      \usepackage{imakeidx}                                   \usepackage{microtype}     \usepackage[pdfstartview=FitH,                          plainpages=false,                           hyperfootnotes=false,                       pdfauthor={lpdbw},                         pdftitle={title},                 pdfsubject={XYZ},                 pdfkeywords={math},                 pdfproducer={LaTeX with hyperref},                 pdfcreator={PDFLaTeX}                 ]{hyperref}     \usepackage{bookmark}       * * *


title: How to Draw a Partitioned Circle in TikZ?

text: I want to draw something like this: ![diagram](http://i.stack.imgur.com/Mf592.jpg) I know everything apart from that circle. This is my code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes,shapes.geometric,arrows,fit,calc,positioning,automata,}     \usepackage{amsmath}          \begin{document}          \begin{tikzpicture}[shorten >=1pt,auto,node distance=3 cm, scale = 1.0, transform shape]     \tikzstyle{int}=[draw, minimum size=4em]     \tikzset{every edge/.append style={font=\Large}}     \tikzset{every node/.append style={font=\Large}}            \node[state,minimum size=3 cm]    (A)                                 {};       \node[state,minimum size=3 cm]        (B) [right of=A,node distance=6 cm]                 {};            \node[int]           (C) [above of=A]                     {  };       \node[int]           (D) [below of=A]                     {  };       \node[int]           (E) [above of=B]                     {  };       \node[int]           (F) [below of=B]                     {  };                 \path[->] (A) edge [] node []  {} (C);       \path[->] (C) edge [] node []  {} (E);       \path[->] (E) edge [] node []  {} (B);       \path[->] (B) edge [] node []  {} (F);       \path[->] (F) edge [] node []  {} (D);       \path[->] (D) edge [] node []  {} (A);          \end{tikzpicture}               \end{document}      Output is: ![current output](http://i.stack.imgur.com/yA64Z.png)


title: Sidenote formatting

text: I want to have sidenotes (alternate footnotes) in the margin. I found this code on the Latex Community website.               \newcommand{\sidenote}[1]{%             \refstepcounter{sidenote}\mbox{\textsuperscript{\alph{sidenote}}}%             \marginpar{\footnotesize \mbox{\textsuperscript{\alph{sidenote}} }#1}%     }     \newcounter{sidenote}      It works, in general, but there is some personalization I would like to make:   1. I would like to have my sidenotes in the opposite (inner) margin. I tried to change the `\marginpar` to `\reversemarginpar`, but it did not work. It actually put my sidenotes into the main body of text!   2. I would like to have these fit into paragraph style. (I use the `fnpara` package to accomplish a similar effect with my footnotes.) MWE (as requested):               \documentclass[letter]{book}          \newcommand{\sidenote}[1]{%             \refstepcounter{sidenote}\mbox{\textsuperscript{\alph{sidenote}}}%             \marginpar{\footnotesize \mbox{\textsuperscript{\alph{sidenote}} }#1}%     }     \newcounter{sidenote}          \begin{document}          In the beginning\sidenote{Gn 1:1; Pr 8:22-31; Jn 8:58; 17:5; Cl 1:17-18; He 1:8-12; 7:3; 13:8; 1Jn 1:1; Rv 1:4,8,11,17; 2:8; 3:14; 21:6; 22:13} the Word\sidenote{Is 55:11; Jn 1:14; He 4:12; 1Jn 1:1; 5:7; Rv 1:2; 19:13} was \ldots          \end{document}


title: Poor man's "namespaces"

text: I have searched for "namespaces", but all of these posts seem to ask for something way more advanced. The problem I encounter can be solved by renaming everything, but that does not seem "right". There are bunch of commands in my document such as `\renewcommand{\vec}[1]{\mathbf{#1}}` for vectors in the physics part. However, I would like to include papers in my final thesis where sometimes the same command is used with a different definition (different field). Hence, the files would compile on themselves, but if I include them in my larger document (such that they get page numbers and included in the TOC) this will give collisions. So my question is: Is it possible to "rewrite" a prefix in a command on a per- file basis? That would be, I define `\newcommand{\jonas@vec}[1]{\mathbf{#1}}` and in my particular document `jonas.tex` I would rewrite all commands `\jonas@vec` to the one with the part without `\jonas@`. This would allow me to use the same syntax, but have a different definition.


title: Eclipse-Latex-Building problem

text: I've just installed MikText and the TeXlipse 1.5.0 plugin on Eclipse. On this photo you can see the Builder settings: ![enter image description here](http://i.stack.imgur.com/Hm1VA.jpg) Im getting this error, when I try to build the file: ![enter image description here](http://i.stack.imgur.com/LyesN.jpg) I am also getting en error in Eclipse- it says: "Emergency stop.\end{document}(followed by:) ![enter image description here](http://i.stack.imgur.com/ITcMF.jpg)


title: \bibentry problem with chapterbib package

text: In my document I want to create a separate bibliography for each chapter. This works fine by using the chapterbib package. However, \bibentry does not work anymore in included files when invoking the chapterbib package. The MWE shows that the full cite is present in the main document, but does not show in the chapter.               \begin{filecontents}{mytestbib.bib}     @Article{einstein1911,      author        = "Albert Einstein",      title         = "On The influence of gravitation on the propagation of light",      journal       = "Annalen Phys.",      volume        = "35",      pages         = "898-908",      year          = "1911"}     \end{filecontents}          \begin{filecontents}{testchap.tex}     \chapter{light}     A full in-text cite of \bibentry{einstein1911}.\\     A regular citation: \citep{einstein1911}.     \bibliographystyle{apalike}     \bibliography{mytestbib}     \end{filecontents}          \documentclass{scrbook}     \usepackage{filecontents}     \usepackage{natbib}     \usepackage{bibentry}     \usepackage[sectionbib]{chapterbib}     \nobibliography*          \begin{document}     A full in-text cite of \bibentry{einstein1911}.\\     A regular citation: \citep{einstein1911}.          \include{testchap}          \bibliographystyle{apalike}     \bibliography{mytestbib}     \end{document}


title: Install packages in texworks missing style files

text: So I am trying to install the `pgfplots` package in LaTeX on my Windows 7 machine. I usually did this by just running the LaTeX file with `\usepackage{pgfplots}`, and then the computer asks me if I want to install the packages. I click yes, but I look in my style files under the `pgf` folder and do not find the appropriate style file. My error message is               ======================================================================     pdflatex.EXE: Cannot start MiKTeX package manager.     pdflatex.EXE: Data: Invalid syntax          ======================================================================               ! LaTeX Error: File `pgfplots.sty' not found.          Type X to quit or <RETURN> to proceed,     or enter new name. (Default extension: sty)


title: endnotes with eledmac

text: Here's a very minimal NWE:               \documentclass[12pt]{memoir}     \usepackage{eledmac}          \begin{document}     \Aendnote{BBB}          \doendnotes{A}     \end{document}      Here's what I see in the log:               \Aend{}{}{BBB}{A}     ! I can't find file `memoir-eledmac.end'.     \doendnotes ...me =\endprint \input \jobname .end                                                        \endgroup      l.9 \doendnotes{A}      Could someone please help me turn this into a working example?


title: Setting same specific width to columns of sequential tables produces horizontal offset

text: I obtain weird results when I sequentially arrange several tables with specific column widths **MWE**               \documentclass[ngerman]{scrartcl}          \usepackage[german]{babel}     \usepackage{booktabs, array}     \usepackage{longtable}     \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}               \begin{document}     \begin{longtable}{R{139.4185pt} L{278.837pt}} %Numbers are .3333 and .6666 of \textwidth         Bla & Bla\\     \end{longtable}          \begin{tabular}{R{139.4185pt} L{278.837pt}}         Bla & Bla\\     \end{tabular}          \begin{tabular}{R{139.4185pt} L{278.837pt}}         Bla & Bla\\     \end{tabular}     \begin{tabular}{R{139.4185pt} L{278.837pt}}         Bla & Bla\\     \end{tabular}     \end{document}      This produces unwanted offset that sometimes depends on whether there is an empty line before a `tabular` or not. No matter where I place the longtable, the next tabular has wrong offset: ![Example of wrong offsets](http://i.stack.imgur.com/YPKtV.png) What's going on?


title: Splitting y domain in 3D pgfplots

text: What I want is to plot my function from y=0-->y=3 and then from y=3,2-->y=6. I want to ommit the space between 3 and 3,2. This is my code:               \documentclass[border= 5mm]{standalone}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis} [ restrict z to domain=0:85,zmax=85,zmin=0, width=30 cm, height=20 cm]     \addplot3 [surf, samples=50,domain=-155:205,y domain=0:6, z buffer=sort]({sin(x)*y},{cos(x)*y},{17.22 + 5.53*y + 1.161*tan((180/pi)*(29.97 + y))});      \end{axis}      \end{tikzpicture}     \end{document}      I tried to use the \addplot twice, but then the second plot appears on top of the first (and not inside or around as it should)... Any ideas how I could split the y domain?


title: Document not compiling correctly

text: I've compiled a LaTeX document successfully by typing               latex documentname.tex      into terminal when in the correct working directory. The document successfully compiles. I'm using TexLive. I then make changes to the document. For some reason, when I type `latex documentname.tex` again, it compiles very quickly and gives me the previous version of the document out. I've tried deleting the output file and log file and typing `latex documentname.tex` yet again, but it still somehow outputs the old version of the document. Same for the `pdflatex` command - what is going wrong here? Is there some other command I should be using or extra arguments I can pass in? Even changing the filename of the document does not cause the new version to be compiled - I still get the old one out.


title: XeTeX hebrew problem with LyX

text: I am using LyX and trying to write in Hebrew using XeTeX. I get the following error messages:               undefined control sequence     Package polyglossia error      Is this a package I should get manually? I would mention that the problem is only with Hebrew fonts. If I am writing an English document it compiles fine and there is no problem. **Edit** Ok, I have written a MWE and exported it to a TeX file, I got the following:               %% LyX 2.0.0 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[english,hebrew]{article}     \usepackage{fontspec}     \setmainfont[Mapping=tex-text]{David}          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.     \usepackage{theorem}     \theorembodyfont{\upshape}     \newtheorem{theorem}{\R{משפט}}[section]     \AtBeginDocument{\make@lr\thetheorem}          \makeatother          \usepackage{xunicode}     \usepackage{polyglossia}     \setdefaultlanguage{hebrew}     \setotherlanguage{english}     \begin{document}     שלום עולם. זוהי דוגמה למסמך עברי\L{     \[     E=mc^{2}     \]     }זו הנוסחה המפורסמת של אינשטיין     \end{document}      The error messages are:               !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     Fatal fontspec error: "cannot-use-pdftex"     The fontspec package requires either XeTeX or LuaTeX to function     You must change your typesetting engine to, e.g., "xelatex" or "lualatex"     instead of plain "latex" or "pdflatex"     See the fontspec documentation for further information     For immediate help type H <return>     ...............................................  :    }


title: Identifying long-distance float and footnote references

text: Many people have asked questions about how to locate float references such that the float will appear near the first reference (note that a similar - but less common - problem exists for footnotes, as described in "Footnote being pushed to after a float page."). I'm hoping for an automated tool to identify potential problem floats and footnotes. In a small document, it's relatively easy to identify and fix any problematic references, but in a large document (e.g. a dissertation or a book), the proofreading effort is considerable, and the problems may change considerably after minor editing. At the extreme, adding a sentence or a paragraph early in a chapter may affect float placement throughout that chapter - and I don't want to repeat the laborious proofing process after each compilation. I'm imagining a PDF tool that would output a list of potentially problematic placements, for manual review. E.g. "Table 2.3 located 3 pages after the first reference", "Footnote 3 in chapter 4 located 2 pages after reference". Such a tool could presumably use the PDF hyperlinks produced by the hyperref package to trace references within the document. Alternatively (and more simply), is there a pdflatex option to output a warning when placing a float or footnote more than x pages from the first reference? Update: I've built myself a simple tool using the iText library, but it's pretty rudimentary, and I'd still be interested in a more sophisticated proofing tool.


title: Displaying a later value of a counter

text: I have a counter which is used throughout my document. At the beginning of each chapter (right after the `\chapter` command), I want to print the value of the counter which is reached immediately before the next `\chapter` command. For e.g. At the first paragraph occurring within chapter 1, I want to display the last value the counter reached within chapter 1. At the first paragraph occurring within chapter 2, I want to display the last value the counter reached within chapter 2. I have put together a partial solution, but I do not know if it is ideal: I have the counter `thecounter`, which is used for the entire length of my document. I use a custom macro for `\chapter` called `\newchapter`. This macro resets the counter each time back to "0" whenever I start a new chapter:               \newmacro{\newchapter}[1]{         \setcounter{thecounter}{0}         \chapter{#1}     }      I can further add to this macro by creating a variable which knows the value of the counter immediately before the reset:               \newmacro{\newchapter}[1]{         \def\valuebeforethechapterends{\value{thecounter}}         \setcounter{thecounter}{0}         \chapter{#1}     %the last value of the counter before it gets reset for the next chapter should be printed here     }      Within the first paragraph of each chapter, I'd like to display the value that the counter will reach before the next reset. Unfortunately, I do not know how to tell the code which `\valuebeforethechapterends` to use, as it will be defined many times in the document. How can I print the last value of the counter before it gets reset right after the `\chapter` command in my macro?


title: Beamer overlay specifications for a tikzpicture

text: Overlay specifications can be added to the TikZ commands.               \node<2> (a) {only visible on slide 2};      Is this also possible for the whole tikzpicture environment?               \begin{tikzpicture}[<2>]       \node (a) {only visible on slide 2};       \node (b) {also only visible on slide 2};     \end{tikzpicture}      This can be emulated by enclosing the environment in `\only<2>{ ... }` but this is impossible when the `tikzpicture` is used in a `\newenvironment`.


title: What does $\mbox$ do?

text: The LaTeX wiki says it makes a box, but when I used it with `\mbox{Cos}` for example, it simply wrote "Cos" in the same way that writing Cos by itself would have done. What's the point of `\mbox`?


title: Using \extrawidth in exam class results in unwanted margin changes (per page)

text: I'm trying out the Exam class after seeing good things about it on this site following the guide: _Using the exam document class_ by Philip Hirschhorn . However, I've run into some problems with the number of marks in the margin. I have tried using the `\extrawidth{}` function but to no avail. When all my qs fit on one page it works, but when the questions run over one page the margins keep on changing by their self... MWE:               % Exam style         \documentclass[addpoints,12pt]{exam}     % Adding in my packages for maths         \usepackage[utf8]{inputenc}         \usepackage{amsmath, amsfonts, amssymb, color, mathtools}     % Borders         \usepackage[a4paper,bindingoffset=0 cm, left=2cm, right=2cm, top=2cm, bottom=2cm, footskip=0.5cm]{geometry}     %--------------------------------------------------------------------     %   Customisations to the exam layout design     %--------------------------------------------------------------------     % Settings for marks         \pointsdroppedatright  % Marks at bottom right         \marginpointname{ \points}  % Gives my margin points a name         \marksnotpoints  % Using 'Marks' not 'Points'         \pointformat{\themarginpoints}  % Setting for the display     % Settings for total marks (per question)         \totalformat{Total Marks for Question \thequestion: \totalpoints  \points}  % Setting for the display       % Settings for questions         \qformat{\textbf{Question \thequestion} (\totalpoints\ \points) \hfill}         \renewcommand{\questionshook}{%               \setlength{\leftmargin}{0cm}%               \setlength{\labelwidth}{-\labelsep}%         }  % No indent for the question content          \begin{document}     \begin{questions}     % So the dropmarks fit in the right margin         \extrawidth{3cm}         \question  %[2] means worth 2 marks, not question 2         Imagine if there is no air         \begin{parts}                 \part[2] What would be the effect on the balloon industry?              \fillwithlines{5cm}             \droppoints             \part[6] What would be the effect on the aircraft industry?              \fillwithlines{15cm}             \droppoints         \end{parts}         \question[5]         Why is there air?         \fillwithlines{15cm}         \droppoints     \end{questions}     \end{document}      When I run it, the margins are different one page one and two and the guide I'm using has no answer... (tried google too with no avail) Any help appreciated thanks!