Home > environments > Maintain display of arguments for certain folded environments with AUCTeX

# Maintain display of arguments for certain folded environments with AUCTeX

August 14Hits:1

When working with some environments (function and friends from l3doc prompted this), it is desirable to have the environment's arguments visible at all times:

Some text that, in reality, shouldn't be here in an l3doc \begin{function}{\tl_new:N}   Some documentation... \end{function} more inappropriate text 


When folding this using C-c C-o C-e, everything goes away (which is useful for environments like minipage, etc.):

Some text that, in reality, shouldn't be here in an l3doc   [function] more inappropriate text 


Is there any way to turn this into the following for certain environments?

Some text that, in reality, shouldn't be here in an l3doc   [function]{\tl_new:N} more inappropriate text 


(If only a solution for all environments exists easily, I can manage with turning on/off the mode.)

If the solution would be similar, it would be really cool if you could have some sort of marker, say %!!, that would always stay visible in folded environments.

Start of a solution, based on this answer

(defun mg-TeX-fold-environment-with-argument ()
"Hide the current environment with \"[environment]{argument}\"."
(interactive)
(if (equal (LaTeX-current-environment) "function")
(let ((env-end (save-excursion
(LaTeX-find-matching-end)
(point)))
env-start priority ov)
(setq env-start (save-excursion
(LaTeX-find-matching-begin)
(looking-at "\\\\begin{function}\$${[^}]*}\$$")
(point)))
(if (and env-start env-end)
(progn
(setq priority (TeX-overlay-prioritize env-start env-end))
(setq ov (make-overlay env-start env-end
(current-buffer) t nil))
(overlay-put ov 'category 'TeX-fold)
(overlay-put ov 'priority priority)
(overlay-put ov 'evaporate t)
(overlay-put ov 'TeX-fold-display-string-spec
(concat "[function]" (match-string-no-properties 1)))
(TeX-fold-hide-item ov))
(message "No environment found")))))



## Related Articles

• ### Maintain display of arguments for certain folded environments with AUCTeXAugust 14

When working with some environments (function and friends from l3doc prompted this), it is desirable to have the environment's arguments visible at all times: Some text that, in reality, shouldn't be here in an l3doc \begin{function}{\tl_new:N} Some

• ### How to display item count of specific folder in listJuly 31

I have a list, which has some columns including title and URL. URL column directs to specific folder related to list item. I want to add one more column in list, which would display items' count of that folder. How I can do this? There is no workflow

• ### Notebook UI: Autocompletion - Display function arguments when typing?May 4

Is there a setting to display the required arguments of a function when typing as Visual Studio, Matlab, etc. does? --------------Solutions------------- The closest thing to what you're describing are function templates, there is a tutorial on how to

• ### How can I display directories in the "Recent" folder?October 20

"Recent" folder in Nautilus only displays recent files. Can it display recent folders too, such as in the "save as" interface? --------------Solutions------------- Are you looking for the folders in which Recently Used Files reside, or

• ### How to display the date a directory folder on ftp was modifiedJune 30

We have our site running on wordpress, but we upload all of our PDF files via FTP and NOT the WP media. I want to be able to display in a WP Page, the last time a file, or a "folder in the FTP directory" was modified. I have tried using the diff

• ### Display media library in a folder view in winamp 5.5February 3

Is it possible to to display media by folders-view? all my files organized by folders. --------------Solutions------------- Best I could find is: http://albumlist.sourceforge.net/ Album List turns your directory tree into a list of albums. It allows

• ### Drupal 7 with Display Suite and Apache SOLR search environmentsJanuary 19

I have the magnificent Display Suite working for search results but I can't for the life of me figure out how to use it to modify a search environment defined on admin/config/search/apachesolr/search-pages. Please can someone explain how do I use DS

• ### Nautilus doesn't display contents of the home folder when launched as rootJanuary 25

It shows the desktop symbol but it doesn't show the files on my desktop neither. I'm running Ubuntu 11.10 with GNOME shell. --------------Solutions------------- If you're running nautilus in as root, you'll see root's Desktop folder. Yours is likely

• ### List view web part to display all item from document folder in subsites (SharePoint 2010)November 21

How can I achieve that I can display all the documents from the document libraries from all the site collections sub sites? (Actually I only need to show the onces that where changed lately.) It seems to me that List View and Content Query web parts

• ### How to display pictures from shared OneDrive folder on the Windows 8.1 lock screen?October 22

I would like one machine to show a photo slide show on the lock screen, with photos belonging to another Microsoft account. I have shared the "Camera Roll" album from the photo producers account to the receiver, and can see the photos as shared

• ### Access from included files to environments in AUCtex December 11

This question already has an answer here: Adding custom macros to completion list with AUCTeX 1 answer When I am writing slides, I usually use one master file and several dependent files; as a macro package I use beamer. I would like to access the en

• ### Indentation of tabular-like environments in AUCTeX 11.88May 2

AUCTeX 11.88 introduced a new style of indentation for tabular-like environments. I understand this is implemented in LaTeX-indent-tabular. Is there an easy way to revert to the old style? --------------Solutions------------- You can restore the old

• ### Display Document Library Folder contents on a different Sharepoint 2007 SiteNovember 30

What I want to do seems incredibly simple, but I am getting nowhere quickly searching and reading about this. I need to list some policy documents on a Sharepoint page on our corporate intranet. This is in web application http://intranet The document

• ### Passing a field_id argument to a contextual filter in a Views block displayMay 24

I'm editing/rewriting this question since I've made a bit more progress on it since I first posted it, and now the questions I have about what I'm trying to do are more specific: I have a content type with a video field that can have multiple values

• ### Display folder in webpart on pageOctober 11

I need to display folder in a web part on a page in SharePoint 2010. I was trying to do it using content query web part but it gives only items not the folder but i need to show folder in the web part is there any alternative way for this.Thanks ----

• ### What is the name of the functional argument in foldDecember 13

In the higher order function fold/reduce what is the name, if any, of the functional argument? I am working on a monadic tabular processing library where rows are folded to produce simple analyses (like finding the minimum, maximum, average of a colu

• ### PHP script: Display images from folder with limit and next navigation February 6

Here is my current php script that will display all images from a folder into a table. However, there are a lot of images and the load time is really slow. How can I limit the number of images displayed and create a dynamic navigation feature? Thanks

• ### Why does LaTeX make a distinction between commands and environments?January 6

Why does LaTeX make a distinction between commands and environments? Or also: why do we need environments? I ask this because I am defining a number of custom commands (like \question{} and \answer{}) and I am not entirely sure whether to use the \ne

• ### Audio players that access music library as file browser (and see folder structure)October 8

I have a big music library. Nothing special there. But I very much dislike the way usually music library is displayed in most recommended players, according to Artist/Album/Year/Genre tags, ignoring my folder structure or making it hardly accessible.

• ### Folding entire section in AUCTeX?December 30

I'm new to AUCTeX and I wonder: is it possible to fold entire sections or subsections of a LaTeX document for a better overview, so that they are only represented by their headline (kind of a tree view of the document)? I would expected that being do