Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TeX: [enhancement] Patch for LaTeX for beamer presentations #2421

Closed
jagjordi opened this issue Feb 12, 2020 · 9 comments · Fixed by #2424
Closed

TeX: [enhancement] Patch for LaTeX for beamer presentations #2421

jagjordi opened this issue Feb 12, 2020 · 9 comments · Fixed by #2424
Assignees

Comments

@jagjordi
Copy link

Implement a similar patch like in this post https://sourceforge.net/p/ctags/patches/76/ so that LaTeX beamer presentations are sorted by slides instead of sections

@masatake masatake self-assigned this Feb 12, 2020
@masatake
Copy link
Member

Thank you for making this issue.

Do you have an example input?
I would like to include it as a test case into our repository.

https://github.com/strace/strace-talks/blob/master/2019-ossdevconf-kaluga-linux_design_flaw_story/ossdevconf_2019-slides-linux_design_flaw_story.tex

is a good example but it doesn't use \frametitle.
It uses \begin{frame}{AN ITEM WE WOULD LIKE TO TAG}.

I have already implemented functions for captruing \frametitle.
However, \begin{frame}{...} is not yet.

@masatake masatake changed the title [enhancement] Patch for LaTeX for beamer presentations TeX: [enhancement] Patch for LaTeX for beamer presentations Feb 12, 2020
@jagjordi
Copy link
Author

jagjordi commented Feb 17, 2020

I think this one can be used, I changed the titles to use \frametitle keyword
https://github.com/jagjordi/IL2239-presentation

@masatake
Copy link
Member

Still struggling.

@jagjordi
Copy link
Author

Is there any way I can help with this?

@masatake
Copy link
Member

Could you try #2424?

@jagjordi
Copy link
Author

Hello @masatake
I have a suggestion to modify the behaviour of the parser in a beamer presentation.
If a arrangement of slides as this is written

Frame 1
|-- Subframe 1.1
|-- Subframe 1.2
|-- Subframe 1.3

Frame 2
|-- Subframe 2.1
|-- Subframe 2.2

Normally I would have the same title repeated as many times as "sub-slides" exist. For example

\frametitle{Frame1}
\framesubtitle{Subframe1.1}

\frametitle{Frame1}
\framesubtitle{Subframe1.2}

\frametitle{Frame1}
\framesubtitle{Subframe1.3}

\frametitle{Frame2}
\framesubtitle{Subframe2.1}

\frametitle{Frame2}
\framesubtitle{Subframe2.2}

With the current behaviour of the parser it will generate a tag entry for every time the command frametitle is used. I would argue that generally the behaviour sould be that it only generates a tag entry the first tame that the command is used, and subsequent uses of the command (with the same title name) will "point" to the first usage.

Let me know what you think?

Regards,

@masatake masatake reopened this Mar 22, 2020
@masatake
Copy link
Member

I will work on this item after merging #2450.
It will take a longer time than you assume.

In #2450, I will introduce a symbol table.
With that we can write the following code:

tagEntryInfo *tag = lookupTag ("Frame1");
if (! (tag && kinfOf(tag) == "frametitle"))
   skip();
else /* a frame title we have never seen. */
   makeTag ();

@jagjordi
Copy link
Author

Sounds great. Let me know if you need something to be tested 👍

@masatake
Copy link
Member

masatake commented Apr 4, 2020

It works partially.
A bit more work is needed.

[yamato@slave]~/var/ctags-github% cat /tmp/input.tex 
cat /tmp/input.tex 
\frametitle{Frame1}
\framesubtitle{Subframe1.1}

\frametitle{Frame1}
\framesubtitle{Subframe1.2}

\frametitle{Frame1}
\framesubtitle{Subframe1.3}

\frametitle{Frame2}
\framesubtitle{Subframe2.1}

\frametitle{Frame2}
\framesubtitle{Subframe2.2}
[yamato@slave]~/var/ctags-github% ./ctags --sort=no -o - /tmp/input.tex 
./ctags --sort=no -o - /tmp/input.tex 
Frame1	/tmp/input.tex	/^\\frametitle{Frame1}$/;"	f	language:TeXBeamer
Subframe1.1	/tmp/input.tex	/^\\framesubtitle{Subframe1.1}$/;"	g	language:TeXBeamer	frametitle:Frame1
Subframe1.2	/tmp/input.tex	/^\\framesubtitle{Subframe1.2}$/;"	g	language:TeXBeamer	frametitle:Frame1
Subframe1.3	/tmp/input.tex	/^\\framesubtitle{Subframe1.3}$/;"	g	language:TeXBeamer	frametitle:Frame1
Frame2	/tmp/input.tex	/^\\frametitle{Frame2}$/;"	f	language:TeXBeamer
Subframe2.1	/tmp/input.tex	/^\\framesubtitle{Subframe2.1}$/;"	g	language:TeXBeamer	frametitle:Frame2
Subframe2.2	/tmp/input.tex	/^\\framesubtitle{Subframe2.2}$/;"	g	language:TeXBeamer	frametitle:Frame2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants