title: Chapter numbers not showing on page, but showing in TOC

text: In my multi-chapter document, I have child docs that all use `\chapter` but the chapter number is not showing, just the chapter title. However, the numbers do show in the TOC. Below is the MWE for the master doc and a sample chapter. It is long, so bear with me, not sure how much more minimum I can go, but this recreates the problem:               \documentclass[12pt,letterpaper,truedoublespace]{report}     \renewcommand{\familydefault}{\rmdefault}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}          \makeatletter          \RequirePackage{setspace}[1998/04/8]          \newcommand{\etptsize}{12pt}          \DeclareOption{10pt}{\renewcommand{\etptsize}{10pt}}     \DeclareOption{11pt}{\renewcommand{\etptsize}{11pt}}     \DeclareOption{12pt}{\renewcommand{\etptsize}{12pt}}     \DeclareOption{letterpaper}{\PassOptionsToClass{letterpaper}{report}}          % The following options set the global amount of spacing          \newcommand{\etspacing}{\setstretch{1.37}}     \DeclareOption{truedoublespace}{\renewcommand{\etspacing}{\doublespacing}}     \DeclareOption{doublespace}{\renewcommand{\etspacing}{\setstretch{1.37}}}     \DeclareOption{onehalfspace}{\renewcommand{\etspacing}{\onehalfspacing}}     \DeclareOption{singlespace}{\renewcommand{\etspacing}{\singlespacing}}          % Normally, the chapter heads are all uppercase, but sometimes     % this causes problems.  The following option changes     % the chapter heads to small caps instead.          \newcommand{\etchapterheadstyle}[1]{\MakeUppercase{#1}}     \DeclareOption{plainchapterheads}{\renewcommand{\etchapterheadstyle}[1]{#1}}          % Pass all other options to report.cls.     \DeclareOption*{%      \PassOptionsToClass{\CurrentOption}{report}     }          % CCW: font size modifications, from Martin Pergler     % Put it at document start, else some packages may clobber it.     % Thesis Office says minimum should be 9pt for microfilming, but they     % didn't actually complain about the standard LaTeX sizes (12/8/6) that     % I used previously.  So 8pt isn't too much of a cheat.     \AtBeginDocument{\DeclareMathSizes{12}{12}{10}{8}}          % Adjust spacing of document          \etspacing          \newcommand{\dedication}{             \chapter*{}             \thispagestyle{empty}     }          % copyright page (if used, should appear directly after title page)     % usage: \makecopyright     \def\makecopyright{\@restonecolfalse        \if@twocolumn\@restonecoltrue\onecolumn        \else \newpage \fi        \thispagestyle{empty}%\setcounter{page}{2}%     %   \addtocounter{page}{1}        \null\vfill     \centerline{   Copyright \copyright\ \number\year\ by \@author }     \centerline{ All rights reserved }        \vskip 15pt\relax        \if@restonecol\twocolumn \else \newpage \fi        \let\makecopyright=\relax}          %     % \topmatter : Things like Abstract, Acknowledgments.     %    Usage:     %       \topmatter{Title Of Matter}     %     %       Use like \chapter, once for each page of matter you want.  Don't     %       use numbered sections within these.  Use \section* instead.     %     \newcommand{\topmatter}[1]{             \chapter*{#1}             \addcontentsline{toc}{chapter}{#1}     }          %     % redefinition of abstract environment     %          \renewenvironment{abstract}{\topmatter{Abstract}}{}     \newenvironment{acknowledgments}{\topmatter{Acknowledgments}}{}          %     % \mainmatter : Signals the start of the document's body.     %    Usage:     %       \mainmatter     %     %       Use once before the first numbered \chapter.     %     \newcommand{\mainmatter}{             \clearpage             \pagenumbering{arabic}     }          %     % Title Page Information Commands     %    Example Usage:     %       \title{Stones And L^2 Invariants}     %       \author{Fred D. Belitnikoff}     %       \department{Mathematics}     %       \division{Physical Sciences}  (Sciences with an s!)     %       \date{July 1998}    (Your grad. date, formatted like the example)     %     %     \renewcommand{\title}[1]{\gdef\@title{#1}}     \renewcommand{\author}[1]{\gdef\@author{#1}}     \newcommand{\department}[1]{\gdef\@department{#1}}     \newcommand{\division}[1]{\gdef\@division{#1}}     \newcommand{\degree}[1]{\gdef\@degree{#1}}     \renewcommand{\date}[1]{\gdef\@date{#1}}          %     % \maketitle :  Makes the U. of Chicago dissertation title page.     %               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %     %     Internal Formatting Commands For This Thesis Style     %     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %     % Renew commands that make chapter & section headers     %     \renewcommand{\@makechapterhead}[1]{{             \setlength{\topmargin}{0.5in}   % really 1.5in, added by bph for OAP standards             \normalfont\large\bfseries             \begin{center}             \etchapterheadstyle{\@chapapp{ \thechapter}}  %  CHAPTER 1 or APPENDIX             \etchapterheadstyle{#1}     %     TITLE OF CHAPTER             \end{center}             \setlength{\topmargin}{0in}   % back to 1in          }}     \renewcommand{\@makechapterhead}[1]{{               \setlength{\topmargin}{0.5in}    % really 1.5in, added by bph for OAP standards             \normalfont\large\bfseries             \begin{center}             \etchapterheadstyle{#1}                       %     TITLE OF CHAPTER             \end{center}             \setlength{\topmargin}{0in}   % back to 1in     }}     \renewcommand\section{\@startsection {section}{1}{\z@}%                                     {-3.5ex \@plus -1ex \@minus -.2ex}%                                     {2.3ex \@plus.2ex}%                                     {\normalfont\large\bfseries\centering}}     \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%                                     {-3.25ex\@plus -1ex \@minus -.2ex}%                                     {1.5ex \@plus .2ex}%                                     {\normalfont\large\itshape\centering}}     \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%                                     {-3.25ex\@plus -1ex \@minus -.2ex}%                                     {1.5ex \@plus .2ex}%                                     {\normalfont\large}}     %\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%     %                              {3.25ex \@plus1ex \@minus.2ex}%     %                              {-1em}%     %                              {\normalfont\normalsize\bfseries}}     \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%                                     {3.25ex \@plus1ex \@minus .2ex}%                                     {-1em}%                                     {\normalfont\small\bfseries}}     %\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%     %                             {3.25ex \@plus1ex \@minus .2ex}%     %                             {-1em}%     %                             {\normalfont\normalsize\itshape}}     \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%                                     {3.25ex \@plus1ex \@minus .2ex}%                                     {-1em}%                                     {\normalfont\small\bfseries}}          % Change style of printing chapters in TOC to match chapter headings.          \renewcommand*\l@chapter[2]{%       \ifnum \c@tocdepth >\m@ne         \addpenalty{-\@highpenalty}%         \vskip 1.0em \@plus\p@         \setlength\@tempdima{1.5em}%         \begingroup           \parindent \z@ \rightskip \@pnumwidth           \parfillskip -\@pnumwidth           \leavevmode           \advance\leftskip\@tempdima           \hskip -\leftskip           \etchapterheadstyle{#1}\nobreak     % CCW: The following 3 lines add dots to the chapter TOC listings           \leaders\hbox{$\m@th             \mkern \@dotsep mu\hbox{.}\mkern \@dotsep             mu$}\hfill           \hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par           \penalty\@highpenalty         \endgroup       \fi}          %% Change name of table of contents     %\renewcommand{\contentsname}{Table of Contents}          %% Change name of table of contents if using package{babel}     \addto\captionsenglish{\def\contentsname{Table of Contents}}          % Change the margins to fit requirements     % Because most printers add 0.25in on both margins by default, use {0.25in} for 1.5in margins, or {0in} for 1.25in margins     \setlength{\oddsidemargin}{0.25in}  % for 1.5in     \setlength{\evensidemargin}{0.25in}  % for 1.5in     %\setlength{\oddsidemargin}{0in}  % for 1.25in     %\setlength{\evensidemargin}{0in}  % for 1.25in     \setlength{\textwidth}{6.25in}     % Printers do not seem to add anything to top/bottom margins, so {0in} does in fact leave a 0in top margin     \setlength{\topmargin}{0in}   % really 1in     \setlength{\headheight}{0.2in}     \setlength{\headsep}{0.3in}     \setlength{\textheight}{8.25in}     \setlength{\footskip}{0.5in}          % Changing where the page numbers go on pages that aren't the first     % page of a chapter.          %changed by Yahui Peng 2/1/10     \pagestyle{myheadings}     \markright{}     \pagestyle{plain}          %% Added by CWH for SSD/Anthro requirements: the first page of a chapter,      %% use \page in footer center; otherwise \page in header right     %\usepackage{fancyhdr}     %\pagestyle{fancy}     %\fancyhead{}     %\fancyfoot{}     %\fancyhead[R]{\thepage}     %\renewcommand{\headrulewidth}{0pt}     %\rhead{\thepage}               % Make the table of contents, etc.,  single spaced     %     % bph added lists of tables/figures to table of contents.     % CCW fixed bug where multipage LOT/LOF were listed in TOC with wrong     % page number.          \let\oldtableofcontents = \tableofcontents     \renewcommand{\tableofcontents}{       \begin{singlespace}         \oldtableofcontents       \end{singlespace}     }          \let\oldlistoftables = \listoftables     \renewcommand{\listoftables}{       \begin{singlespace}         % This works b/c multiple \newpage's are treated as one         \newpage         \addcontentsline{toc}{chapter}{List of Tables}         \oldlistoftables        \end{singlespace}     }          \let\oldlistoffigures = \listoffigures     \renewcommand{\listoffigures}{       \begin{singlespace}         % This works b/c multiple \newpage's are treated as one         \newpage         \addcontentsline{toc}{chapter}{List of Figures}         \oldlistoffigures        \end{singlespace}     }          \renewcommand{\figurename}{Figure}     \providecommand{\fnum@figure}[1]{\textbf{\figurename~\thefigure}.}               \widowpenalty=10000     \clubpenalty=10000     \raggedbottom          \@ifundefined{showcaptionsetup}{}{%      \PassOptionsToPackage{caption=false}{subfig}}          \makeatother          \begin{document}          \dedication \begin{center} \emph{In order to properly understand the big picture, we should fear becoming mentally clouded and obsessed with one small section of truth.}\\\emph{- Xunzi}\end{center}          \tableofcontents          \clearpage          \pagenumbering{arabic}          \setcounter{page}{1}          \chapter{Introduction}          The Late Neolithic (3000-2000 bce) is characterized by the spread     of the Longshan Culture Complex throughout the Huang-Huai floodplain,     covering all regions occupied by the earlier Yangshao and Dawenkou     cultures (Chang 1986; Fitzgerald-Huber 1983; Liu 2004; Liu and Chen     2006). Definition of local Longshan phases is based primarily on minor     stylistic differences in the pottery inventories of these regions,     though such stylistic criteria are limited to external, decorative     features of the pottery.               \section{Research Questions}          The developments that took place in the communities of the Luoyang     Basin between 3000 and 1500 BCE provide an excellent opportunity for     studying the emergence of the state through material culture.          \end{document}      Edit #1: I figured this out with much help from Sora and Christian. In response to my comment about having the chapter # and chapter title on separate lines, I believe the first set of code was intended to do just that. It worked in LyX (which probably ignored the second set), but not in LaTeX (which probably ignored the first set). So, I now have:               \renewcommand{\@makechapterhead}[1]{{             \setlength{\topmargin}{0.5in}             \normalfont\large\bfseries             \begin{center}             \etchapterheadstyle{\@chapapp{~\thechapter}}  %  CHAP or APP #             \\             \etchapterheadstyle{#1}                       %  TITLE OF CHAPTER             \end{center}             \setlength{\topmargin}{0in}     }}      Perfect!


title: What are the differences between using paralist vs. enumitem

text: I am looking for advice on which of these packages to use? Under what circumstances would `paralist` be preferred over `enumitem`?


title: Submitting a journal article as a single tex file

text: Although many academic journals readily accept submissions in some format of TeX, indeed some enlightened ones _insist_ on it, it is rare that one can simply send exactly the same document that one has been working on as a submission. Most journals insist on authors using their "house class file", and some have specific style files that define "common macros". Some journals further make one or both of the following demands:   1. That the submission be a single file,   2. That all unnecessary macros be removed. For example in BioMed Central TeX template files (the linked page seems to be an unofficial copy, but I could not find an official one online), Sections 2.2 and 2.3 say: > **2.2:** In order to submit a manuscript as a .tex file to BioMed Central, > you must > >   * use the BioMed Central template >   * format your references with BibTeX using the bmc_article.bst style file >   * not rely on any non-standard macros, classes or files > > > **2.3:** Make sure that you only a single .tex document for the entire > manuscript, as you will need to upload it as a single file (together with > its associated formatted bibliography file). Do not use the \input command > to include other .tex files. Obviously, some journals adhere to these more strictly than others and the first thing to do is to determine whether these requests are enforced or not (and what, exactly, is considered "non-standard"). So let us suppose that this has been done and the answer is: yes, these are enforced. Then the question is: how does one do this? In all likelihood, there is not a simple answer, in which case it will be extremely valuable to know what strategies and workflows others have employed. (But **please** do **not** name-and-shame journals who make these requests. It may not be the journal but the publisher, and I'm sure that the journals could provide equally horrific stories of the TeX-mangling that they've received.) One thing to take note of is that the additional files may not just be style files or bibliography files but images as well. For example, in the BioMed instructions given above, the reason given for this request is that the upload is to be a _single file_ (and let us, for the sake of argument, assume that archived files are not allowed). Thus we can divide this in to various scenarios:   1. The journal asks that the submission contain only one **TeX file**. So image files and bibliography files are fine as extras. We assume also that it is possible to identify which extra files should be included, but they may be a combination of user-written style files and packages downloaded from CTAN. The task is to fold all of these in to a single file. **How do we make these in to a single file, and what pitfalls are there to be aware of?**   2. The journal asks that the submission contain only one **file** in total. Now we wish to embed non-standard type files into our TeX file. **Is this possible?** and if so, how, and what pitfalls are there to be wary of?   3. The journal asks that _unnecessary_ macros/commands be removed. Are there any strategies for going through a document and identifying those commands which have been defined but never used?


title: How to change bibliography style so that writer's last name on the front?

text: I'm a total noob in latex world, but i need to write in latex for my thesis. I just want the writer's name is in the front of each entry, but i dont know which style to use and how to use it. Here is the unexpected results. You can notice it is alphabetically sorted by the last name, but the first name is still on the front. Here's the `.tex` file:               \documentclass[a4paper,12pt,oneside,makeidx]{skripsi}          \usepackage[bahasa]{}     \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}     \usepackage{array}     \usepackage{longtable}     \usepackage{rotating}     \usepackage{graphicx}     \usepackage{setspace}     \usepackage{textcomp}     \usepackage{multirow}     \usepackage{listings}     \usepackage{booktabs}     \usepackage{makeidx}     \usepackage[style=ieee,natbib=true]{biblatex}     \defbibheading{bibliography}{\chapter*{Bibliography}}          \addbibresource{stream_video_net.bib}          \makeindex{} \centerchapter \makeatletter \doublespacing     \makeatother     \parindent 3.0em     %===================================================================     \setlength{\textwidth}{15.0cm}     \setlength{\evensidemargin}{2.5cm}     \setlength{\footskip}{2.5cm}             \setlength{\textheight}{\paperheight}     \addtolength{\textheight}{-\topmargin}     \addtolength{\textheight}{-\headheight}     \addtolength{\textheight}{-\headsep}     \addtolength{\textheight}{-\footskip}     \addtolength{\textheight}{-4cm}          \begin{document}     \nocite{*}          \pagestyle{empty}     \pagenumbering{roman}          \pagestyle{plain}     \pagenumbering{roman}     \setcounter{page}{1}     \addcontentsline{toc}{chapter}{TABLE OF CONTENTS}     \tableofcontents{}          \listoffigures \addcontentsline{toc}{chapter}{LIST OF FIGURES}          \listoftables \addcontentsline{toc}{chapter}{LIST OF TABLES}          \newpage     \pagestyle{headings}     \pagenumbering{arabic}     \setcounter{page}{1}      \newpage     \addcontentsline{toc}{chapter}{BIBLIOGRAPHY}      \pagestyle{plain}     \printbibliography     \pagebreak     \pagenumbering{gobble}     \include{daftarlampiran}     \end{document}      and the `.bib` file               % This file was created with JabRef 2.9.2.     % Encoding: UTF-8          @ELECTRONIC{apache,       author = {anonym},       month = {1},       year = {2014},       title = {What is Apache Web Server},       howpublished = {Online},       url = {http://httpd.apache.org/ABOUT_APACHE.html},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ELECTRONIC{mobileburn,       author = {anonym},       month = {1},       year = {2014},       title = {What is "Frame Rate"?},       howpublished = {Online},       url = {http://www.mobileburn.com/definition.jsp?term=fps},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ELECTRONIC{openssh,       author = {anonym},       month = {1},       year = {2014},       title = {OpenSSH Documentation Page},       howpublished = {Online},       url = {http://www.openssh.org/},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ELECTRONIC{red,       author = {anonym},       year = {2014},       title = {High Frame Rate Video},       howpublished = {Online},       organization = {RED},       url = {http://www.red.com/learn/red-101/high-frame-rate-video},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ELECTRONIC{wan,       author = {anonym},       year = {2014},       title = {Difference between LAN, MAN, and WAN},       howpublished = {Online},       url = {http://www.differencebetween.co.in/computers/difference-between-lan-man-and-wan/},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ELECTRONIC{avermedia,       author = {anonym},       month = {12},       year = {2013},       title = {HTTP/TCP vs. RTP/UDP},       howpublished = {Online},       organization = {AverMedia},       address = {47358 Fremont Blvd., Fremont, CA 94538},       url = {http://solutions.avermedia.com/?q=en/support/knowledge-base/internet-basic/http-tcp-vs-rtp-udp},       owner = {noersetiawan},       timestamp = {2013.12.31}     }          @ELECTRONIC{diffen,       author = {anonym},       month = {12},       year = {2013},       title = {TCP vs UDP},       howpublished = {Online},       organization = {Diffen},       url = {http://www.diffen.com/difference/TCP_vs_UDP},       owner = {noersetiawan},       timestamp = {2013.12.31}     }          @ELECTRONIC{princeton,       author = {anonym},       month = {12},       year = {2013},       title = {Metropolitan Area Network},       howpublished = {Online},       organization = {Princeton Univeristy},       address = {Princeton, NJ 08544, United States},       url = {http://www.princeton.edu/~achaney/tmve/wiki100k/docs/Metropolitan_area_network.html},       owner = {noersetiawan},       timestamp = {2013.12.31}     }          @ELECTRONIC{vlc,       author = {anonym},       month = {12},       year = {2013},       title = {Online Documentation of VLC},       howpublished = {Online},       url = {http://www.videolan.org/doc/vlc-user-guide/en/ch01.html},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @STANDARD{MOS,       title = {Subjective video quality assessment methods for multimedia applications},       organization = {International telecommunication Union, ITU-T Recommendation P.910},       author = {anonym},       year = {1996},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ELECTRONIC{bth,       author = {Vasanthi Dwaraka Bhamidipati and Swetha Kilari},       month = {12},       year = {2013},       title = {Effect of Delay/ Delay Variable on QoE in Video Streaming},       howpublished = {Online},       organization = {Blekinge College of Technology},       address = {Valhallavägen, 371 41 Karlskrona, Sweden},       url = {http://www.bth.se/com/mscee.nsf/attachments/5297_Effect_of_Delay_Delay_Variation_on_QoE_in_Video_Streaming_pdf/$file/5297_Effect_of_Delay_Delay_Variation_on_QoE_in_Video_Streaming.pdf},       owner = {noersetiawan},       timestamp = {2013.12.31}     }          @ELECTRONIC{videoband,       author = {Brad},       month = {1},       year = {2014},       title = {How Fast Does Your Network Needs To Be?},       howpublished = {Online},       organization = {About},       url = {http://compnetworking.about.com/od/speedtests/tp/how-fast-does-your-network-need-to-be.htm},       owner = {noersetiawan},       timestamp = {2014.02.07}     }          @ELECTRONIC{gafferongames,       author = {Gleen Fiedler},       year = {2014},       title = {UDP vs TCP},       howpublished = {Online},       url = {http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ARTICLE{vlclow,       author = {Giovanni Gualdi and Rita Cucchiara and Andrea Prati},       title = {Low-Latency Live Video Streaming over Low-Capacity Network},       journal = {Eighth IEEE International Symposium on Multimedia, 2006.},       year = {2006},       volume = {8},       pages = {449-456},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ARTICLE{traffic,       author = {Stephen Hemminger},       title = {Network Emulation with NetEm},       journal = {Open Source Development Lab},       year = {2005},       note = {NetEm is available is tool from tc},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ELECTRONIC{plymouth,       author = {Asiya Khan},       month = {12},       year = {2013},       title = {Video Mean Opinion Score (MOS) Test},       howpublished = {Online},       organization = {University of Plymouth},       address = {Plymouth University, Plymouth PL4 8AA, United Kingdom},       url = {http://www.tech.plymouth.ac.uk/spmc/staff/akhan/mostest/default.htm},       owner = {noersetiawan},       timestamp = {2013.12.31}     }          @ELECTRONIC{mcgath,       author = {Gary McGath},       month = {12},       year = {2013},       title = {Basics of Streaming Protocols},       howpublished = {Online},       url = {http://www.garymcgath.com/streamingprotocols.html},       owner = {noersetiawan},       timestamp = {2013.12.31}     }          @ELECTRONIC{osi,       author = {Bradley Mitchell},       month = {1},       year = {2014},       title = {OSI Model Reference Guide},       howpublished = {Online},       url = {http://compnetworking.about.com/cs/designosimodel/a/osimodel.htm},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ELECTRONIC{utl,       author = {Mario Serafim Nunes},       month = {12},       year = {2013},       title = {Quality of Service of Video Streaming},       howpublished = {Online},       organization = {Instituto Superior Tecnico},       address = {Instituto Superior Tecnico, Universidade de Lisboa.},       url = {http://comp.ist.utl.pt/pdeec-qs/bibliografia/50-QoS%20Video%20streaming.pdf},       owner = {noersetiawan},       timestamp = {2013.12.31}     }          @ELECTRONIC{streamingmedia,       author = {Jan Ozer},       month = {8},       year = {2012},       title = {What Is a Streaming Media Protocol?},       howpublished = {Online},       organization = {Information Today Inc.},       url = {http://www.streamingmedia.com/Articles/Editorial/What-Is-.../What-Is-a-Streaming-Media-Protocol-84496.aspx},       owner = {noersetiawan},       timestamp = {2013.12.31}     }          @ELECTRONIC{digitaltrends,       author = {Drew Pindle},       month = {12},       year = {2013},       title = {Best Media Streaming Services},       howpublished = {Online},       organization = {Digital Trends},       url = {http://www.digitaltrends.com/home-theater/best-media-streaming-services/},       owner = {noersetiawan},       timestamp = {2013.12.31}     }          @ARTICLE{netem,       author = {Junaid Shaikl and Thair Nawaz Minhas and Patrik Arlos and Markus         Fiedler},       title = {Evaluation of Delay Performance of Traffic Shappers},       journal = {International Workshop on Security and Communication Networks},       year = {2010},       owner = {noersetiawan},       timestamp = {2014.01.30}     }          @ELECTRONIC{norway,       author = {Jie Xu and Liyuan Xing and A. Perkis and Yuming Jiang},       month = {12},       year = {2011},       title = {On the Properties of Mean Opinion Scores for Quality of Experience         Management},       howpublished = {Online},       organization = {Norwegian University of Science and Technology},       address = {Høgskoleringen 1, 7491 Trondheim, Norway},       url = {http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=6123396&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D6123396},       owner = {noersetiawan},       timestamp = {2013.12.31}     }


title: Standalone and citation/cross-referencing from source document

text: How to cite or cross-reference an item from source document in a `standalone` document?               \documentclass{article}     \usepackage[mode=buildnew]{standalone}          \begin{filecontents}{stdalone.tex}     \documentclass{standalone}     \begin{document}        This is a test \cite{cref}.     \end{document}     \end{filecontents}          \begin{document}          This is the source file.          This works here: \cite{cref}          But does not work here: \includestandalone{stdalone}     \begin{thebibliography}{10}        \bibitem{cref}         A test reference.     \end{thebibliography}     \end{document}


title: slidestop for a single slide in beamer

text: Is it possible to align text at the top of the slide for only a single slide? Alternatively is there a simple way to absolute align anything in a beamer slide.


title: tabular* with rubber spacing and \cline

text: I'm using a `tabular*` with rubber spacing to fill the complete width of the page. This works fine, except that when I use `\cline`, the line is not complete. It seems that `\cline` does not cover the spacing. I'm using `pdflatex`. Below you will find a code example. Any ideas on how to fix this?                \usepackage{array} % for defining a new column type      \usepackage{varwidth} %for the varwidth minipage environment      %...      \newcolumntype{M}{>{\begin{varwidth}{6cm}}l<{\end{varwidth}}} %M is for Maximal column      %...      \begin{tabular*}{15.5cm}{@{\extracolsep{\fill}} | M | r | r | r | r |}        \hline        \bf Omschrijving & \bf Hoeveelheid & \bf Prijs & \bf SubTotaal & \bf BTW\\        \hline        Armband 2 & 1 & 256.00 & 256.00 & 19.00\% \\        \hline        \multicolumn{3}{c |}{} & SubTotaal & 256.00\\        \multicolumn{3}{c |}{} & BTW (19.0) & 48.64\\        \multicolumn{3}{c |}{}  & \bf Totaal & \bf 304.64\\        \cline{4-5}     \end{tabular*}


title: Minimum length for \xrightarrow

text: I want to place text over arrows. The obvious choice is to use the amsmath command `\xrightarrow{#1}` However, sometimes the text above may be a single digit:               %Example 1     \xrightarrow{1}      other times the text is slightly longer:               %Example 2     \xrightarrow{1000}      The problem I have is that the length of the arrow is scaled to the length of the text. So the arrow in example 1 is much shorter than the arrow in example 2. Is there a way of making the arrows the same length? Should I use a different command altogether?


title: Marking Specific x-values in TikZ Plot

text: I've plotted a function using TikZ and gnuplot and would like to indicate certain points on the graph. From the manual, I can only figure out how to get TikZ to place a mark at a point it's using to plot the function. Is there a clever (or even a simple) way to do this or am I better off just making a node for each point I want? For reference, so far I have               \begin{tikzpicture}[domain=-4:4]         \draw[very thin,color=gray] (-4.1,-1.1) grid (3.9,0.9);                  \draw[color=red] plot[id=f,smooth] function{x*exp(-2*x**2)}             node[right]{$f(x)=xe^{-2x^2}$};     \end{tikzpicture}


title: How to properly break text with lots of inline formulas?

text: I have the following document:               \documentclass{article}     \begin{document}     \textbf{Theorem:}     $\forall x_0\cdots\forall x_{n+2}(     \forall x_{n+3}(x_{n+3}\in x_{n+1}\leftrightarrow     \bigvee_{i=0}^n(x_{n+3}=x_i))\land     \forall x_{n+3}(x_{n+3}\in x_{n+2}     \leftrightarrow\bigvee_{i=0}^n(x_{n+3}=x_i))     \rightarrow x_{n+1}=x_{n+2})$.     \end{document}      When compiling it, I get a: `Overfull \hbox (29.87967pt too wide)` warning message. I can get rid of it by adding `\raggedright` before the theorem statement, but this way lines are not filled completely. I'd like to have justified text, no matter where LaTeX decides to break the formula. How can I accomplish this? Thanks.


title: How to add shiny effect

text: I have the following code:               \begin{tikzpicture}[decoration={random steps,segment length=8pt,amplitude=4pt},thick]            \begin{scope}[opacity=.8,transparency group]         \draw[fill=yellow,draw=none] (-4,3.75) rectangle (4,3);         \draw[fill=yellow,draw=none,opacity=0.8] (-3.8,3.2) rectangle (3.84,2);       \end{scope}       \node[anchor=west] at (4.5,3.5) {hv};       \draw[dash pattern=on 20pt off 10pt,line width=30pt,draw=white] (-4,2.5) -- (4,2.5);       \draw[dash pattern=on 20pt off 10pt,line width=2pt] (-4,3) -- (4,3);       \node[anchor=west] at (4.5,3) {Mask};       \filldraw[fill=blue!20]         (4,1.5)         decorate { -- (4,2) }         -- (-4,2)         decorate { -- (-4,1.5) };       \node[anchor=west] at (4.5,1.75) {Hydrogel};       \filldraw[fill=orange]          (-4,0) -- (4,0)         decorate { -- (4,1.5) }         -- (-4,1.5)         decorate { -- (-4,0) };       \node[anchor=west] at (4.5,0.75) {Substrat};     \end{tikzpicture}      Which results in this image: ![enter image description here](http://i.stack.imgur.com/Oh8SQ.png) Now I want to add a shiny effect to the hv, like a blurred outline. How is this achievable?


title: How to switch the poles of the SPDT switch in circuitikz

text: I am drawing a circuit with **circuitikz** that have lots of SPDT switches. I want to show the circuit at two different moments: once, when all the SPDT switches connected to out1 and the second with all of them to out2. Is there any simple way to do this? Here is a working example of what I am trying to code:               \documentclass[a4paper]{article}          \usepackage{amsmath}     \usepackage{tikz}     \usepackage{circuitikz}     \begin{document}               \begin{circuitikz}         % Switches         \draw (0,2) node[spdt,xscale=1,anchor=in] (Swp) {};         \draw (0,0) node[spdt,xscale=-1,anchor=in] (Swc) {};         \draw (0,-2) node[spdt,xscale=1,anchor=in] (Swn) {};              % Capacitors         \draw (Swp.in) to[C,l_=$(C_s + \Delta C)$] (Swc.in);         \draw (Swn.in) to[C,l^=$(C_s - \Delta C)$] (Swc.in);              % Voltages         \draw (Swp.out 1) node[anchor=west] {$V_{in}^+$};         \draw (Swn.out 1) node[anchor=west] {$V_{in}^-$};         \draw (Swp.out 2) node[anchor=west] {$V_{cm}$};         \draw (Swn.out 2) node[anchor=west] {$V_{cm}$};         \draw (Swc.out 1) node[anchor=east] {$V_{cm}$};         \draw (Swc.out 2) node[anchor=east] {$V_{ref}$};     \end{circuitikz}     \end{document}


title: How to get Latex formula in inkscape on mac?

text: I am using Inkscape version 0.48.2 on Mavericks OS X. I have to add latex formulas in some of the images but when I tried it through Extensions > Render > couldn't find the option there. After going through several blogpost I have installed the package pstoedit (through fink install) as well. But still I don't the option to type latex over my images. Can someone help please?


title: Is there a way to use #.# style for theorems and definitions, but #.#.# for associated examples?

text: EDIT: Question solved. Answer below. I would like to be able to do this sort of thing with my examples: * * * 1 Mathematical Logic Theorem 1.1 blahblah Definition 1.2 blahblah Theorem 1.3 blahblah Example 1.3.1 Example 1.3.2 Definition 1.4 * * * where the examples are "associated" with that theorem. They don't actually have to be linked together - just want the numbering to look like that. Here's a MWE               \documentclass[a4 paper,11pt]{article}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage[pdftex]{graphicx}     \usepackage{amssymb}     \usepackage{parskip}     \usepackage{dsfont}     \usepackage{amsthm}     \usepackage[usenames, dvipsnames]{xcolor}     \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}     \usepackage{mathrsfs}     \newcommand{\spacing}[1]{\phantom{space}}     \newcommand{\tourlakislogic}[1]{\textcolor{NavyBlue}{\footnotesize Source: George Tourlakis -  \emph{Mathematical Logic} (2008)} \vspace{4 mm} \normalsize}          \title{Foundations}     \author{Chris Middleton}          \begin{document}     \maketitle          \newtheorem{thm}{Theorem}[section]          \theoremstyle{definition}     \newtheorem{defn}[thm]{Definition}          \newtheorem{axiom}[thm]{Axiom}          \theoremstyle{remark}     \newtheorem*{rmk}{Remark}          \theoremstyle{definition}     \newtheorem*{exmpl}{Example}          \section{Mathematical Logic}          \begin{defn}[alphabet]     \label{alphabet}     We denote by $\mathcal{V}$ the \textbf{alphabet} consisting of          (A1) symbols for \textbf{Boolean variables} $$ p, q, r, \ldots $$     (A2) symbols for verum (true) and falsum (false), respectively $$\top \text{ and } \bot$$     (A3) brackets $$( \text{ and } )$$     (A4) Boolean \textbf{connectives} $$\neg, \wedge, \vee, \rightarrow, \equiv$$     We will use boldface letters \textbf{p} and \textbf{q} to stand for variables in formulas in which one could substitute any number of actual variables in their place.     \end{defn}           \tourlakislogic \spacing          \begin{rmk}     We will say "variables" in place of "symbols for variables".     \end{rmk}          \spacing          \begin{defn}[string]     We call a \textbf{string} (or word or expression), over a given alphabet, any ordered sequence of the alphabet's symbols, written adjacent to each other without any visible separators (such as spaces, commas, etc.).     \end{defn}          \tourlakislogic \spacing          \begin{exmpl}     $aabba$ is a string of symbols over the alphabet $\{a,b,c,0,1,2,3\}$. Note that not all symbols in the alphabet need be used.     \end{exmpl}      And here's what it currently looks like: ![screenshot](http://i.stack.imgur.com/4MkFd.png)


title: How to vertically shift an underbrace?

text: Is there a way to vertically shift an underbrace downwards? My Problem is, that the underscripts in the following code overlap:               \begin{equation*}         \mathbf{v}_n \approx \sum_{m} \underbrace{\mathbf{T}^{(m)} \mathbf{W}}_{\mathclap{\text{m-te Transformation aller Basisvektoren}}} H_{:,n}^{(m)}.     \end{equation*}      Is there a way to solve this?


title: Why does TeXShop add a dot after autocomplete

text: Why does TeXShop add a dot after auto-completing an environment? An example is shown in the following image:   ![enter image description here](http://i.stack.imgur.com/AiHzB.png) I'm referring to the dot after `\end{itemize}`. If I don't delete it pdflatexmk can not compile the document and throws the following error:               Package inputenc Error: Keyboard character used is undefined     (inputenc) in inputencoding 'utf8'.      What is the purpose of the dot?


title: Processing a tex file automatically

text: I'm currently writing in markdown and converting using Pandoc, but there are additional replacements that I want to do, as well as fixing some of what pandoc does that I don't like. Does anyone know the best approach to writing a script or somehow automating the process of find+replace using regex? I'm not asking for someone to do this for me, but it would be great just to get a hint as to what kind of thing I need (e.g. which programming language, if I need to go down that route).


title: pdftooltip (from pdfcomment package) with included graphic?

text: I would like to show structure formulas associated with chemical compounds in tooltips, but have not been able to achieve that easily. `\includegraphics` appears to be ignored silently, rather its filename argument is displayed. Is there a way to achieve this?


title: Set master file in vim-latex (TeX-Suite)

text: When I type `<leader>ll` in Vim with `vim-latex` installed, I can compile the .tex file in my current buffer. But the .tex file I'm editing is actually just `\input{}`ed into a master .tex file. How can I tell `vim-latex` to always compile my master document?


title: How to compare against a constant with ifx?

text: I am trying to test one char substrings (TeX or LaTeX):               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          \usepackage{fp,stringstrings}          \newcommand*{\mytest}[1]{%       \def\firstChar{\substring{#1}{1}{1}}%       \ifx M\firstChar\textit{M has been recognized}\else\textbf{M has NOT been recognized, firstChar='\firstChar'}\fi     }          \begin{document}\thispagestyle{empty}     Test with Matching: \mytest{Matching}\par     Test with M:  \mytest{M}\par     Test with No: \mytest{No}\par     Test with N:  \mytest{N}\par     \end{document}      Expected result is _"M has been recognized"_ for the first two calls. What I obtain is:![enter image description here](http://i.stack.imgur.com/kfcCn.png) How to compare against a constant with ifx ?


title: Why does pdflatex crash with the pdfpages packages, and is there anything I can do to prevent this?

text: I wish to append some pdf documents to the end of a larger document I'm writing, but find that using the `\includepdf` command provided by `pdfpages` always crashes pdflatex. The following example exibits the behaviour: First create a test pdf, which we will append to the main doc:               \documentclass{minimal}          \begin{document}          This is some text          \end{document}      Then               \documentclass{minimal}          \usepackage{pdfpages}               \begin{document}            This is the text in the main doc.            \includepdf[pages={~}]{test_pdf.pdf}          \end{document}      This causes pdflates to crash with a 'pdflatex has encountered a problem' message. In this case I'm using MikTeX 2.9 on windows XP Pro 32 Bit with Texniccenter 1.0 as my editor (although Texworks also fails, not that I think the editor has anything to do with it, but you never know). I haven't tried on other platforms. In case it's relevent I do not normally have admin access on this PC. Is this a known problem, and is there a latex work around? I'm aware of other non-latex methods to append the pdfs if necessary.


title: TikZ: Relative positioning of nodes

text: I am working on script to build chart depending on the input data and one of the troubles is to place node right of the rightest node. This is MWE:               \documentclass[border=.5cm]{standalone}          \usepackage{tikz}     \usetikzlibrary{positioning}          \begin{document}          \begin{tikzpicture}          \node at (0,0) [draw] (n1) {node1};     \node at (-1,1) [draw] (n2) {node2};     \node at (1,2) [draw] (n3) {node3};     \node at (0.5,-1) [draw] (n4) {node4};          \end{tikzpicture}          \end{document}      So, I have several nodes placed in several rows. Only one node in a row. And I need to place a new node in the specific row but right of the rightest node in all row. In the above example I need to place a node in the one row with `n1`, but on .5cm right of the `n3` (this node is rightest node of all nodes in picture). I could use low level commands to compare nodes right corner coordinates, but maybe there easier way? Any suggestions? **UPDATE:** I could use the `let` command to position node relatively to the other nodes:               \path let \p1=(n3.south east), \p2=(n1.south east) in     node[anchor = south west, draw, xshift=.5cm] at (\x1,\y2) {node5};      But how I can compute the most right node? **UPDATE 2:** I tried to use `max` command:               \path let \p1=(n1.south east),               \p2=(n2.south east),               \p3=(n3.south east),               \p4=(n4.south east) in     node[anchor = south west, draw, xshift=.5cm] at (max(\x1,\x2,\x3, \x4), \y2) {node5};      but receiving following error:               ! Package tikz Error: A node must have a (possibly empty) label text.          See the tikz package documentation for explanation.     Type  H <return>  for immediate help.     ...                                                        l.25 ...aw, xshift=.5cm] at (max(\x1,\x2,\x3,\x4),                                                       \y2) {node5};      What am I doing wrong?


title: image inside a multirow: problems with the vertical space

text: I have a problem when including an image inside a table using the multirow option. My problem comes from the vertical space dedicated to this row. As you can see in the picture included, the image gets more vertical space than the dedicated to the row. ![As you can see the image is not fully included](http://i.stack.imgur.com/92LAQ.png) Here, I put the latex code I have used for generating the above picture:               \begin{table}[!htb]     \centering     \begin{tabular}{m{1.5cm}c ccccc}     \toprule      & & $1024 \times 1024$ & $512 \times 512$ &$256 \times 256$ & $128 \times 128$ & $64  \times 64$ \tabularnewline     \midrule     \multirow{3}{*}{\includegraphics[height=.15\textwidth{../images/BestViews/PVMTooth/3.PVMTooth.dir/1024x1024-0613}}& Time & 254.2 & 57.63 & 17.61 & 4.77& 2.07  \tabularnewline     & Best Entropy & 3.0 & 3.49 & 4.28 & 5.88 & 8.56 \tabularnewline     & Worst Entropy & 1.23 & 1.52 &1.9&2.6 & 4.67 \tabularnewline     \midrule     \bottomrule     \end{tabular}     \caption{The best and worst views according to our measure for different image size.}     \label{table:BB:BestAndWorstNumbers}     \end{table}       Thanks in advance.


title: Strange behaviour of ifnumequal?

text: If I use `\cfoot` to evaluate and print this section counter, it shows the correct section number in my appendix. However, when I evaluate the section counter using `\ifnumequal`, it shows that the expression of equality is **never** met. Why? A not so minimum example:               \documentclass[12pt]{article}     \usepackage{etoolbox}     \usepackage[heightrounded]{geometry}     \usepackage[toc,titletoc,page]{appendix}     \usepackage{blindtext}          \usepackage[pageanchor]{hyperref}           \newrobustcmd{\PreviousSectionTitle}{}%     \newrobustcmd{\CurrentSectionTitle}%          \newcommand{\Contentsname}{Inhoudsopgave}     \newcommand{\LinkToContentsName}{inhoudsopgave}     \newcommand{\LinkToIndexName}{Index}          \newrobustcmd{\GotoName}{Naar}     \newrobustcmd{\DoIfNumInequal}[3]{%     \ifnumequal{#1}{#2}{}{#3}%  Drop last      }%     \newrobustcmd{\IfNumInequal}[4]{%     \ifnumequal{#1}{#2}{#3}{#4}%       }%               \newcounter{PreviousSectionCounter}% No resetting%%%     \setcounter{PreviousSectionCounter}{0}%     \newcounter{NextSectionCounter}% No resetting%%%     \setcounter{NextSectionCounter}{0}     \newcounter{CurrentSectionCounter}% No resetting%%%     \setcounter{CurrentSectionCounter}{0}     \newcounter{LastSectionValue}                 \usepackage{fancyhdr}     \fancyhf{}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{.4pt}                         \lfoot{\CurrentSectionTitle}          \fancypagestyle{FootLinks}{     }%          \AtEndDocument{%     \makeatletter     \def\LastSectionInFile{%        \immediate\write\@auxout{\string          \setcounter{LastSectionValue}{\number\value{CurrentSectionCounter}}%        }%     }%     \makeatother     }%          \newrobustcmd{\NextSectionHyperLinkFormat}[1]{\GotoName~#1~\(\rightarrow\)}%     \newrobustcmd{\PreviousSectionHyperLinkFormat}[1]{\(\leftarrow\)~\GotoName~#1}%          \begin{document}          \tableofcontents     \cleardoublepage          \newpage                   \let\LaTeXStandardSection\section%         \renewcommand{\section}[2][]{%         \stepcounter{CurrentSectionCounter}%         %%%%% Check first whether there is a already a previous section         \ifnumequal{\number\value{CurrentSectionCounter}}{1}{% Yes, section number is zero         \setcounter{PreviousSectionCounter}{1}%         \expandafter\renewrobustcmd{\CurrentSectionTitle}{%         #2}%         }{%         \makeatletter         \edef\@@oldtitle{\CurrentSectionTitle}         \expandafter\renewrobustcmd{\PreviousSectionTitle}{%         \@@oldtitle         }%         \expandafter\renewrobustcmd{\CurrentSectionTitle}{%         #2%         }%         \setcounter{PreviousSectionCounter}{\number\value{CurrentSectionCounter}}         \addtocounter{PreviousSectionCounter}{-1}         }% CurrentSectionCounter > 1         % Set Target to current section         \phantomsection         \hypertarget{CurrentSection::\number\value{CurrentSectionCounter}}{}%         %\makeatletter         \immediate\write1{%         \string\phantomsection%         \string\newlabel{CurrentSection::\number\value{CurrentSectionCounter}::Title}{{\thesection}{\thepage}{#2}}%         }%         \makeatother         % Set Link to previous section%         \setcounter{NextSectionCounter}{\number\value{CurrentSectionCounter}}         \ifnumequal{\number\value{CurrentSectionCounter}}{\number\value{LastSectionValue}}{}{%         \addtocounter{NextSectionCounter}{1}         }%         \phantomsection         \LaTeXStandardSection[#2]{#2}%         }%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%% This code is behaving weird? %%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %\ifnumequal{\number\value{CurrentSectionCounter}}{2}{\cfoot{\number\value{CurrentSectionCounter}}}{\cfoot{Wrong number}}% This line always yields "wrong number"     \cfoot{Current section number is: \number\value{CurrentSectionCounter}}% This line displays the counter value correctly          \section{test}     \newpage     \blindtext     \newpage          \begin{appendices}          \pagestyle{FootLinks}          \section{Section Number A}     \blindtext     \clearpage     \section{B}     \blindtext     \clearpage     \section{Section Number C}     \blindtext     \clearpage          \section{D}     \blindtext          \end{appendices}          \end{document}


title: How to insert custom text in place of figure

text: I would like to replace some figures in a document with a black frame of the same size as the figure, such as that which you get when using `\includegraphics` in draft mode. However, this places the name of the figure file inside the framed box. Is there a way to replace this text with centered text stating   _Figure removed due to copyright restrictions_?


title: How to get the natural width of the last box in a paragraph?

text: I want to get the natural width of the last line in a paragraph. For example, the last line of the following paragraph > Georg Friedrich Bernhard Riemann (September 17, 1826 – July 20, 1866) was an > influential German mathematician who made lasting contributions to analysis, > number theory, and differential geometry, some of them enabling the later > development of general relativity. may be from `some` to `relativity`(that is, `some of them enabling the later development of general relativity.`) When the line-breaking happened, the last line will be put into an hbox, so, how can I get this hbox?


title: Changing citation delimiters

text: The default citation delimiter is `,`. For instance,               \cite{John96, Doe78, White05}      generates something like `[8, 2, 4]`, where the citation numbers (8, 2, and 4) are separated by a comma (`,`). This is very natural in Latin languages, but some other languages use different delimiters. Let's assume you want to change the delimiter to, say `+`. How do you do that?


title: "Author et al., submitted", is that possible with \citep?

text: Is it possible to have "Author et al., submitted" using the package natbib? e.g.:               @article{papersubmitted,         title = {{I love LaTeX, and you?}},         author = {Author1, Name and Author2, Name and Author3, Name},         note = {submitted}     }      so, using:               \citep{papersubmitted}      gives:               Author1 et al., [n.d]      but I need:               Author1 et al., submitted      I tried 'submitted' in year but it gave some error messages that afaik relate to integers. Thanks in advance for any hint, PS. I am using report.


title: Highlight language keywords in a paragraph?

text: While it is possible to highlight specific language keywords (such as public in C++) by using lstinline command from listing package as in:               Highlighting a C++ keyword \lstinline|public| in a sentence.      Is it possible to provide a list of keywords or better still specify the language and let a macro or other option search-and-augment keywords with lstinline in the paragraph? There appear to be a related question on StackOverflow but I am not sure how to source keywords.


title: Tikz arrow head same as arrows in latex?

text: > **Possible Duplicate:**   >  Matching arrowheads in TikZ with math mode arrowheads How do I make the arrow head in latex same (or at lest very similar) to those that e.g. \leftarrow produces?               \documentclass[]{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \node (A) at (0,0) {$A \rightarrow B$};     \node (B) at (2,0) {$0$};      \path[->]     (B) edge[] node{} (A);     \end{tikzpicture}     \end{document      Silly example, but I use mostly simple diagrams for which I use math-mode arrows, and occasional complicated ones for which I use tikz. It would be nice if they would look the same.


title: Strange interaction between natbib and algorithm2e

text: Here's a minimal example.               \documentclass{article}     \usepackage{titlesec}     \usepackage{algorithm2e}     \usepackage{natbib}     \begin{document}     \bibliographystyle{plainnat}     \begin{thebibliography}{1}     \bibitem[Bar(2011)]{bar}     Bar     \end{thebibliography}     \end{document}      This produces a heading akin to >     *Bibliography If `titlesec` is commented out, it fails to compile unless `natbib` is also commented out If either `algorithm2e` or `natbib` are commented out, then it produces the heading > ## References I would clearly like to see the latter. Do I need to use another pseudocode package or can this be solved?


title: Reproducing an official letterhead

text: My university, just like many other institutions, isn't really aware of something called LaTeX. Therefore, the letterhead comes only in MS Word. The following (low quality) image is the best guide I have that describes the measurements, margins, and fonts. I will need to reproduce the letterhead (some measurements are, at best, odd). ![WSU Letterhead](http://i.stack.imgur.com/9u6Cr.gif) The University's logo is available at WSU visual identity web site as shown below ![WSU logo](http://i.stack.imgur.com/vXW80.png) I know I can place the logo at the prescribed location using `textpos` package, but how can I add the horizontal line and the flushright text?


title: Commutative Diagrams

text: Can anyone help me in giving commands for commutative diagrams in LaTeX ? It doesn't seem to appear properly in the LaTeX guides that I have. A command for a simple triangular diagram with arrows associated to maps would be good enough, or maybe some appropriate reference.


title: Minipage width not acurate

text: I have the following document, with several minipages of 12cm width. Each minipage contains a different number of minipages (with a sum of 12cm for all of them). So every *sub*minipages should fit inside its main minipage, but the more minipages there are, the more they're oversized. I see no spaces between the minipages, so i don't understand why i have such a behaviour, especialy since the size is in cm and not in 0.X\linewidth. Thank you for your lights on this. Here is my code :               \documentclass[a4paper]{article}     \usepackage{xcolor}     \begin{document}          \fbox{\begin{minipage}[t]{12cm}     \hspace{-1mm}\colorbox{gray}{\begin{minipage}[t]{12cm}12\end{minipage}}%     \end{minipage}}          \fbox{\begin{minipage}[t]{12cm}     \hspace{-1mm}\colorbox{gray}{\begin{minipage}[t]{6cm}6\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{6cm}6\end{minipage}}%     \end{minipage}}          \fbox{\begin{minipage}[t]{12cm}     \hspace{-1mm}\colorbox{gray}{\begin{minipage}[t]{4cm}4\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{4cm}4\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{4cm}4\end{minipage}}%     \end{minipage}}          \fbox{\begin{minipage}[t]{12cm}     \hspace{-1mm}\colorbox{gray}{\begin{minipage}[t]{3cm}3\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{3cm}3\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{3cm}3\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{3cm}3\end{minipage}}%     \end{minipage}}          \fbox{\begin{minipage}[t]{12cm}     \hspace{-1mm}\colorbox{gray}{\begin{minipage}[t]{3cm}3\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{2cm}2\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{3cm}3\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{2cm}2\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \end{minipage}}          \fbox{\begin{minipage}[t]{12cm}     \hspace{-1mm}\colorbox{gray}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{2cm}2\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{3cm}3\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{2cm}2\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{3cm}3\end{minipage}}%     \end{minipage}}          \fbox{\begin{minipage}[t]{12cm}     \hspace{-1mm}\colorbox{gray}{\begin{minipage}[t]{2cm}2\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{2cm}2\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{2cm}2\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{2cm}2\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{2cm}2\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{2cm}2\end{minipage}}%     \end{minipage}}          \fbox{\begin{minipage}[t]{12cm}%     \hspace{-1mm}\colorbox{gray}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{gray}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \colorbox{cyan}{\begin{minipage}[t]{1cm}1\end{minipage}}%     \end{minipage}}     \end{document}      And here is the result : ![myscreenshot](http://i.stack.imgur.com/o8G2w.png)


title: Add vertical space before and after framed-theorem environments

text: I want my theorem-like environments to be framed, as it's an effective way of making them stand out from the main text. According to Gonzalo Medina's answer to the question box around theorem statement, the `\newmdtheoremenv` command from the `mdframed` package is the way to go. However, I find that vertical space before and after such framed-theorem environments is lacking (see below). I looked into the `mdframed` documentation but did not find anything to fix this. Did I miss something in the documentation? How would you fix this in an easy and efficient (automatic) way? Is a package other than `mdframed` more appropriate for framed-theorem environments? ![enter image description here](http://i.stack.imgur.com/raRPX.png)               \documentclass{book}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{mdframed}     \theoremstyle{definition}     \newmdtheoremenv{assum}{Assumption}[chapter]          \begin{document}          \chapter{Fluid mechanics}          \section{Fields}          The following fields are of particular interest:     \begin{itemize}         \item $\rho$: fluid density (time-dependent scalar field);         \item $p_{\text{tot}}$: total pressure in the fluid (time-dependent scalar field);         \item $v$: velocity of the fluid parcels (time-dependent vector field).     \end{itemize}              \begin{assum}[Differentiability of tensor fields]         \label{assum:differentiability}         All tensor fields of interest are differentiable (weakly, at least).     \end{assum}          Assumption~\ref{assum:differentiability} blah blah          \subsubsection{Mass-continuity equation}          The mass-continuity equation is derived from the principle of conservation of mass:     \begin{assum}[Conservation of mass]         \label{assum:conservation_of_mass}         Fluid density $\rho$ is a conserved quantity within fluid parcels:     if $V_{\text{fp}}(t)$ delimits a region of space occupied by a fluid parcel     at time $t$, then         \begin{equation}             \frac{\mathrm{d}\phantom{t}}{\mathrm{d}t}     \iiint_{ V_{\text{fp}}(t)} \rho \, \mathrm{d}V = 0\,.         \end{equation}     \end{assum}     blablah          \end{document}


title: Draw a cylindrical spiral with TikZ

text: I want to make a tikzpicture to illustrate the construction of a spiral capacitor. These are made of spiral coiled films. So imagine a rectangular paper that you tail around one side. Thats basically how it looks like. Well I can programme this in MATLAB using cylindrical coordinates, then regrid to cathesian and then plot with pgfplots, but I think there must be a easier way. When I think of the possibilities of TikZ I think more about drawing a rectangle and tail it around a path I specified before. But sadly I found nothing about how to do that. Anyone any idea?


title: Repeat table header on every page using supertabular

text: This question is related to this one: How to repeat top rows (column headings) on every page But I want to repeat the header row of a table using supertabular and not long table.


title: Fancy cross-referencing

text: As an extended idea of Using section sign (§) for cross-references to sections, how can we use > See ⚙5.2 and ☰5.3 in ☞123. instead of: > See figure 5.2 and table 5.3 in page 123. (Surely there are more appropriate symbols, but because of HTML and font concerns I used these symbols.) **see also:** Looking for camera and paper icon


title: Customizable size of image

text: I have the following problem: I have a document with image on title page. User can select custom image for title page. I need some space, fixed space for image. this space should be fixed, and it should not be dependent on image. this mean that if user select a small image - this image should be placed in this space without scaling, also if user select a large image - image should be scaled to fit fixed space. I used for this purpose , but it doesn't help me when user select a large image.               \begin{minipage}[c][0.43\textheight]{\textwidth}          \begin{center}          \includegraphics[]{\Userimage}            \end{center}           \end{minipage}


title: Use \textwidth for Image width Only when it outgrows the page

text: > **Possible Duplicate:**   >  Shrink figure only when necessary? Consider that you have this:               \includegraphics{some_image_in_pdf.pdf}      This will now take its original width, but if you want it to take up 100% of the text width you do it like this:               \includegraphics[width=\textwidth]{some_image_in_pdf.pdf}      How about if you want to include images and use their original size if they fit, otherwise have it resized? In this example, the second image should get `[width=\textwidth]` because it is going to exceed the bounds of the document.               \includegraphics{some_image_in_pdf.pdf}     \includegraphics{some_image_in_pdf_that_is_too_wide.pdf}


title: IEEEtranN.bst and Babel

text: I'm trying to use the package `IEENTranN` with `natbib` for the references in my thesis document. I'm writing in Spanish so I would like, for instance, that when I cite a proceedings instead of "in IEEE 2005" it appear "en IEEE 2005", that is the translation for this. Before I was using the `aplain.bst` style, that was aware of these changes in the bibliography but I need to write the thesis with the IEEE citation standard. Do you know if there is a workaround for this?


title: How do I specify a round parenthesis above some text?

text: How can I draw a horizontal round parenthesis _above_ some text? How do I specify a round parenthesis below some text? explains how to do it below text.


title: subfigure caption for all subfigures in a row (subfigure environment; subcaption package)

text: Heyho, my third question for today :-) I had again a look at the subcaption package manual by Axel Sommerfeldt but did not got managed to have just one subcaption for all subfigures in a row. Can anybody assist me?               \documentclass[a4paper,oneside,10pt]{scrartcl}          \usepackage{graphicx}     \usepackage{caption}     \usepackage{subcaption}          %%%%%%%%%%%%          \begin{document}          \begin{figure}         \centering         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 {\rule{3cm}{2cm}}                 \caption{Noon}         \end{subfigure}%         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 {\rule{3cm}{2cm}}                 \caption{Noon}         \end{subfigure}                      \begin{subfigure}[b]{0.3\textwidth}                 \centering                 {\rule{3cm}{2cm}}                 \caption{Midnight}         \end{subfigure}%         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 {\rule{3cm}{2cm}}                 \caption{Midnight}         \end{subfigure}         \caption{Cool (left) and uncool (right) pictures; Recorded at noon (a) and at midnight (b).}     \end{figure}          \end{document}      not desired output: ![not desired](http://i.stack.imgur.com/UySEF.png) desired output: ![desired](http://i.stack.imgur.com/VuVOt.png) ...sorry for my inability, but I am sitting in front of my laptop for 14 h :-) kind regards Benjamin


title: Use a loop to generate a list for another (foreach) loop

text: Is it possible to use a loop to generate a list for a foreach loop? More specifically I want the following: Consider the following answer to a question I asked some time ago: http://tex.stackexchange.com/a/38793/4011 It worked very well except if I define `\alist` as follows:               \def\alist{         \foreach \i in {1,2,3}{           \i/1,           }4/1         }      I get the following error:               ERROR: Undefined control sequence.          --- TeX said ---     \foreach ...reach \let \pgffor@assign@before@code                                                        =\pgfutil@empty \let \pgff...     l.38   \rectDiv{7}{5}{(1,1)}{(4,3)}{\alist}      Is there any way to fix this? **Edit** : Full example:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}       \def\rectDiv#1#2#3#4#5{%#columns, #rows, rectangle start, rectangle end, list of elements to fill         \begin{tikzpicture}           \draw #3 rectangle #4;           \path #3;           \pgfgetlastxy{\firstx}{\firsty}           \path #4;           \pgfgetlastxy{\secondx}{\secondy}           \pgfmathsetlengthmacro{\xdiff}{\secondx-\firstx}           \pgfmathsetlengthmacro{\ydiff}{\secondy-\firsty}           \pgfmathsetlengthmacro{\myxstep}{\xdiff/#1}           \pgfmathsetlengthmacro{\myystep}{\ydiff/#2}           \foreach \x in {1,...,#1}{             \draw ($#3 +\x*(\myxstep,0)$) -- ($#3 +(0,\ydiff) +\x*(\myxstep,0)$);           }           \foreach \y in {1,...,#2}{             \draw ($#3 +\y*(0,\myystep)$) -- ($#3 +(\xdiff,0) +\y*(0,\myystep)$);           }           \edef\temp{\noexpand\foreach \noexpand\i/\noexpand\j in {#5}}           \temp{             \path[fill=blue!20,draw] ($#3 + (\i*\myxstep,\j*\myystep)$) rectangle ($#3 + (\i*\myxstep,\j*\myystep) + (\myxstep,\myystep)$);           }         \end{tikzpicture}       }     \begin{document}       \rectDiv{7}{5}{(1,1)}{(4,3)}{0/0,1/1,2/0,5/3}            \def\list{1/0}       \rectDiv{7}{5}{(1,1)}{(4,3)}{\list}            \rectDiv{7}{5}{(1,1)}{(4,3)}{\list,2/0,5/3}            \def\alist{         \foreach \i in {1,2,3}{           \i/1,           }4/1         }             \alist             \rectDiv{7}{5}{(1,1)}{(4,3)}{\alist}  %this doesn't  work          \end{document}


title: How to redefine a final generated indexitem in imakeidx/splitindex

text: I want to define `\index[table]{#1}` to hold several arguments: `\index[table]{{#1}{#2}}` and build a table row with it, using the `splitindex`. How can I do this?


title: What needs to be done to update lablst.sty?

text: This question is related to the question How to get a list of all the labels in a LaTeX document. According to the author of lablst.sty, you can use `lablst` as a global option to `documentstyle` as `\documentstyle[11pt,lablst]{article}` to produce (a list of) label definitions at the end of the document. Can this be updated so that it can be used with `documentclass`?


title: figure headings on every page of list of figures

text: I am writing my dissertation and I have lots of figures. I have FIGURE heading only on the first page of list of figures. How can you make FIGURE heading appear on every page of list of figures? Any help would be appreciated. I used the following to crate list of figures.               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%                           LIST OF FIGURES     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \phantomsection     \addcontentsline{toc}{chapter}{LIST OF FIGURES}            \renewcommand{\cftloftitlefont}{\center\normalfont\MakeUppercase}          \setlength{\cftbeforeloftitleskip}{-12pt} %% Positions the LOF title vertically to match the chapter titles     \renewcommand{\cftafterloftitleskip}{12pt}               \renewcommand{\cftafterloftitle}{%     %\\[4em]\mbox{}\hspace{2pt}FIGURE\hfill{\normalfont Page}\vskip\baselineskip} %original     \\[4em]\mbox{}\hspace{2pt}FIGURE\hfill{\normalfont Page}}          \begingroup          \begin{center}     \begin{singlespace}          % These values make the lot table entries appear double spaced between.     \setlength{\cftbeforechapskip}{0.4cm}     \setlength{\cftbeforesecskip}{0.30cm}     \setlength{\cftbeforesubsecskip}{0.30cm}     \setlength{\cftbeforefigskip}{0.4cm}     \setlength{\cftbeforetabskip}{0.4cm}          \listoffigures          \end{singlespace}     \end{center}          \pagebreak{}


title: Removing the dashed blue box around a folded code header in TeXstudio

text: I've looked through the configuration menus several times, but haven't been able to find a way to change the color of or remove altogether the dashed blue box that appears around a folded code header (while keeping the folding itself). Is it not possible or have I just missed it?


title: Macro with environmental dependent output

text: I'm trying to develop a macro that gives two different outputs depending on whether it is in math mode (i.e. `$ $` or `\begin{equation} ... \end{equation}`) or anywhere else. The reason is that I use a lot of physical variables and molecule names such as e.g. `$^{12}$CO(1-0)` and use macros to be able to have them typeset uniformly troughout the text. I use them in normal text as well as math environment. Right now I have two macros one for text:               \newcommand{\twCO}{%     $^{12}$CO(1-0)\xspace%     }%      and one for math with out the math signs:               \newcommand{\twCO}{%     ^{12}CO(1-0)%     }% .      I would like to come up with something more generic:               \newcommand{\twCO}{%     \ifinmathmode%      ^{12}CO(1-0)%     \else%      $^{12}$CO(1-0)\xspace%     }      Searching quite some time on TeX and a prominent search provider, I could not find a satisfying answer to this, only more complex constructions to do the check. But I'd like to ask if someone is aware of a straightforward check to see which environment one is in? EDIT: After trying out the options given in the answer and comments below, I found that the easiest and best setup for my situation in which I also want the new commands to respect boldface and italic (which I figured out after I asked...) from the environment is to use `text` from `amsmath` which was pointed out by @egreg in the comments to his answer. Thus the best solution to my question is to use something like:               \usepackage{amsmath}     \newcommand{\twCO}{\text{\textsuperscript{12}CO}}      To set Isotopes however `mhchem`, which was pointed out in the comments, is really usefull. However for someone that want to test for math mode, the second answer is working well. Or one could use `\ensuremath`, also mentioned in the comments. This however does not respect boldface or italics from the environment.


title: Rounded corners not working in \mdf@singleextra using mdframed with TikZ

text: I am creating new framed environments using the `mdframed` package (along with `TikZ`) based on the digression example given in `mdframed-example-texsx.tex`. My code is the following:               \documentclass{scrartcl}          \usepackage{times}          \usepackage{lipsum}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \usepackage{tikz}        \usetikzlibrary{calc,arrows,shadows}     \usepackage[framemethod=tikz]{mdframed}               \tikzset{         title/.style={           fill=white,           font=\normalfont,           text=black,           anchor=base west,         },         contour/.style = {           line width = 0.6pt,           draw = black,           rounded corners = 2ex,         },         fakeshadow/.style = {           line width = 4.5pt,           draw = white,         },     }          \newcommand{\definitiontitle}{       {\scshape \bfseries \Large Definition}     }          \mdfdefinestyle{definition}{%         singleextra={%               %% Store (O) in \p1, store (P) in \p2. Now \p1=(\x1,\y1) and \p2=(\x2,\y2). From that, define (Q) = (\x1,\y2).               \path let \p1=(O), \p2=(P) in (\x1,\y2) coordinate (Q);               \path let \p1=(O), \p2=(P) in (\x2,\y1) coordinate (R);               \path let \p1=(O), \p2=(Q) in (\x1,{(\y1+\y2)/2}) coordinate (M);               \path[contour] (M) |- (P) |- (O) -- (M);               \node[title, anchor=west, xshift=18pt - 5pt] at (Q) {\definitiontitle};         },         firstextra={%               \path let \p1=(O), \p2=(P) in (\x1,\y2) coordinate (Q);               \path let \p1=(O), \p2=(P) in (\x2,\y1) coordinate (R);               \path[contour] (O) -- (Q) -- (P) -- (R);               \node[title, anchor=west, xshift=18pt - 5pt] at (Q) {\definitiontitle};               \path[fakeshadow] ($(O)+(1pt,-1.5pt)$) -- ($(R)+(-1pt,-1.5pt)$);  %% Hide the bottom shadow         },         secondextra={%               \path let \p1=(O), \p2=(P) in (\x1,\y2) coordinate (Q);               \path let \p1=(O), \p2=(P) in (\x2,\y1) coordinate (R);               \path[contour] (Q) -- (O) -- (R) -- (P);         },         middleextra={%               \path let \p1=(O), \p2=(P) in (\x1,\y2) coordinate (Q);               \path let \p1=(O), \p2=(P) in (\x2,\y1) coordinate (R);               \path[contour] (O) -- (Q);               \path[contour] (P) -- (R);               \path[fakeshadow] ($(O)+(1pt,-1.5pt)$) -- ($(R)+(-1pt,-1.5pt)$);  %% Hide the bottom shadow         },         align=center,         backgroundcolor=yellow,         userdefinedwidth=.9\textwidth,         middlelinewidth=1.7em,middlelinecolor=white,         hidealllines=true,topline=true,         innertopmargin=6pt,         innerbottommargin=18pt,         innerleftmargin=18pt,         innerrightmargin=18pt,         splitbottomskip=8pt,         splittopskip=16pt,         roundcorner=2ex,         shadow=true,         shadowsize=5,         shadowcolor=black!40,         %% Experimental         needspace=3em,         ignorelastdescenders=true,     }                    \begin{document}          \lipsum[3]          \vspace{1\baselineskip}     \begin{mdframed}[style=definition]         \lipsum[1]     \end{mdframed}          \vspace{1\baselineskip}     \lipsum[3]          \vspace{1\baselineskip}     \begin{mdframed}[style=definition]         \lipsum[1-2]     \end{mdframed}          \vspace{1\baselineskip}     \lipsum[3]          \vspace{1\baselineskip}     \begin{mdframed}[style=definition]         \lipsum[1-8]     \end{mdframed}          \end{document}         I am currently using TikZ to place a custom title and to draw the frame. This is required in order to use the appropriate `middlelinewidth` to compensate for the title height, so that mdframed will know where to split. However, I am also using rounded corners, and this is where the overall problem happens. As pointed out by Marco Daniel in this post, it is important to use the code                   hidealllines=true,topline=true,         However, using `hidealllines=true` has an unexpected effect in `\mdf@singleextra`, i.e. the rounded corners disappear and a full box is rendered instead. This does not happen when the frame gets split (or when `hidealllines=true` is not used, but then the height cannot be calculated properly), as shown in the output: ![output](http://i.imgur.com/FJcfW.jpg) Any idea why this happens only in the `\mdf@singleextra` and how to fix it?


title: "Missing $ inserted" although I have $

text: I have problem with this               $ \text{bredden = x \Leftrightarrow längden = 3 \cdot bredden = 3x} $      I get a               Missing $ inserted      error, although I have `$`.


title: Filling in markers in pgfplots

text: I've been searching around and digging through the pgfplots manual and I can't quite seem to find a good answer for this. I'm trying to make a graph with "open circles" to indicate where the function is undefined. Right now I'm using the following:               \begin{tikzpicture}     \begin{axis}[         domain=-2:6,         xtick={-2,...,6},         ytick={-20,-10,...,40},         xmajorgrids=true,ymajorgrids=true,         xlabel={$x$},title={Graph of $y=g(x)$}     ]     \addplot+[mark=none]{(20/9)*(x^3/3-(3/2)*x^2)};     \addplot+[only marks,mark=o,mark options={scale=2},text mark as node=true] coordinates {         (-2,-20)         (6,40)         (5,10)     };     \end{axis}     \end{tikzpicture}      This results in the following picture: ![enter image description here](http://i.stack.imgur.com/Ne8QP.png) Is there a simple way to fill in those circles so we don't see the graph behind them? I've tried adding "fill=white", "fill opacity=0", etc to the "mark options", but to no avail. I've also tried using the tikz command \draw to manually draw a circle, but that didn't seem to work either. Thanks!


title: Displaying a Numbered Questions and Answer

text: I made a presentation in the form of **Questions and Answers**.               \documentclass{beamer}     \setbeamercovered{transparent=0}          \usepackage{xcolor}     \usepackage{transparent}          \title{Questions and Answer}     \author{Edy Wihardjo}     \date{}          \newcounter{num}     \setcounter{num}{0}     \newcommand\Que[1]{%         \leavevmode\par         \stepcounter{num}             \noindent             \hbox{                  {\color{blue} \transparent{0.3} \Huge Q{\huge \thenum }} --- #1\par              }         }     \newcommand\Ans[2][]{%         \leavevmode\par         \noindent         \begin{flushright}             \textbf{#1} #2  --- {\Huge \color{blue} \transparent{0.3} A} \par         \end{flushright}\par}%}          \begin{document}     \maketitle          \texttransparent{Questions and Answer}}          \begin{frame}         \Que{First Question?}         \pause         \Ans{First Answer!}     \end{frame}          \begin{frame}         \Que{Second Question?}         \pause         \Ans{Second Answer!}     \end{frame}          \end{document}      the problem is: ![FirstQue](http://i.stack.imgur.com/Bolid.png) after displaying the **first answer** , the **first question number** changed. ![FirstQueAns](http://i.stack.imgur.com/bmf80.png)


title: Interactive PDF - Click thumbnail images to open in quicklook like window

text: Is it possible to create an interactive PDF where you can click a scaled down embedded image and it opens it up large in a preview like window hovering in front of the open PDF? Sort of like the PDF is extending outwards and then a second click will close the window back into the PDF. I am thinking along the lines of quicklook in OS X. I don't mean just zooming the document into the clicked picture and then zooming back out again. Maybe javascript is necessary? I know websites have this sort of behavior all the time. **The following question is similar but specifically not what I want. That solution is just zooming within the document. How to enlarge a picture on click


title: How to handle listings, fancyvrb, newfloat and caption?

text: I am planning a "small thesis" for university which will need to display lots of code (C, C++, gnuplot, LaTeX, ...) - thus I spent this evening reading about `listings` and `fancyvrb`. The latter I've already been using together with the `newfloat`\- and `caption`-package. The former seems very appealing and handy (linebreaking, indexing, caption without floating body...) during my first experiments. All the four packages grant compability with each other, yet I am confused as for instance both, `caption` _and_ `listings`, provide caption-functionality, or both, `newfloat` and `listings`, could be used to create a "Table of Listings", etc... I'm afraid I have no specific question... I'm rather asking for hints or advice on how to use these four packages together. For example: Should I assign the float/caption-management to `newfloat` and `caption` only? Which of the code-packages should "do the main part of the job"? Is it possible to define independent code-environments with their individual "lists of listings"? Is there a convenient way to generate different styles of inline listings? Etc. I would be glad if you could start me off and steer me in a promising direction so that I can - if necessesary - ask more precise questions in the course of setting everything up.


title: How does LaTeX compile packages?

text: I wonder how does the compile process work with LaTeX? If I am defining `\usepackage{PACKAGENAME}`, and then using a specific command from this package in my LaTeX-file, how does it work? I thought it compiles Top->Down, or does the compiler exclude the packages in the first place and check it later on if a command is found in the file?


title: Extra characters in reftex citation yasnippet

text: I am having an issue with a YASnippet for inserting a RefTeX citation. As many others have, I'm trying to use this snippet from GitHub with the following syntax               \cite{${1:label$(unless yas/modified-p (reftex-citation nil 'dont-insert))}}$0      however, the snippet will complete and include a citation, but I am getting extra characters around the citation label, so the citation ends up looking like               \cite{(pauling1936)}      instead of like               \cite{pauling1936}      and the file will not compile successfully because there are no parentheses around the entry titles in the .bib file. Also, if I try to include multiple entries into one citation the result looks like               \cite{(pauling1936 giauque1933)}      instead of               \cite{pauling1936, giauque1933}      * * * If I just use the RefTeX shortcut, `C-c [` instead of attempting to use the YASnippet, the citation is formatted correctly for both single and multiple entries. Also, essentially the same code from GitHub will work perfectly for a `reftex-reference` call instead of a citation. Perhaps I should mention that I am using Windows 8, Emacs 24.3.1, YASnippets 0.8, and AUCTeX 11.87.1, and my preamble doesn't have any `\usepackage{}` calls relating to bibtex.


title: Equation errors in latex

text: i have this equation               \begin{equation} D{_{T__1}_,}{_{T__2}} (g)= | H{_T{__1}} (g)- H{_{T__2}} (g)|=|log_2 P{_{T__1}}(g)-log_2 P{_T{__2}} (g)| \end{equation}      and it shows some error and also the number of this equation is in wrong place as shown in picture any advice how to fix it? ![this](http://i.stack.imgur.com/N0CE3.png)


title: Add straight line beneath a plot

text: I would like to add straight lines beneath a scatter plot for instance in order to delimit the region where |y| < x and |y| < 2 * x. I wrote something similar to th code below which give satisfactory result but requires to know the range of the data beforehand. I would like to make a template for this graphics that would work equally well if the maximum abscissa is 1e12 or 0.1. I could replace the 1 and .5 in my code by huge numbers but I am sure there is some neater way to achieve this result. One constraint is that the straight lines should be _beneath_ the marks of the scatter plot. My current code:               \documentclass{article}          \usepackage{pgfplots}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}       \begin{axis}         \tikzset{bisector/.style={black}}         \tikzset{half bisector/.style={black, dashed}}              \coordinate (origin) at (axis cs:0,0);         \draw[bisector] (origin)--(axis cs:1,1);         \draw[bisector] (origin)--(axis cs:1,-1);         \draw[half bisector] (origin)--(axis cs:1,.5);         \draw[half bisector] (origin)--(axis cs:1,-.5);              \addplot[only marks] table[x=x, y=y] {           x y           .3 .7           .2 .1           .5 .6           0.4 -0.5         };       \end{axis}     \end{tikzpicture}     \end{document}      Its output: ![sample output](http://i.stack.imgur.com/TVDyZ.png)


title: How to write inference rules if we are having two antecedents

text: \[ \frac{A \rightarrow f[\overrightarrow{B}]:= \Psi \\ \Phi \in     \langle\Psi\rangle} {A \rightarrow f[\bullet\overrightarrow{B}];\Phi} \]      I need to get the two antecedents in two seperate lines.               A \rightarrow f[\overrightarrow{B}]:= \Psi          \Phi \in \langle\Psi\rangle


title: Gobble page numbers

text: In my document I have 5 pages that consist of the chapter name. I want these pages not to have page numbers displayed _and_ not to contribute to the page numbering. This is what I am trying to achieve: > ..., p5, p6, blank page, p7, p8, ... By using `\thispagestyle{empty}` on the blank page and I get: > ..., p5, p6, blank page, p8, p9, ... where the blank page has been included in the numbering. I then tried to use `\pagenumbering{gobble}` on the blank page and then `\pagenumbering{arabic}` on the next consecutive page but the numbering was reset to give: > ..., p5, p6, blank page, p1, p2, ... How can I prevent the gobble input from resetting the page numbering?


title: Macros formatting/arranging words {A_1}{A_2},...{A_n} into predefined paragraph for varying n and tagging

text: How does one robustly (without breaking most environments) construct the macros with arbitrary number of parameters that output the parameters into a predesigned paragraph such that several of these parameters may also be referenced with corresponding macros to display the other corresponding parameters (later in the document)? [EDIT: After some confusion I have provided a step by step explanation of a MWE, a) because it may be be useful for people trying to do the same thing, b) to make the question clearer. I also put up a bounty.] We'll declare a standard environment               \documentclass[12pt]{article}     \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}     \usepackage[usenames,dvipsnames]{color}     \usepackage{graphicx}     \usepackage{amsfonts,amsmath}      Suppose we _color and text size rank_ a descending ordered set of text entries. To do _this_ we give these definitions in the preamble of the file that contains our entries:               \def\useful{\normalsize\color{black}}     \def\mixedquality{\footnotesize\color{Green}}     \def\useless{\footnotesize\color{blue}}     \def\nonsense{\footnotesize\color{Gray}}      Suppose we also _enumerate_ those text entries. In this case we generate and display the number of each entry on the left in the margin beside the text entry, which is flush to the margin and hang indented, to be easily distinguished by the eye from the other entries above or below if there are any. To do _this_ we give these definitions in the same preamble:               \setlength{\parindent}{27pt}     \newcounter{pnkt}     \newlength{\dlh}     \newcommand*\pnkt{%         \stepcounter{pnkt}%          \settowidth{\dlh}{\textbf{\textit{\arabic{pnkt}}}}%         \hspace*{\dimexpr-\dlh-18mm}         \hangindent=9mm\noindent%         \textbf{\textit{\arabic{pnkt}}} \hspace{7mm}}      We may write for example (EXAMPLE 1)               \pnkt {\useless%         \textbf{AAA1}, \textbf{BBB1}; \textbf{AAA2}, \textbf{BBB2}; \textbf{AAA3}, \textbf{BBB3}. %         \textbf{CCC}. \textit{DDD}. EEE.%         }      What we want to write instead is this               \book{useless}{3}{AAA1}{BBB1}{AAA2}{BBB2}{AAA3}{BBB3}{CCC}{DDD}{EEE}      Again We may write for example (EXAMPLE 2)               \pnkt {\mixedquality%         \textbf{AAA1}, \textbf{BBB1}; \textbf{AAA2}, \textbf{BBB2}. %         \textbf{CCC}. DDD. \textit{EEE} FFF.%         }      What we want to write instead is this               \essy{mixedquality}{2}{AAA1}{BBB1}{AAA2}{BBB2}{CCC}{DDD}{EEE}{FFF}      and so on for arbitrary numbers of AAA and BBB parameters. Motivation?! Basically this may be adapted for writing up not only references but also for any (repetitive) situation, such as write up of a series of experiments or mathematical statements where the number of variables is itself variable but the paragraph is basically unchanged "if AAA1 then BBB1 and if AAA2 then BBB2 and ... and if AAAn then BBB2, _and in case we also suppose CCC_ , then we infer DDD, _which is same as EEE_ , and so its opposite FFF is excluded." This is topologically identical to the references problem. We code the results by importance. (Unimportant paragraphs or entries get smaller font and maybe different color and all paragraphs are numbered in the margin.) But TeX `\def` and \LaTeX `\newcommand` are defined only for nine parameters and each case n must be defined separately like so:               \newcommand{\book}[9]{%         \textbf{#1}, \textbf{#2}; \textbf{#3}, \textbf{#4}; \textbf{#5}, \textbf{#6}. %         \textbf{#7}. \textit{#8}. #9.}      Which saves some effort but is not a robust solution. The first part of the question is: > create a macro `\book{rank}{n}{AAA1}{BBB1}...{AAAn}{BBBn}{CCC}{DDD}...` for > arbitrary integer `n > 0` that works in the manner of EXAMPLE 1 and 2 above. user WIPET has suggested an answer to this part of the question. Adapting his answer to the numbering system above gives us               \def\monograf#1#2#3{\textbf{#1}. \textit{#2}. #3.\egroup\par}     \def\mirpages#1#2#3#4{\textbf{#1}. #2. \textit{#3} #4.\egroup\par}          \newcount{\tmpnmbr}          \def\book#1#2{\par\pnkt\bgroup%     \csname#1\endcsname\tmpnmbr=0\def\authornumber{#2}\authornamedB}     \def\authornamedB#1#2{\textbf{#1}, \textbf{#2}%     \advance\tmpnmbr by1 \ifnum\tmpnmbr<\authornumber; \expandafter\authornamedB\else. \expandafter\monograf\fi}          \def\essy#1#2{\par\pnkt\bgroup%     \csname#1\endcsname\tmpnmbr=0\def\authornumber{#2}\authornamedE}     \def\authornamedE#1#2{\textbf{#1}, \textbf{#2}%     \advance\tmpnmbr by1 \ifnum\tmpnmbr<\authornumber; \expandafter\authornamedE\else. \expandafter\mirpages\fi}      A small problem (notice that `\bgroup ... \egroup` are used instead of `{}`. It seems we break something because if ... else arguments are very picky about `{}`. Again for instance we may want to complete reference functionality and make the formatted AAA1 ... BBBn replaced in the above output with a line of equal length if we have the same authors in the paragraph right above it (or in two paragraphs one below the other, part of the experiment is unchanged). We'll simply define               \newlength{\rulelength}          \def\nrwl #1. #2{\settowidth{\rulelength}{#1}\rule{\rulelength}{0.4pt}. #2}      We cannot however directly write (we get one very long line: \nrwl cannot read the period . after BBBn we realize)               \nrwl \book{...}      So a part of the question to make macros of this type with > 9 parameters useful (allow them to be manipulated together with other macros) I think we need to somehow instruct the code to compile \book _first_ and only then \nrwl, and apply \nrwl to _compiled_ \book, instead of trying to expand \book into \nrwl and then compiling. I think this is how the problem must be solved because the following does work:               \pnkt \nrwl \book{useful}{2}{Darwin}{C}{Spencer}{H}{}{}{}. \monografr{useful}{1624}{Apples and Oranges}{London: Cape.}      ![output](http://i57.tinypic.com/2vbo6yh.jpg) That BTW is the first part of the question and it seems there is not far to go to answer it. > The second part of the original question was this: _observe that we have > enumerated each paragraph_ and later in the text of a document we want to > write for example `This suggestion was proved years later > \ranked{3}{AAA1}{AAA2}{AAA3}` to display               This suggestion was proved years later [the number of the reference corresponding to \book{rank}{3}{AAA1 ... BBB3}{CCC}{DDD}{EEE} it by the enumeration `\pnkt` appears in these brackets similar to references to tagged figures or formulas].      for example (EXAMPLE 3)               This suggestion was proved years later [46].      > and later in the text of a document we want to write for example `... > \extracted{3}{AAA1}{AAA2}{AAA3}` to display EXAMPLE 4               ... (AAA1, AAA2, AAA3 CCC).      or EXAMPLE 5               ... (AAA1, AAA2, AAA3, useful)      or EXAMPLE 6               ... (AAA1, AAA2, AAA3, DDD)      depending on how we define the \rank. 1) Probably the most important aspect is right now is the second part of the original question: how to get the number of each paragraph created by \book{n}{AAA1 ... BBBn}{...} to be referenced and displayed by `\ranked{n}{AAA1 ... AAAn} 2) The next most important thing is figuring out how the various bugs due to sensitivity to additional {} of iteratively generated macros (and they have to be if .. then generated if they have > 9 parameters) may be be resolved. It seems the solution is to make a second macro that compiles and stores the pure _output_ of `\book` (but does not display it yet) and then combine other macros like \par, \nrwl, with that macro. I am trying what I know to figure this out. 3) I do not know if EXAMPLES 4, 5, 6 can be realized? If they cannot (at least not without a bibliography package) for some known reason, that is also an answer.