Search Results

Search found 11 results on 1 pages for 'newenvironment'.

Page 1/1 | 1 

  • Latex newenvironment

    - by Alex
    There's something wrong with this code: \newenvironment{Tbl} {\begin{tabularx}{\textwidth}{|l|X|} \hline} {\end{tabularx}} but this is fine: \newenvironment{Tbl} {\begin{tabular}{|l|l|} \hline} {\end{tabular}} Why? And how can I get the first to work?

    Read the article

  • Problem with creating a newenvironment in LaTeX

    - by Andreas Grech
    I am trying to implement this new environment in LaTeX: \newenvironment{javacode}[2] {\begin{lstlisting}[language=java, label=#1, caption=#2]} {\end{lstlisting}} And then use it like such: \begin{javacode}{c}{some code} int x = 5; \end{javacode} But I am getting the following error: Overfull \hbox (6.0pt too wide) in paragraph at lines 6--6 [][][][][][][] [1] [2]) [3]) * Can anyone help as regards fixing this problem? [Update] I tried it doing it like Red-nosed unicorn instructed, and it worked correctly. But now I tried adding a \begin{singlespace} like such: \lstnewenvironment{javacode}[2] { \begin{singlespace} \lstset{language=java, label=#1, caption=#2}} { \end{singlespace} } And I got the same error: Overfull \hbox (6.0pt too wide) in paragraph at lines 6--6 [][][][][][][] [1]) [2] [3]) *

    Read the article

  • Wrapping \NewEnviron into \newenvironment fails

    - by o_O Tync
    Hello! I am trying to wrap an environment created with \NewEnviron (package 'environ') into an old good \newenvironment: \NewEnviron{test}{aaa(\BODY)bbb} \newenvironment{wrapper}{\begin{test}}{\end{test}} \begin{wrapper} debug me \end{wrapper} However, this gives me a strange error: LaTeX Error: \begin{test} on input line 15 ended by \end{wrapper}. LaTeX Error: \begin{wrapper} on input line 15 ended by \end{document}. If I replace \NewEnviron{test}{aaa(\BODY)bbb} with \newenvironment{test}{aaa(}{)bbb} — everything works as expected! It seems like \NewEnviron fails to find its end for some reason. I'm trying to do some magic with 'floatfig' wrapped into a \colorbox so I need a way to convert \colorbox to an environment and wrap it into another one. I can define a new command but it's not a very good idea. Thanks in advance!

    Read the article

  • How to create a \newenvironment in latex for a scaled table

    - by markus
    Hi, I try to define a table as a new environment. \newenvironment{scaledtable}[1]{% \begin{table}[h] \caption{xxx} \label{tab:xxx} \begin{center} \begin{tabular}{rcrrrrrrrrrrrrcc} }{ \hline \end{tabular} \end{center} \end{table}} The problem I have is that I can't use scalebox{}. If I put the closing bracket into the end definition of the environment, latex can't assign the brackets anymore. I also can not use PStricks because of pdflatex. /Markus

    Read the article

  • Tripple-wrapping fails: \colorbox ? \NewEnviron ? \newenvironment fails

    - by o_O Tync
    Hello! I am trying to wrap an environment created with \NewEnviron (package 'environ') into an old good \newenvironment: \NewEnviron{test}{\colorbox[gray]{0.7}{\BODY}} \newenvironment{wrapper}{\begin{test}}{\end{test}} \begin{wrapper} debug me \end{wrapper} However, this gives me a strange error: LaTeX Error: \begin{test} on input line 15 ended by \end{wrapper}. LaTeX Error: \begin{wrapper} on input line 15 ended by \end{document}. If I replace \NewEnviron{test}{aaa(\BODY)bbb} with \newenvironment{test}{aaa(}{)bbb} — everything works as expected! It seems like \NewEnviron fails to find its end for some reason. I'm trying to do some magic with 'floatfig' wrapped into a \colorbox so I need a way to convert \colorbox to an environment and wrap it into another one. I can define a new command but it's not a very good idea. Thanks in advance!

    Read the article

  • How to define a multipage environment not interrupted by tables and figures?

    - by Egon Willighagen
    I have defined a new LaTeX environment for excursions in a book chapter I am writing. The environment is multipage and often includes inline images. Moreover, I am using the shaded environment to give the environment a background colour to make it stand out a bit. However, the environment, as shown below, is split up by floating tables and images, which makes the flow of the environment visually more difficult to follow. For example, it is now difficult to see if that floating image or table is part (the missing background colour does not help). So, I like to extend my environment to disallow it to be interrupted by floating elements, but do not know how to get that done. \newcounter{bioclipse} \def\thebioclipse{\thechapter-\arabic{bioclipse}} \newenvironment{bioclipse}[2][]{\begin{small}\begin{shaded}\refstepcounter{bioclipse} \par\medskip\noindent% \textbf{Bioclipse Excursion~\thebioclipse #1: #2 \vspace{0.1cm} \hrule \vspace{0.1cm}} \rmfamily}{\medskip \end{shaded}\end{small}} Any solution to disallow interruption is fine, even if the background colour is done differently.

    Read the article

  • Ant Exec environment var

    - by Mike
    I have a problem where I don't want to have to call a setEnv.sh file before i call my ant target that calls an exec task. Right now I have a way to save the environment variables in setenv.properties file in the key=value notation. The exec task for some reason does not see the variables that are set in the .properties file.... (I know i could use the tag but the setenv.properties is dynamically generated) setenv.properties: HELLO=XYZ part of my build.xml : <property file="setenv.properties"/> <target name="test" depends="setEnv"> <exec executable="/bin/ksh" newenvironment="false"> test.sh : echo ${HELLO} Any thoughts?

    Read the article

  • Using Unicode in fancyvrb’s VerbatimOut

    - by Konrad Rudolph
    Problem VerbatimOut from the “fancyvrb” package doesn’t play nicely with UTF-8 characters. Minimal working example: \documentclass{minimal} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fancyvrb} \begin{document} \begin{VerbatimOut}{\jobname.test} é \end{VerbatimOut} \input{\jobname.test} \end{document} Error message When compiled using pdflatex mini, this gives the error File ended while scanning use of \UTFviii@three@octets. A different error occurs when the sole occurrence of é above is replaced by something else, e.g. é */: Package inputenc Error: Unicode char \u8:### not set up for use with LaTeX. – indicating that in this case, LaTeX succeeds in reading a multi-byte UTF-8 character, but not knowing what to do with it (i.e. it’s the wrong character). In fact, when I open the produced .test file manually, it contains the character é, but in Latin-1 encoding! Proof: when I open the files in a hex editor, I get the following: Original file: C3 A9 (corresponds to LATIN SMALL LETTER E WITH ACUTE in UTF-8) Written file: E9 (corresponds to é in Latin-1) Question How to set VerbatimOut up correctly? filecontents* (from “filecontents”) shows that it can work. Unfortunately, I don’t understand either code so I cannot fix fancyvrb’s code by replicating the logic from filecontents manually. I also cannot use filecontents* instead of VerbatimOut because the former doesn’t work within a \newenvironment, while the latter does. (Oh, by the way: vanilla Verbatim instead of VerbatimOut also works as expected. The error seems to occur when writing the file, not when reading the verbatim input)

    Read the article

  • latex list environment inside the tabular environment: extra line at top preventing alignment

    - by Usagi
    Hello good people of stackoverflow. I have a LaTeX question that is bugging me. I have been trying to get a list environment to appear correctly inside the tabular environment. So far I have gotten everything to my liking except one thing: the top of the list does not align with other entries in the table, in fact it looks like it adds one line above the list... I would like to have these lists at the top. This is what I have, a custom list environment: \newenvironment{flushemize}{ \begin{list}{$\bullet$} {\setlength{\itemsep}{1pt} \setlength{\parskip}{0pt} \setlength{\parsep}{0pt} \setlength{\partopsep}{0pt} \setlength{\topsep}{0pt} \setlength{\leftmargin}{12pt}}}{\end{list}} Renamed ragged right: \newcommand{\rr}{\raggedright} and here is my table: \begin{table}[H]\caption{Tank comparisons}\label{tab:tanks} \centering \rowcolors{2}{white}{tableShade} \begin{tabular}{p{1in}p{1.5in}p{1.5in}rr} \toprule {\bf Material} & {\bf Pros} & {\bf Cons} & {\bf Size} & {\bf Cost} \\ \midrule \rr Reinforced concrete &\rr \begin{flushemize}\item Strong \item Secure \end{flushemize}&\rr \begin{flushemize}\item Prone to leaks \item Relatively expensive to install \item Heavy \end{flushemize} & 100,000 gal & \$299,400 \\ \rr Steel & \begin{flushemize}\item Strong \item Secure \end{flushemize} & \begin{flushemize}\item Relatively expensive to install \item Heavy \item Require painting to prevent rusting \end{flushemize} & 100,000 gal & \$130,100 \\ \rr Polypropylene & \begin{flushemize}\item Easy to install \item Mobile \item Inexpensive \item Prefabricated \end{flushemize} & \begin{flushemize}\item Relatively insecure \item Max size available 10,000 gal \end{flushemize} & 10,000 gal & \$5,000 \\ \rr Wood & \begin{flushemize}\item Easy to install \item Mobile \item Cheap to install \end{flushemize} & \begin{flushemize}\item Prone to rot \item Must remain full once constructed \end{flushemize} & 100,000 gal & \$86,300\\ \bottomrule \end{tabular} \end{table} Thank you for any advice :)

    Read the article

  • Suppress indentation after environment in LaTeX

    - by David
    I'm trying to create a new environment in my LaTeX document where indentation in the next paragraph following the environment is suppressed. I have been told (TeXbook and LaTeX source) that by setting \everypar to {\setbox0\lastbox}, the TeX typesetter will execute this at the beginning of the next paragraph and thus remove the indentation: \everypar{\setbox0\lastbox} So this is what I do, but to no effect (following paragraph is still indented): \newenvironment{example} {\begin{list} {} {\setlength\leftmargin{2em}}} {\end{list}\everypar{\setbox0\lastbox}} I have studied LaTeX's internals as well as I could manage. It seems that the \end routine says \endgroup and \par at some point, which may be the reason LaTeX ignores my \everypar setting. \global doesn't help either. I know about \noindent but want to do this automatically. Example document fragment: This is paragraph text. This is paragraph text, too. \begin{example} \item This is the first item in the list. \item This is the second item in the list. \end{example} This is more paragraph text. I don't want this indented, please. Internal routines and switches of interest seem to be \@endpetrue, \@endparenv and others. Thanks for your help.

    Read the article

  • How to Remove Header in LaTex

    - by Tim
    Hi, I would like to not show the name of each chapter on the header of its each page. I also like to have nothing in the headers for abstract, acknowledgement, table of content, list of figures and list of tables. But currently I have header on each page, for example: Here is my code when specifying these parts in my tex file \begin{abstract} ... \end{abstract} \begin{acknowledgement} ... \end{acknowledgement} % generate table of contents \tableofcontents % generate list of tables \listoftables % generate list of figures \listoffigures \chapter{Introduction} \label{chp1} %% REFERENCES \appendix \input{appendiximages.tex} \bibliographystyle{plain} %%\bibliographystyle{abbrvnat} \bibliography{thesis} Here is what I believe to be the definition of the commands. More details can be found in these two files jhu12.clo and thesis.cls. % \chapter: \def\chaptername{Chapter} % ABSTRACT % MODIFIED to include section name in headers \def\abstract{ \newpage \dsp \chapter*{\abstractname\@mkboth{\uppercase{\abstractname}}{\uppercase{\abstractname}}} \fmfont \vspace{8pt} \addcontentsline{toc}{chapter}{\abstractname} } \def\endabstract{\par\vfil\null} % DEDICATION % Modified to make dedication its own section %\newenvironment{dedication} %{\begin{alwayssingle}} %{\end{alwayssingle}} \def\dedication{ \newpage \dsp \chapter*{Dedication\@mkboth{DEDICATION}{DEDICATION}} \fmfont} \def\endacknowledgement{\par\vfil\null} % ACKNOWLEDGEMENTS % MODIFIED to include section name in headers \def\acknowledgement{ \newpage \dsp \chapter*{\acknowledgename\@mkboth{\uppercase{\acknowledgename}}{\uppercase{\acknowledgename}}} \fmfont \addcontentsline{toc}{chapter}{\acknowledgename} } \def\endacknowledgement{\par\vfil\null} \def\thechapter {\arabic{chapter}} % \@chapapp is initially defined to be '\chaptername'. The \appendix % command redefines it to be '\appendixname'. % \def\@chapapp{\chaptername} \def\chapter{ \clearpage \thispagestyle{plain} \if@twocolumn % IF two-column style \onecolumn % THEN \onecolumn \@tempswatrue % @tempswa := true \else \@tempswafalse % ELSE @tempswa := false \fi \dsp % double spacing \secdef\@chapter\@schapter} % TABLEOFCONTENTS % In ucthesis style, \tableofcontents, \listoffigures, etc. are always % set in single-column style. @restonecol \def\tableofcontents{\@restonecolfalse \if@twocolumn\@restonecoltrue\onecolumn\fi %%%%% take care of getting page number in right spot %%%%% \clearpage % starts new page \thispagestyle{botcenter} % Page style of frontmatter is botcenter \global\@topnum\z@ % Prevents figures from going at top of page %%%%% \@schapter{\contentsname \@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}}% {\ssp\@starttoc{toc}}\if@restonecol\twocolumn\fi} \def\l@part#1#2{\addpenalty{-\@highpenalty}% \addvspace{2.25em plus\p@}% space above part line \begingroup \@tempdima 3em % width of box holding part number, used by \parindent \z@ \rightskip \@pnumwidth %% \numberline \parfillskip -\@pnumwidth {\large \bfseries % set line in \large boldface \leavevmode % TeX command to enter horizontal mode. #1\hfil \hbox to\@pnumwidth{\hss #2}}\par \nobreak % Never break after part entry \global\@nobreaktrue %% Added 24 May 89 as \everypar{\global\@nobreakfalse\everypar{}}%% suggested by %% Jerry Leichter \endgroup} % LIST OF FIGURES % % Single-space list of figures, add it to the table of contents. \def\listoffigures{\@restonecolfalse \if@twocolumn\@restonecoltrue\onecolumn\fi %%%%% take care of getting page number in right spot %%%%% \clearpage \thispagestyle{botcenter} % Page style of frontmatter is botcenter \global\@topnum\z@ % Prevents figures from going at top of page. \@schapter{\listfigurename\@mkboth{\uppercase{\listfigurename}}% {\uppercase{\listfigurename}}} \addcontentsline{toc}{chapter}{\listfigurename} {\ssp\@starttoc{lof}}\if@restonecol\twocolumn\fi} \def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}} % bibliography \def\thebibliography#1{\chapter*{\bibname\@mkboth {\uppercase{\bibname}}{\uppercase{\bibname}}} \addcontentsline{toc}{chapter}{\bibname} \list{\@biblabel{\arabic{enumiv}}}{\settowidth\labelwidth{\@biblabel{#1}}% \leftmargin\labelwidth \advance\leftmargin\labelsep \usecounter{enumiv}% \let\p@enumiv\@empty \def\theenumiv{\arabic{enumiv}}}% \def\newblock{\hskip .11em plus.33em minus.07em}% \sloppy\clubpenalty4000\widowpenalty4000 \sfcode`\.=\@m} Thanks and regards! EDIT: I just replaced \thispagestyle{botcenter} with \thispagestyle{plain}. The latter is said to clear the header (http://en.wikibooks.org/wiki/LaTeX/Page_Layout), but it does not. How shall I do? Thanks!

    Read the article

1